Files
CalamityModPublic/Items/SummonItems/ExoticPheromones.cs
T
2023-08-10 21:12:50 +07:00

62 lines
2.0 KiB
C#

using CalamityMod.Events;
using CalamityMod.Items.Materials;
using CalamityMod.NPCs.Bumblebirb;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Items.SummonItems
{
[LegacyName("BirbPheromones")]
public class ExoticPheromones : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.SummonItems";
public override void SetStaticDefaults()
{
ItemID.Sets.SortingPriorityBossSpawns[Type] = 19; // Celestial Sigil
}
public override void SetDefaults()
{
Item.width = 28;
Item.height = 18;
Item.rare = ItemRarityID.Red;
Item.useAnimation = 10;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.HoldUp;
Item.consumable = false;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
{
itemGroup = ContentSamples.CreativeHelper.ItemGroup.BossItem;
}
public override bool CanUseItem(Player player)
{
return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType<Bumblefuck>()) && !BossRushEvent.BossRushActive;
}
public override bool? UseItem(Player player)
{
SoundEngine.PlaySound(SoundID.Roar, player.Center);
if (Main.netMode != NetmodeID.MultiplayerClient)
NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType<Bumblefuck>());
else
NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, -1, -1, null, player.whoAmI, ModContent.NPCType<Bumblefuck>());
return true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<LifeAlloy>(5).
AddIngredient(ItemID.FragmentSolar, 20).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}