From b83bc86969b159c46d99eab9fca1b79ca734644d Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 26 Sep 2021 12:02:59 -0500 Subject: [PATCH] 1 - Increased boss aggression for taking too long moved to Rev+ only. 2 - Increased Slime God large slime kill times from 1 minute to 1.5 minutes. --- CalamityMod.cs | 8 +- Items/DifficultyItems/Revenge.cs | 5 +- NPCs/Abyss/EidolonWyrmHeadHuge.cs | 9 +- NPCs/Bumblebirb/Bumblefuck.cs | 18 ++- NPCs/CalamityAI.cs | 110 +++++++++++------- NPCs/Crabulon/CrabulonIdle.cs | 9 +- NPCs/Cryogen/Cryogen.cs | 9 +- NPCs/DesertScourge/DesertScourgeHead.cs | 9 +- NPCs/DevourerofGods/DevourerofGodsHead.cs | 9 +- NPCs/DevourerofGods/DevourerofGodsHeadS.cs | 14 ++- NPCs/HiveMind/HiveMindP2.cs | 9 +- NPCs/Leviathan/Leviathan.cs | 9 +- NPCs/Leviathan/Siren.cs | 9 +- NPCs/Perforator/PerforatorHeadLarge.cs | 9 +- NPCs/Perforator/PerforatorHeadMedium.cs | 9 +- NPCs/Perforator/PerforatorHeadSmall.cs | 9 +- NPCs/Perforator/PerforatorHive.cs | 9 +- .../PlaguebringerGoliath.cs | 23 ++-- NPCs/Polterghast/Polterghast.cs | 27 +++-- NPCs/Polterghast/PolterghastHook.cs | 9 +- .../ProfanedGuardians/ProfanedGuardianBoss.cs | 29 ++--- NPCs/Providence/Providence.cs | 33 +++--- NPCs/Ravager/RavagerBody.cs | 9 +- NPCs/Signus/Signus.cs | 9 +- NPCs/SlimeGod/SlimeGod.cs | 9 +- NPCs/SlimeGod/SlimeGodCore.cs | 9 +- NPCs/SlimeGod/SlimeGodRun.cs | 9 +- NPCs/SlimeGod/SlimeGodRunSplit.cs | 9 +- NPCs/SlimeGod/SlimeGodSplit.cs | 9 +- NPCs/StormWeaver/StormWeaverHeadNaked.cs | 9 +- NPCs/Yharon/Yharon.cs | 21 ++-- 31 files changed, 303 insertions(+), 174 deletions(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index becfa0ed7c..e1f03a83fd 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -554,10 +554,10 @@ namespace CalamityMod { ModContent.NPCType(), 5400 }, { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 10800 }, - { ModContent.NPCType(), 3600 }, - { ModContent.NPCType(), 3600 }, - { ModContent.NPCType(), 3600 }, - { ModContent.NPCType(), 3600 }, + { ModContent.NPCType(), 5400 }, + { ModContent.NPCType(), 5400 }, + { ModContent.NPCType(), 5400 }, + { ModContent.NPCType(), 5400 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 7200 }, diff --git a/Items/DifficultyItems/Revenge.cs b/Items/DifficultyItems/Revenge.cs index c345697fd0..7603218209 100644 --- a/Items/DifficultyItems/Revenge.cs +++ b/Items/DifficultyItems/Revenge.cs @@ -19,11 +19,12 @@ namespace CalamityMod.Items.DifficultyItems "You gain Rage when in proximity of enemies or by using special items.\n" + "ADRENALINE TOOLTIP LINE HERE\n" + "You gain Adrenaline whenever a boss is alive. Getting hit drops Adrenaline back to 0.\n" + - "All enemies drop 50% more coins and spawn 15% more frequently\n" + + "All enemies drop 50% more coins and spawn 15% more frequently.\n" + "Certain enemies and projectiles deal between 5% and 25% more damage.\n" + "Makes certain enemies block life steal and nerfs the effectiveness of life steal.\n" + "Nerfs the effectiveness of the Titanium Armor set bonus.\n" + - "Changes ALL boss AIs and some enemy AIs in vanilla and the Calamity Mod."); + "Changes ALL boss AIs and some enemy AIs in vanilla and the Calamity Mod.\n" + + "Most bosses will enter later phases sooner if the fight has gone on for a long time."); } public override void SetDefaults() diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index f0055d6d68..4f1d467405 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -147,9 +147,12 @@ namespace CalamityMod.NPCs.Abyss // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < 0.8f; diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 5f19f42c20..3ffcfe54aa 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -106,9 +106,12 @@ namespace CalamityMod.NPCs.Bumblebirb // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; @@ -195,9 +198,12 @@ namespace CalamityMod.NPCs.Bumblebirb // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index e2a57dea9c..6125036f3c 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -66,14 +66,17 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + // Phases bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Homing only works if the boss is hostile if (head) npc.chaseable = calamityGlobalNPC.newAI[0] == 1f; @@ -668,10 +671,6 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Variables for buffing the AI bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive; bool enraged = calamityGlobalNPC.enraged > 0; @@ -679,6 +678,14 @@ namespace CalamityMod.NPCs bool expertMode = Main.expertMode || malice; bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + bool phase2 = lifeRatio < 0.5f && revenge; bool phase3 = lifeRatio < 0.33f; @@ -1209,9 +1216,12 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase3 = lifeRatio < 0.7f; @@ -1980,10 +1990,6 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Emit light Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1f, 0f, 0f); @@ -1996,6 +2002,13 @@ namespace CalamityMod.NPCs bool expertMode = Main.expertMode || malice; bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); @@ -2273,10 +2286,6 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Emit light Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1f, 0f, 0f); @@ -2289,6 +2298,13 @@ namespace CalamityMod.NPCs bool expertMode = Main.expertMode || malice; bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) npc.TargetClosest(); @@ -2571,10 +2587,6 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Variables bool enraged = calamityGlobalNPC.enraged > 0; bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; @@ -2582,7 +2594,14 @@ namespace CalamityMod.NPCs bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; - float shootTimer = 1f; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + + float shootTimer = 1f; if (expertMode) shootTimer += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio)); @@ -3286,9 +3305,12 @@ namespace CalamityMod.NPCs // Life float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases based on life percentage bool halfHealth = npc.life / (float)npc.lifeMax < 0.5f; @@ -3950,12 +3972,6 @@ namespace CalamityMod.NPCs // Percent life remaining double lifeRatio = npc.life / (double)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - - int lifePercentage = (int)(100.0 * lifeRatio); - // Difficulty modes bool enraged = calamityGlobalNPC.enraged > 0; bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; @@ -3963,6 +3979,13 @@ namespace CalamityMod.NPCs bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + // Phases bool phase2 = lifeRatio <= 0.7; bool phase3 = lifeRatio <= 0.4; @@ -4627,9 +4650,12 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f); @@ -5225,16 +5251,20 @@ namespace CalamityMod.NPCs // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Variables bool enraged = calamityGlobalNPC.enraged > 0; bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; bool expertMode = Main.expertMode || malice; bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + bool phase2 = lifeRatio <= (death ? 0.8f : revenge ? 0.7f : 0.5f); bool phase3 = lifeRatio <= (death ? 0.5f : (revenge ? 0.35f : 0.2f)) && expertMode; bool phase2AI = npc.ai[0] > 4f; diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 3af7137de0..98f3bea9e3 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -86,9 +86,12 @@ namespace CalamityMod.NPCs.Crabulon // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < 0.66f && expertMode; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index ea60d65401..1f89fb60ec 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -128,9 +128,12 @@ namespace CalamityMod.NPCs.Cryogen // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < (revenge ? 0.85f : 0.8f); diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index d476040836..0deb863734 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -118,9 +118,12 @@ namespace CalamityMod.NPCs.DesertScourge // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } if (revenge || lifeRatio < (expertMode ? 0.75f : 0.5f)) npc.Calamity().newAI[0] += 1f; diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 3b3824eaaa..4adfc6b129 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -114,9 +114,12 @@ namespace CalamityMod.NPCs.DevourerofGods // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.2f; diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 2c8158963c..34b668db1a 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -158,10 +158,6 @@ namespace CalamityMod.NPCs.DevourerofGods // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Variables Vector2 vector = npc.Center; bool flies = npc.ai[3] == 0f; @@ -170,7 +166,15 @@ namespace CalamityMod.NPCs.DevourerofGods bool expertMode = Main.expertMode || malice; bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; - bool phase2 = lifeRatio < 0.8f; + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + + bool phase2 = lifeRatio < 0.8f; bool phase3 = lifeRatio < 0.6f; bool phase4 = lifeRatio < 0.3f; bool phase5 = lifeRatio < 0.15f; diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index 2906b42abf..8d4c4227a1 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -312,9 +312,12 @@ namespace CalamityMod.NPCs.HiveMind // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (CalamityWorld.malice || CalamityWorld.revenge || BossRushEvent.BossRushActive) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } bool enraged = calamityGlobalNPC.enraged > 0; bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index e7a7dae482..fa1c08064a 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -105,9 +105,12 @@ namespace CalamityMod.NPCs.Leviathan // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < 0.7f && expertMode; diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 942a59a2c7..4da4020b83 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -141,9 +141,12 @@ namespace CalamityMod.NPCs.Leviathan float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } float bubbleVelocity = death ? 9f : revenge ? 7f : expertMode ? 6f : 5f; bubbleVelocity += 4f * enrageScale; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 9c06df575b..742cb16347 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -87,9 +87,12 @@ namespace CalamityMod.NPCs.Perforator // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } if (revenge || lifeRatio < (expertMode ? 0.75f : 0.5f)) npc.Calamity().newAI[0] += 1f; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index bae751179d..c2b46ad11c 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -75,9 +75,12 @@ namespace CalamityMod.NPCs.Perforator // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } float speed = 8f; float turnSpeed = 0.06f; diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 22421499bb..76b957f403 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -74,9 +74,12 @@ namespace CalamityMod.NPCs.Perforator // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } float speed = 0.15f; float turnSpeed = 0.1f; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 07a2bd0f20..5ae9e1aa38 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -108,9 +108,12 @@ namespace CalamityMod.NPCs.Perforator // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases based on life percentage bool phase2 = lifeRatio < 0.7f; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 36cb8861c3..ea64fd0eba 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -107,12 +107,22 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.width = npc.frame.Width / 2; npc.height = (int)(npc.frame.Height * (charging ? 1.5f : 1.8f)); + // Mode variables + bool enraged = calamityGlobalNPC.enraged > 0; + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Phases bool phase2 = lifeRatio < 0.75f; @@ -120,13 +130,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath bool phase4 = lifeRatio < 0.25f; bool phase5 = lifeRatio < 0.1f; - // Mode variables - bool enraged = calamityGlobalNPC.enraged > 0; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || malice; - bool revenge = CalamityWorld.revenge || malice; - bool expertMode = Main.expertMode || malice; - // Adjust slowing debuff immunity bool immuneToSlowingDebuffs = npc.ai[0] == 0f || npc.ai[0] == 4f; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index a892138319..b2ecdcde54 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -138,10 +138,6 @@ namespace CalamityMod.NPCs.Polterghast // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Variables Vector2 vector = npc.Center; bool enraged = calamityGlobalNPC.enraged > 0; @@ -151,7 +147,15 @@ namespace CalamityMod.NPCs.Polterghast bool death = CalamityWorld.death || malice; bool revenge = CalamityWorld.revenge || malice; bool expertMode = Main.expertMode || malice; - bool phase2 = lifeRatio < (death ? 0.9f : revenge ? 0.8f : expertMode ? 0.65f : 0.5f); + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + + bool phase2 = lifeRatio < (death ? 0.9f : revenge ? 0.8f : expertMode ? 0.65f : 0.5f); bool phase3 = lifeRatio < (death ? 0.6f : revenge ? 0.5f : expertMode ? 0.35f : 0.2f); bool phase4 = lifeRatio < (death ? 0.45f : revenge ? 0.35f : expertMode ? 0.2f : 0.1f); bool phase5 = lifeRatio < (death ? 0.2f : revenge ? 0.15f : expertMode ? 0.1f : 0.05f); @@ -1104,16 +1108,21 @@ namespace CalamityMod.NPCs.Polterghast // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > npc.Calamity().killTimeRatio_IncreasedAggression) - lifeRatio = npc.Calamity().killTimeRatio_IncreasedAggression; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; bool expertMode = Main.expertMode || malice; bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > npc.Calamity().killTimeRatio_IncreasedAggression) + lifeRatio = npc.Calamity().killTimeRatio_IncreasedAggression; + } + bool phase2 = lifeRatio < (death ? 0.9f : revenge ? 0.8f : expertMode ? 0.65f : 0.5f); bool phase3 = lifeRatio < (death ? 0.6f : revenge ? 0.5f : expertMode ? 0.35f : 0.2f); + npc.frameCounter += 1D; if (npc.frameCounter > 6D) { diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index 4acb4bfdac..a4704b170e 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -87,9 +87,12 @@ namespace CalamityMod.NPCs.Polterghast // Percent life remaining, Polter float lifeRatio = Main.npc[CalamityGlobalNPC.ghostBoss].life / (float)Main.npc[CalamityGlobalNPC.ghostBoss].lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().killTimeRatio_IncreasedAggression) - lifeRatio = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().killTimeRatio_IncreasedAggression) + lifeRatio = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().killTimeRatio_IncreasedAggression; + } // Scale multiplier based on nearby active tiles float tileEnrageMult = Main.npc[CalamityGlobalNPC.ghostBoss].ai[3]; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index e9d3f7166b..ad3f0d6531 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -87,12 +87,21 @@ namespace CalamityMod.NPCs.ProfanedGuardians CalamityGlobalNPC.doughnutBoss = npc.whoAmI; - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; + bool enraged = calamityGlobalNPC.enraged > 0; + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || malice; + bool revenge = CalamityWorld.revenge || malice; + bool death = CalamityWorld.death || malice; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + // Percent life remaining + float lifeRatio = npc.life / (float)npc.lifeMax; + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } Vector2 vectorCenter = npc.Center; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[1] == 0f) @@ -141,16 +150,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians else if (npc.timeLeft < 1800) npc.timeLeft = 1800; + // Become immune over time if target isn't in hell or hallow bool isHoly = player.ZoneHoly; bool isHell = player.ZoneUnderworldHeight; - bool enraged = calamityGlobalNPC.enraged > 0; - bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || malice; - bool revenge = CalamityWorld.revenge || malice; - bool death = CalamityWorld.death || malice; - - // Become immune over time if target isn't in hell or hallow - if (!isHoly && !isHell && !BossRushEvent.BossRushActive) + if (!isHoly && !isHell && !BossRushEvent.BossRushActive) { if (immuneTimer > 0) immuneTimer--; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index edcd99f867..7677a9bb9f 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -166,8 +166,18 @@ namespace CalamityMod.NPCs.Providence // Target variable and boss center Player player = Main.player[npc.target]; - // Target's current biome - bool isHoly = player.ZoneHoly; + // Night bool + bool malice = CalamityWorld.malice; + bool nightTime = !Main.dayTime || malice; + + // Difficulty bools + bool death = CalamityWorld.death || BossRushEvent.BossRushActive || nightTime; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive || nightTime; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive || nightTime; + bool enraged = npc.Calamity().enraged > 0; + + // Target's current biome + bool isHoly = player.ZoneHoly; bool isHell = player.ZoneUnderworldHeight; // Fire projectiles at normal rate or not @@ -180,13 +190,12 @@ namespace CalamityMod.NPCs.Providence // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - - // Night bool - bool malice = CalamityWorld.malice; - bool nightTime = !Main.dayTime || malice; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Play enrage animation if night starts if (nightTime && calamityGlobalNPC.newAI[3] == spawnAnimationTime) @@ -201,12 +210,6 @@ namespace CalamityMod.NPCs.Providence npc.netUpdate = true; } - // Difficulty bools - bool death = CalamityWorld.death || BossRushEvent.BossRushActive || nightTime; - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive || nightTime; - bool expertMode = Main.expertMode || BossRushEvent.BossRushActive || nightTime; - bool enraged = npc.Calamity().enraged > 0; - // Increase all projectile damage at night int projectileDamageMult = 1; if (nightTime) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 1e22acec8b..8d39a3bcfb 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -106,9 +106,12 @@ namespace CalamityMod.NPCs.Ravager // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Large fire light Lighting.AddLight((int)(npc.Center.X - 110f) / 16, (int)(npc.Center.Y - 30f) / 16, 0f, 0.5f, 2f); diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index ac9f53ca89..9c5fe321e7 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -104,9 +104,12 @@ namespace CalamityMod.NPCs.Signus double lifeRatio = npc.life / (double)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } lifeToAlpha = (int)(100.0 * (1.0 - lifeRatio)); int maxCharges = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index b134405e8b..a9b3963bc3 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -71,9 +71,12 @@ namespace CalamityMod.NPCs.SlimeGod float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } npc.defense = npc.defDefense; npc.damage = npc.defDamage; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 3de06f1d4a..86cdf3713b 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -99,9 +99,12 @@ namespace CalamityMod.NPCs.SlimeGod // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } Vector2 vectorCenter = npc.Center; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 46062cbf5f..ae6f5a6d58 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -74,9 +74,12 @@ namespace CalamityMod.NPCs.SlimeGod float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } npc.defense = npc.defDefense; npc.damage = npc.defDamage; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 23ca6bc4b7..34c01edd23 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -76,9 +76,12 @@ namespace CalamityMod.NPCs.SlimeGod float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } npc.defense = npc.defDefense; npc.damage = npc.defDamage; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 3c4c228f54..ae3b4984a4 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -76,9 +76,12 @@ namespace CalamityMod.NPCs.SlimeGod float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } npc.defense = npc.defDefense; npc.damage = npc.defDamage; diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 138d77e96c..aef2f2945c 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -132,9 +132,12 @@ namespace CalamityMod.NPCs.StormWeaver float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } // Start charging at the target bool phase2 = lifeRatio < 0.7f; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index be93674baa..205f510b30 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -145,10 +145,6 @@ namespace CalamityMod.NPCs.Yharon // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Stop rain CalamityMod.StopRain(); @@ -157,6 +153,14 @@ namespace CalamityMod.NPCs.Yharon bool expertMode = Main.expertMode || malice; bool revenge = CalamityWorld.revenge || malice; bool death = CalamityWorld.death || malice; + + if (revenge) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) + lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; + } + float pie = (float)Math.PI; Vector2 vectorCenter = npc.Center; @@ -2998,9 +3002,12 @@ namespace CalamityMod.NPCs.Yharon // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > npc.Calamity().killTimeRatio_IncreasedAggression) - lifeRatio = npc.Calamity().killTimeRatio_IncreasedAggression; + if (CalamityWorld.revenge || CalamityWorld.malice || BossRushEvent.BossRushActive) + { + // Increase aggression if player is taking a long time to kill the boss + if (lifeRatio > npc.Calamity().killTimeRatio_IncreasedAggression) + lifeRatio = npc.Calamity().killTimeRatio_IncreasedAggression; + } bool doTelegraphFlightAnimation = npc.localAI[1] < fastChargeTelegraphTime * 0.5f || npc.localAI[1] > fastChargeTelegraphTime - (fastChargeTelegraphTime / 6f); bool doTelegraphRoarAnimation = npc.localAI[1] > fastChargeTelegraphTime - fastChargeTelegraphTime * 0.4f && npc.localAI[1] < fastChargeTelegraphTime - fastChargeTelegraphTime * 0.2f;