From d56c21458e343dd7b1cef1961771d0839df65eb4 Mon Sep 17 00:00:00 2001 From: GinYuH <72181395+GinYuH@users.noreply.github.com> Date: Sat, 17 May 2025 18:26:15 -0700 Subject: [PATCH] smoother turning for EutRay --- NPCs/SunkenSea/EutrophicRay.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index 554774655a..e879c1483c 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -141,7 +141,16 @@ namespace CalamityMod.NPCs.SunkenSea hasBeenHit = true; NPC.chaseable = hasBeenHit; - NPC.rotation = NPC.velocity.ToRotation() + MathHelper.Pi; + float curRot = NPC.rotation; + float newRot = NPC.velocity.ToRotation() + MathHelper.Pi; + if (Math.Abs(MathHelper.WrapAngle(curRot) - MathHelper.WrapAngle(newRot)) > MathHelper.PiOver4) + { + NPC.rotation = MathHelper.Lerp(curRot, newRot, 0.1f); + } + else + { + NPC.rotation = newRot; + } } private void OnBehaviorChange(Action newBehavior) {