From 028cc465c19f08c250d2521eedb819aaa096633a Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <142704082+CongratsIsTrash@users.noreply.github.com> Date: Fri, 5 Jan 2024 17:53:08 -0500 Subject: [PATCH] Made Snowstorm Staff's ice stars use HomeInOnNPC for consistency --- Projectiles/Magic/SnowflakeIceStar.cs | 29 +-------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/Projectiles/Magic/SnowflakeIceStar.cs b/Projectiles/Magic/SnowflakeIceStar.cs index 43627c432c..162864fe30 100644 --- a/Projectiles/Magic/SnowflakeIceStar.cs +++ b/Projectiles/Magic/SnowflakeIceStar.cs @@ -37,34 +37,7 @@ namespace CalamityMod.Projectiles.Magic } else { - Projectile.extraUpdates = 1; - - Vector2 center = Projectile.Center; - float maxDistance = 500f; - bool homeIn = false; - - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].CanBeChasedBy(Projectile, false)) - { - float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2); - - if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(Projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) - { - center = Main.npc[i].Center; - homeIn = true; - break; - } - } - } - - if (homeIn) - { - Vector2 moveDirection = Projectile.SafeDirectionTo(center, Vector2.UnitY); - Projectile.velocity = (Projectile.velocity * 20f + moveDirection * 12f) / (21f); - } - else - Projectile.Kill(); + CalamityUtils.HomeInOnNPC(Projectile, true, 500f, 12f, 20f); } Lighting.AddLight(Projectile.Center, Main.DiscoR * 0.075f / 255f, Main.DiscoR * 0.1f / 255f, Main.DiscoR * 0.125f / 255f);