Exercise Advanced Moritani assassination preview games
This commit is contained in:
1 parent
c961a93f62
commit
ac8742c829
8 files changed
+152
-20
No files matched your search
@@ -119,6 +119,27 @@ void test('Ecaz card samples keep all three physical identities through saved re
|
||||
assertFailedEvidence(resumed, 'ecaz-treachery-2-advanced', 1137, true);
|
||||
});
|
||||
|
||||
void test('Advanced Moritani assassination samples retain their preview and physical Traitor pool on resume', (t) => {
|
||||
const area = temporary(t);
|
||||
const out = join(area, 'assassinate');
|
||||
assert.equal(run(out, '--profile', 'moritani-assassinate', '--players', '3',
|
||||
'--seed', '1000', '--max-actions', '1').status, 1);
|
||||
assertFailedEvidence(out, 'moritani-assassinate-3-advanced', 1147, false);
|
||||
const snapshot = join(out, 'failed-moritani-assassinate-3-advanced.json');
|
||||
const game = json<{ advanced: boolean; moritaniAssassinatePreview: boolean;
|
||||
moritaniAssassinate: { owner: string; opportunities: unknown[] };
|
||||
players: { id: string; faction: string }[] }>(snapshot);
|
||||
assert.equal(game.advanced, true);
|
||||
assert.equal(game.moritaniAssassinatePreview, true);
|
||||
assert.equal(game.moritaniAssassinate.owner, game.players.find(p => p.faction === 'moritani')?.id);
|
||||
const resumed = join(area, 'resumed');
|
||||
assert.equal(run(resumed, '--resume', snapshot, '--seed', '1000', '--max-actions', '1').status, 1);
|
||||
assertFailedEvidence(resumed, 'moritani-assassinate-3-advanced', 1147, true);
|
||||
const unsupported = join(area, 'basic');
|
||||
assert.equal(run(unsupported, '--profile', 'moritani-assassinate', '--rules', 'basic').status, 1);
|
||||
assert.equal(existsSync(unsupported), false);
|
||||
});
|
||||
|
||||
void test('Moritani Skills samples preserve their full module on saved continuation and reject Advanced before running', (t) => {
|
||||
const area = temporary(t);
|
||||
const out = join(area, 'skills');
|
||||
|
||||
@@ -12,6 +12,13 @@ import {
|
||||
} from '../game/engine';
|
||||
import { sampleInventory, verifySampleCustody } from '../tools/sample-custody';
|
||||
import { completedMoritaniSkillsGame } from './moritani-skills-fixture';
|
||||
import {
|
||||
assassinationChoice,
|
||||
assassinationGame,
|
||||
assassinationToMentat,
|
||||
resolveAssassinationBattle,
|
||||
stageAssassinationBattle,
|
||||
} from './moritani-assassinate-fixture';
|
||||
|
||||
void test('Moritani Skills sample custody checks the physical skill and Traitor inventories after genuine setup', () => {
|
||||
const game = completedMoritaniSkillsGame();
|
||||
@@ -29,6 +36,23 @@ void test('Moritani Skills sample custody checks the physical skill and Traitor
|
||||
assert.throws(() => verifySampleCustody(traitors, inventory), /traitor custody/);
|
||||
});
|
||||
|
||||
void test('Moritani assassination samples conserve retired Traitors after real battle and Mentat replacement', () => {
|
||||
const start = assassinationGame();
|
||||
const inventory = sampleInventory(start);
|
||||
assert.ok(inventory.traitors);
|
||||
verifySampleCustody(start, inventory);
|
||||
const staged = stageAssassinationBattle(start);
|
||||
verifySampleCustody(staged, inventory);
|
||||
const revealed = assassinationChoice(resolveAssassinationBattle(staged), 'guild-1');
|
||||
verifySampleCustody(revealed, inventory);
|
||||
const settled = assassinationToMentat(revealed);
|
||||
assert.equal(settled.moritaniAssassinate?.opportunities[0].stage, 'replaced');
|
||||
verifySampleCustody(settled, inventory);
|
||||
const duplicated = structuredClone(settled);
|
||||
duplicated.traitorReserve!.push('guild-1');
|
||||
assert.throws(() => verifySampleCustody(duplicated, inventory), /physical traitor custody/);
|
||||
});
|
||||
|
||||
function fixture(advanced = false) {
|
||||
let game = createGame(
|
||||
'SAMPLEQA',
|
||||
|
||||
Reference in new issue
Block a user