this is utter cancer

This commit is contained in:
mountaindrew10 committed 2025-03-17 07:50:10 -05:00
1 parent 8838193460
commit ac0ff550b2
4 files changed
+133 -152

No files matched your search

@@ -68,7 +68,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < DRIncreaseTime;
@@ -77,8 +76,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
float lifeRatio = npc.life / (float)npc.lifeMax;
// Phases based on life percentage
bool phase2 = lifeRatio < 0.85f || masterMode;
bool phase3 = lifeRatio < 0.7f || masterMode;
bool phase2 = lifeRatio < 0.85f || death;
bool phase3 = lifeRatio < 0.7f || death;
bool startFlightPhase = lifeRatio < 0.5f;
bool phase4 = lifeRatio < (death ? 0.4f : 0.25f);
bool phase5 = lifeRatio < (death ? 0.2f : 0.1f);
@@ -182,7 +181,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
else
{
if (masterMode && !bossRush && npc.localAI[3] == 1f)
if (death && !bossRush && npc.localAI[3] == 1f)
{
for (int i = 0; i < Main.maxNPCs; i++)
{
@@ -215,14 +214,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
bool spitLaserSpreads = death;
// Height of the box used to calculate whether The Destroyer should fly at its target or not
int noFlyZoneBoxHeight = masterMode ? 1500 : 1800;
int noFlyZoneBoxHeight = death ? 1500 : 1800;
// Speed and movement variables
float speed = masterMode ? 0.2f : 0.1f;
float turnSpeed = masterMode ? 0.3f : 0.15f;
float speed = death ? 0.2f : 0.1f;
float turnSpeed = death ? 0.3f : 0.15f;
// Max velocity
float segmentVelocity = flyAtTarget ? (masterMode ? 22.5f : 15f) : (masterMode ? 30f : 20f);
float segmentVelocity = flyAtTarget ? (death ? 22.5f : 15f) : (death ? 30f : 20f);
// Increase velocity based on distance
float velocityMultiplier = increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f;
@@ -290,7 +289,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Regenerate Probes in Master Mode if the number of Probes is less than 40 and the number of living NPCs is less than the segment count + 40 (this limit is here just in case)
// This doesn't happen if Oblivion is alive
if (masterMode && probeLaunched && !oblivionAlive)
if (death && probeLaunched && !oblivionAlive)
{
npc.localAI[2] += 1f;
if (npc.localAI[2] >= 600f)
@@ -410,8 +409,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity;
int numProj = calamityGlobalNPC.newAI[0] % 60f == 0f ? (masterMode ? 9 : 7) : (masterMode ? 6 : 4);
int spread = masterMode ? 38 : 26;
int numProj = calamityGlobalNPC.newAI[0] % 60f == 0f ? (death ? 9 : 7) : (death ? 6 : 4);
int spread = death ? 38 : 26;
float rotation = MathHelper.ToRadians(spread);
for (int i = 0; i < numProj; i++)
{
@@ -442,7 +441,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Set laser color and type
if (calamityGlobalNPC.destroyerLaserColor == -1 && !probeLaunched)
{
if (Main.rand.NextBool(masterMode ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser))
if (Main.rand.NextBool(death ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser))
{
int random = phase3 ? 4 : phase2 ? 3 : 2;
switch (Main.rand.Next(random))
@@ -473,8 +472,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
// Laser rate of fire
float shootProjectileTime = death ? (masterMode ? (phase5 ? 120f : phase4 ? 150f : 180f) : 270f) : (masterMode ? (phase5 ? 150f : phase4 ? 210f : 270f) : 450f);
float bodySegmentTime = npc.ai[0] * (masterMode ? 20f : 30f);
float shootProjectileTime = death ? (phase5 ? 120f : phase4 ? 150f : 180f) : 450f;
float bodySegmentTime = npc.ai[0] * (death ? 20f : 30f);
float shootProjectileGateValue = bodySegmentTime + shootProjectileTime;
float laserTimerIncrement = (calamityGlobalNPC.newAI[0] > shootProjectileGateValue - LaserTelegraphTime) ? 1f : 2f;
if (ableToFireLaser)
@@ -528,7 +527,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Shoot nothing if probe has been launched
if (calamityGlobalNPC.newAI[0] >= shootProjectileGateValue && ableToFireLaser)
{
if (!masterMode)
if (!death)
{
int numProbeSegments = 0;
for (int i = 0; i < Main.maxNPCs; i++)
@@ -545,7 +544,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height))
{
if (masterMode)
if (death)
{
int numProbeSegments = 0;
for (int i = 0; i < Main.maxNPCs; i++)
@@ -561,7 +560,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
// Laser speed
float projectileSpeed = (masterMode ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f;
float projectileSpeed = (death ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f;
projectileSpeed += enrageScale;
// Set projectile damage and type
@@ -607,14 +606,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.netUpdate = true;
if (masterMode)
if (death)
{
calamityGlobalNPC.destroyerLaserColor = -1;
npc.SyncDestroyerLaserColor();
}
}
if (!masterMode)
if (!death)
{
calamityGlobalNPC.destroyerLaserColor = -1;
npc.SyncDestroyerLaserColor();
@@ -846,7 +845,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!shouldFly)
{
npc.velocity.Y += 0.15f;
if (masterMode && npc.velocity.Y > 0f && Math.Abs(npc.Center.Y - player.Center.Y) > 360f)
if (death && npc.velocity.Y > 0f && Math.Abs(npc.Center.Y - player.Center.Y) > 360f)
npc.velocity.Y += 0.05f;
if (npc.velocity.Y > segmentVelocity)
@@ -1037,7 +1036,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Force the fucker to turn around in ground phase in Master
// Turns slower if Oblivion is alive, for fairness
if (npc.type == NPCID.TheDestroyer && masterMode && !flyAtTarget)
if (npc.type == NPCID.TheDestroyer && death && !flyAtTarget)
{
if (npc.Distance(player.Center) > 2000f)
npc.velocity += (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? speed : turnSpeed);
@@ -1742,7 +1741,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
public static bool BuffedProbeAI(NPC npc, Mod mod)
{
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
bool oblivionAlive = npc.ai[1] == 1f;
// Get a target
@@ -1754,8 +1753,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (targetData.Type == NPCTargetType.Player)
targetDead = Main.player[npc.target].dead;
float velocity = bossRush ? 12f : masterMode ? 8.4f : 7.2f;
float acceleration = bossRush ? 0.1f : masterMode ? 0.07f : 0.06f;
float velocity = bossRush ? 12f : death ? 8.4f : 7.2f;
float acceleration = bossRush ? 0.1f : death ? 0.07f : 0.06f;
float deceleration = 1f - acceleration;
if (targetDead)
@@ -1785,7 +1784,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
for (int i = 0; i < Main.maxNPCs; i++)
{
if (masterMode && !bossRush && npc.ai[1] == 0f)
if (death && !bossRush && npc.ai[1] == 0f)
{
if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType<SkeletronPrime2>() || Main.npc[i].type == NPCID.SkeletronPrime))
npc.ai[1] = 1f;
@@ -1860,7 +1859,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.dontTakeDamage = false;
npc.localAI[0] += 1f;
if ((npc.justHit && !masterMode) || targetDead)
if ((npc.justHit && !death) || targetDead)
npc.localAI[0] = 0f;
float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev;
@@ -1883,7 +1882,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
damage = (int)(damage * secondMechMultiplier);
}
int totalProjectiles = oblivionAlive ? 2 : (CalamityWorld.death || bossRush) ? 3 : 1;
int totalProjectiles = oblivionAlive ? 2 : death ? 3 : 1;
Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity;
if (NPC.IsMechQueenUp)
{
@@ -16,7 +16,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
// Difficulty bools
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Percent life remaining
@@ -25,9 +24,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
float slimeScale = 1f;
bool teleported = false;
bool phase2 = lifeRatio <= 0.5f;
bool phase3 = lifeRatio <= (masterMode ? 0.5f : 0.4f);
bool phase4 = lifeRatio <= (masterMode ? 0.5f : 0.2f);
bool phase5 = lifeRatio <= 0.25f && masterMode;
bool phase3 = lifeRatio <= (death ? 0.5f : 0.4f);
bool phase4 = lifeRatio <= (death ? 0.5f : 0.2f);
bool phase5 = lifeRatio <= 0.25f && death;
// Spawn settings
if (npc.localAI[0] == 0f)
@@ -60,7 +59,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
// Teleport
float teleportGateValue = masterMode ? 300f : 600f;
float teleportGateValue = death ? 300f : 600f;
if (!Main.player[npc.target].dead && npc.timeLeft > 10 && !phase2 && npc.ai[3] >= teleportGateValue && npc.ai[0] == 0f && npc.velocity.Y == 0f)
{
// Avoid cheap bullshit
@@ -315,7 +314,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
Gore.NewGore(npc.GetSource_FromAI(), npc.Center + new Vector2(-40f, -npc.height / 2), npc.velocity, GoreID.QueenSlimeCrown);
// Spawn spread of projectiles in Master Mode
if (masterMode)
if (death)
{
int numGelProjectiles = 12;
if (Main.getGoodWorld)
@@ -445,7 +444,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.ai[2] += 1f;
}
if (masterMode)
if (death)
npc.velocity.X *= (death ? 1.4f : 1.2f);
npc.noTileCollide = true;
@@ -455,16 +454,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (npc.target >= Main.maxPlayers)
break;
float jumpVelocity = bossRush ? 9f : death ? (masterMode ? 7f : 5.5f) : (masterMode ? 6f : 4.5f);
float jumpVelocity = bossRush ? 9f : death ? 7f : 4.5f;
if (Main.getGoodWorld)
jumpVelocity = 12f;
if ((npc.direction == 1 && npc.velocity.X < jumpVelocity) || (npc.direction == -1 && npc.velocity.X > 0f - jumpVelocity))
{
if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1))
npc.velocity.X += (bossRush ? 1f : death ? (masterMode ? 0.45f : 0.35f) : (masterMode ? 0.4f : 0.3f)) * npc.direction;
npc.velocity.X += (bossRush ? 1f : death ? 0.45f : 0.3f) * npc.direction;
else
npc.velocity.X *= bossRush ? 0.8f : death ? (masterMode ? 0.85f : 0.9f) : (masterMode ? 0.88f : 0.91f);
npc.velocity.X *= bossRush ? 0.8f : death ? 0.85f : 0.91f;
}
if (!Main.player[npc.target].dead)
@@ -515,7 +514,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, damage, 0f, Main.myPlayer);
// Line of explosions in Master Mode
if (masterMode)
if (death)
{
float expandDelay = 0f;
int maxSmashes = death ? 22 : 16;
@@ -537,7 +536,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Eruption of crystals in phase 3
if (npc.ai[0] == 6f && phase3)
{
float projectileVelocity = masterMode ? (death ? 18f : 15f) : 12f;
float projectileVelocity = death ? 18f : 12f;
type = ProjectileID.QueenSlimeMinionBlueSpike;
damage = npc.GetProjectileDamage(type);
Vector2 destination = (new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center).SafeNormalize(Vector2.UnitY);
@@ -638,7 +637,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
int projectileAmt = 2;
int type = ProjectileID.QueenSlimeMinionBlueSpike;
int damage = npc.GetProjectileDamage(type);
Vector2 velocityIncrease = masterMode ? (Vector2.UnitY * (death ? 4f : 2f)) : Vector2.Zero;
Vector2 velocityIncrease = death ? (Vector2.UnitY * 4f) : Vector2.Zero;
for (int i = 0; i < projectileAmt; i++)
{
int totalProjectiles = 2;
@@ -691,7 +690,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
npc.velocity = center - npc.Center;
npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero);
npc.velocity *= bossRush ? 30f : death ? (masterMode ? 27.3f : 26f) : (masterMode ? 25.2f : 24f);
npc.velocity *= bossRush ? 30f : death ? 27.3f : 24f;
}
else
npc.velocity.Y *= 0.95f;
@@ -845,7 +844,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Spawn small slimes
// Don't spawn any slimes in final phase
if (npc.life <= 0 || (phase4 && !masterMode))
if (npc.life <= 0 || (phase4 && !death))
return false;
if (Main.netMode == NetmodeID.MultiplayerClient)
@@ -862,7 +861,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
float slimeSpawnHealthGateValue = CalamityWorld.LegendaryMode ? 0.01f : phase3 ? 0.04f : phase2 ? 0.03f : 0.025f;
if (masterMode)
if (death)
slimeSpawnHealthGateValue *= 0.5f;
int slimeSpawnThreshold = (int)(npc.lifeMax * slimeSpawnHealthGateValue);
@@ -1645,15 +1644,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
// Difficulty bools
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode;
bool death = CalamityWorld.death;
bool death = CalamityWorld.death || bossRush;
npc.noTileCollide = true;
npc.noGravity = true;
float flyVelocity = bossRush ? 24f : death ? (masterMode ? 21f : 18f) : (masterMode ? 19f : 16f);
float flyAcceleration = bossRush ? 0.3f : death ? (masterMode ? 0.18f : 0.14f) : (masterMode ? 0.16f : 0.12f);
float flyDistanceY = masterMode ? 350f : 450f;
float flyVelocity = bossRush ? 24f : death ? 21f : 16f;
float flyAcceleration = bossRush ? 0.3f : death ? 0.18f : 0.12f;
float flyDistanceY = death ? 350f : 450f;
Vector2 desiredVelocity = npc.Center;
@@ -22,7 +22,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -44,7 +43,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
// Spawn second head in Master Mode
// The main head owns the Saw and the Laser in Master Mode
if (masterMode)
if (death)
{
int head = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType<SkeletronPrime2>(), npc.whoAmI);
Main.npc[head].ai[0] = npc.whoAmI;
@@ -99,7 +98,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.SyncExtraAI();
}
if (masterMode)
if (death)
{
if (!Main.npc[(int)npc.ai[0]].active || Main.npc[(int)npc.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead)
{
@@ -178,9 +177,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Phases
bool phase2 = lifeRatio < 0.66f;
bool spawnDestroyer = lifeRatio < 0.75f && masterMode && !bossRush && npc.localAI[2] == 0f;
bool spawnDestroyer = lifeRatio < 0.75f && death && !bossRush && npc.localAI[2] == 0f;
bool phase3 = lifeRatio < 0.33f;
bool spawnRetinazer = lifeRatio < 0.5f && masterMode && !bossRush && npc.localAI[2] == 1f;
bool spawnRetinazer = lifeRatio < 0.5f && death && !bossRush && npc.localAI[2] == 1f;
// Spawn The Destroyer in Master Mode (just like Oblivion from Avalon)
if (spawnDestroyer)
@@ -305,16 +304,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Start other phases; if arms are dead, start with spin phase
bool otherHeadChargingOrSpinning = Main.npc[(int)npc.ai[0]].ai[1] == 5f || Main.npc[(int)npc.ai[0]].ai[1] == 1f;
if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || masterMode)
if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || death)
{
// Start spin phase after 1.5 seconds
npc.ai[2] += phase3 ? 1.5f : 1f;
if (npc.ai[2] >= (90f - (death ? (masterMode ? 15f : 60f) * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !masterMode || phase3) && (canUseAttackInMaster || !masterMode))
if (npc.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !death || phase3) && (canUseAttackInMaster || !death))
{
bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 320f &&
Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f;
bool shouldCharge = masterMode && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode;
bool shouldCharge = death && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode;
if (shouldCharge)
{
npc.ai[2] = 0f;
@@ -342,7 +341,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
else
npc.rotation = npc.velocity.X / 15f;
float acceleration = (bossRush ? 0.16f : masterMode ? 0.12f : 0.1f) + (death ? 0.05f * (1f - lifeRatio) : 0f);
float acceleration = bossRush ? 0.2f : (death ? (0.12f + 0.05f * (1f - lifeRatio)) : 0.1f);
float accelerationMult = 1f;
if (!cannonAlive)
{
@@ -358,11 +357,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
acceleration += 0.0125f;
if (!sawAlive)
acceleration += 0.0125f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.7f : 0.85f;
float deceleration = death ? 0.7f : 0.85f;
float headDecelerationUpDist = 0f;
float headDecelerationDownDist = 0f;
@@ -435,7 +434,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
npc.localAI[0] = 0f;
int totalProjectiles = bossRush ? 24 : death ? (masterMode ? 15 : 18) : 12;
int totalProjectiles = bossRush ? 24 : death ? 15 : 12;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ProjectileID.DeathLaser;
int damage = npc.GetProjectileDamage(type);
@@ -493,7 +492,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
float headTargetY = Main.player[npc.target].Center.Y - headPosition.Y;
float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY);
float speed = bossRush ? 12f : (masterMode ? 8f : 6f);
float speed = bossRush ? 12f : death ? 8f : 6f;
if (phase2)
speed += 0.5f;
if (phase3)
@@ -645,9 +644,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation = npc.velocity.X / 50f;
float skullSpawnDivisor = bossRush ? 9f : death ? 15f - (float)Math.Round((masterMode ? 3f : 5f) * (1f - lifeRatio)) : 15f;
float skullSpawnDivisor = bossRush ? 9f : death ? 15f - (float)Math.Round(3f * (1f - lifeRatio)) : 15f;
float totalSkulls = 12f;
int skullSpread = bossRush ? 250 : death ? (masterMode ? 125 : 150) : 100;
int skullSpread = bossRush ? 250 : death ? 125 : 100;
// Spin for about 3 seconds
// Decreasing this number will INCREASE how fast he moves while spinning
@@ -688,7 +687,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 headCenter = npc.Center;
float enragedHeadSpeed = (masterMode ? 5f : 4f) + (death ? (masterMode ? 1f : 2f) * (1f - lifeRatio) : 0f);
float enragedHeadSpeed = death ? (5f + (1f - lifeRatio)) : 4f;
float enragedHeadSkullTargetX = Main.player[npc.target].Center.X - headCenter.X + Main.rand.Next(-20, 21);
float enragedHeadSkullTargetY = Main.player[npc.target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21);
float enragedHeadSkullTargetDist = (float)Math.Sqrt(enragedHeadSkullTargetX * enragedHeadSkullTargetX + enragedHeadSkullTargetY * enragedHeadSkullTargetY);
@@ -717,7 +716,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (npc.localAI[0] % 3f == 0f)
{
int probeLimit = death ? (masterMode ? 3 : 4) : 2;
int probeLimit = death ? 3 : 2;
if (NPC.CountNPCS(NPCID.Probe) < probeLimit)
NPC.NewNPC(npc.GetSource_FromAI(), (int)headCenter.X, (int)headCenter.Y + 30, NPCID.Probe);
}
@@ -756,14 +755,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation = npc.velocity.X / 15f;
float flightVelocity = bossRush ? 24f : death ? 21f : 18f;
float flightAcceleration = bossRush ? 1f : death ? 0.8f : 0.6f;
if (masterMode)
{
flightVelocity += 4f;
flightAcceleration += 0.16f;
}
float flightVelocity = bossRush ? 29f : death ? 25f : 18f;
float flightAcceleration = bossRush ? 1.12f : death ? 0.96f : 0.6f;
Vector2 destination = new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y - 420f);
npc.SimpleFlyMovement((destination - npc.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration);
@@ -772,8 +765,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.localAI[3] += 1f;
if (Vector2.Distance(npc.Center, destination) < 80f || npc.ai[2] > 0f || npc.localAI[3] > 120f)
{
float missileSpawnDivisor = death ? 8f : (masterMode ? 10f : 12f);
float totalMissiles = masterMode ? 12f : 10f;
float missileSpawnDivisor = death ? 10f : 12f;
float totalMissiles = death ? 12f : 10f;
npc.ai[2] += 1f;
if (npc.ai[2] % missileSpawnDivisor == 0f)
{
@@ -825,7 +818,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
public static bool BuffedPrimeLaserAI(NPC npc, Mod mod)
{
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -885,7 +877,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
bool normalLaserRotation = npc.localAI[1] % 2f == 0f;
// Movement
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f;
float accelerationMult = 1f;
if (!cannonAlive)
{
@@ -896,11 +888,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
acceleration += 0.025f;
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 70f)
{
@@ -960,7 +952,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!sawAlive)
npc.ai[3] += 1f;
if (npc.ai[3] >= (masterMode ? 200f : 800f))
if (npc.ai[3] >= (death ? 200f : 800f))
{
npc.target = Main.npc[(int)npc.ai[1]].target;
npc.localAI[0] = 0f;
@@ -1056,7 +1048,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (npc.localAI[0] >= 120f)
{
npc.localAI[0] = 0f;
int totalProjectiles = bossRush ? 32 : (masterMode ? 24 : 16);
int totalProjectiles = bossRush ? 32 : death ? 24 : 16;
float radians = MathHelper.TwoPi / totalProjectiles;
int type = ProjectileID.DeathLaser;
int damage = npc.GetProjectileDamage(type);
@@ -1094,7 +1086,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
public static bool BuffedPrimeCannonAI(NPC npc, Mod mod)
{
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -1171,7 +1162,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!sawAlive)
npc.ai[3] += 1f;
if (npc.ai[3] >= (masterMode ? 200f : 800f))
if (npc.ai[3] >= (death ? 200f : 800f))
{
npc.target = Main.npc[(int)npc.ai[1]].target;
npc.localAI[0] = 0f;
@@ -1208,7 +1199,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
// Movement
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f;
float accelerationMult = 1f;
if (!laserAlive)
{
@@ -1219,11 +1210,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
acceleration += 0.025f;
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 70f)
{
@@ -1374,7 +1365,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
public static bool BuffedPrimeViceAI(NPC npc, Mod mod)
{
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -1439,7 +1429,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Return to the head
if (npc.ai[2] == 99f)
{
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f;
float accelerationMult = 1f;
if (!cannonAlive)
{
@@ -1453,11 +1443,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 20f)
{
@@ -1521,7 +1511,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!sawAlive)
npc.ai[3] += 1f;
if (npc.ai[3] >= (masterMode ? 150f : 600f))
if (npc.ai[3] >= (death ? 150f : 600f))
{
npc.target = Main.npc[(int)npc.ai[1]].target;
npc.ai[2] += 1f;
@@ -1529,7 +1519,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.netUpdate = true;
}
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f;
float accelerationMult = 1f;
if (!cannonAlive)
{
@@ -1543,11 +1533,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
if (!sawAlive)
acceleration += 0.025f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 100f)
{
@@ -1601,7 +1591,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Charge towards the player
if (npc.ai[2] == 1f)
{
float deceleration = masterMode ? 0.75f : 0.8f;
float deceleration = death ? 0.75f : 0.8f;
if (npc.velocity.Y > 0f)
npc.velocity.Y *= deceleration;
@@ -1743,7 +1733,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
public static bool BuffedPrimeSawAI(NPC npc, Mod mod)
{
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -1806,7 +1795,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (npc.ai[2] == 99f)
{
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f;
float accelerationMult = 1f;
if (!cannonAlive)
{
@@ -1820,11 +1809,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
if (!viceAlive)
acceleration += 0.025f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 20f)
{
@@ -1884,7 +1873,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
if (!viceAlive)
npc.ai[3] += 1f;
if (npc.ai[3] >= (masterMode ? 90f : 180f))
if (npc.ai[3] >= (death ? 90f : 180f))
{
npc.target = Main.npc[(int)npc.ai[1]].target;
npc.ai[2] += 1f;
@@ -1892,7 +1881,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.netUpdate = true;
}
float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f));
float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f;
float accelerationMult = 1f;
if (!cannonAlive)
{
@@ -1906,11 +1895,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
if (!viceAlive)
acceleration += 0.025f;
if (masterMode)
if (death)
acceleration *= accelerationMult;
float topVelocity = acceleration * 100f;
float deceleration = masterMode ? 0.6f : 0.8f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 100f)
{
@@ -1968,7 +1957,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
float sawArmChargeTargetY = Main.npc[(int)npc.ai[1]].position.Y + 230f - sawArmChargePos.Y;
npc.rotation = (float)Math.Atan2(sawArmChargeTargetY, sawArmChargeTargetX) + MathHelper.PiOver2;
float deceleration = masterMode ? 0.875f : 0.9f;
float deceleration = death ? 0.875f : 0.9f;
npc.velocity.X *= deceleration;
npc.velocity.Y -= 0.5f;
if (npc.velocity.Y < -12f)
@@ -2022,7 +2011,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
chargeVelocity += 1.5f;
if (!viceAlive)
chargeVelocity += 1.5f;
if (masterMode)
if (death)
chargeVelocity *= 1.25f;
Vector2 sawArmOtherChargePos = npc.Center;
@@ -2033,11 +2022,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
sawArmOtherChargeTargetX *= sawArmOtherChargeTargetDist;
sawArmOtherChargeTargetY *= sawArmOtherChargeTargetDist;
float acceleration = bossRush ? 0.3f : death ? 0.1f : 0.08f;
if (masterMode)
acceleration *= 1.25f;
float deceleration = masterMode ? 0.6f : 0.8f;
float acceleration = bossRush ? 0.3f : death ? 0.125f : 0.08f;
float deceleration = death ? 0.6f : 0.8f;
if (npc.velocity.X > sawArmOtherChargeTargetX)
{
+40 -42
View File
@@ -18,7 +18,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -29,7 +28,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
CalamityUtils.CalamityTargeting(npc, options);
}
float enrageScale = bossRush ? 0.5f : masterMode ? 0.3f : 0f;
float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f;
if (Main.IsItDay() || bossRush)
{
npc.Calamity().CurrentlyEnraged = !bossRush;
@@ -79,7 +78,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Check for Oblivion in Master Mode
bool oblivionAlive = false;
if (masterMode && !bossRush && npc.localAI[3] == 1f)
if (death && !bossRush && npc.localAI[3] == 1f)
{
for (int i = 0; i < Main.maxNPCs; i++)
{
@@ -92,7 +91,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
// Foveanator spawn
if (!oblivionAlive && masterMode && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient && !bossRush)
if (!oblivionAlive && death && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient && !bossRush)
{
NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType<Foveanator>());
calamityGlobalNPC.newAI[0] = 1f;
@@ -102,25 +101,25 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType<Foveanator>());
// Phase HP ratios
float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f;
float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f;
float phase2LifeRatio = oblivionAlive ? 0.5f : death ? 0.85f : 0.7f;
float finalPhaseLifeRatio = death ? 0.4f : 0.25f;
// Movement variables
float phase1MaxSpeedIncrease = masterMode ? 2f : 4f;
float phase1MaxAccelerationIncrease = masterMode ? 0.025f : 0.05f;
float phase1MaxChargeSpeedIncrease = masterMode ? 3f : 6f;
float phase1MaxSpeedIncrease = death ? 2f : 4f;
float phase1MaxAccelerationIncrease = death ? 0.025f : 0.05f;
float phase1MaxChargeSpeedIncrease = death ? 3f : 6f;
// Phase duration variables
float phase1MaxLaserPhaseDurationDecrease = masterMode ? 120f : 300f;
float phase1MaxLaserPhaseDurationDecrease = death ? 120f : 300f;
// If Oblivion is alive reduce aggression of all attacks
if (oblivionAlive)
{
phase1MaxSpeedIncrease = masterMode ? 1f : 2f;
phase1MaxAccelerationIncrease = masterMode ? 0.0125f : 0.025f;
phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f;
phase1MaxSpeedIncrease = death ? 1f : 2f;
phase1MaxAccelerationIncrease = death ? 0.0125f : 0.025f;
phase1MaxChargeSpeedIncrease = death ? 1.5f : 3f;
phase1MaxLaserPhaseDurationDecrease = masterMode ? 60f : 150f;
phase1MaxLaserPhaseDurationDecrease = death ? 60f : 150f;
}
// Phase checks
@@ -199,7 +198,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
else
npc.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration);
float phaseGateValue = (masterMode ? 300f : 450f) - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
float phaseGateValue = death ? (300f - phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 450f;
float laserGateValue = oblivionAlive ? 60f : foveanatorAlive ? 45f : 30f;
if (NPC.IsMechQueenUp)
{
@@ -283,13 +282,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.damage = npc.defDamage;
npc.ai[2] += 1f;
float decelerateGateValue = (masterMode ? 36f : 32f) + (death ? (masterMode ? 6f : 12f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
float decelerateGateValue = (death ? 36f : 32f) + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
if (npc.ai[2] >= decelerateGateValue)
{
// Avoid cheap bullshit
npc.damage = 0;
float decelerationMultiplier = (masterMode ? 0.84f : 0.92f) - (death ? (masterMode ? 0.16f : 0.32f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
float decelerationMultiplier = (death ? 0.84f : 0.92f) - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
npc.velocity *= decelerationMultiplier;
if (Math.Abs(npc.velocity.X) < 0.1)
@@ -300,7 +299,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
else
npc.rotation = npc.velocity.ToRotation() - MathHelper.PiOver2;
float delayBeforeChargingAgain = (masterMode ? 48f : 56f) - (death ? (masterMode ? 3f : 6f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
float delayBeforeChargingAgain = (death ? 48f : 56f) - (death ? 3f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f);
if (npc.ai[2] >= delayBeforeChargingAgain + (oblivionAlive ? 15f : 0f))
{
npc.ai[3] += 1f;
@@ -366,7 +365,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation += npc.ai[2];
npc.ai[1] += 1f;
if (masterMode && npc.ai[2] >= 0.2f)
if (death && npc.ai[2] >= 0.2f)
{
if (npc.ai[1] % 10f == 0f)
{
@@ -603,7 +602,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
}
npc.ai[2] += spazAlive ? 1f : 1.5f;
if (npc.ai[2] >= (masterMode ? 150f : 180f) - (death ? (masterMode ? 60f : 90f) * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f))
if (npc.ai[2] >= (death ? 150f : 180f) - (death ? 60f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f))
{
npc.ai[1] = finalPhase ? 4f : 0f;
npc.ai[2] = 0f;
@@ -707,7 +706,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.ai[2] = 0f;
float chargeIncrement = 1f;
if (masterMode && Main.rand.NextBool() && npc.ai[3] < (spazAlive ? 1f : 3f))
if (death && Main.rand.NextBool() && npc.ai[3] < (spazAlive ? 1f : 3f))
{
chargeIncrement = 2f;
@@ -781,7 +780,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
CalamityGlobalNPC calamityGlobalNPC = npc.Calamity();
bool bossRush = BossRushEvent.BossRushActive;
bool masterMode = Main.masterMode || bossRush;
bool death = CalamityWorld.death || bossRush;
// Get a target
@@ -792,7 +790,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
CalamityUtils.CalamityTargeting(npc, options);
}
float enrageScale = bossRush ? 0.5f : masterMode ? 0.3f : 0f;
float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f;
if (Main.IsItDay() || bossRush)
{
npc.Calamity().CurrentlyEnraged = !bossRush;
@@ -847,7 +845,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
// Check for Oblivion in Master Mode
bool oblivionAlive = false;
if (masterMode && !bossRush && npc.localAI[3] == 1f)
if (death && !bossRush && npc.localAI[3] == 1f)
{
for (int i = 0; i < Main.maxNPCs; i++)
{
@@ -862,27 +860,27 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType<Foveanator>());
// Phase HP ratios
float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f;
float finalPhaseLifeRatio = masterMode ? 0.3f : 0.15f;
float phase2LifeRatio = oblivionAlive ? 0.5f : death ? 0.85f : 0.7f;
float finalPhaseLifeRatio = death ? 0.3f : 0.15f;
// Movement variables
float phase1MaxSpeedIncrease = masterMode ? 2.25f : 4.5f;
float phase1MaxAccelerationIncrease = masterMode ? 0.075f : 0.15f;
float phase1MaxChargeSpeedIncrease = masterMode ? 3f : 6f;
float phase1MaxSpeedIncrease = death ? 2.25f : 4.5f;
float phase1MaxAccelerationIncrease = death ? 0.075f : 0.15f;
float phase1MaxChargeSpeedIncrease = death ? 3f : 6f;
// Phase duration variables
float phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 80f : 200f;
float phase1MaxChargesDecrease = masterMode ? 2f : 4f;
float phase1MaxCursedFlamePhaseDurationDecrease = death ? 80f : 200f;
float phase1MaxChargesDecrease = death ? 2f : 4f;
// If Oblivion is alive reduce aggression of all attacks
if (oblivionAlive)
{
phase1MaxSpeedIncrease = masterMode ? 1.125f : 2.25f;
phase1MaxAccelerationIncrease = masterMode ? 0.0375f : 0.075f;
phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f;
phase1MaxSpeedIncrease = death ? 1.125f : 2.25f;
phase1MaxAccelerationIncrease = death ? 0.0375f : 0.075f;
phase1MaxChargeSpeedIncrease = death ? 1.5f : 3f;
phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 40f : 100f;
phase1MaxChargesDecrease = masterMode ? 1f : 2f;
phase1MaxCursedFlamePhaseDurationDecrease = death ? 40f : 100f;
phase1MaxChargesDecrease = death ? 1f : 2f;
}
// Phase checks
@@ -1041,7 +1039,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.ai[2] += 1f;
float timeBeforeSlowDown = masterMode ? 30f : 10f;
float timeBeforeSlowDown = death ? 30f : 10f;
if (npc.ai[2] >= timeBeforeSlowDown)
{
// Avoid cheap bullshit
@@ -1059,7 +1057,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation = npc.velocity.ToRotation() - MathHelper.PiOver2;
// Charge 8 times
float chargeTime = masterMode ? 45f : 25f;
float chargeTime = death ? 45f : 25f;
if (npc.ai[2] >= chargeTime + (oblivionAlive ? 15f : 0f))
{
// Reset AI array and go to cursed fireball phase
@@ -1126,7 +1124,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.rotation += npc.ai[2];
npc.ai[1] += 1f;
if (masterMode && npc.ai[2] >= 0.2f)
if (death && npc.ai[2] >= 0.2f)
{
if (npc.ai[1] % 10f == 0f)
{
@@ -1236,7 +1234,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
{
// Boost speed if too far from target
if (distanceFromDestination > distanceFromTarget)
maxVelocity += MathHelper.Lerp(0f, oblivionAlive ? 3f : masterMode ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f));
maxVelocity += MathHelper.Lerp(0f, oblivionAlive ? 3f : death ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f));
if (Main.getGoodWorld)
{
@@ -1302,7 +1300,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
flamethrowerVelocity = (npc.rotation + MathHelper.PiOver2).ToRotationVector2() * flamethrowerSpeed + npc.velocity * 0.5f;
Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer);
if (masterMode && npc.ai[3] % 30f == 0f)
if (death && npc.ai[3] % 30f == 0f)
{
type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType<ShadowflameFireball>() : ProjectileID.CursedFlameHostile;
damage = npc.GetProjectileDamage(type);
@@ -1526,7 +1524,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
npc.ForceNetUpdate(false);
float chargeIncrement = 1f;
if (masterMode && Main.rand.NextBool() && npc.ai[3] < (retAlive ? 2f : 3f))
if (death && Main.rand.NextBool() && npc.ai[3] < (retAlive ? 2f : 3f))
chargeIncrement = 2f;
npc.ai[3] += chargeIncrement;