Files
CalamityModPublic/Items/SummonItems/ProfanedCoreUnlimited.cs
T

56 lines
1.8 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.NPCs.Providence;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.SummonItems
{
public class ProfanedCoreUnlimited : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Profaned Core");
Tooltip.SetDefault("The core of the unholy flame\n" +
"Summons Providence\n" +
"Can only be used during daytime\n" +
"Not consumable");
}
public override void SetDefaults()
{
item.width = 20;
item.height = 20;
item.useAnimation = 45;
item.useTime = 45;
item.useStyle = 4;
item.consumable = false;
item.rare = 10;
item.Calamity().postMoonLordRarity = 12;
}
public override bool CanUseItem(Player player)
{
return !NPC.AnyNPCs(ModContent.NPCType<Providence>()) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight) && CalamityWorld.downedBossAny;
}
public override bool UseItem(Player player)
{
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Providence>());
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y);
return true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<ProfanedCore>());
recipe.AddIngredient(ModContent.ItemType<UnholyEssence>(), 50);
recipe.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}