SicknessDebuffsList and more oopsies.
This commit is contained in:
1 parent
34fbf02b57
commit
3eefa0a146
3 files changed
+40
-19
No files matched your search
@@ -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)
|
||||
|
||||
@@ -77,8 +77,6 @@ namespace CalamityMod
|
||||
{
|
||||
public sealed class CalamityLists : ModSystem
|
||||
{
|
||||
public static List<int> fireDebuffList;
|
||||
public static List<int> sicknessDebuffList;
|
||||
public static List<int> alcoholList;
|
||||
public static List<int> spearAutoreuseList;
|
||||
public static List<int> pumpkinMoonBuffList;
|
||||
@@ -153,20 +151,6 @@ namespace CalamityMod
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
fireDebuffList
|
||||
|
||||
sicknessDebuffList = new List<int>()
|
||||
{
|
||||
BuffID.Poisoned,
|
||||
BuffID.Venom,
|
||||
BuffType<SulphuricPoisoning>(),
|
||||
BuffType<AstralInfectionDebuff>(),
|
||||
BuffType<Plague>(),
|
||||
BuffType<AbsorberAffliction>(),
|
||||
BuffType<WhisperingDeath>(),
|
||||
BuffType<Irradiated>()
|
||||
};
|
||||
|
||||
alcoholList = new List<int>()
|
||||
{
|
||||
BuffID.Tipsy,
|
||||
@@ -1572,8 +1556,6 @@ namespace CalamityMod
|
||||
|
||||
public override void Unload()
|
||||
{
|
||||
fireDebuffList = null;
|
||||
sicknessDebuffList = null;
|
||||
alcoholList = null;
|
||||
spearAutoreuseList = null;
|
||||
pumpkinMoonBuffList = null;
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="ModSystem"/> that contains a <see cref="IList{T}"/> that has all the Sickness Debuffs' IDs.
|
||||
/// </summary>
|
||||
public sealed class SicknessDebuffsList : ModSystem
|
||||
{
|
||||
public static IList<int> List { get; private set; }
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
List =
|
||||
[
|
||||
BuffID.Poisoned,
|
||||
BuffID.Venom,
|
||||
BuffType<SulphuricPoisoning>(),
|
||||
BuffType<AstralInfectionDebuff>(),
|
||||
BuffType<Plague>(),
|
||||
BuffType<AbsorberAffliction>(),
|
||||
BuffType<WhisperingDeath>(),
|
||||
BuffType<Irradiated>()
|
||||
];
|
||||
}
|
||||
|
||||
public override void Unload() => List = null;
|
||||
|
||||
/// <summary>
|
||||
/// A shorthand method to check if a buff ID is a Sickness Debuff.
|
||||
/// </summary>
|
||||
public static bool IsSickenessDebuff(int buffID) => List.Contains(buffID);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user