56 lines
2.0 KiB
C#
56 lines
2.0 KiB
C#
using CalamityMod.Events;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.NPCs.ProfanedGuardians;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.Audio;
|
|
using Terraria.GameContent.Creative;
|
|
|
|
namespace CalamityMod.Items.SummonItems
|
|
{
|
|
public class ProfanedShard : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
|
DisplayName.SetDefault("Profaned Shard");
|
|
Tooltip.SetDefault("A shard of the unholy flame\n" +
|
|
"Summons the Profaned Guardians when used in the hallow or underworld during daytime\n" +
|
|
"Not consumable");
|
|
}
|
|
|
|
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 bool CanUseItem(Player player)
|
|
{
|
|
return !NPC.AnyNPCs(ModContent.NPCType<ProfanedGuardianBoss>()) && Main.dayTime && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive;
|
|
}
|
|
|
|
public override bool? UseItem(Player player)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Roar, player.position, 0);
|
|
if (Main.netMode != NetmodeID.MultiplayerClient)
|
|
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<ProfanedGuardianBoss>());
|
|
else
|
|
NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType<ProfanedGuardianBoss>());
|
|
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe(1).AddIngredient(ModContent.ItemType<UnholyEssence>(), 25).AddIngredient(ItemID.LunarBar, 5).AddTile(TileID.LunarCraftingStation).Register();
|
|
}
|
|
}
|
|
}
|