From 23344c4f099efbf245a7760f5a8563a6ef784080 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 4 Oct 2021 03:10:36 -0500 Subject: [PATCH] 1 - Ares Laser Cannon makes a charge up noise when it's about to fire its laser. 2 - Ares plasma bolts split less when he's in deathray phase and he's not the last mech alive. 3 - Ares tesla orbs are more predictive if he's the last mech alive. 4 - Ares tesla orbs do not arc if they are more than 100 tiles away from each other. --- NPCs/ExoMechs/Ares/AresBody.cs | 2 -- NPCs/ExoMechs/Ares/AresLaserCannon.cs | 4 ++++ NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 8 ++++++- NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 2 ++ Projectiles/Boss/AresPlasmaFireball.cs | 25 +++++++++++--------- Projectiles/Boss/AresTeslaOrb.cs | 3 +++ 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index c4104d2fb0..f44f7a19c8 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -9,8 +9,6 @@ using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.NPCs.ExoMechs.Apollo; -using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Projectiles.Boss; using CalamityMod.Skies; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 6e75ae655d..186eff4365 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -320,6 +320,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] += 1f; if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) { + // Play a charge up sound so that the player knows when it's about to fire the deathray + if (calamityGlobalNPC.newAI[2] == deathrayTelegraphDuration - 100f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/CrystylCharge"), npc.Center); + // Inverse lerp returns the percentage of progress between A and B float lerpValue2 = Utils.InverseLerp(movementDistanceGateValue, 2400f, distanceFromDestination.Length(), true); diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 349e955dd4..2346199eaf 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -267,7 +267,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares float movementDistanceGateValue = 50f; // Gate values + // Make plasma bolts split less if in deathray spiral phase and not the last mech alive, but fire more if in deathray spiral phase bool fireMoreBolts = calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays; + bool boltsSplitLess = fireMoreBolts && !lastMechAlive; float plasmaBoltPhaseGateValue = fireMoreBolts ? 120f : 270f; if (lastMechAlive) plasmaBoltPhaseGateValue *= 0.7f; @@ -332,7 +334,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); Vector2 offset = Vector2.Normalize(plasmaBoltVelocity) * 40f + Vector2.UnitY * 16f; - Projectile.NewProjectile(npc.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + + if (boltsSplitLess) + Projectile.NewProjectile(npc.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -2f); + else + Projectile.NewProjectile(npc.Center + offset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); } } } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 62aad8fdab..15760d8846 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -184,6 +184,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares predictionAmt *= 0.5f; if (passivePhase) predictionAmt *= 0.5f; + if (lastMechAlive) + predictionAmt *= 1.5f; Vector2 predictionVector = player.velocity * predictionAmt; Vector2 rotationVector = player.Center + predictionVector - npc.Center; diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index 6b062c20a5..e47e09bf62 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -48,16 +48,19 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - if (projectile.ai[0] != -1f) + if (projectile.ai[0] != -2f) { - Vector2 targetLocation = new Vector2(projectile.ai[0], projectile.ai[1]); - if (Vector2.Distance(targetLocation, projectile.Center) < 80f) - projectile.tileCollide = true; - } - else - { - if (projectile.timeLeft < timeLeft / 2) - projectile.Kill(); + if (projectile.ai[0] != -1f) + { + Vector2 targetLocation = new Vector2(projectile.ai[0], projectile.ai[1]); + if (Vector2.Distance(targetLocation, projectile.Center) < 80f) + projectile.tileCollide = true; + } + else + { + if (projectile.timeLeft < timeLeft / 2) + projectile.Kill(); + } } int fadeInTime = 3; @@ -166,8 +169,8 @@ namespace CalamityMod.Projectiles.Boss // Plasma bolts int totalProjectiles = CalamityWorld.malice ? 12 : 8; - // Reduce the total amount of projectiles by half if Apollo is shooting them - if (projectile.ai[0] == -1f) + // Reduce the total amount of projectiles by half if Apollo is shooting them or Ares Plasma Arm is shooting them and in deathray phase and not the last mech + if (projectile.ai[0] == -1f || projectile.ai[0] == -2f) totalProjectiles /= 2; float radians = MathHelper.TwoPi / totalProjectiles; diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index bb0d5beceb..c93d0793da 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -150,6 +150,9 @@ namespace CalamityMod.Projectiles.Boss if (Main.projectile[i].type != projectile.type || Main.projectile[i].ai[0] != Identity + 1f || !Main.projectile[i].active || Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Calamity().newAI[0] == (float)AresBody.Phase.Deathrays) continue; + if (Vector2.Distance(projectile.Center, Main.projectile[i].Center) > 1600f) + continue; + return Main.projectile[i]; } return null;