DebuffsList.

This commit is contained in:
Memes authored and Cameron Ewell committed 2024-11-13 16:18:35 -05:00
1 parent a2fc330e47
commit 557d861441
7 files changed
+115 -83

No files matched your search

+4 -3
View File
@@ -82,6 +82,7 @@ using Terraria.ID;
using Terraria.ModLoader;
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
using CalamityMod.Projectiles.Pets;
using CalamityMod.Systems.Collections;
namespace CalamityMod.CalPlayer
{
@@ -1932,12 +1933,12 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
if (Player.buffTime[l] <= 2 && hasBuff == ModContent.BuffType<Buffs.StatBuffs.TarragonImmunity>())
int buffID = Player.buffType[l];
if (Player.buffTime[l] <= 2 && buffID == ModContent.BuffType<Buffs.StatBuffs.TarragonImmunity>())
if (Player.whoAmI == Main.myPlayer)
Player.AddCooldown(Cooldowns.TarragonImmunity.ID, CalamityUtils.SecondsToFrames(25));
bool shouldAffect = CalamityLists.debuffList.Contains(hasBuff);
bool shouldAffect = DebuffsList.IsDebuff(buffID);
if (shouldAffect)
Player.GetDamage<RogueDamageClass>() += 0.1f;
}
-73
View File
@@ -77,7 +77,6 @@ namespace CalamityMod
{
public sealed class CalamityLists : ModSystem
{
public static List<int> debuffList;
public static List<int> fireDebuffList;
public static List<int> sicknessDebuffList;
public static List<int> alcoholList;
@@ -154,77 +153,6 @@ namespace CalamityMod
public override void OnModLoad()
{
debuffList = new List<int>()
{
BuffID.Poisoned,
BuffID.Darkness,
BuffID.Cursed,
BuffID.OnFire,
BuffID.Bleeding,
BuffID.Confused,
BuffID.Slow,
BuffID.Weak,
BuffID.Silenced,
BuffID.BrokenArmor,
BuffID.CursedInferno,
BuffID.Frostburn,
BuffID.Chilled,
BuffID.Frozen,
BuffID.Burning,
BuffID.Suffocation,
BuffID.Ichor,
BuffID.Venom,
BuffID.Blackout,
BuffID.Electrified,
BuffID.Rabies,
BuffID.Webbed,
BuffID.Stoned,
BuffID.Dazed,
BuffID.VortexDebuff,
BuffID.WitheredArmor,
BuffID.WitheredWeapon,
BuffID.OgreSpit,
BuffID.BetsysCurse,
BuffType<SulphuricPoisoning>(),
BuffType<Shadowflame>(),
BuffType<BrimstoneFlames>(),
BuffType<BurningBlood>(),
BuffType<BrainRot>(),
BuffType<ElementalMix>(),
BuffType<GlacialState>(),
BuffType<GodSlayerInferno>(),
BuffType<AstralInfectionDebuff>(),
BuffType<HolyFlames>(),
BuffType<Irradiated>(),
BuffType<Plague>(),
BuffType<CrushDepth>(),
BuffType<RiptideDebuff>(),
BuffType<MarkedforDeath>(),
BuffType<AbsorberAffliction>(),
BuffType<ArmorCrunch>(),
BuffType<Crumbling>(),
BuffType<Vaporfied>(),
BuffType<Eutrophication>(),
BuffType<Dragonfire>(),
BuffType<VermillionFlux>(),
BuffType<AuricRebuke>(),
BuffType<StaticDischarge>(),
BuffType<Nightwither>(),
BuffType<VulnerabilityHex>(),
BuffType<MiracleBlight>(),
BuffType<WhisperingDeath>(),
BuffType<FrozenLungs>(),
BuffType<FishAlert>(),
BuffType<HolyInferno>(),
BuffType<IcarusFolly>(),
BuffType<DoGExtremeGravity>(),
// BuffType<NOU>(),
BuffType<PopoNoselessBuff>(),
BuffType<SearingLava>(),
BuffType<WeakBrimstoneFlames>(),
BuffType<Withered>()
};
fireDebuffList = new List<int>()
{
BuffID.OnFire,
@@ -1659,7 +1587,6 @@ namespace CalamityMod
public override void Unload()
{
debuffList = null;
fireDebuffList = null;
sicknessDebuffList = null;
alcoholList = null;
+2 -1
View File
@@ -45,6 +45,7 @@ using CalamityMod.Projectiles.Ranged;
using Steamworks;
using CalamityMod.Particles;
using Terraria.Utilities.Terraria.Utilities;
using CalamityMod.Systems.Collections;
namespace CalamityMod.NPCs.SupremeCalamitas
{
@@ -1612,7 +1613,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
{
int buffID = NPC.buffType[l];
bool shouldHalveDuration = CalamityLists.debuffList.Contains(buffID);
bool shouldHalveDuration = DebuffsList.IsDebuff(buffID);
if (shouldHalveDuration && NPC.buffTime[l] > 4)
NPC.buffTime[l] = 4;
+3 -2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Particles;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -58,8 +59,8 @@ namespace CalamityMod.Projectiles.Healing
CleansingEffect = 1;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = player.buffType[l];
if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff))
int buffID = player.buffType[l];
if (player.buffTime[l] > 2 && DebuffsList.IsDebuff(buffID))
{
player.buffTime[l] *= 0;
}
+3 -2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Particles;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -56,8 +57,8 @@ namespace CalamityMod.Projectiles.Healing
CleansingEffect = 1;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = player.buffType[l];
if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff))
int buffID = player.buffType[l];
if (player.buffTime[l] > 2 && DebuffsList.IsDebuff(buffID))
{
player.buffTime[l] *= 0;
}
+3 -2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Particles;
using CalamityMod.Systems.Collections;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -58,8 +59,8 @@ namespace CalamityMod.Projectiles.Healing
CleansingEffect = 1;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = player.buffType[l];
if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff))
int buffID = player.buffType[l];
if (player.buffTime[l] > 2 && DebuffsList.IsDebuff(buffID))
{
player.buffTime[l] *= 0;
}
+100
View File
@@ -0,0 +1,100 @@
using System.Collections.Generic;
using CalamityMod.Buffs;
using CalamityMod.Buffs.Cooldowns;
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 Debuff IDs.
/// </summary>
public sealed class DebuffsList : ModSystem
{
public static IList<int> List { get; private set; }
public override void OnModLoad()
{
List =
[
BuffID.Poisoned,
BuffID.Darkness,
BuffID.Cursed,
BuffID.OnFire,
BuffID.Bleeding,
BuffID.Confused,
BuffID.Slow,
BuffID.Weak,
BuffID.Silenced,
BuffID.BrokenArmor,
BuffID.CursedInferno,
BuffID.Frostburn,
BuffID.Chilled,
BuffID.Frozen,
BuffID.Burning,
BuffID.Suffocation,
BuffID.Ichor,
BuffID.Venom,
BuffID.Blackout,
BuffID.Electrified,
BuffID.Rabies,
BuffID.Webbed,
BuffID.Stoned,
BuffID.Dazed,
BuffID.VortexDebuff,
BuffID.WitheredArmor,
BuffID.WitheredWeapon,
BuffID.OgreSpit,
BuffID.BetsysCurse,
BuffType<SulphuricPoisoning>(),
BuffType<Shadowflame>(),
BuffType<BrimstoneFlames>(),
BuffType<BurningBlood>(),
BuffType<BrainRot>(),
BuffType<ElementalMix>(),
BuffType<GlacialState>(),
BuffType<GodSlayerInferno>(),
BuffType<AstralInfectionDebuff>(),
BuffType<HolyFlames>(),
BuffType<Irradiated>(),
BuffType<Plague>(),
BuffType<CrushDepth>(),
BuffType<RiptideDebuff>(),
BuffType<MarkedforDeath>(),
BuffType<AbsorberAffliction>(),
BuffType<ArmorCrunch>(),
BuffType<Crumbling>(),
BuffType<Vaporfied>(),
BuffType<Eutrophication>(),
BuffType<Dragonfire>(),
BuffType<VermillionFlux>(),
BuffType<AuricRebuke>(),
BuffType<StaticDischarge>(),
BuffType<Nightwither>(),
BuffType<VulnerabilityHex>(),
BuffType<MiracleBlight>(),
BuffType<WhisperingDeath>(),
BuffType<FrozenLungs>(),
BuffType<FishAlert>(),
BuffType<HolyInferno>(),
BuffType<IcarusFolly>(),
BuffType<DoGExtremeGravity>(),
// BuffType<NOU>(),
BuffType<PopoNoselessBuff>(),
BuffType<SearingLava>(),
BuffType<WeakBrimstoneFlames>(),
BuffType<Withered>()
];
}
public override void Unload() => List = null;
/// <summary>
/// A shorthand method to check if a buff ID is a debuff.
/// </summary>
public static bool IsDebuff(int buffID) => List.Contains(buffID);
}
}