Files
CalamityModPublic/Items/SummonItems/ProfanedShard.cs
T
CongratsIsTrash 392961d6cb 1 - Profaned Guardians now enrage at night instead of despawning
2 - Guardians now use their cyan glowmask at night instead of in Remix World, and glowmasks are now rainbow in GFB
3 - Guardians projectiles and shields now draw cyan at night
4 - Fixed Providence always being enraged in Remix world instead of never enraging
2024-05-25 23:10:35 -04:00

64 lines
2.2 KiB
C#

using System.Collections.Generic;
using CalamityMod.Events;
using CalamityMod.Items.Materials;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.World;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.SummonItems
{
public class ProfanedShard : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.SummonItems";
public override void SetStaticDefaults()
{
ItemID.Sets.SortingPriorityBossSpawns[Type] = 19; // Celestial Sigil
}
public override void SetDefaults()
{
Item.width = 20;
Item.height = 20;
Item.useAnimation = 10;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.consumable = false;
Item.rare = ItemRarityID.Purple;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem;
}
public override bool CanUseItem(Player player)
{
return !NPC.AnyNPCs(ModContent.NPCType<ProfanedGuardianCommander>()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive;
}
public override bool? UseItem(Player player)
{
SoundEngine.PlaySound(SoundID.Roar, player.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<ProfanedGuardianCommander>());
else
NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, -1, -1, null, player.whoAmI, ModContent.NPCType<ProfanedGuardianCommander>());
return true;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[SPAWN]", this.GetLocalizedValue(Main.remixWorld ? "SpawnRemix" : "SpawnNormal"));
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.LunarBar, 5).
AddIngredient<UnholyEssence>(25).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}