diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 37acd3132c..45fc1974d3 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -1,6 +1,7 @@ using CalamityMod.Balancing; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -104,7 +105,7 @@ namespace CalamityMod.Buffs { if (npc.Calamity().webbed < npc.buffTime[buffIndex]) npc.Calamity().webbed = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().webbed; npc.DelBuff(buffIndex); buffIndex--; @@ -113,7 +114,7 @@ namespace CalamityMod.Buffs { if (npc.Calamity().slowed < npc.buffTime[buffIndex]) npc.Calamity().slowed = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().slowed; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs index ff9aeafec2..26620b2a52 100644 --- a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -1,6 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.NPCs; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -40,7 +41,7 @@ namespace CalamityMod.Buffs.DamageOverTime } // Apply immunity timer. - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && cgn.debuffResistanceTimer <= 0) cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.trueVulnerabilityHex; // Destroy the vanilla buff, we don't use it. diff --git a/Buffs/DamageOverTime/Vaporfied.cs b/Buffs/DamageOverTime/Vaporfied.cs index 15064126fb..95fb11724b 100644 --- a/Buffs/DamageOverTime/Vaporfied.cs +++ b/Buffs/DamageOverTime/Vaporfied.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,7 +27,7 @@ namespace CalamityMod.Buffs.DamageOverTime { if (npc.Calamity().vaporfied < npc.buffTime[buffIndex]) npc.Calamity().vaporfied = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().vaporfied; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 13cbad0a14..adbcfe635a 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -1,6 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.NPCs; using CalamityMod.Particles; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -43,7 +44,7 @@ namespace CalamityMod.Buffs.DamageOverTime } // Apply immunity timer. - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && cgn.debuffResistanceTimer <= 0) cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.vulnerabilityHex; // Destroy the vanilla buff, we don't use it. diff --git a/Buffs/StatDebuffs/Eutrophication.cs b/Buffs/StatDebuffs/Eutrophication.cs index fe7bb2c1f3..e4bf120f00 100644 --- a/Buffs/StatDebuffs/Eutrophication.cs +++ b/Buffs/StatDebuffs/Eutrophication.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,7 +27,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().eutrophication < npc.buffTime[buffIndex]) npc.Calamity().eutrophication = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().eutrophication; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/GalvanicCorrosion.cs b/Buffs/StatDebuffs/GalvanicCorrosion.cs index 0d6639ee28..17254c5d2f 100644 --- a/Buffs/StatDebuffs/GalvanicCorrosion.cs +++ b/Buffs/StatDebuffs/GalvanicCorrosion.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().tesla < npc.buffTime[buffIndex]) npc.Calamity().tesla = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tesla; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs index d1c0ed7639..0983aad4b4 100644 --- a/Buffs/StatDebuffs/GlacialState.cs +++ b/Buffs/StatDebuffs/GlacialState.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -26,7 +27,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().gState < npc.buffTime[buffIndex]) npc.Calamity().gState = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/KamiFlu.cs b/Buffs/StatDebuffs/KamiFlu.cs index 2bcb04e825..730ca67496 100644 --- a/Buffs/StatDebuffs/KamiFlu.cs +++ b/Buffs/StatDebuffs/KamiFlu.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().kamiFlu < npc.buffTime[buffIndex]) npc.Calamity().kamiFlu = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().kamiFlu; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/TemporalSadness.cs b/Buffs/StatDebuffs/TemporalSadness.cs index 329546014b..8e765be36e 100644 --- a/Buffs/StatDebuffs/TemporalSadness.cs +++ b/Buffs/StatDebuffs/TemporalSadness.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ModLoader; @@ -17,7 +18,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().tSad < npc.buffTime[buffIndex]) npc.Calamity().tSad = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().tSad; npc.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/StatDebuffs/TimeDistortion.cs b/Buffs/StatDebuffs/TimeDistortion.cs index 4156fa9434..f56d673df3 100644 --- a/Buffs/StatDebuffs/TimeDistortion.cs +++ b/Buffs/StatDebuffs/TimeDistortion.cs @@ -1,4 +1,5 @@ using CalamityMod.NPCs; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -19,7 +20,7 @@ namespace CalamityMod.Buffs.StatDebuffs { if (npc.Calamity().timeSlow < npc.buffTime[buffIndex]) npc.Calamity().timeSlow = npc.buffTime[buffIndex]; - if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) + if ((EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().timeSlow; npc.DelBuff(buffIndex); buffIndex--; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 8697e95793..8e2cdefd72 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -33,6 +33,7 @@ using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using CalamityMod.Systems.Collections; namespace CalamityMod.CalPlayer { diff --git a/CalamityLists.cs b/CalamityLists.cs index 9e46306f66..7fe90ea38d 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -80,8 +80,6 @@ namespace CalamityMod { public sealed class CalamityLists : ModSystem { - public static List projectileDestroyExceptionList; - public static List enemyImmunityList; public static List confusionEnemyList; public static List dungeonEnemyBuffList; public static List dungeonProjectileBuffList; @@ -164,150 +162,6 @@ namespace CalamityMod public override void OnModLoad() { - enemyImmunityList = new List() - { - NPCID.KingSlime, - NPCType(), - NPCType(), - NPCType(), - NPCID.EyeofCthulhu, - NPCType(), - NPCID.EaterofWorldsHead, - NPCID.EaterofWorldsBody, - NPCID.EaterofWorldsTail, - NPCID.BrainofCthulhu, - NPCID.Creeper, - NPCID.QueenBee, - NPCID.Deerclops, - NPCID.SkeletronHead, - NPCID.SkeletronHand, - NPCID.WallofFlesh, - NPCID.WallofFleshEye, - NPCID.PirateShipCannon, - NPCID.QueenSlimeBoss, - NPCID.Probe, - NPCID.Retinazer, - NPCID.Spazmatism, - NPCType(), - NPCID.SkeletronPrime, - NPCType(), - NPCID.PrimeCannon, - NPCID.PrimeSaw, - NPCID.PrimeLaser, - NPCID.PrimeVice, - NPCID.Plantera, - NPCID.PlanterasTentacle, - NPCType(), - NPCID.Everscream, - NPCID.SantaNK1, - NPCID.IceQueen, - NPCID.MourningWood, - NPCID.Pumpking, - NPCID.Mothron, - NPCID.Golem, - NPCID.GolemHead, - NPCID.GolemHeadFree, - NPCID.GolemFistRight, - NPCID.GolemFistLeft, - NPCID.MartianSaucerCore, - NPCID.MartianSaucerCannon, - NPCID.MartianSaucerTurret, - NPCID.DukeFishron, - NPCID.Sharkron, - NPCID.Sharkron2, - NPCID.HallowBoss, - NPCID.CultistBoss, - NPCID.CultistDragonHead, - NPCID.CultistDragonBody1, - NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, - NPCID.CultistDragonBody4, - NPCID.CultistDragonTail, - NPCID.AncientCultistSquidhead, - NPCID.MoonLordHead, - NPCID.MoonLordHand, - NPCID.MoonLordCore, - NPCID.MoonLordFreeEye, - NPCID.DD2WyvernT1, - NPCID.DD2WyvernT2, - NPCID.DD2WyvernT3, - NPCID.DD2DarkMageT1, - NPCID.DD2DarkMageT3, - NPCID.DD2SkeletonT1, - NPCID.DD2SkeletonT3, - NPCID.DD2WitherBeastT2, - NPCID.DD2WitherBeastT3, - NPCID.DD2DrakinT2, - NPCID.DD2DrakinT3, - NPCID.DD2KoboldWalkerT2, - NPCID.DD2KoboldWalkerT3, - NPCID.DD2KoboldFlyerT2, - NPCID.DD2KoboldFlyerT3, - NPCID.DD2OgreT2, - NPCID.DD2OgreT3, - NPCID.DD2Betsy, - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType(), - NPCType() - }; - confusionEnemyList = new List() { NPCType(), diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 4f9d40fdd2..045099d291 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -88,6 +88,7 @@ using Terraria.Utilities; using static Terraria.ModLoader.ModContent; using CalamityMod.ExtraTextures; using MonoMod.Utils; +using CalamityMod.Systems.Collections; namespace CalamityMod.NPCs { @@ -8689,7 +8690,7 @@ namespace CalamityMod.NPCs if (target.damage > 0 && !target.boss && !target.friendly && !target.dontTakeDamage && target.type != NPCID.Creeper && target.type != NPCType() && target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCType() && target.type != NPCID.GolemFistLeft && target.type != NPCID.GolemFistRight && - target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !CalamityLists.enemyImmunityList.Contains(target.type) && !AcidRainEvent.AllMinibosses.Contains(target.type)) + target.type != NPCType() && target.type != NPCType() && target.type != NPCID.DD2Betsy && !EnemyImmunitiesList.IsNPCImmune(target) && !AcidRainEvent.AllMinibosses.Contains(target.type)) { return true; } diff --git a/Systems/Collections/EnemyImmunitiesList.cs b/Systems/Collections/EnemyImmunitiesList.cs new file mode 100644 index 0000000000..e82e7e9dc5 --- /dev/null +++ b/Systems/Collections/EnemyImmunitiesList.cs @@ -0,0 +1,191 @@ +using System.Collections.Generic; +using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.AstrumAureus; +using CalamityMod.NPCs.Bumblebirb; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.Cryogen; +using CalamityMod.NPCs.DesertScourge; +using CalamityMod.NPCs.GreatSandShark; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.OldDuke; +using CalamityMod.NPCs.Perforator; +using CalamityMod.NPCs.PlaguebringerGoliath; +using CalamityMod.NPCs.PlagueEnemies; +using CalamityMod.NPCs.ProfanedGuardians; +using CalamityMod.NPCs.Providence; +using CalamityMod.NPCs.Ravager; +using CalamityMod.NPCs.SlimeGod; +using CalamityMod.NPCs.SunkenSea; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains all of the NPC IDs of all NPCs that are immune to special debuffs. + /// + public sealed class EnemyImmunitiesList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + NPCID.KingSlime, + NPCType(), + NPCType(), + NPCType(), + NPCID.EyeofCthulhu, + NPCType(), + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.BrainofCthulhu, + NPCID.Creeper, + NPCID.QueenBee, + NPCID.Deerclops, + NPCID.SkeletronHead, + NPCID.SkeletronHand, + NPCID.WallofFlesh, + NPCID.WallofFleshEye, + NPCID.PirateShipCannon, + NPCID.QueenSlimeBoss, + NPCID.Probe, + NPCID.Retinazer, + NPCID.Spazmatism, + NPCType(), + NPCID.SkeletronPrime, + NPCType(), + NPCID.PrimeCannon, + NPCID.PrimeSaw, + NPCID.PrimeLaser, + NPCID.PrimeVice, + NPCID.Plantera, + NPCID.PlanterasTentacle, + NPCType(), + NPCID.Everscream, + NPCID.SantaNK1, + NPCID.IceQueen, + NPCID.MourningWood, + NPCID.Pumpking, + NPCID.Mothron, + NPCID.Golem, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.GolemFistRight, + NPCID.GolemFistLeft, + NPCID.MartianSaucerCore, + NPCID.MartianSaucerCannon, + NPCID.MartianSaucerTurret, + NPCID.DukeFishron, + NPCID.Sharkron, + NPCID.Sharkron2, + NPCID.HallowBoss, + NPCID.CultistBoss, + NPCID.CultistDragonHead, + NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, + NPCID.CultistDragonBody3, + NPCID.CultistDragonBody4, + NPCID.CultistDragonTail, + NPCID.AncientCultistSquidhead, + NPCID.MoonLordHead, + NPCID.MoonLordHand, + NPCID.MoonLordCore, + NPCID.MoonLordFreeEye, + NPCID.DD2WyvernT1, + NPCID.DD2WyvernT2, + NPCID.DD2WyvernT3, + NPCID.DD2DarkMageT1, + NPCID.DD2DarkMageT3, + NPCID.DD2SkeletonT1, + NPCID.DD2SkeletonT3, + NPCID.DD2WitherBeastT2, + NPCID.DD2WitherBeastT3, + NPCID.DD2DrakinT2, + NPCID.DD2DrakinT3, + NPCID.DD2KoboldWalkerT2, + NPCID.DD2KoboldWalkerT3, + NPCID.DD2KoboldFlyerT2, + NPCID.DD2KoboldFlyerT3, + NPCID.DD2OgreT2, + NPCID.DD2OgreT3, + NPCID.DD2Betsy, + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType(), + NPCType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if an NPC is in this list. + /// + public static bool IsNPCImmune(NPC npc) => List.Contains(npc.type); + } +} diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 31ce973dc9..cd362d8e55 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -35,6 +35,7 @@ using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; +using CalamityMod.Systems.Collections; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -99,7 +100,7 @@ namespace CalamityMod // // All bosses and several enemies are automatically immune to Pearl Aura. - if (CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) + if (EnemyImmunitiesList.IsNPCImmune(npc) || npc.boss) NPCID.Sets.SpecificDebuffImmunity[npc.type][ModContent.BuffType()] = true; // Make all Cal NPCs immune to confused unless otherwise specified