From dc66f5db0a55bf6fe3ef164b40bc274fbf93b15d Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 23 Jan 2022 11:58:34 -0600 Subject: [PATCH] 1 - PBG minions get more challenging as her HP drops. --- .../PlagueHomingMissile.cs | 8 +++---- NPCs/PlaguebringerGoliath/PlagueMine.cs | 12 +++++----- .../PlaguebringerGoliath.cs | 24 ++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index f38d49e09c..83df244dd8 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.rotation = npc.velocity.ToRotation() + MathHelper.PiOver2; - float timeBeforeHoming = 90f; + float timeBeforeHoming = 120f - npc.ai[3] * 0.5f; if (npc.ai[2] < timeBeforeHoming) { npc.ai[2] += 1f; @@ -100,8 +100,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else if (npc.ai[0] == 1f) { npc.localAI[1] += 1f; - float timeBeforeExploding = 600f; - float homingDuration = malice ? 600f : death ? 420f : revenge ? 360f : expertMode ? 300f : 180f; + float timeBeforeExploding = 480f + npc.ai[3] * 2f; + float homingDuration = (malice ? 430f : death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + npc.ai[3] * 2f; if (npc.localAI[1] == timeBeforeExploding) { CheckDead(); @@ -123,7 +123,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { npc.noTileCollide = false; - if (npc.velocity.Length() < 20f) + if (npc.velocity.Length() < (malice ? 25f : 20f)) npc.velocity *= 1.01f; if (Collision.SolidCollision(npc.position, npc.width, npc.height)) diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 6ca59e2b84..6373cfcf09 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -64,23 +64,23 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 vector = Main.player[npc.target].Center - npc.Center; float distanceRequiredForExplosion = 90f; - float timeBeforeExplosion = malice ? 1200f : death ? 940f : revenge ? 720f : 600f; - if (vector.Length() < distanceRequiredForExplosion || npc.ai[3] >= timeBeforeExplosion) + float timeBeforeExplosion = (malice ? 1000f : death ? 740f : revenge ? 520f : 400f) + npc.ai[3] * 4f; + if (vector.Length() < distanceRequiredForExplosion || npc.ai[0] >= timeBeforeExplosion) { CheckDead(); npc.life = 0; return; } - npc.ai[3] += 1f; - if (npc.ai[3] >= timeBeforeExplosion * 0.8f) + npc.ai[0] += 1f; + if (npc.ai[0] >= timeBeforeExplosion * 0.8f) { npc.velocity *= 0.98f; return; } npc.TargetClosest(true); - float velocity = malice ? 16f : death ? 14f : revenge ? 12f : 10f; + float velocity = (malice ? 14f : death ? 12f : revenge ? 10f : 8f) + npc.ai[3] * 0.04f; Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f); float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X; float num1374 = player.Center.Y - vector167.Y; @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float num1376 = velocity / num1375; num1373 *= num1376; num1374 *= num1376; - float inertia = malice ? 20f : death ? 26f : revenge ? 28f : 30f; + float inertia = (malice ? 35f : death ? 40f : revenge ? 45f : 50f) - npc.ai[3] * 0.25f; npc.velocity.X = (npc.velocity.X * inertia + num1373) / (inertia + 1f); npc.velocity.Y = (npc.velocity.Y * inertia + num1374) / (inertia + 1f); } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index b35dd7c25c..c74c9ef2b0 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -135,8 +135,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath bool phase4 = lifeRatio < 0.25f; bool phase5 = lifeRatio < 0.1f; - // Adjusts how 'challenging' the projectiles are to deal with - float projectileChallengeAmt = (1f - lifeRatio) * 100f; + // Adjusts how 'challenging' the projectiles and enemies are to deal with + float challengeAmt = (1f - lifeRatio) * 100f; float nukeBarrageChallengeAmt = (0.5f - lifeRatio) * 200f; // Adjust slowing debuff immunity @@ -600,19 +600,19 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode != NetmodeID.MultiplayerClient) { if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < 2) - NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType()); + NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); - float projectileSpeed = (revenge ? 9f : 7f) + enrageScale * 2f; + float npcSpeed = (revenge ? 9f : 7f) + enrageScale * 2f; float num1071 = player.position.X + player.width * 0.5f - vector119.X; float num1072 = player.position.Y + player.height * 0.5f - vector119.Y; float num1073 = (float)Math.Sqrt(num1071 * num1071 + num1072 * num1072); - num1073 = projectileSpeed / num1073; + num1073 = npcSpeed / num1073; num1071 *= num1073; num1072 *= num1073; - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType()); + int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); Main.npc[num1062].velocity.X = num1071; Main.npc[num1062].velocity.Y = num1072; Main.npc[num1062].netUpdate = true; @@ -680,19 +680,21 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.netMode != NetmodeID.MultiplayerClient) { if (expertMode && NPC.CountNPCS(ModContent.NPCType()) < 3) - NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType()); + NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); - float projectileSpeed = (revenge ? 11f : 9f) + enrageScale * 2f; + float npcSpeed = (revenge ? 11f : 9f) + enrageScale * 2f; float num1071 = player.position.X + player.width * 0.5f - vector119.X; float num1072 = player.position.Y + player.height * 0.5f - vector119.Y; float num1073 = (float)Math.Sqrt(num1071 * num1071 + num1072 * num1072); - num1073 = projectileSpeed / num1073; + num1073 = npcSpeed / num1073; num1071 *= num1073; num1072 *= num1073; + num1071 += Main.rand.Next(-20, 21) * 0.05f; + num1072 += Main.rand.Next(-20, 21) * 0.05f; - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType()); + int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, challengeAmt); Main.npc[num1062].velocity.X = num1071; Main.npc[num1062].velocity.Y = num1072; Main.npc[num1062].netUpdate = true; @@ -768,7 +770,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, projectileChallengeAmt, player.position.Y); + Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, challengeAmt, player.position.Y); npc.netUpdate = true; }