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

This commit is contained in:
Quintine committed 2026-10-29 18:26:33 +11:00
1 parent 5079ab556f
commit 5b8d510470
14 files changed
+418 -18

No files matched your search

+40
View File
@@ -2230,3 +2230,43 @@ void test('Atreides special Karama guide forwards only the live target battle pa
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);
});
void test('Fremen special Karama authoring uses only its public Spice Blow opportunity', () => {
const game = projected(1);
game.advanced = true; game.spiceWindow = null; game.nexus = false;
const fremen = game.players.find(player => player.id === 'p')!;
fremen.faction = 'fremen'; fremen.specialKaramaUsed = false;
const source = JSON.stringify(['karamaFremenSpecial', game.turn, 'p']);
const initial = windowClaim('karamaFremenSpecial', source), e = editor(initial, false, game);
Object.defineProperty(fremen, 'hand', { get() { throw Error('Question authoring read private hand'); }, configurable: true });
assert.equal(e.error(), null);
assert.match(e.html(), /Use Fremen’s special Karama during Spice Blow/);
assert.match(e.html(), /Turn 2 · Fremen special Karama during Spice Blow/);
assert.match(e.html(), /guide uses empty sand without spice/);
assert.ok(turnActionInputError(initial, game, 'r'));
fremen.specialKaramaUsed = true; assert.ok(e.error());
fremen.specialKaramaUsed = false; game.phase = 2; assert.ok(e.error());
});
void test('Fremen special Karama guide forwards only a current sand summon packet', () => {
const game = projected(1, { type:'card', mode:'special', card:'controlled-printed-karama', territory:'hagga_basin' });
game.advanced = true; game.spiceWindow = null; game.nexus = false;
const owner = game.players.find(player => player.id === 'p')!;
owner.faction = 'fremen'; owner.specialKaramaUsed = false;
const source = JSON.stringify(['karamaFremenSpecial', game.turn, 'p']);
game.turnActionPromises[0].mixed = windowClaim('karamaFremenSpecial', 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), /Fremen’s special Karama/);
press(button); assert.deepEqual(sent, [game.turnActionGuide!.action]);
game.spice['hagga_basin:5'] = 1; press(button); assert.equal(sent.length, 1);
delete game.spice['hagga_basin:5'];
owner.specialKaramaUsed = true; press(button); assert.equal(sent.length, 1);
owner.specialKaramaUsed = false; game.phase = 2; press(button); assert.equal(sent.length, 1);
const invalid = projected(1, { type:'card', mode:'special', card:'controlled-printed-karama', territory:'arrakeen' });
invalid.advanced = true; invalid.spiceWindow = null; invalid.nexus = false;
const invalidOwner = invalid.players.find(player => player.id === 'p')!;
invalidOwner.faction = 'fremen'; invalidOwner.specialKaramaUsed = false;
invalid.turnActionPromises[0].mixed = windowClaim('karamaFremenSpecial', source);
assert.equal(guide({ game:invalid, busy:false, act() { assert.fail('Invalid territory'); } }).props.disabled, true);
});