Merge cut emissions-heard (Soul verdict cut-emissions-heard.s1)

Conflict: ContactRevealTests Locker fixture. Kept the branch's Locker(name, interceptFactor) helper and added master's five munition parts to it (as master's Locker carries them since missile-stats).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-13 03:20:22 +02:00
commit 3c628f54f2
8 changed files with 461 additions and 33 deletions

View file

@ -23,6 +23,11 @@ public class LockWeaponData : InstantWeaponData
[Inspectable, JsonProperty("decay"), Key(25)]
public PerformanceStat Decay = new PerformanceStat();
// The ratio of how far this lock sees to how far others hear it (ruling sensor-stat-set); a design without it
// reads as 1.
[Inspectable, JsonProperty("interceptFactor"), Key(34)]
public PerformanceStat InterceptFactor;
public override Behavior CreateInstance(EquippedItem item)
{
@ -50,6 +55,7 @@ public class LockWeapon : InstantWeapon
public float LockAngle { get; private set; }
public float DirectionImpact { get; private set; }
public float Decay { get; private set; }
public float InterceptFactor => _data.InterceptFactor == null ? 1f : Evaluate(_data.InterceptFactor);
public override float Progress => saturate(_cooldown > 0 ? _cooldown : _lock);
@ -103,6 +109,7 @@ public class LockWeapon : InstantWeapon
var lerp = 1 - unlerp(0, 90, degrees);
_lock = saturate(_lock + pow(lerp, DirectionImpact) * dt * LockSpeed * pow(Entity.EntityInfoGathered[target], SensorImpact));
target.ReceivePaint(Entity, Item, PaintMode.Track, Lock);
Entity.Emit(Item, Range / InterceptFactor);
}
else _lock = saturate(_lock - dt * Decay);
}

View file

@ -42,6 +42,11 @@ public class SensorData : BehaviorData
// how much a ping reveals is a stat). 360 or more is omnidirectional; a design without it reads as 360.
[Inspectable, JsonProperty("beamWidth"), Key(12)]
public PerformanceStat BeamWidth;
// The ratio of how far this sensor sees to how far others hear it (ruling sensor-stat-set); a design without it
// reads as 1.
[Inspectable, JsonProperty("interceptFactor"), Key(13)]
public PerformanceStat InterceptFactor;
public override Behavior CreateInstance(EquippedItem item)
{
@ -86,6 +91,8 @@ public class Sensor : Behavior, IEventBehavior, IPowerConsumer
public float BeamWidth => _data.BeamWidth == null ? 360f : Evaluate(_data.BeamWidth);
public float InterceptFactor => _data.InterceptFactor == null ? 1f : Evaluate(_data.InterceptFactor);
public float2 Facing => Direction.xz;
// Whether the offset `diff` (length `dist`) from this sensor lies inside its beam.
@ -169,6 +176,7 @@ public class Sensor : Behavior, IEventBehavior, IPowerConsumer
_pingLerp += dt / _data.PingDuration;
_pingRadius = lerp(0, Evaluate(_data.PingRange), pow(_pingLerp, _data.PingRadiusExponent));
_reached.IntersectWith(Entity.Zone.Entities);
Entity.Emit(Item, Evaluate(_data.PingRange) / InterceptFactor);
if (_pingLerp > 1) EndPing();
}