Resolve advisor conversion after battle losses before optional cleanup

Preserve committed casualties, payments and mandatory disposal when battle
losses leave BG bystanders alone. Bind the public phase-six receipt to the
original battle and resume its private winner/aftermath cursor once. Record
provisional priority; explosions with no surviving advisors create no response.

Repair stale Semuta fixtures to acknowledge the existing final battle window;
a representative failure reproduces against unchanged base035be51. Production
Semuta guards stay intact.

Validation: 16 affected files264/264, types/lint/build, five native battle and
GameTable SSR journeys, eight existing-profile response paths. Genuine44-action
sources earn original cards/forces and actual Collection outcomes. Broader
combinations and complete modes remain unfinished. Not deployed; no room/D1,
reset or restart operation. Runtime fingerprint
665defe51a1f46a6b5992b6e1e4b034203f91e7101acf860eb549f5bf9865151;
checkpoint prose/reference overlays are reviewed separately.
This commit is contained in:
Quintine committed 2026-10-24 20:37:09 +11:00
1 parent 035be51915
commit d83db397c0
17 files changed
+908 -26

No files matched your search

+14
View File
@@ -29,6 +29,20 @@ export function holdSemutaHomeworldChoamCard(game: Game, owner: string, name: st
return moveSemutaEmperorCard(game, card.id, owner);
}
/** Acknowledge only the actual final battle window; leave fresh discards and
* every subsequent card, casualty or aftermath choice to the caller. */
export function finishSemutaBattleOutcome(state: Game, actions?: RicheseSkillsTechStep[]): Game {
let game = state;
while (game.battle?.outcomeWindow && !game.battle.outcomeWindow.closed) {
const window = game.battle.outcomeWindow;
const actor = [window.attacker, window.defender].find(id => !window.ready.includes(id));
assert.ok(actor);
game = applySemutaHomeworldChoamStep(game, actor,
{ type: 'battleOutcomeReady', event: window.event }, actions);
}
return game;
}
/** Caller tests the requested boundary before each real native action. */
export function advanceSemutaHomeworldChoam(
state: Game, until: (game: Game) => boolean, actions?: RicheseSkillsTechStep[],