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

@@ -4,7 +4,8 @@ import { nativeShipmentSources } from '../game/homeworld-options';
import { SEMUTA_DRUG_ID } from '../game/semuta-drug';
import { semutaEmperorPlayer as player, moveSemutaEmperorCard } from './fixture-semuta-emperor-share';
import { advanceSemutaHomeworldChoam, applySemutaHomeworldChoamStep,
createSemutaHomeworldChoamSetup, holdSemutaHomeworldChoamCard } from './fixture-semuta-homeworld-choam';
createSemutaHomeworldChoamSetup, finishSemutaBattleOutcome,
holdSemutaHomeworldChoamCard } from './fixture-semuta-homeworld-choam';
import type { RicheseSkillsTechStep } from './fixture-richese-skills-tech';
export type SemutaHomeworldWinnerKind = 'mandatory' | 'selected';
@@ -117,6 +118,7 @@ export function createSemutaHomeworldWinnerFixture(
let action = finalResponse;
if (kind === 'selected') {
game = applySemutaHomeworldChoamStep(game, voters[1], finalResponse, actions);
game = finishSemutaBattleOutcome(game, actions);
if (game.pendingTreacheryDiscard) {
earlierEvents.push(game.pendingTreacheryDiscard.batch.event);
game = passOffer(game, actions);
@@ -134,6 +136,7 @@ export function createSemutaHomeworldWinnerFixture(
export function disposeSemutaHomeworldWinner(f: SemutaHomeworldWinnerFixture,
state = f.game, actions?: RicheseSkillsTechStep[]): Game {
let game = applySemutaHomeworldChoamStep(state, f.actor, f.action, actions);
game = finishSemutaBattleOutcome(game, actions);
if (f.kind === 'mandatory' && game.pendingTreacheryDiscard?.continuation.kind === 'battleResolved')
game = passOffer(game, actions);
return game;