FireDebuffsList and oopsies.
This commit is contained in:
1 parent
557d861441
commit
34fbf02b57
3 files changed
+50
-21
No files matched your search
@@ -16,6 +16,7 @@ using CalamityMod.NPCs;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -390,9 +391,9 @@ namespace CalamityMod.CalPlayer
|
||||
continue;
|
||||
bool shouldHalveDuration = CalamityLists.sicknessDebuffList.Contains(buffID);
|
||||
if (livingDewHalveDebuffs)
|
||||
shouldHalveDuration |= CalamityLists.fireDebuffList.Contains(buffID);
|
||||
shouldHalveDuration |= FireDebuffsList.IsFireDebuff(buffID);
|
||||
if (purity)
|
||||
shouldHalveDuration |= CalamityLists.debuffList.Contains(buffID);
|
||||
shouldHalveDuration |= DebuffsList.IsDebuff(buffID);
|
||||
|
||||
if (shouldHalveDuration)
|
||||
--Player.buffTime[l];
|
||||
@@ -456,7 +457,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (purity)
|
||||
{
|
||||
int intendedPurityDefense = 0;
|
||||
int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains);
|
||||
int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains);
|
||||
if (currentDebuffs > 0)
|
||||
{
|
||||
// Healing rate is normally 5 HP/s (+1 every 12 frames)
|
||||
@@ -509,7 +510,7 @@ namespace CalamityMod.CalPlayer
|
||||
// If the player has any debuffs, give the extra life regen and defense
|
||||
// More defense is given for each additional debuff
|
||||
int intendedJewelDefense = 0;
|
||||
int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains);
|
||||
int currentDebuffs = Player.buffType.Count(DebuffsList.List.Contains);
|
||||
if (currentDebuffs > 0)
|
||||
{
|
||||
Player.lifeRegen += 4;
|
||||
@@ -536,7 +537,7 @@ namespace CalamityMod.CalPlayer
|
||||
Player.lifeRegen += 2;
|
||||
|
||||
// If any debuff is detected, provide even more life regen and massively accelerate it
|
||||
if (Player.buffType.Any(CalamityLists.debuffList.Contains))
|
||||
if (Player.buffType.Any(DebuffsList.List.Contains))
|
||||
{
|
||||
Player.lifeRegen += 3;
|
||||
if (Player.lifeRegenTime < 1800)
|
||||
|
||||
+1
-16
@@ -153,22 +153,7 @@ namespace CalamityMod
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
fireDebuffList = new List<int>()
|
||||
{
|
||||
BuffID.OnFire,
|
||||
BuffID.OnFire3, // Hellfire
|
||||
BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull
|
||||
BuffID.CursedInferno,
|
||||
BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players
|
||||
BuffType<Shadowflame>(), // Calamity Shadowflame copy for players
|
||||
BuffType<SearingLava>(), // Crags lava
|
||||
BuffType<BrimstoneFlames>(),
|
||||
BuffType<HolyFlames>(),
|
||||
BuffType<GodSlayerInferno>(),
|
||||
BuffType<Dragonfire>(),
|
||||
BuffType<WeakBrimstoneFlames>(), // Aflame enchant self damage
|
||||
BuffType<BanishingFire>(),
|
||||
};
|
||||
fireDebuffList
|
||||
|
||||
sicknessDebuffList = new List<int>()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
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 IDs of all Fire-type debuffs.
|
||||
/// </summary>
|
||||
public sealed class FireDebuffsList : ModSystem
|
||||
{
|
||||
public static IList<int> List { get; private set; }
|
||||
|
||||
public override void OnModLoad()
|
||||
{
|
||||
List =
|
||||
[
|
||||
BuffID.OnFire,
|
||||
BuffID.OnFire3, // Hellfire
|
||||
BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull
|
||||
BuffID.CursedInferno,
|
||||
BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players
|
||||
BuffType<Shadowflame>(), // Calamity Shadowflame copy for players
|
||||
BuffType<SearingLava>(), // Crags lava
|
||||
BuffType<BrimstoneFlames>(),
|
||||
BuffType<HolyFlames>(),
|
||||
BuffType<GodSlayerInferno>(),
|
||||
BuffType<Dragonfire>(),
|
||||
BuffType<WeakBrimstoneFlames>(), // Aflame enchant self damage
|
||||
BuffType<BanishingFire>(),
|
||||
];
|
||||
}
|
||||
|
||||
public override void Unload() => List = null;
|
||||
|
||||
/// <summary>
|
||||
/// A shorthand method to check if a buff ID is a fire debuff.
|
||||
/// </summary>
|
||||
public static bool IsFireDebuff(int buffID) => List.Contains(buffID);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user