Files
Project-M/Assets/_Project/Tests/EditMode/SaturationMathTests.cs
T
kronic 2aebc37115 G6+G4: Cone damage-at-contact + zone fill telegraph (ZoneEffect GhostFields) + co-op saturation budget
Cone/SpecialSlam damage lands at its visual contact via ConeContactPending (knob 32, 0=legacy;
early-flush + resolve re-validate; death + BOTH class-swap paths drop armed pendings — fixes the
shipped melee death-strand in the same stroke). Zones: [GhostField] Caster/Radius/NextTick +
ZoneTelegraphSystem (Geyser latch contract on InterpolationTick; rim = true radius; arm grows,
persistent phase drains). Cone cues latch to contact (FireStartRaw, C14); TuningConfig.Defaults()
fallback at client cue sites (release-build timing fix). G4: SaturationMath ally-FX degrade
(living-enemy census, solo-exempt; enemy telegraphs structurally exempt) + CombatStressDebug +
overlay saturation rows. Reviews wf_98bf1268 (13 confirmed folded) / wf_9757d214 (5 confirmed fixed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 13:27:50 -07:00

46 lines
1.6 KiB
C#

using NUnit.Framework;
using ProjectM.Client;
namespace ProjectM.Tests
{
/// <summary>07-21 G4 — pins the ally-FX saturation ramp (SaturationMath.AllyScale): full loudness at or
/// under the start count, linear to the floor at the full count, clamped floor, degenerate-range snap.
/// Enemy telegraphs never ride this scale (structural, no knob) — that is pinned by ARCHITECTURE, not here.</summary>
public class SaturationMathTests
{
[Test]
public void At_Or_Below_Start_Is_Full()
{
Assert.AreEqual(1f, SaturationMath.AllyScale(0, 8, 16, 0.35f), 1e-4f);
Assert.AreEqual(1f, SaturationMath.AllyScale(8, 8, 16, 0.35f), 1e-4f);
}
[Test]
public void Midpoint_Is_Half_Lerped()
{
Assert.AreEqual(0.675f, SaturationMath.AllyScale(12, 8, 16, 0.35f), 1e-4f); // lerp(1, .35, .5)
}
[Test]
public void At_Or_Past_Full_Sits_At_Floor()
{
Assert.AreEqual(0.35f, SaturationMath.AllyScale(16, 8, 16, 0.35f), 1e-4f);
Assert.AreEqual(0.35f, SaturationMath.AllyScale(40, 8, 16, 0.35f), 1e-4f);
}
[Test]
public void Degenerate_Range_Snaps_To_Floor_Past_Start()
{
Assert.AreEqual(1f, SaturationMath.AllyScale(8, 8, 8, 0.5f), 1e-4f);
Assert.AreEqual(0.5f, SaturationMath.AllyScale(9, 8, 8, 0.5f), 1e-4f);
}
[Test]
public void Floor_Is_Clamped_01()
{
Assert.AreEqual(1f, SaturationMath.AllyScale(100, 8, 16, 1.7f), 1e-4f);
Assert.AreEqual(0f, SaturationMath.AllyScale(100, 8, 16, -2f), 1e-4f);
}
}
}