Files
CalamityModPublic/Items/SummonItems/CosmicWorm.cs
T

81 lines
2.7 KiB
C#

using CalamityMod.Events;
using CalamityMod.Items.Materials;
using CalamityMod.NPCs.DevourerofGods;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Items.SummonItems
{
public class CosmicWorm : ModItem
{
public override void SetStaticDefaults()
{
SacrificeTotal = 1;
DisplayName.SetDefault("Cosmic Worm");
Tooltip.SetDefault("Summons the Devourer of Gods\n" +
"Not consumable");
ItemID.Sets.SortingPriorityBossSpawns[Type] = 17; // Celestial Sigil
}
public override void SetDefaults()
{
Item.width = 28;
Item.height = 18;
Item.useAnimation = 10;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.consumable = false;
Item.rare = ItemRarityID.Purple;
Item.Calamity().customRarity = CalamityRarity.Turquoise;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem;
}
public override bool CanUseItem(Player player)
{
return !NPC.AnyNPCs(ModContent.NPCType<DevourerofGodsHead>()) && !BossRushEvent.BossRushActive;
}
public override bool? UseItem(Player player)
{
string key = "Mods.CalamityMod.EdgyBossText7";
Color messageColor = Color.Cyan;
CalamityUtils.DisplayLocalizedText(key, messageColor);
SoundEngine.PlaySound(DevourerofGodsHead.SpawnSound, player.position);
if (Main.netMode != NetmodeID.MultiplayerClient)
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<DevourerofGodsHead>());
else
NetMessage.SendData(MessageID.SpawnBoss, -1, -1, null, player.whoAmI, ModContent.NPCType<DevourerofGodsHead>());
return true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ArmoredShell>().
AddIngredient<TwistingNether>().
AddIngredient<DarkPlasma>().
AddTile(TileID.LunarCraftingStation).
Register();
CreateRecipe().
AddRecipeGroup("IronBar", 30).
AddIngredient(ItemID.LunarBar, 10).
AddIngredient<GalacticaSingularity>(20).
AddIngredient(ItemID.SoulofLight, 20).
AddIngredient(ItemID.SoulofNight, 20).
AddIngredient<Phantoplasm>(30).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}