From f2b2171fde71dbddae90c102110ba38f5e1be0af Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 1 Apr 2024 14:03:20 -0500 Subject: [PATCH] Master Rev+ predictive EoW and BoC. --- NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs | 10 ++++++---- NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index 428cf9c661..91882982c8 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -198,8 +198,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!despawn) { Vector2 brainCenter = npc.Center; - float targetXDist = Main.player[npc.target].Center.X - brainCenter.X; - float targetYDist = Main.player[npc.target].Center.Y - brainCenter.Y; + Vector2 destination = Main.player[npc.target].Center + (masterMode ? Main.player[npc.target].velocity * 20f : Vector2.Zero); + float targetXDist = destination.X - brainCenter.X; + float targetYDist = destination.Y - brainCenter.Y; float targetDistance = (float)Math.Sqrt(targetXDist * targetXDist + targetYDist * targetYDist); float velocityScale = death ? 6f : 4.5f; float velocityBoost = velocityScale * (1f - lifeRatio); @@ -265,7 +266,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.ForceRoarPitched, npc.Center); // Velocity - npc.velocity = (Main.player[npc.target].Center + (bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; + npc.velocity = (Main.player[npc.target].Center + (masterMode ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; if (Main.getGoodWorld) npc.velocity *= 1.15f; } @@ -925,7 +926,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float chargeVelocity = (death ? (masterMode ? 12f : 9f) : (masterMode ? 9f : 6f)) + chargeAggressionScale; chargeVelocity += 2f * enrageScale; - Vector2 targetDirection = Main.player[npc.target].Center - npc.Center; + Vector2 destination = Main.player[npc.target].Center + (masterMode ? Main.player[npc.target].velocity * 20f : Vector2.Zero); + Vector2 targetDirection = destination - npc.Center; targetDirection = targetDirection.SafeNormalize(Vector2.UnitY); if (Main.getGoodWorld) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 68ed0ff416..01730b578d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -324,7 +324,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses noFlyZone -= (int)(enrageScale * 200f); if (masterMode) - noFlyZone -= 200; + noFlyZone -= phase5 ? 400 : 200; if (noFlyZone < 100) noFlyZone = 100; @@ -357,8 +357,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase6) { - segmentVelocity += 8f * (enrageScale + 1f); - segmentAcceleration += 0.4f * (enrageScale + 1f); + segmentVelocity += 6f * (enrageScale + 1f); + segmentAcceleration += 0.3f * (enrageScale + 1f); } else if (phase5) { @@ -389,8 +389,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } Vector2 segmentDirection = npc.Center; - float targetPosX = Main.player[npc.target].Center.X; - float targetPosY = Main.player[npc.target].Center.Y; + Vector2 destination = Main.player[npc.target].Center + (phase6 ? Main.player[npc.target].velocity * 20f : Vector2.Zero); + float targetPosX = destination.X; + float targetPosY = destination.Y; targetPosX = (int)(targetPosX / 16f) * 16; targetPosY = (int)(targetPosY / 16f) * 16;