Visibility 4b: a ping or a lock paint is an emission heard within its range over its intercept factor
Entity.Emit posts an ActiveEmission (item, range / InterceptFactor) from Sensor's sweep and LockWeapon's Track paint; Sense hears every other ship's emissions within HearRange x HearingMultiple x obscuration through RecordReveal, bearing only, feeding no track. SensorData key 13 and LockWeaponData key 34 carry InterceptFactor (absent reads 1). Unverified at this commit: the headless suite has not run yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
642a61ebbf
commit
9de7756006
6 changed files with 419 additions and 22 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue