From 13855b047b3fa864cdcdb4f009622cbcae2ed1d6 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 14 Sep 2024 18:48:34 -0400 Subject: [PATCH] Fixed Cal Clone phase transitions getting offset by dealing high damage in a single hit BEFORE: newAI[0] starts as her max health, and is set to her current health when a transition attack starts. This means dealing high damage on the hit taking into a transition attack causes the succeeding transitions to be offset. AFTER: newAI[0] starts as 1, and has 0.3 subtracted from it when a transition attack starts. Since it no longer relies on her current health to determine suceeding phases, transitions are no longer offset. --- .../CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs index 6af4cb2a2e..7dfb5557da 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs @@ -74,18 +74,21 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs calamityGlobalNPC.newAI[1] = 1f; } + // CIT 14SEP2024: Fixed bug where her phases would get offset by dealing a large amount of damage in a single hit to take her into a new phase. + // newAI[0] now starts at 1 and has 0.3 subtracted from it for each phase, instead of it storing her current health when she enters a new phase. + // Do bullet hell or spawn brothers if (calamityGlobalNPC.newAI[0] == 0f && npc.life > 0) - calamityGlobalNPC.newAI[0] = npc.lifeMax; + calamityGlobalNPC.newAI[0] = 1f; // Bullet hells at 70% and 10%, brothers at 40% if (npc.life > 0) { int calClonePhaseThreshold = (int)(npc.lifeMax * 0.3); - if ((npc.life + calClonePhaseThreshold) < calamityGlobalNPC.newAI[0]) + if (((npc.life + calClonePhaseThreshold) / (float)npc.lifeMax) < calamityGlobalNPC.newAI[0]) { - calamityGlobalNPC.newAI[0] = npc.life; - if (calamityGlobalNPC.newAI[0] <= npc.lifeMax * 0.1) + calamityGlobalNPC.newAI[0] -= 0.3f; + if (calamityGlobalNPC.newAI[0] <= 0.1f) { SoundEngine.PlaySound(SoundID.Item109, npc.Center); calamityGlobalNPC.newAI[2] = 2f; @@ -95,7 +98,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs SpawnDust(); } - else if (calamityGlobalNPC.newAI[0] <= npc.lifeMax * 0.4) + else if (calamityGlobalNPC.newAI[0] <= 0.4f) { if (Main.netMode != NetmodeID.MultiplayerClient) {