END-2: final siege + latching win/lose (SL-3)

At GoalProgress.Charge>=Target a new server-only GoalReachedSystem arms a larger final siege (x live FinalSiegeMultiplier) and flips RunPhase=FinalDefense; CyclePhaseSystem latches a REPLICATED RunOutcome (Victory on clear / Loss on Core breach) and halts the director. RunOutcome is a [GhostField] byte on the global CycleDirector ghost (the client banner observes it); RunPhase stays server-only. ThreatDirector/CoreRestore/CoreDamage halt once decided; SiegeTimeout is off during the final siege. SaveData v5 persists the outcome so a won/lost run loads finished. GoalProgress.Target 10->4. Completes Path A's spine. See DR-036.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-15 12:38:21 -07:00
parent 33c85c4f9a
commit 4f0b4e8087
16 changed files with 313 additions and 33 deletions
@@ -40,6 +40,10 @@ namespace ProjectM.Server
var core = SystemAPI.HasComponent<CoreIntegrity>(dir)
? SystemAPI.GetComponent<CoreIntegrity>(dir)
: default;
// END-2: persist the terminal run outcome so a won/lost run loads finished (no re-arm on Continue).
var outcome = SystemAPI.HasComponent<RunOutcome>(dir)
? SystemAPI.GetComponent<RunOutcome>(dir)
: default;
// The shared ledger lives on this same CycleDirector ghost (ResourceLedger-tagged StorageEntry buffer).
@@ -57,6 +61,7 @@ namespace ProjectM.Server
GoalCharge = goal.Charge,
GoalTarget = goal.Target,
CoreCurrent = core.Current,
RunOutcome = outcome.Value,
Ledger = rows,
Structures = structures,