Merge pull request #1337 from CalamityTeam/stun-removal

Removal of Boss Slowing Debuff System
This commit is contained in:
Doze-Zoze authored and GitHub committed 2026-03-31 17:48:42 -05:00
commit 052d8c400b
63 files changed
+56 -221

No files matched your search

+4 -2
View File
@@ -156,11 +156,13 @@ namespace CalamityMod.Buffs
}
}
if (type == BuffID.Frozen)
{
npc.Calamity().frozen = true;
}
if (type == BuffID.Webbed)
{
npc.Calamity().webbed = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
if (type == BuffID.Electrified)
{
@@ -41,9 +41,6 @@ namespace CalamityMod.Buffs.DamageOverTime
cgn.trueVulnerabilityHex = true;
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex];
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
-2
View File
@@ -34,8 +34,6 @@ namespace CalamityMod.Buffs.DamageOverTime
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().vaporfied = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin +npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
-4
View File
@@ -46,10 +46,6 @@ namespace CalamityMod.Buffs.DamageOverTime
// Set the remaining time of the fire drawer to be exactly right.
if (cgn.VulnerabilityHexFireDrawer != null)
cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + npc.buffTime[buffIndex];
// Apply immunity timer.
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && cgn.debuffResistanceTimer <= 0)
cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + +npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
-2
View File
@@ -26,8 +26,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().eutrophication = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
-2
View File
@@ -26,8 +26,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().galvanicCorrosion = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
public override void Update(Player player, ref int buffIndex)
-28
View File
@@ -1,28 +0,0 @@
using CalamityMod.NPCs;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class GlacialState : ModBuff
{
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
BuffID.Sets.LongerExpertDebuff[Type] = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().glacialState = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 B

-2
View File
@@ -17,8 +17,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().temporalSadness = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
}
}
-2
View File
@@ -19,8 +19,6 @@ namespace CalamityMod.Buffs.StatDebuffs
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().timeDistortion = true;
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
}
}
}
+1 -1
View File
@@ -2322,7 +2322,7 @@ namespace CalamityMod.CalPlayer
if (duration > 120)
duration = 120;
npc.AddBuff(ModContent.BuffType<GlacialState>(), (int)duration, false);
npc.AddBuff(BuffID.Frozen, (int)duration, false);
}
}
}
+2 -2
View File
@@ -2803,10 +2803,10 @@ namespace CalamityMod.CalPlayer
Player.buffImmune[BuffID.Chilled] = true;
}
// Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff
// Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Frozen debuff
if (cFreeze)
{
int buffType = ModContent.BuffType<GlacialState>();
int buffType = BuffID.Frozen;
float freezeDist = 200f;
if (Player.whoAmI == Main.myPlayer)
{
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
var source = player.GetSource_ItemUse(Item);
int p = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<DarkIceZero>(), Item.damage, 12f, player.whoAmI);
Main.projectile[p].Kill();
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
public const int TrueMeleeHitHeal = 4;
public const int TrueMeleeGlacialStateTime = 30;
public const int TrueMeleeFrozenTime = 30;
public const float SmallSlashDamageFactor = 0.4f;
@@ -1126,12 +1126,6 @@ GalvanicCorrosion: {
ItemTooltipEnemy: Slows enemies
}
GlacialState: {
DisplayName: Glacial State
Description: Cannot move
ItemTooltipEnemy: Freezes enemies
}
IcarusFolly: {
DisplayName: Icarus' Folly
Description:
@@ -189,7 +189,7 @@ AquaticHeart: {
Wow, you can swim now!
Being underwater increases max speed and acceleration by {0}%
Greatly reduces breath loss and reduces the darkness intensity in the abyss
Attackers are inflicted with [cbuff:CalamityMod/GlacialState]
Attackers are inflicted with [cbuff:Frozen]
Gain a fragile ice barrier that grants {1}% damage reduction for one hit
The ice shield regenerates after {2} seconds
'''
@@ -41,6 +41,7 @@ Slimed.ItemTooltipEnemy: Enhances Heat debuff damage
Wet.ItemTooltipEnemy: Enhances Electric debuff damage
Confused.ItemTooltipEnemy: Reverses movement
Webbed.ItemTooltipEnemy: Slows enemies
Frozen.ItemTooltipEnemy: Freezes enemies
Electrified: {
ItemTooltipPlayer: Electric - 4 DPS. Deals 5x damage to moving players
-10
View File
@@ -155,16 +155,6 @@ namespace CalamityMod.NPCs.AquaticScourge
enrageScale += 2f;
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = getFuckedAI;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Fire teeth
if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4))
{
@@ -151,16 +151,6 @@ namespace CalamityMod.NPCs.AquaticScourge
enrageScale += 2f;
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = getFuckedAI;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Kill body and tail
bool shouldDespawn = true;
for (int i = 0; i < Main.maxNPCs; i++)
-10
View File
@@ -291,16 +291,6 @@ namespace CalamityMod.NPCs.AquaticScourge
}
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = doSpiral || getFuckedAI;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Spawn segments
if (calamityGlobalNPC.newAI[2] == 0f && NPC.ai[0] == 0f)
{
-10
View File
@@ -150,16 +150,6 @@ namespace CalamityMod.NPCs.AquaticScourge
enrageScale += 2f;
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = getFuckedAI;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Kill body and tail
bool shouldDespawn = true;
for (int i = 0; i < Main.maxNPCs; i++)
-10
View File
@@ -139,16 +139,6 @@ namespace CalamityMod.NPCs.Bumblebirb
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = NPC.ai[0] == 3f || NPC.ai[0] == 3.1f || NPC.ai[0] == 3.2f;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// If target is outside the jungle for more than 5 seconds, enrage
if (!player.ZoneJungle && !BossRushEvent.BossRushActive)
{
+10 -23
View File
@@ -252,15 +252,10 @@ namespace CalamityMod.NPCs
/// <summary> If set to true, allows for manually disabling this NPC's Boss Health Bar, even if they are still active. </summary>
public bool ShouldCloseHPBar = false;
/// <summary> Constant representing the cooldown, in frames, before a boss can be affected by a slowing debuff. </summary>
public const int slowingDebuffResistanceMin = 1800;
/// <summary> Tracks the current slowing debuff cooldown for this NPC. </summary>
public int debuffResistanceTimer = 0;
#region Debuffs
public bool vaporfied = false;
public bool timeDistortion = false;
public bool glacialState = false;
public bool frozen = false;
public bool galvanicCorrosion = false;
public bool temporalSadness = false;
public bool eutrophication = false;
@@ -550,11 +545,9 @@ namespace CalamityMod.NPCs
myClone.CanHaveBossHealthBar = CanHaveBossHealthBar;
myClone.ShouldCloseHPBar = ShouldCloseHPBar;
myClone.debuffResistanceTimer = debuffResistanceTimer;
myClone.vaporfied = vaporfied;
myClone.timeDistortion = timeDistortion;
myClone.glacialState = glacialState;
myClone.frozen = frozen;
myClone.galvanicCorrosion = galvanicCorrosion;
myClone.temporalSadness = temporalSadness;
myClone.eutrophication = eutrophication;
@@ -751,12 +744,9 @@ namespace CalamityMod.NPCs
//Debuff Bool clearing.
// Doze 2jun2025 - Moved here from PostAI so drawing can read the bools.
if (debuffResistanceTimer > 0)
debuffResistanceTimer--;
timeDistortion = false;
galvanicCorrosion = false;
glacialState = false;
frozen = false;
temporalSadness = false;
eutrophication = false;
webbed = false;
@@ -3324,10 +3314,6 @@ namespace CalamityMod.NPCs
laserBurnDamage = 0;
}
// Queen Bee is completely immune to having her movement impaired if not in a high difficulty mode.
if (npc.type == NPCID.QueenBee && !CalamityWorld.revenge && !BossRushEvent.BossRushActive)
return;
// Pearl Aura shard spawning
// Slowing is handled in the general slowing code below
if (pearlAura)
@@ -3369,8 +3355,8 @@ namespace CalamityMod.NPCs
}
impalePacketTimer++;
// Apply slowing debuff effects
if (debuffResistanceTimer <= 0 || (debuffResistanceTimer > slowingDebuffResistanceMin))
// Apply slowing debuff effects, will not apply to bosses
if (!(CalamityNPCSets.ImmuneToSlowsAndOtherSpecialEffects[npc.type] || npc.boss))
{
// Slowing debuffs which set a velocity hard cap take priority first.
if (vulnerabilityHex)
@@ -3389,7 +3375,7 @@ namespace CalamityMod.NPCs
if (webbed)
velocitySlownessFactor += 0.15f;
if (glacialState)
if (frozen)
{
float baseSlownessFactor = 0.1f;
if (VulnerableToCold.HasValue)
@@ -4881,7 +4867,7 @@ namespace CalamityMod.NPCs
// Calamity debuff coloring effects
// These are in order of precedence because they override each other.
if (glacialState)
if (frozen)
drawColor = Color.Cyan;
else if (auricRebuke)
@@ -4986,7 +4972,6 @@ namespace CalamityMod.NPCs
("CalamityMod/Buffs/StatDebuffs/Crumbling", NPC => NPC.Calamity().crumble),
("CalamityMod/Buffs/StatDebuffs/Eutrophication", NPC => NPC.Calamity().eutrophication),
("CalamityMod/Buffs/StatDebuffs/GalvanicCorrosion", NPC => NPC.Calamity().galvanicCorrosion),
("CalamityMod/Buffs/StatDebuffs/GlacialState", NPC => NPC.Calamity().glacialState),
("CalamityMod/Buffs/StatDebuffs/Irradiated", NPC => NPC.Calamity().irradiated),
("CalamityMod/Buffs/StatDebuffs/MarkedforDeath", NPC => NPC.Calamity().markedForDeath),
("CalamityMod/Buffs/StatDebuffs/PearlAura", NPC => NPC.Calamity().pearlAura),
@@ -5077,6 +5062,8 @@ namespace CalamityMod.NPCs
currentDebuffs.Add(TextureAssets.Buff[BuffID.Confused].Value);
if (npc.ichor)
currentDebuffs.Add(TextureAssets.Buff[BuffID.Ichor].Value);
if (frozen)
currentDebuffs.Add(TextureAssets.Buff[BuffID.Frozen].Value);
if (webbed)
currentDebuffs.Add(TextureAssets.Buff[BuffID.Webbed].Value);
if (npc.midas)
@@ -5487,7 +5474,7 @@ namespace CalamityMod.NPCs
if (target.damage > 0 && !target.boss && !target.friendly && !target.dontTakeDamage && target.type != NPCID.Creeper && target.type != NPCType<RavagerClawLeft>() &&
target.type != NPCID.MourningWood && target.type != NPCID.Everscream && target.type != NPCID.SantaNK1 && target.type != NPCType<RavagerClawRight>() &&
target.type != NPCType<ReaperShark>() && target.type != NPCType<Mauler>() && target.type != NPCType<EidolonWyrmHead>() && target.type != NPCID.GolemFistLeft && target.type != NPCID.GolemFistRight &&
target.type != NPCType<PrimordialWyrmHead>() && target.type != NPCType<ColossalSquid>() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type))
target.type != NPCType<PrimordialWyrmHead>() && target.type != NPCType<ColossalSquid>() && target.type != NPCID.DD2Betsy && !CalamityNPCSets.ImmuneToSlowsAndOtherSpecialEffects[target.type] && !AcidRainEvent.AllMinibosses.Contains(target.type))
{
return true;
}
-10
View File
@@ -218,16 +218,6 @@ namespace CalamityMod.NPCs.Leviathan
NPC.dontTakeDamage = spawnAnimation;
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = NPC.ai[0] == 2f;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Despawn
if (!player.active || player.dead || Vector2.Distance(player.Center, npcCenter) > 5600f)
{
@@ -180,16 +180,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
nukeBarrageChallengeAmt *= 1.5f;
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = NPC.ai[0] == 0f || NPC.ai[0] == 4f;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Light
Lighting.AddLight((int)(NPC.Center.X / 16f), (int)(NPC.Center.Y / 16f), 0.3f, 0.7f, 0f);
-10
View File
@@ -341,16 +341,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm
iceMistDuration *= 0.5f;
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = AIState == (float)Phase.FinalPhase || AIState == (float)Phase.ShadowFireballSpin;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Adjust opacity
bool invisiblePartOfChargePhase = calamityGlobalNPC.newAI[2] >= chargePhaseGateValue && calamityGlobalNPC.newAI[2] <= chargePhaseGateValue + 1f && (AIState == (float)Phase.ChargeOne || AIState == (float)Phase.ChargeTwo || AIState == (float)Phase.FastCharge);
bool invisiblePartOfLightningChargePhase = calamityGlobalNPC.newAI[2] >= lightningChargePhaseGateValue && calamityGlobalNPC.newAI[2] <= lightningChargePhaseGateValue + 1f && AIState == (float)Phase.LightningCharge;
@@ -243,7 +243,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int whoAmI = NPC.whoAmI;
float ai0Holdover = NPC.ai[0];
float newAI1Holdover = calamityGlobalNPC.newAI[1];
int slowingDebuffResistTimer = calamityGlobalNPC.debuffResistanceTimer;
// Actually transform the body segment into a head segment.
NPC.SetDefaultsKeepPlayerInteraction(NPC.type);
@@ -253,7 +252,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Heads spawned mid fight by splitting do not get reset spawn invincibility.
CalamityGlobalNPC newCGN = NPC.Calamity();
newCGN.newAI[1] = newAI1Holdover;
newCGN.debuffResistanceTimer = slowingDebuffResistTimer;
CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults);
@@ -268,14 +266,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
float segmentLifeRatio = MathHelper.Lerp(0.5f, 1f, NPC.life / (float)NPC.lifeMax);
int whoAmI = NPC.whoAmI;
float ai1Holdover = NPC.ai[1];
int slowingDebuffResistTimer = calamityGlobalNPC.debuffResistanceTimer;
// Actually transform the body segment into a tail segment.
NPC.SetDefaultsKeepPlayerInteraction(NPC.type);
NPC.life = (int)(NPC.lifeMax * segmentLifeRatio);
NPC.whoAmI = whoAmI;
NPC.ai[1] = ai1Holdover;
NPC.Calamity().debuffResistanceTimer = slowingDebuffResistTimer;
CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults);
@@ -136,16 +136,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (Main.player[NPC.target].dead)
NPC.ai[0] = 7f;
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = NPC.ai[0] == 0f;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
// Always start in enemy spawning phase
if (calamityGlobalNPC.newAI[3] == 0f)
{
@@ -147,16 +147,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center);
}
// Adjust slowing debuff immunity
bool immuneToSlowingDebuffs = NPC.ai[1] == 5f;
NPC.buffImmune[ModContent.BuffType<GlacialState>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TemporalSadness>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Eutrophication>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<TimeDistortion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<GalvanicCorrosion>()] = immuneToSlowingDebuffs;
NPC.buffImmune[ModContent.BuffType<Vaporfied>()] = immuneToSlowingDebuffs;
NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
bool normalLaserRotation = NPC.localAI[1] % 2f == 0f;
// Float near player
+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
public override Color? GetAlpha(Color lightColor)
+1 -1
View File
@@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
target.AddBuff(BuffID.Frostburn2, 180);
}
}
+1 -1
View File
@@ -132,6 +132,6 @@ namespace CalamityMod.Projectiles.Magic
}
public override bool? CanDamage() => Timer == 140f ? null : false;
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 60);
}
}
+1 -1
View File
@@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
if (Projectile.damage > 10)
{
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
public override Color? GetAlpha(Color lightColor)
+1 -1
View File
@@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn, 120);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
}
}
@@ -102,7 +102,7 @@ namespace CalamityMod.Projectiles.Melee
{
base.OnHitNPC(target, hit, damageDone);
if (SwingMode == 2)
target.AddBuff(BuffType<GlacialState>(), 20);
target.AddBuff(BuffID.Frozen, 20);
}
public override void AI()
+1 -1
View File
@@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Melee
{
Player player = Main.player[Projectile.owner];
target.AddBuff(ModContent.BuffType<Nightwither>(), 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<CosmicIceBurst>(), Projectile.damage, 10f, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
+1 -1
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
public override Color? GetAlpha(Color lightColor)
+1 -1
View File
@@ -616,7 +616,7 @@ namespace CalamityMod.Projectiles.Melee
}
// Freeze the target briefly, to allow the player to more easily perform a powerful slash.
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
}
if (State == SwingState.Swinging && PerformingPowerfulSlash && Owner.ownedProjectileCounts[ModContent.ProjectileType<Exoboom>()] < 1)
+1 -1
View File
@@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Melee
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.IceRod, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 30);
public override bool PreDraw(ref Color lightColor)
{
@@ -99,7 +99,7 @@ namespace CalamityMod.Projectiles.Melee
{
base.OnHitNPC(target, hit, damageDone);
if (SwingMode == 2)
target.AddBuff(BuffType<GlacialState>(), 40);
target.AddBuff(BuffID.Frozen, 40);
}
public override void AI()
+1 -1
View File
@@ -285,7 +285,7 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), Terratomere.TrueMeleeGlacialStateTime);
target.AddBuff(BuffID.Frozen, Terratomere.TrueMeleeFrozenTime);
Owner.DoLifestealDirect(target, (int)Math.Round(hit.Damage * 0.025), 0.75f);
// Create a slash creator on top of the hit target.
@@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Melee
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffType<GlacialState>(), 100);
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frozen, 100);
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item105, Projectile.Center);
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
public override void OnKill(int timeLeft)
+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn, 120);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
public override void OnKill(int timeLeft)
+1 -1
View File
@@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Ranged
SoundEngine.PlaySound(crit with { Volume = 0.35f, Pitch = 1f }, Projectile.Center);
if (!target.boss)
target.AddBuff(ModContent.BuffType<GlacialState>(), 120);
target.AddBuff(BuffID.Frozen, 120);
int points = 6;
float radians = MathHelper.TwoPi / points;
+1 -1
View File
@@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
}
}
}
+1 -1
View File
@@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
Projectile.ai[0] = 1f;
Projectile.ai[1] = target.whoAmI;
Projectile.velocity = target.Center - Projectile.Center;
+1 -1
View File
@@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
Projectile.ai[0] = 1f;
Projectile.ai[1] = target.whoAmI;
Projectile.velocity = target.Center - Projectile.Center;
+1 -1
View File
@@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
target.AddBuff(ModContent.BuffType<GlacialState>(), 150);
target.AddBuff(BuffID.Frozen, 150);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
+1 -1
View File
@@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue
explosionCount++;
}
int buffType = ModContent.BuffType<GlacialState>();
int buffType = BuffID.Frozen;
float radius = 112f; // 7 blocks
foreach (NPC nPC in Main.ActiveNPCs)
+1 -1
View File
@@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Rogue
OnHitEffects(target);
target.AddBuff(BuffID.Frostburn2, 120);
if (Projectile.Calamity().stealthStrike)
target.AddBuff(ModContent.BuffType<GlacialState>(), 45);
target.AddBuff(BuffID.Frozen, 45);
}
+1 -1
View File
@@ -355,7 +355,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
+1 -1
View File
@@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
+1 -1
View File
@@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
+1 -1
View File
@@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
target.AddBuff(BuffID.Frozen, 60);
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Turret
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
target.AddBuff(BuffID.Frostburn2, 180);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
+1 -1
View File
@@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Turret
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
target.AddBuff(BuffID.Frostburn2, 180);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
+1 -1
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Typeless
if (!player.Calamity().CryoStoneVanity)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
}
// CIT 2MAY2025: Replaced old manual knockback code with setting HitDirectionOverride
+1 -1
View File
@@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Typeless
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Frostburn2, 180);
target.AddBuff(ModContent.BuffType<GlacialState>(), 30);
target.AddBuff(BuffID.Frozen, 30);
}
public override Color? GetAlpha(Color lightColor)
+1 -1
View File
@@ -61,7 +61,7 @@ namespace CalamityMod.Systems.Collections
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.ShadowFlame,
BuffID.OgreSpit, BuffID.BetsysCurse, BuffID.Wet, BuffID.Slimed, BuffID.OnFire3, BuffID.Frostburn2, BuffType<SulphuricPoisoning>(), BuffType<Shadowflame>(), BuffType<Daybroken>(), BuffType<BrimstoneFlames>(), BuffType<BurningBlood>(),
BuffType<BrainRot>(), BuffType<ElementalMix>(), BuffType<GlacialState>(), BuffType<GodSlayerInferno>(), BuffType<AstralInfectionDebuff>(), BuffType<HolyFlames>(),
BuffType<BrainRot>(), BuffType<ElementalMix>(), BuffType<GodSlayerInferno>(), BuffType<AstralInfectionDebuff>(), BuffType<HolyFlames>(),
BuffType<Irradiated>(), BuffType<Plague>(), BuffType<CrushDepth>(), BuffType<HadopelagicPressure>(), BuffType<RiptideDebuff>(), BuffType<MarkedforDeath>(),
BuffType<HeavyBleeding>(), BuffType<Laceration>(), BuffType<AbsorberAffliction>(), BuffType<ArmorCrunch>(), BuffType<Crumbling>(), BuffType<Vaporfied>(), BuffType<Eutrophication>(),
BuffType<Dragonfire>(), BuffType<VermillionFlux>(), BuffType<AuricRebuke>(), BuffType<StaticDischarge>(), BuffType<Nightwither>(), BuffType<Voidfrost>(),
+2 -2
View File
@@ -177,11 +177,11 @@ namespace CalamityMod.Systems.Collections
NPCID.MothronEgg, NPCID.MothronSpawn);
/// <summary>
/// If <see langword="true"/> for an NPC type, then the NPC will receive a 30 second global cooldown to slowing debuffs after being inflicted by one.<br/>
/// If <see langword="true"/> for an NPC type, then the NPC will not be affected by slowing debuffs.<br/>
/// Also used to prevent weapon pulling effects and Anarchy Blade's ability to instantly kill enemies that are below 50% health.<br/>
/// Defaults to <see langword="false"/>.
/// </summary>
public static bool[] ResistSlowingDebuffsAndOtherSpecialEffects = Factory.CreateBoolSet(NPCID.KingSlime, NPCType<KingSlimeJewelRuby>(),
public static bool[] ImmuneToSlowsAndOtherSpecialEffects = Factory.CreateBoolSet(NPCID.KingSlime, NPCType<KingSlimeJewelRuby>(),
NPCID.EyeofCthulhu, 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, NPCID.SkeletronPrime, NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, NPCID.PrimeVice, NPCID.Plantera,
+1 -1
View File
@@ -136,7 +136,7 @@ namespace CalamityMod
#region Standard Enemy Immunity Sets
private static readonly int[] slimeEnemyImmunities = new int[1] { BuffID.Poisoned };
private static readonly int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, ModContent.BuffType<GlacialState>() };
private static readonly int[] iceEnemyImmunities = new int[3] { BuffID.Frostburn, BuffID.Frostburn2, BuffID.Frozen };
private static readonly int[] sulphurEnemyImmunities = new int[4] { BuffID.Poisoned, BuffID.Venom, ModContent.BuffType<SulphuricPoisoning>(), ModContent.BuffType<Irradiated>() };
private static readonly int[] sunkenSeaEnemyImmunities = new int[2] { ModContent.BuffType<Eutrophication>(), ModContent.BuffType<PearlAura>() };
private static readonly int[] abyssEnemyImmunities = new int[2] { ModContent.BuffType<CrushDepth>(), ModContent.BuffType<RiptideDebuff>() };