From ae24ea60ebeeffe664a36d1ff248416dc1aaeac4 Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 7 Aug 2023 15:01:31 -0700 Subject: [PATCH] Hammers, Instant transmition into this guy's skull Changed the strange homing on Stellar Contempt, Fallen Paladins Hammer, and Galaxy Smasher to be more consistent, still cant figure out how to make them just retarget to the nearest enemy if their original target dies. --- Projectiles/Melee/FallenPaladinsHammerEcho.cs | 17 +++++++---------- Projectiles/Melee/GalaxySmasherEcho.cs | 17 +++++++---------- Projectiles/Melee/GalaxySmasherHammer.cs | 2 +- Projectiles/Melee/StellarContemptEcho.cs | 10 +++++++--- 4 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Projectiles/Melee/FallenPaladinsHammerEcho.cs b/Projectiles/Melee/FallenPaladinsHammerEcho.cs index 9c880575fc..9ecacb7c6c 100644 --- a/Projectiles/Melee/FallenPaladinsHammerEcho.cs +++ b/Projectiles/Melee/FallenPaladinsHammerEcho.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Melee ProjectileID.Sets.TrailCacheLength[Projectile.type] = 15; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; } - //This is all copied straight from PwnagehammerEcho with some minor edits. public override void SetDefaults() { Projectile.width = 40; @@ -41,23 +40,20 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - speed = Projectile.velocity.Length(); Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 55f) - { - CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f); - } if (Projectile.ai[0] < 42f) { - Projectile.velocity *= 0.9575f; + Projectile.velocity *= 0.95f; Projectile.rotation += MathHelper.ToRadians(Projectile.ai[0] * 0.5f) * Projectile.localAI[0]; } - else if (Projectile.ai[0] < 44f) + else if (Projectile.ai[0] > 42f) { Projectile.extraUpdates = 1; if (Projectile.ai[1] < 0f) { - Projectile.Kill(); + CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f); + if (Projectile.ai[0] > 80f) + Projectile.Kill(); return; } @@ -66,7 +62,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); else { - float velConst = 12f; + float velConst = 7f; + velConst--; Projectile.velocity = new Vector2((target.Center.X - Projectile.Center.X) / velConst, (target.Center.Y - Projectile.Center.Y) / velConst); Projectile.rotation += MathHelper.ToRadians(48f) * Projectile.localAI[0]; } diff --git a/Projectiles/Melee/GalaxySmasherEcho.cs b/Projectiles/Melee/GalaxySmasherEcho.cs index ac4bfe603d..7699be7196 100644 --- a/Projectiles/Melee/GalaxySmasherEcho.cs +++ b/Projectiles/Melee/GalaxySmasherEcho.cs @@ -45,23 +45,19 @@ namespace CalamityMod.Projectiles.Melee rotatehammer *= 1.2f; Projectile.rotation += MathHelper.ToRadians(rotatehammer) * Projectile.direction; Projectile.ai[0] += 1f; - speed = Projectile.velocity.Length(); - if (Projectile.ai[0] > 55f) - { - CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f); - } if (Projectile.ai[0] < 42f) { - Projectile.velocity *= 0.9575f; + Projectile.velocity *= 0.95f; Projectile.rotation += MathHelper.ToRadians(Projectile.ai[0] * 0.5f) * Projectile.localAI[0]; } - else if (Projectile.ai[0] < 44f) + else if (Projectile.ai[0] > 42f) { Projectile.extraUpdates = 1; if (Projectile.ai[1] < 0f) { - Projectile.Kill(); - return; + CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f); + if (Projectile.ai[0] > 80f) + Projectile.Kill(); } NPC target = Main.npc[(int)Projectile.ai[1]]; @@ -69,7 +65,8 @@ namespace CalamityMod.Projectiles.Melee Projectile.Kill(); else { - float velConst = 24f; + float velConst = 5f; + velConst--; Projectile.velocity = new Vector2((target.Center.X - Projectile.Center.X) / velConst, (target.Center.Y - Projectile.Center.Y) / velConst); Projectile.rotation += MathHelper.ToRadians(48f) * Projectile.localAI[0]; } diff --git a/Projectiles/Melee/GalaxySmasherHammer.cs b/Projectiles/Melee/GalaxySmasherHammer.cs index ff1d2805d4..8cd049249f 100644 --- a/Projectiles/Melee/GalaxySmasherHammer.cs +++ b/Projectiles/Melee/GalaxySmasherHammer.cs @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Melee { if (InPulse == 1) { - Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Orchid, new Vector2(1f, 1f), Main.rand.NextFloat(12f, 25f), 50f, 0.1f, 30); + Particle pulse2 = new StaticPulseRing(Projectile.Center, Vector2.Zero, Color.Orchid, new Vector2(1f, 1f), 0f, 4.9f, 0f, 25); GeneralParticleHandler.SpawnParticle(pulse2); InPulse = 2; } diff --git a/Projectiles/Melee/StellarContemptEcho.cs b/Projectiles/Melee/StellarContemptEcho.cs index 5088826751..f8202cee55 100644 --- a/Projectiles/Melee/StellarContemptEcho.cs +++ b/Projectiles/Melee/StellarContemptEcho.cs @@ -56,12 +56,14 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity *= 0.95f; Projectile.rotation += MathHelper.ToRadians(Projectile.ai[0] * 0.5f) * Projectile.localAI[0]; } - else if (Projectile.ai[0] < 44f) + else if (Projectile.ai[0] > 42f) { Projectile.extraUpdates = 1; if (Projectile.ai[1] < 0f) { - Projectile.Kill(); + CalamityUtils.HomeInOnNPC(Projectile, Projectile.tileCollide, 2000f, speed, 12f); + if (Projectile.ai[0] > 80f) + Projectile.Kill(); return; } @@ -72,11 +74,13 @@ namespace CalamityMod.Projectiles.Melee } else { - float velConst = 24f; + float velConst = 7f; + velConst--; Projectile.velocity = new Vector2((target.Center.X - Projectile.Center.X) / velConst, (target.Center.Y - Projectile.Center.Y) / velConst); Projectile.rotation += MathHelper.ToRadians(48f) * Projectile.localAI[0]; } } + if (Main.rand.NextBool(2)) {