54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using CalamityMod.Items.Materials;
|
|
using CalamityMod.NPCs.Yharon;
|
|
using CalamityMod.World;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.SummonItems
|
|
{
|
|
public class ChickenEgg : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Dragon Egg");
|
|
Tooltip.SetDefault("Summons the loyal guardian of the tyrant king\n" +
|
|
"It yearns for the jungle\n" +
|
|
"Not consumable");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 28;
|
|
item.height = 18;
|
|
item.useAnimation = 45;
|
|
item.useTime = 45;
|
|
item.useStyle = 4;
|
|
item.consumable = false;
|
|
item.Calamity().postMoonLordRarity = 14;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType<Yharon>()) && CalamityWorld.downedBossAny;
|
|
}
|
|
|
|
public override bool UseItem(Player player)
|
|
{
|
|
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Yharon>());
|
|
Main.PlaySound(SoundID.Roar, player.position, 0);
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ModContent.ItemType<EffulgentFeather>(), 15);
|
|
recipe.AddIngredient(ModContent.ItemType<BarofLife>(), 15);
|
|
recipe.AddTile(TileID.LunarCraftingStation);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|