1 - Worm bosses take 50% less DoT from debuffs.

2 - Fixed worm bosses not taking zeros due to their increased spawn DR.
This commit is contained in:
Andrew Marheine committed 2022-01-08 20:22:12 -06:00
1 parent 5cbca25f5f
commit 521232c5dc
1 file changed
+18 -14
+18 -14
View File
@@ -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;