diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 46400873cb..9b743fa3c0 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -389,7 +389,7 @@ namespace CalamityMod.CalPlayer int buffID = Player.buffType[l]; if (Player.buffTime[l] <= 2) continue; - bool shouldHalveDuration = CalamityLists.sicknessDebuffList.Contains(buffID); + bool shouldHalveDuration = SicknessDebuffsList.IsSickenessDebuff(buffID); if (livingDewHalveDebuffs) shouldHalveDuration |= FireDebuffsList.IsFireDebuff(buffID); if (purity) diff --git a/CalamityLists.cs b/CalamityLists.cs index 956b98d2c1..43581e6a97 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -77,8 +77,6 @@ namespace CalamityMod { public sealed class CalamityLists : ModSystem { - public static List fireDebuffList; - public static List sicknessDebuffList; public static List alcoholList; public static List spearAutoreuseList; public static List pumpkinMoonBuffList; @@ -153,20 +151,6 @@ namespace CalamityMod public override void OnModLoad() { - fireDebuffList - - sicknessDebuffList = new List() - { - BuffID.Poisoned, - BuffID.Venom, - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType(), - BuffType() - }; - alcoholList = new List() { BuffID.Tipsy, @@ -1572,8 +1556,6 @@ namespace CalamityMod public override void Unload() { - fireDebuffList = null; - sicknessDebuffList = null; alcoholList = null; spearAutoreuseList = null; pumpkinMoonBuffList = null; diff --git a/Systems/Collections/SicknessDebuffsList.cs b/Systems/Collections/SicknessDebuffsList.cs new file mode 100644 index 0000000000..9bf886a662 --- /dev/null +++ b/Systems/Collections/SicknessDebuffsList.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Systems.Collections +{ + /// + /// A that contains a that has all the Sickness Debuffs' IDs. + /// + public sealed class SicknessDebuffsList : ModSystem + { + public static IList List { get; private set; } + + public override void OnModLoad() + { + List = + [ + BuffID.Poisoned, + BuffID.Venom, + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType(), + BuffType() + ]; + } + + public override void Unload() => List = null; + + /// + /// A shorthand method to check if a buff ID is a Sickness Debuff. + /// + public static bool IsSickenessDebuff(int buffID) => List.Contains(buffID); + } +}