Allow battle cards while Sandtrout waits
Verify and publish checkpoint container / container (push) Successful in 10m47s

This commit is contained in:
Quintine committed 2026-11-16 17:02:50 +11:00
1 parent 2cea251afd
commit 338f2d8980
13 files changed
+471 -19

No files matched your search

+5 -11
View File
@@ -46,7 +46,8 @@ void test('Reinforcements consumes exactly three own normal reserves in either c
for (const advanced of [false, true]) for (const slot of ['weapon', 'defense'] as const) {
const start = fixture(advanced);
const owner = viewGame(start, 'a');
assert.deepEqual(owner.battle?.reinforcements, { blocked: null, normal: 3, elite: 0 });
assert.deepEqual(owner.battle?.reinforcements, { blocked: null, normal: 3, elite: 0,
eliteOptions: advanced ? [0, 1, 2, 3] : [0] });
assert.equal(viewGame(start, 'd').battle?.reinforcements, null);
assert.equal(viewGame(start, 't').battle?.reinforcements, null);
const privatePlan = applyAction(start, 'a', {
@@ -75,7 +76,7 @@ void test('paired Ecaz/Moritani battles spend one physical Reinforcements cost w
let g = harassWithdrawGame({ advanced, factions: [owner, owner === 'ecaz' ? 'moritani' : 'ecaz', 'atreides'] });
takeHarassCard(g, 'a', cardId);
harassCustody(g);
assert.deepEqual(viewGame(g, 'a').battle?.reinforcements, { blocked: null, normal: 3, elite: 0 });
assert.deepEqual(viewGame(g, 'a').battle?.reinforcements, { blocked: null, normal: 3, elite: 0, eliteOptions: [0] });
assert.equal(viewGame(g, 'd').battle?.reinforcements, null);
g = applyAction(JSON.parse(JSON.stringify(g)) as Game, 'a', {
type: 'battlePlan', dial: 1, support: advanced ? 1 : 0,
@@ -129,7 +130,7 @@ void test('Reinforcements normal-first cost preserves elite subpool and is paid
p.elites!.reserves = 2;
p.elites!.tanks = 3;
harassCustody(g);
assert.deepEqual(viewGame(g, 'a').battle?.reinforcements, { blocked: null, normal: 1, elite: 2 });
assert.deepEqual(viewGame(g, 'a').battle?.reinforcements, { blocked: null, normal: 1, elite: 2, eliteOptions: [2] });
// Give Atreides the Emperor's selected leader as a real traitor, preserving the deck's identities.
const target = 'emperor-0';
const old = g.players[1].traitors[0];
@@ -146,7 +147,7 @@ void test('Reinforcements normal-first cost preserves elite subpool and is paid
assert.equal(done.discard.filter(c => c.id === cardId).length, 1);
});
void test('insufficient reserves and unsupported modules reject without mutating the original game', () => {
void test('insufficient reserves reject without mutating the original game', () => {
const g = fixture(true);
const p = g.players[0];
p.reserves = 2;
@@ -156,11 +157,4 @@ void test('insufficient reserves and unsupported modules reject without mutating
harassCustody(g);
assert.match(viewGame(g, 'a').battle!.reinforcements!.blocked!, /three physical forces/);
reject(g, 'a', { type: 'battlePlan', dial: 1, leader: 'emperor-0', weapon: cardId }, /three own forces/);
p.reserves = 15;
p.tanks = 0;
p.elites!.reserves = 5;
p.elites!.tanks = 0;
g.sandtrout = {} as Game['sandtrout'];
assert.throws(() => applyAction(g, 'a',
{ type: 'battlePlan', dial: 1, leader: 'emperor-0', weapon: cardId }), RuleError);
});