Support Emperor special Karama truth commitments
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 18:12:20 +11:00
1 parent b448144c52
commit add8e1d51a
14 files changed
+345 -20

No files matched your search

+33
View File
@@ -2162,3 +2162,36 @@ void test('Harkonnen special Karama guide forwards only the exact live printed-c
target.handCount = 0; press(button); assert.equal(sent.length, 1);
target.handCount = 1; owner.specialKaramaUsed = true; press(button); assert.equal(sent.length, 1);
});
void test('Emperor special Karama authoring uses only the public Revival opportunity', () => {
const game = projected(4);
game.advanced = true;
const emperor = game.players.find(player => player.id === 'p')!;
emperor.faction = 'emperor'; emperor.specialKaramaUsed = false;
const source = JSON.stringify(['karamaEmperorSpecial', game.turn, 'p']);
const initial = windowClaim('karamaEmperorSpecial', source), e = editor(initial, false, game);
Object.defineProperty(emperor, 'hand', { get() { throw Error('Question authoring read private hand'); }, configurable: true });
assert.equal(e.error(), null);
assert.match(e.html(), /Use Emperor’s special Karama during Revival/);
assert.match(e.html(), /Turn 2 · Emperor special Karama during Revival/);
assert.ok(turnActionInputError(initial, game, 'r'));
emperor.specialKaramaUsed = true; assert.ok(e.error());
emperor.specialKaramaUsed = false; game.phase = 5; assert.ok(e.error());
});
void test('Emperor special Karama guide forwards only a current legal force packet', () => {
const source = JSON.stringify(['karamaEmperorSpecial', 2, 'p']);
const game = projected(4, { type:'card', mode:'special', card:'controlled-printed-karama', amount:2, elite:1 });
game.advanced = true;
const owner = game.players.find(player => player.id === 'p')!;
owner.faction = 'emperor'; owner.specialKaramaUsed = false; owner.tanks = 3;
owner.elites = { reserves: 3, tanks: 1, forces: {}, revived: 0 };
game.revival.prevented = false; game.revival.pending = false; game.revival.sardaukarFreeBlock = null;
game.turnActionPromises[0].mixed = windowClaim('karamaEmperorSpecial', source);
const sent: Action[] = [], props = { game, busy:false, act(action:Action) { sent.push(action); } };
const button = guide(props); assert.equal(button.props.disabled, false);
assert.match(renderToStaticMarkup(button), /Emperor’s special Karama/);
press(button); assert.deepEqual(sent, [game.turnActionGuide!.action]);
owner.tanks = 1; press(button); assert.equal(sent.length, 1);
owner.tanks = 3; owner.specialKaramaUsed = true; press(button); assert.equal(sent.length, 1);
});