DesertScourgeIDList.

This commit is contained in:
Flowaria authored and Cameron Ewell committed 2024-11-13 16:18:35 -05:00
1 parent be0ab6f915
commit a96ab160fa
4 files changed
+32 -15

No files matched your search

+1 -1
View File
@@ -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
-11
View File
@@ -44,8 +44,6 @@ namespace CalamityMod
{
public sealed class CalamityLists : ModSystem
{
public static List<int> PerforatorIDs;
public static List<int> DesertScourgeIDs;
public static List<int> EaterofWorldsIDs;
public static List<int> SlimeGodIDs;
public static List<int> 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<int>
{
NPCType<DesertScourgeHead>(),
NPCType<DesertScourgeBody>(),
NPCType<DesertScourgeTail>()
};
EaterofWorldsIDs = new List<int>
{
NPCID.EaterofWorldsHead,
@@ -728,8 +719,6 @@ namespace CalamityMod
public override void Unload()
{
PerforatorIDs = null;
DesertScourgeIDs = null;
EaterofWorldsIDs = null;
SlimeGodIDs = null;
DeathModeSplittingWormIDs = null;
+3 -3
View File
@@ -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<DarkEnergy>() || npc.type == NPCType<RavagerBody>() || CalamityLists.AresIDs.Contains(npc.type) || npc.type == NPCType<Crabulon.Crabulon>() ||
@@ -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;
@@ -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<int> List { get; private set; }
public override void OnModLoad()
{
List =
[
NPCType<DesertScourgeHead>(),
NPCType<DesertScourgeBody>(),
NPCType<DesertScourgeTail>()
];
}
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);
}
}