From a96ab160fa830e705f8b641410580b7fd0bdf2ff Mon Sep 17 00:00:00 2001 From: Flowaria Date: Thu, 31 Oct 2024 19:22:05 +0900 Subject: [PATCH] DesertScourgeIDList. --- Balancing/BalancingChangesManager.cs | 2 +- CalamityLists.cs | 11 -------- NPCs/CalamityGlobalNPC.cs | 6 ++-- .../Collections/NPCIDs/DesertScourgeIDList.cs | 28 +++++++++++++++++++ 4 files changed, 32 insertions(+), 15 deletions(-) create mode 100644 Systems/Collections/NPCIDs/DesertScourgeIDList.cs diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 268cc8b7f4..819cabe3ec 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -94,7 +94,7 @@ namespace CalamityMod.Balancing #region Desert Scourge // 25% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DesertScourgeIDs, Do(ResistTrueMelee(0.75f)))); + NPCSpecificBalancingChanges.AddRange(Bundle(DesertScourgeIDList.List, Do(ResistTrueMelee(0.75f)))); #endregion #region Crabulon diff --git a/CalamityLists.cs b/CalamityLists.cs index 0a46067a98..d3843d30c3 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -44,8 +44,6 @@ namespace CalamityMod { public sealed class CalamityLists : ModSystem { - public static List PerforatorIDs; - public static List DesertScourgeIDs; public static List EaterofWorldsIDs; public static List SlimeGodIDs; public static List DeathModeSplittingWormIDs; @@ -87,13 +85,6 @@ namespace CalamityMod // Lists of enemies that resist piercing to some extent (mostly worms). // Could prove useful for other things as well. - DesertScourgeIDs = new List - { - NPCType(), - NPCType(), - NPCType() - }; - EaterofWorldsIDs = new List { NPCID.EaterofWorldsHead, @@ -728,8 +719,6 @@ namespace CalamityMod public override void Unload() { - PerforatorIDs = null; - DesertScourgeIDs = null; EaterofWorldsIDs = null; SlimeGodIDs = null; DeathModeSplittingWormIDs = null; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 4f30abfe63..48764ace41 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -804,7 +804,7 @@ namespace CalamityMod.NPCs // Damage multiplier calcs. // Worms that are vulnerable to debuffs and Slime God slimes take reduced damage from vulnerabilities. #region Debuff System Multiplier Calculations - bool wormBoss = CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || PerforatorWormIDList.Includes(npc) || + bool wormBoss = DesertScourgeIDList.Includes(npc) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || PerforatorWormIDList.Includes(npc) || AquaticScourgeIDList.Includes(npc) || AstrumDeusIDList.Includes(npc) || CalamityLists.StormWeaverIDs.Contains(npc.type); bool slimeGod = CalamityLists.SlimeGodIDs.Contains(npc.type); @@ -6063,7 +6063,7 @@ namespace CalamityMod.NPCs modifiers.SourceDamage *= 0.1f; // True melee resists - if (CalamityLists.DesertScourgeIDs.Contains(npc.type) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper || + if (DesertScourgeIDList.Includes(npc) || CalamityLists.EaterofWorldsIDs.Contains(npc.type) || npc.type == NPCID.Creeper || PerforatorWormIDList.Includes(npc) || AquaticScourgeIDList.Includes(npc) || CalamityLists.DestroyerIDs.Contains(npc.type) || AstrumDeusIDList.Includes(npc) || CalamityLists.StormWeaverIDs.Contains(npc.type) || CalamityLists.ThanatosIDs.Contains(npc.type) || npc.type == NPCType() || npc.type == NPCType() || CalamityLists.AresIDs.Contains(npc.type) || npc.type == NPCType() || @@ -6235,7 +6235,7 @@ namespace CalamityMod.NPCs // Note that Calamity reduces the vanilla resist from 80% to 60% bool hasResist = CalamityLists.EaterofWorldsIDs.Contains(npc.type) && !Main.expertMode; // Add a resist for BoC's creepers and Prehardmode worm bosses - if (npc.type == NPCID.Creeper || CalamityLists.DesertScourgeIDs.Contains(npc.type) || PerforatorWormIDList.Includes(npc)) + if (npc.type == NPCID.Creeper || DesertScourgeIDList.Includes(npc) || PerforatorWormIDList.Includes(npc)) hasResist = true; if (hasResist) modifiers.SourceDamage *= 0.4f; diff --git a/Systems/Collections/NPCIDs/DesertScourgeIDList.cs b/Systems/Collections/NPCIDs/DesertScourgeIDList.cs new file mode 100644 index 0000000000..c76e65a551 --- /dev/null +++ b/Systems/Collections/NPCIDs/DesertScourgeIDList.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.DesertScourge; +using Terraria; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + public sealed class DesertScourgeIDList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + public static bool Includes(NPC npc) => List.Contains(npc.type); + public static bool Includes(int npcType) => List.Contains(npcType); + } +}