From efaa8f5b540d02852a5d5f8cdc82a8261e6df597 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 10 Oct 2026 23:45:21 +0200 Subject: [PATCH] LockWarningTests: pin the full-lock strength through the launcher's own Execute (a zone tick resolves the shot a full lock fires) --- .../Aetheria.Shared.Tests/LockWarningTests.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/LockWarningTests.cs b/tests/Aetheria.Shared.Tests/LockWarningTests.cs index 6ad6bdc58..bf05566ac 100644 --- a/tests/Aetheria.Shared.Tests/LockWarningTests.cs +++ b/tests/Aetheria.Shared.Tests/LockWarningTests.cs @@ -154,7 +154,6 @@ public sealed class LockWarningTests : IDisposable [InlineData(1.55f, .93f)] [InlineData(1.6f, .96f)] [InlineData(1.65f, .99f)] - [InlineData(5f, 1f)] public void StrengthIsTheLockAcrossItsWholeRange(float dt, float expectedLock) { var locker = NewShip(float3(0, 0, 0), "Launcher"); @@ -162,13 +161,27 @@ public sealed class LockWarningTests : IDisposable Aim(locker, b); Tick(dt); - // A full lock fires the launcher and spends the lock, so the emitter's own Lock is read only below it. - if (expectedLock < 1f) Assert.Equal(expectedLock, LauncherOf(locker).Lock, 4); + Assert.Equal(expectedLock, LauncherOf(locker).Lock, 4); Tick(0f); Assert.Equal(expectedLock, Assert.Single(b.IncomingLocks).Strength, 4); } + // A saturated lock is a strength of exactly 1: the launcher's own Execute outside the zone tick, so that the + // zone's fire resolution does not run on the shot a full lock fires. + [Fact] + public void AFullLockIsAStrengthOfOne() + { + var locker = NewShip(float3(0, 0, 0), "Launcher"); + var b = NewShip(float3(0, 0, 9)); + + Aim(locker, b); + LauncherOf(locker).Execute(5f); + Tick(0f); + + Assert.Equal(1f, Assert.Single(b.IncomingLocks).Strength, 4); + } + // The lock's progress terms: direction (lerp ^ DirectionImpact) and sensor info (info ^ SensorImpact), each // with an exponent other than 1, aimed off-axis at a partly sensed target. Lock after dt = 1: // 0.8 * (1 - 30/90)^2 * 0.8^3 = 0.18204.