diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 7387859b80..f9f157f01f 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -923,7 +923,10 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 center = player.Center + new Vector2(0f, -540f); + float bulletHellTeleportLocationDistance = 540f; + Vector2 defaultTeleportLocation = new Vector2(0f, -bulletHellTeleportLocationDistance); + Vector2 teleportLocation = -(player.velocity.SafeNormalize(Vector2.Zero) * bulletHellTeleportLocationDistance); + Vector2 center = player.Center + (teleportLocation == Vector2.Zero ? defaultTeleportLocation : teleportLocation); NPC.Center = center; int type = ModContent.ProjectileType(); @@ -1297,7 +1300,10 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - Vector2 center = player.Center + new Vector2(0f, -540f); + float bulletHellTeleportLocationDistance = 540f; + Vector2 defaultTeleportLocation = new Vector2(0f, -bulletHellTeleportLocationDistance); + Vector2 teleportLocation = -(player.velocity.SafeNormalize(Vector2.Zero) * bulletHellTeleportLocationDistance); + Vector2 center = player.Center + (teleportLocation == Vector2.Zero ? defaultTeleportLocation : teleportLocation); NPC.Center = center; int type = ModContent.ProjectileType(); @@ -2042,7 +2048,10 @@ namespace CalamityMod.NPCs.Yharon NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); } - Vector2 center = targetData.Center + new Vector2(0f, -540f); + float bulletHellTeleportLocationDistance = 540f; + Vector2 defaultTeleportLocation = new Vector2(0f, -bulletHellTeleportLocationDistance); + Vector2 teleportLocation = -(targetData.velocity.SafeNormalize(Vector2.Zero) * bulletHellTeleportLocationDistance); + Vector2 center = targetData.Center + (teleportLocation == Vector2.Zero ? defaultTeleportLocation : teleportLocation); NPC.Center = center; int type = ModContent.ProjectileType();