Aetheria/Assets/Scripts/ServerShared/Sensing.cs
Meta Vens c47ced9cfd Paints carry search or track; a ping sweep warns every ship it crosses in its beam; allies hear the return silently
LockWarning becomes PaintWarning with a PaintMode (Search for a ping sweep, Track for a lock);
Entity.IncomingLocks becomes IncomingPaints. Sensor replaces the _pingedEntities set with a stateless
crossing rule over the previous and current wavefront radius, limited to a new BeamWidth stat (key 12,
absent reads 360), and credits allied pings from the receiving sensor's own sensitivity and distance.
The HUD lock indicator follows Track paints only. Folds in the radiator sampling-instant pin.

Unverified at this commit (first build still to run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:05:16 +02:00

55 lines
1.6 KiB
C#

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// Light signatures split by channel (ruling visibility-per-capability-reveal): an observer learns what a ship
// is by which channel carries the light. Append-only: values are serialized in VisibilityData.
public enum SignatureChannel
{
Thermal,
Reflection,
DrivePlume,
LaunchFlash,
Emission
}
public readonly struct Signature
{
public readonly SignatureChannel Channel;
public readonly float Strength;
public readonly EquippedItem Item;
public Signature(SignatureChannel channel, float strength, EquippedItem item)
{
Channel = channel;
Strength = strength;
Item = item;
}
public Signature WithStrength(float strength) => new Signature(Channel, strength, Item);
}
// What a painted ship learns of a beam on it (ruling sensor-stat-set item 4): a Search paint is a ping sweeping
// it (Strength 0); a Track paint is a lock (Strength is the emitter's own lock progress, 0..1, ruling
// lock-warning-strength). Never summed.
public enum PaintMode
{
Search,
Track
}
public readonly struct PaintWarning
{
public readonly float2 Bearing;
public readonly EquippableItemData EmitterClass;
public readonly PaintMode Mode;
public readonly float Strength;
public PaintWarning(float2 bearing, EquippableItemData emitterClass, PaintMode mode, float strength)
{
Bearing = bearing;
EmitterClass = emitterClass;
Mode = mode;
Strength = strength;
}
}