53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.NPCs.Perforator;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.SummonItems
|
|
{
|
|
public class BloodyWormFood : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Bloody Worm Food");
|
|
Tooltip.SetDefault("Summons the Perforator Hive");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 28;
|
|
item.height = 18;
|
|
item.maxStack = 20;
|
|
item.rare = 3;
|
|
item.useAnimation = 45;
|
|
item.useTime = 45;
|
|
item.useStyle = 4;
|
|
item.consumable = true;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return player.ZoneCrimson && !NPC.AnyNPCs(ModContent.NPCType<PerforatorHive>());
|
|
}
|
|
|
|
public override bool UseItem(Player player)
|
|
{
|
|
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<PerforatorHive>());
|
|
Main.PlaySound(SoundID.Roar, player.position, 0);
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.Vertebrae, 9);
|
|
recipe.AddIngredient(ModContent.ItemType<BloodSample>(), 5);
|
|
recipe.AddIngredient(ItemID.CrimtaneBar, 2);
|
|
recipe.AddTile(TileID.DemonAltar);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|