54 lines
1.2 KiB
C#
54 lines
1.2 KiB
C#
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items
|
|
{
|
|
public class BulbofDoom : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Portabulb");
|
|
Tooltip.SetDefault("Summons Plantera");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 28;
|
|
item.height = 18;
|
|
item.maxStack = 20;
|
|
item.useAnimation = 45;
|
|
item.useTime = 45;
|
|
item.useStyle = 4;
|
|
item.rare = 7;
|
|
item.consumable = true;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return player.ZoneJungle && !NPC.AnyNPCs(NPCID.Plantera);
|
|
}
|
|
|
|
public override bool UseItem(Player player)
|
|
{
|
|
NPC.SpawnOnPlayer(player.whoAmI, NPCID.Plantera);
|
|
Main.PlaySound(SoundID.Roar, player.position, 0);
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.JungleSpores, 15);
|
|
recipe.AddIngredient(ItemID.SoulofNight, 10);
|
|
recipe.AddIngredient(ItemID.SoulofLight, 10);
|
|
recipe.AddIngredient(null, "MurkyPaste", 3);
|
|
recipe.AddIngredient(null, "ManeaterBulb");
|
|
recipe.AddIngredient(null, "TrapperBulb");
|
|
recipe.AddTile(TileID.MythrilAnvil);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|