From 521232c5dcfd17261bdefa3ea7d03a0ee3eaebce Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 8 Jan 2022 20:22:12 -0600 Subject: [PATCH] 1 - Worm bosses take 50% less DoT from debuffs. 2 - Fixed worm bosses not taking zeros due to their increased spawn DR. --- NPCs/CalamityGlobalNPC.cs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9da8fc4608..df286d9d56 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -803,6 +803,10 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(1500, 300, ref npc.lifeRegen, ref damage); if (bBlood > 0) ApplyDPSDebuff(50, 10, ref npc.lifeRegen, ref damage); + + // Reduce DoT on worm bosses by 50%. + if (wormBoss && npc.lifeRegen < 0) + npc.lifeRegen /= 2; } public void ApplyDPSDebuff(int lifeRegenValue, int damageValue, ref int lifeRegen, ref int damage) @@ -2455,20 +2459,6 @@ namespace CalamityMod.NPCs if (damage == 0D) return false; - // Damage reduction on spawn - bool destroyerResist = CalamityLists.DestroyerIDs.Contains(npc.type) && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice); - bool eaterofWorldsResist = CalamityLists.EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive; - if (destroyerResist || eaterofWorldsResist || CalamityLists.AstrumDeusIDs.Contains(npc.type)) - { - float resistanceGateValue = (CalamityLists.AstrumDeusIDs.Contains(npc.type) && newAI[0] != 0f) ? 300f : 600f; - if (newAI[1] < resistanceGateValue || (newAI[2] > 0f && CalamityLists.DestroyerIDs.Contains(npc.type))) - damage *= 0.01; - } - - // Large Deus worm takes reduced damage to last a long enough time - if (CalamityLists.AstrumDeusIDs.Contains(npc.type) && newAI[0] == 0f) - damage *= 0.8; - // Override hand/head eye 'death' code and use custom 'death' code instead, this is here just in case the AI code fails if (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice) { @@ -2511,6 +2501,20 @@ namespace CalamityMod.NPCs // DR applies after vanilla defense. damage = ApplyDR(npc, damage, yellowCandleDamage); + // Damage reduction on spawn for certain worm bosses. + bool destroyerResist = CalamityLists.DestroyerIDs.Contains(npc.type) && (CalamityWorld.revenge || BossRushEvent.BossRushActive || CalamityWorld.malice); + bool eaterofWorldsResist = CalamityLists.EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive; + if (destroyerResist || eaterofWorldsResist || CalamityLists.AstrumDeusIDs.Contains(npc.type)) + { + float resistanceGateValue = (CalamityLists.AstrumDeusIDs.Contains(npc.type) && newAI[0] != 0f) ? 300f : 600f; + if (newAI[1] < resistanceGateValue || (newAI[2] > 0f && CalamityLists.DestroyerIDs.Contains(npc.type))) + damage *= 0.01; + } + + // Large Deus worm takes reduced damage to last a long enough time. + if (CalamityLists.AstrumDeusIDs.Contains(npc.type) && newAI[0] == 0f) + damage *= 0.8; + // Inflict 0 damage if it's below 0.5 damage = damage < 0.5 ? 0D : damage < 1D ? 1D : damage;