Check Advanced victory after Mentat actions
Verify and publish checkpoint container / container (push) Successful in 10m42s
Verify and publish checkpoint container / container (push) Successful in 10m42s
This commit is contained in:
1 parent
c608d6fea6
commit
64706cc7e0
12 files changed
+339
-27
No files matched your search
@@ -53,6 +53,11 @@ function enterMentat(source: Game): Game {
|
||||
g = applyAction(g, g.decision.player, { type: 'decision', done: true });
|
||||
assert.equal(g.decision?.kind, 'choamMentat');
|
||||
g = applyAction(g, g.decision.player, { type: 'decision', done: true });
|
||||
} else if (g.advanced) {
|
||||
// Fresh Advanced Mentat evaluates victory after all ordinary opportunities.
|
||||
assert.equal(g.status, 'playing');
|
||||
assert.ok(!g.victoryContinuation);
|
||||
for (const p of g.players) g = applyAction(g, p.id, { type: 'ready' });
|
||||
}
|
||||
return g;
|
||||
}
|
||||
@@ -110,7 +115,7 @@ void test('unanimous turn-ten agreement opens real turn eleven without replaying
|
||||
const opening = enterMentat(original);
|
||||
const before = opening.players.map(p => ({ id: p.id, forces: p.forces, reserves: p.reserves }));
|
||||
const agreed = accept(opening, 1);
|
||||
assert.equal(agreed.turn, 10); assert.equal(agreed.phase, 8);
|
||||
assert.equal(agreed.turn, 11); assert.equal(agreed.phase, 0);
|
||||
assert.equal(agreed.victoryFinalTurn, 11); assert.equal(agreed.victoryExtraStrongholds, 1);
|
||||
assert.deepEqual(agreed.players.map(p => ({ id: p.id, forces: p.forces, reserves: p.reserves })), before);
|
||||
const next = finishMentat(agreed);
|
||||
@@ -151,6 +156,9 @@ void test('accepted turn eleven follows native phases through its next Mentat ch
|
||||
}
|
||||
assert.equal(game.turn, 11);
|
||||
assert.equal(game.phase, 8, 'The original phase sequence reaches the next Mentat check');
|
||||
assert.equal(game.status, 'playing');
|
||||
assert.ok(!game.victoryContinuation);
|
||||
for (const p of game.players) game = actAdvancedRevivalOrder(game, p.id, { type: 'ready' }, actions);
|
||||
assert.ok(game.status === 'finished' || game.victoryContinuation,
|
||||
'The extended final-turn check settles a winner or offers the next agreement');
|
||||
assert.equal(game.victoryFinalTurn, 11);
|
||||
|
||||
Reference in new issue
Block a user