* Fixed Netcode Issues on BossSummon Items * Replaced npc loop to ActiveNPCs iterator
57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using CalamityMod.Events;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.NPCs.HiveMind;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.SummonItems
|
|
{
|
|
public class Teratoma : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.SummonItems";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ItemID.Sets.SortingPriorityBossSpawns[Type] = 5; // Abeemination / Deer Thing
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 28;
|
|
Item.height = 18;
|
|
Item.rare = ItemRarityID.Orange;
|
|
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.ZoneCorrupt && !NPC.AnyNPCs(ModContent.NPCType<HiveMind>()) && !BossRushEvent.BossRushActive;
|
|
}
|
|
|
|
public override bool? UseItem(Player player)
|
|
{
|
|
CalamityUtils.SpawnBossUsingItem<HiveMind>(player, SoundID.Roar);
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
CreateRecipe().
|
|
AddIngredient(ItemID.DemoniteBar, 3).
|
|
AddIngredient<RottenMatter>(7).
|
|
AddIngredient(ItemID.RottenChunk, 13).
|
|
AddTile(TileID.DemonAltar).
|
|
AddDecraftCondition(CalamityConditions.DownedHiveMind).
|
|
Register();
|
|
}
|
|
}
|
|
}
|