Admit Mirror and Stone in Basic native E3 battles
Reuse original copied-weapon and typed coalition accounting for bare Basic Ecaz/Moritani and selected Ix. Preserve optional-module guards and physical card identity, actual force-owner commitments and native continuations.
This commit is contained in:
1 parent
49992d322f
commit
19e554666e
18 files changed
+566
-23
No files matched your search
@@ -0,0 +1,21 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { applyAction, viewGame, type Game } from '../game/engine';
|
||||
|
||||
/** Close only the actual final-priority controls. Do not bypass a response,
|
||||
* pending native decision, Stone count, casualty choice or cleanup. */
|
||||
export function finishBattleOutcomeWindow(source: Game): Game {
|
||||
let game = source;
|
||||
for (let count = 0; count < 2; count++) {
|
||||
const window = game.battle?.outcomeWindow;
|
||||
if (!window || window.closed) return game;
|
||||
assert.ok(!game.response && !game.decision && !game.phaseOpening,
|
||||
'Finish the actual native control before final battle priority');
|
||||
const actor = [window.attacker, window.defender].find(id => !window.ready.includes(id));
|
||||
assert.ok(actor);
|
||||
const own = viewGame(game, actor).battle!.outcomeWindow;
|
||||
assert.ok(own && !own.closed);
|
||||
game = applyAction(game, actor, { type: 'battleOutcomeReady', event: own.event });
|
||||
}
|
||||
assert.ok(!game.battle?.outcomeWindow || game.battle.outcomeWindow.closed);
|
||||
return game;
|
||||
}
|
||||
Reference in new issue
Block a user