Scanner fix batch: consumable hosts decay on the same tick; hostility, pilot-path, consumable and wire-key-51 tests
ConsumableItemEffect.Update now runs Execute before the always-updated pass, as EquippedItem.Update does, so a consumable-hosted scanner decays on the tick the scan breaks. Tests: AScanReadsNoHostility (hostile/friendly, honest/lying), AScanTakesTheSamePathForAnyPilot (AI-agent ship and agentless ship), AConsumableScannerDecaysOnTheSameTick, ScannerDataRoundTripsAsUnionKey51. Not yet verified at this commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b026ea6eb6
commit
26d0e66ff5
4 changed files with 133 additions and 6 deletions
|
|
@ -1955,17 +1955,19 @@ public class ConsumableItemEffect : IStatContext
|
|||
.ToArray();
|
||||
}
|
||||
|
||||
// Execute, then the always-updated pass, as EquippedItem.Update orders them: an always-updated behaviour that reads
|
||||
// what Execute marked this tick (Scanner's held mark) sees the same tick on either host.
|
||||
public void Update(float delta)
|
||||
{
|
||||
foreach (var behavior in Behaviors)
|
||||
if(behavior is IAlwaysUpdatedBehavior alwaysUpdatedBehavior) alwaysUpdatedBehavior.Update(delta);
|
||||
|
||||
foreach (var behavior in Behaviors)
|
||||
{
|
||||
if (!behavior.Execute(delta))
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var behavior in Behaviors)
|
||||
if(behavior is IAlwaysUpdatedBehavior alwaysUpdatedBehavior) alwaysUpdatedBehavior.Update(delta);
|
||||
|
||||
RemainingDuration -= delta;
|
||||
// Progress moves every tick; a stat with a ConsumableProgress term must recompute against it, the same
|
||||
// way EquippedItem signals Heat and Durability from UpdatePerformance below.
|
||||
|
|
|
|||
Loading…
Reference in a new issue