60 lines
1.8 KiB
C#
60 lines
1.8 KiB
C#
using CalamityMod.Events;
|
|
using CalamityMod.Items.Materials;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.SummonItems
|
|
{
|
|
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 = ItemUseStyleID.HoldingUp;
|
|
item.rare = 7;
|
|
item.consumable = true;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return player.ZoneJungle && !NPC.AnyNPCs(NPCID.Plantera) && !BossRushEvent.BossRushActive;
|
|
}
|
|
|
|
public override bool UseItem(Player player)
|
|
{
|
|
Main.PlaySound(SoundID.Roar, player.position, 0);
|
|
if (Main.netMode != NetmodeID.MultiplayerClient)
|
|
NPC.SpawnOnPlayer(player.whoAmI, NPCID.Plantera);
|
|
else
|
|
NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, NPCID.Plantera);
|
|
|
|
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(ModContent.ItemType<MurkyPaste>(), 3);
|
|
recipe.AddIngredient(ItemID.Vine);
|
|
recipe.AddIngredient(ModContent.ItemType<TrapperBulb>());
|
|
recipe.AddTile(TileID.MythrilAnvil);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|