Lock warning: a painted ship owns a typed incoming-lock warning carrying the lock's strength

LockWeapon.Execute paints its target with its own Lock (the one value the outgoing indicator also reads);
Entity publishes the one-tick inbox as IncomingLocks; the HUD shows one incoming indicator on the strongest
warning with the outgoing indicator's curves. Unity HUD code not compiled here; tests not yet run at this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-10 19:25:22 +02:00
commit e5cfc0d676
4 changed files with 320 additions and 0 deletions

View file

@ -102,6 +102,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.Position, Item?.Data, Lock);
}
else _lock = saturate(_lock - dt * Decay);
}
@ -110,3 +111,18 @@ public class LockWeapon : InstantWeapon
}
}
// What a painted ship senses of one beam on it (ruling sensor-stat-set item 4; strength per ruling
// lock-warning-strength). Strength is the emitter's own lock progress at the paint, 0..1, never summed.
public readonly struct LockWarning
{
public readonly float2 Bearing;
public readonly EquippableItemData EmitterClass;
public readonly float Strength;
public LockWarning(float2 bearing, EquippableItemData emitterClass, float strength)
{
Bearing = bearing;
EmitterClass = emitterClass;
Strength = strength;
}
}