Support Atreides special Karama truth commitments
Verify and publish checkpoint container / container (push) Successful in 10m46s

This commit is contained in:
Quintine committed 2026-10-29 18:17:14 +11:00
1 parent add8e1d51a
commit 5079ab556f
16 files changed
+408 -19

No files matched your search

+35
View File
@@ -2195,3 +2195,38 @@ void test('Emperor special Karama guide forwards only a current legal force pack
owner.tanks = 1; press(button); assert.equal(sent.length, 1);
owner.tanks = 3; owner.specialKaramaUsed = true; press(button); assert.equal(sent.length, 1);
});
void test('Atreides special Karama authoring uses the public battle window and owner', () => {
const game = combat(false);
game.advanced = true;
const owner = game.players.find(player => player.id === 'p')!;
const other = game.players.find(player => player.id === 'a')!;
owner.faction = 'atreides'; owner.specialKaramaUsed = false; other.faction = 'emperor';
const source = JSON.stringify(['karamaAtreidesSpecial', game.turn, 'p', game.battle!.event, game.battle!.territory]);
const initial = windowClaim('karamaAtreidesSpecial', source), e = editor(initial, false, game);
Object.defineProperty(owner, 'hand', { get() { throw Error('Question authoring read private hand'); }, configurable: true });
assert.equal(e.error(), null);
assert.match(e.html(), /Use Atreides’ special Karama in this battle/);
assert.match(e.html(), /Turn 2 · Atreides special Karama in this battle/);
assert.ok(turnActionInputError(initial, game, 'r'));
owner.specialKaramaUsed = true; assert.ok(e.error());
owner.specialKaramaUsed = false; game.battle!.revealed = true; assert.ok(e.error());
});
void test('Atreides special Karama guide forwards only the live target battle packet', () => {
const game = combat(false, { type:'card', mode:'special', card:'controlled-printed-karama', target:'r' });
game.advanced = true;
const owner = game.players.find(player => player.id === 'p')!;
const asker = game.players.find(player => player.id === 'a')!;
owner.faction = 'atreides'; owner.specialKaramaUsed = false; asker.faction = 'emperor';
// The Atreides owner may inspect a battle in which they are not a participant.
game.battle!.attacker = 'a'; game.battle!.defender = 'r';
const source = JSON.stringify(['karamaAtreidesSpecial', 2, 'p', game.battle!.event, game.battle!.territory]);
game.turnActionPromises[0].mixed = windowClaim('karamaAtreidesSpecial', 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), /Atreides’ special Karama/);
press(button); assert.deepEqual(sent, [game.turnActionGuide!.action]);
game.battle!.defender = 'p'; press(button); assert.equal(sent.length, 1);
game.battle!.defender = 'r'; owner.specialKaramaUsed = true; press(button); assert.equal(sent.length, 1);
});