From 4bb740fa6445e2a258af46b6a8928c445daa4215 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 6 Jun 2023 22:03:56 -0500 Subject: [PATCH] Legendary Rev+ GFB Ravager, Guardian and Providence changes. --- .../ProfanedGuardianCommander.cs | 12 ++++++- NPCs/ProfanedGuardians/ProfanedRocks.cs | 5 ++- NPCs/Ravager/RavagerBody.cs | 36 ++++++++++++++++--- Projectiles/Boss/HolyBlast.cs | 4 +++ Projectiles/Boss/MoltenBlast.cs | 3 ++ Projectiles/CalamityGlobalProjectile.cs | 2 +- 6 files changed, 54 insertions(+), 8 deletions(-) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 2e5815f66b..a29a831bce 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].ai[0] == 599 && CalamityWorld.getFixedBoi && Main.netMode != NetmodeID.MultiplayerClient) { - // gain more health once the healer's channel heal is done + // Gain more health once the healer's channel heal is done NPC.lifeMax += 7500; NPC.life += NPC.lifeMax - NPC.life; NPC.HealEffect(NPC.lifeMax - NPC.life, true); @@ -373,6 +373,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians float maxChargeVelocity = (bossRush || biomeEnraged) ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; if (Main.getGoodWorld) maxChargeVelocity *= 1.15f; + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) + maxChargeVelocity *= 2f; float inertia = (bossRush || biomeEnraged) ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; if (lifeRatio < 0.5f) @@ -954,6 +956,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (revenge) Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, type, damage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) + { + rotation *= 0.33f; + laserVelocity = laserVelocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + } + NPC.netUpdate = true; } } diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index dcd8c5c8eb..ec6e3e3f4b 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -181,7 +181,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.noGravity = false; NPC.velocity.Y += 0.1f; - // Die if insied any tiles + // Die if inside any tiles if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) { if (NPC.DeathSound.HasValue) @@ -200,6 +200,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians { // Start off slow Vector2 finalVelocity = NPC.SafeDirectionTo(player.Center, -Vector2.UnitY) * chargeSpeed; + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) + finalVelocity *= Main.rand.NextFloat(1f, 1.7f); + NPC.Calamity().newAI[2] = finalVelocity.X; NPC.Calamity().newAI[3] = finalVelocity.Y; NPC.velocity = finalVelocity * 0.1f; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 54b47f2dfb..08c509f983 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -28,6 +28,7 @@ using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Enemy; namespace CalamityMod.NPCs.Ravager { @@ -574,6 +575,33 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { + bool anyRockPillars = NPC.AnyNPCs(ModContent.NPCType()); + bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); + + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && revenge) + { + if (!expertMode || anyRockPillars || anyFlamePillars) + SoundEngine.PlaySound(PillarSound, NPC.Center); + + // Eruption of bouncing rock projectiles + float projectileVelocity = 12f; + int type = ModContent.ProjectileType(); + Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; + destination.Normalize(); + destination *= projectileVelocity; + int numProj = 11; + float rotation = MathHelper.ToRadians(90); + for (int i = 0; i < numProj; i++) + { + // Spawn projectiles 0, 1, 2, 3, 7, 8, 9 and 10 + if (i < 4 || i > 6) + { + Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f * NPC.scale + Vector2.Normalize(perturbedSpeed) * 30f * NPC.scale, perturbedSpeed, type, 60, 0f, Main.myPlayer); + } + } + } + if (expertMode) { for (int i = 0; i < Main.maxNPCs; i++) @@ -587,19 +615,17 @@ namespace CalamityMod.NPCs.Ravager } int spawnDistance = 360; - bool anyrockpillars = NPC.AnyNPCs(ModContent.NPCType()); - bool anyflamepillars = NPC.AnyNPCs(ModContent.NPCType()); - if (!anyrockpillars || !anyflamepillars) + if (!anyRockPillars || !anyFlamePillars) { SoundEngine.PlaySound(PillarSound, NPC.Center); } - if (!anyrockpillars || Main.getGoodWorld) + if (!anyRockPillars || Main.getGoodWorld) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); } - else if (!anyflamepillars || Main.getGoodWorld) + else if (!anyFlamePillars || Main.getGoodWorld) { float distanceMultiplier = finalPhase ? 2.5f : 2f; NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index b9ef83176e..1f478da356 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -8,6 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using System.IO; +using CalamityMod.World; namespace CalamityMod.Projectiles.Boss { @@ -116,6 +117,9 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 8 : 6; + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && CalamityWorld.revenge) + totalProjectiles *= 2; + float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 5f; diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 3f2db56dbc..1f69b60fd5 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -132,6 +132,9 @@ namespace CalamityMod.Projectiles.Boss for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + Projectile.velocity; + if (CalamityWorld.getFixedBoi && CalamityWorld.LegendaryMode && CalamityWorld.revenge) + velocity *= 2f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, 0f); } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index adab16602d..f00384285c 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2134,7 +2134,7 @@ namespace CalamityMod.Projectiles { // 5% chance every frame to get a random velocity multiplier (this is actually rolled twice per frame, due to the extra update in GFB) if (Main.rand.Next(100) >= 95) - projectile.velocity *= Main.rand.NextFloat(0.9f, 1.1f); + projectile.velocity *= Main.rand.NextFloat(0.9f, 1.25f); } // Accelerate for 1.5 seconds to full velocity