smoother turning for EutRay

This commit is contained in:
GinYuH authored and Cameron Ewell committed 2025-05-22 15:43:23 -04:00
1 parent bb099da035
commit d56c21458e
1 file changed
+10 -1
+10 -1
View File
@@ -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)
{