From 61ba4b56da20973558e34e9f0309d35b262e66a6 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 8 Jun 2025 22:15:24 -0400 Subject: [PATCH] Ares laser arm in mecha mayhem now only sweeps horizontally and swaps sides each time it fires Mecha mayhem now requires alternating holding A and D keys instead of just holding A key we're making so much progress guys --- NPCs/ExoMechs/Ares/AresBody.cs | 5 +++-- NPCs/ExoMechs/Ares/AresLaserCannon.cs | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 416eb7870a..d8fcf7c080 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -505,11 +505,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Prevent mechs from being respawned - if (otherExoMechWasFirst) + // CIT 08JUN2025: This code is pointless and makes me unable to work swapping the laser arm position. Commenting it out. + /*if (otherExoMechWasFirst) { if (NPC.ai[3] < 1f) NPC.ai[3] = 1f; - } + }*/ // Phases bool spawnOtherExoMechs = lifeRatio < 0.7f && NPC.ai[3] == 0f; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 81107f0d5a..a81f63a56e 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -184,6 +184,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool nerfedAttacks = false; if (exoTwinsAlive) nerfedAttacks = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].Calamity().newAI[1] != (float)Apollo.Apollo.SecondaryPhase.PassiveAndImmune; + // Used to make the beam only sweep horizontally during mecha mayhem phase + bool mechaMayhem = nerfedAttacks && exoWormAlive && Main.npc[CalamityGlobalNPC.draedonExoMechWorm].Calamity().newAI[1] != (float)ThanatosHead.SecondaryPhase.PassiveAndImmune; // Phases bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); @@ -346,7 +348,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares else if (shouldGetBuffedByBerserkPhase) deathrayPhaseGateValue *= 0.5f; - float deathrayPhaseVelocity = (nerfedAttacks ? 6f : passivePhase ? 9f : 12f) * baseVelocityMult; + float deathrayPhaseVelocity = (nerfedAttacks ? 8f : passivePhase ? 9f : 12f) * baseVelocityMult; if (lastMechAlive) deathrayPhaseVelocity *= 1.2f; else if (shouldGetBuffedByBerserkPhase) @@ -512,10 +514,21 @@ namespace CalamityMod.NPCs.ExoMechs.Ares AIState = (float)Phase.Nothing; calamityGlobalNPC.newAI[2] = 0f; - // Change deathray sweep type for next deathray phase + // Change deathray sweep type for next deathray phase; this does not affect anything during mecha mayhem calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] > 1f) calamityGlobalNPC.newAI[3] = 0f; + + // If mecha mayhem, make Ares swap the position of the laser and gauss arms, and ensure the beam always sweeps horizontal + if (mechaMayhem) + { + calamityGlobalNPC.newAI[3] = 0f; + if (Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] == 0f) + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] = 1f; + else + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] = 0f; + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ForceNetUpdate(); + } } break;