diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 66168b6c31..2e4b7548e9 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -376,7 +376,8 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo predictionAmt *= 0.5f; // Gate values - float attackPhaseGateValue = lastMechAlive ? 360f : 480f; + float reducedTimeForGateValue = malice ? 60f : death ? 40f : revenge ? 30f : expertMode ? 20f : 0f; + float attackPhaseGateValue = (lastMechAlive ? 360f : 480f) - reducedTimeForGateValue; float timeToLineUpAttack = 30f; // Distance where Apollo stops moving @@ -768,8 +769,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (firingPlasma) { // Fire plasma - int numPlasmaOrbs = nerfedAttacks ? 8 : lastMechAlive ? 10 : 12; - float divisor = attackPhaseGateValue / numPlasmaOrbs; + float divisor = nerfedAttacks ? 60f : lastMechAlive ? 36f : 40f; float plasmaTimer = calamityGlobalNPC.newAI[3] - 2f; if (plasmaTimer % divisor == 0f && canFire) { diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index e2253cc9d1..4e48d24cff 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -644,7 +644,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[3] = 1f; npc.velocity *= decelerationVelocityMult; - int totalProjectiles = malice ? 12 : expertMode ? 10 : 8; + int totalProjectiles = malice ? 12 : death ? 10 : revenge ? 9 : expertMode ? 8 : 6; float radians = MathHelper.TwoPi / totalProjectiles; Vector2 laserSpawnPoint = new Vector2(npc.Center.X, npc.Center.Y); bool normalLaserRotation = npc.localAI[0] % 2f == 0f; diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 4acf99009a..e9610457d4 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -396,7 +396,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis predictionAmt *= 0.5f; // Gate values - float attackPhaseGateValue = lastMechAlive ? 360f : 480f; + float reducedTimeForGateValue = malice ? 60f : death ? 40f : revenge ? 30f : expertMode ? 20f : 0f; + float attackPhaseGateValue = (lastMechAlive ? 360f : 480f) - reducedTimeForGateValue; float timeToLineUpAttack = phase2 ? 30f : 45f; // Spin variables @@ -763,8 +764,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (firingLasers) { // Fire lasers - int numLasers = nerfedAttacks ? 8 : 12; - float divisor = attackPhaseGateValue / numLasers; + float divisor = nerfedAttacks ? 60f : lastMechAlive ? 30f : 40f; float laserTimer = calamityGlobalNPC.newAI[3] - 2f; if (laserTimer % divisor == 0f && canFire) { @@ -825,8 +825,8 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); Vector2 laserVelocity = chargeVelocityNormalized * 10f; - int numLasersPerSpread = 6; - int spread = 21; + int numLasersPerSpread = malice ? 10 : death ? 8 : expertMode ? 6 : 4; + int spread = malice ? 30 : death ? 26 : expertMode ? 21 : 15; float rotation = MathHelper.ToRadians(spread); float distanceFromTarget = Vector2.Distance(npc.Center, npc.Center + chargeVelocityNormalized * chargeDistance); float setVelocityInAI = 10f; @@ -930,8 +930,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis * normal = 16, 20, 24 * nerfedAttacks = 12, 15, 18 */ - int numLasersPerSpread = (nerfedAttacks || nerfedLaserShotgun) ? 4 : lastMechAlive ? 8 : 6; - int baseSpread = (nerfedAttacks || nerfedLaserShotgun) ? 12 : lastMechAlive ? 20 : 16; + int numLasersAddedByDifficulty = malice ? 3 : death ? 2 : expertMode ? 1 : 0; + int numLasersPerSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 3 : lastMechAlive ? 7 : 5) + numLasersAddedByDifficulty; + int baseSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 9 : lastMechAlive ? 18 : 13) + numLasersAddedByDifficulty * 2; int spread = baseSpread + (int)(calamityGlobalNPC.newAI[2] / divisor2) * (baseSpread / 4); float rotation = MathHelper.ToRadians(spread); float distanceFromTarget = Vector2.Distance(npc.Center, player.Center + predictionVector); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index fae843acce..106ec95511 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -187,7 +187,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.Calamity().newAI[i] = reader.ReadSingle(); } - public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => lastMechAlive ? 640f : 800f; + public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => + (CalamityWorld.malice ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) - (lastMechAlive ? 160f : 0f); public int CheckForOtherMechs(ref Player target, out bool exoPrimeAlive, out bool exoTwinsAlive) { diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index 924aeaf3dc..cedd7ee0ab 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.penetrate = -1; projectile.Opacity = 0f; cooldownSlot = 1; - projectile.timeLeft = timeLeft; + projectile.timeLeft = CalamityWorld.malice ? 48 : timeLeft; projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; } @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = true; int fadeInTime = 3; - projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); + projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - ((CalamityWorld.malice ? 48 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(projectile.Center, 0f, 0.6f * projectile.Opacity, 0f); diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 653e3ac678..d74e3b8e6e 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -1,3 +1,4 @@ +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -11,8 +12,6 @@ namespace CalamityMod.Projectiles.Boss { public class ApolloRocket : ModProjectile { - private const int timeLeft = 180; - public override void SetStaticDefaults() { DisplayName.SetDefault("High Explosive Plasma Rocket"); @@ -31,7 +30,7 @@ namespace CalamityMod.Projectiles.Boss projectile.tileCollide = false; projectile.penetrate = -1; cooldownSlot = 1; - projectile.timeLeft = timeLeft; + projectile.timeLeft = 600; projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; } @@ -118,15 +117,21 @@ namespace CalamityMod.Projectiles.Boss } } - // Light - Lighting.AddLight(projectile.Center, 0f, 0.6f, 0f); + // Difficulty modes + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + + // Light + Lighting.AddLight(projectile.Center, 0f, 0.6f, 0f); // Get a target and calculate distance from it int target = Player.FindClosest(projectile.Center, 1, 1); Vector2 distanceFromTarget = Main.player[target].Center - projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = 200f; + float stopHomingDistance = malice ? 120f : death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; if (distanceFromTarget.Length() < stopHomingDistance || projectile.ai[0] == 1f) { projectile.ai[0] = 1f; @@ -139,7 +144,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = projectile.velocity.Length(); - float inertia = 10f; + float inertia = malice ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; projectile.velocity = (projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -147,7 +152,8 @@ namespace CalamityMod.Projectiles.Boss projectile.velocity *= scaleFactor; // Fly away from other rockets - float pushForce = 0.05f; + float pushForce = malice ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; + float pushDistance = malice ? 120f : death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; @@ -158,7 +164,7 @@ namespace CalamityMod.Projectiles.Boss // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. bool sameProjType = otherProj.type == projectile.type; float taxicabDist = Vector2.Distance(projectile.Center, otherProj.Center); - if (sameProjType && taxicabDist < 80f) + if (sameProjType && taxicabDist < pushDistance) { if (projectile.position.X < otherProj.position.X) projectile.velocity.X -= pushForce; diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index f29c203c30..e9f9a9fc2b 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -1,3 +1,4 @@ +using CalamityMod.Events; using CalamityMod.Skies; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -107,12 +108,18 @@ namespace CalamityMod.Projectiles.Boss // Light Lighting.AddLight(projectile.Center, 0.2f, 0.25f, 0.05f); + // Difficulty modes + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || malice; + bool revenge = CalamityWorld.revenge || malice; + bool expertMode = Main.expertMode || malice; + // Get a target and calculate distance from it - int target = Player.FindClosest(projectile.Center, 1, 1); + int target = Player.FindClosest(projectile.Center, 1, 1); Vector2 distanceFromTarget = Main.player[target].Center - projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = 300f; + float stopHomingDistance = malice ? 260f : death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; if (distanceFromTarget.Length() < stopHomingDistance || projectile.ai[0] == 1f) { projectile.ai[0] = 1f; @@ -125,7 +132,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = projectile.velocity.Length(); - float inertia = 10f; + float inertia = malice ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; projectile.velocity = (projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index ef10bccb8f..78e476ffbe 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss projectile.penetrate = -1; projectile.Opacity = 0f; cooldownSlot = 1; - projectile.timeLeft = timeLeft; + projectile.timeLeft = CalamityWorld.malice ? 96 : timeLeft; projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; } @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss } int fadeInTime = 3; - projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); + projectile.Opacity = MathHelper.Clamp(1f - ((projectile.timeLeft - ((CalamityWorld.malice ? 96 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(projectile.Center, 0f, 0.6f * projectile.Opacity, 0f);