Add opt-in CHOAM market skip for the current turn
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
685bd8bdfc
commit
825f903cce
12 files changed
+536
-2
No files matched your search
@@ -224,7 +224,7 @@ void test('CHOAM duplicate sale retains its witness and three spice through Semu
|
||||
assert.equal(claimed.discard.filter(card => card.id === semuta.id).length, 1);
|
||||
assert.equal(claimed.decision?.kind, 'choamMarket');
|
||||
});
|
||||
void test('canceled CHOAM sale creates no Semuta event or bank income', () => {
|
||||
void test('canceled CHOAM sale offers the spent Karama but creates no sale discard or bank income', () => {
|
||||
const g = fixture();
|
||||
g.players[1] = newPlayer('e', 'Richese', 'richese');
|
||||
g.richeseCache = richeseCards();
|
||||
@@ -235,8 +235,17 @@ void test('canceled CHOAM sale creates no Semuta event or bank income', () => {
|
||||
const sold = hold(g, 'c', 'Baliset');
|
||||
const declaration = sell(ready(g), sold.id);
|
||||
const karama = declaration.players[2].hand.find(card => card.effect === 'karama')!;
|
||||
const canceled = applyAction(declaration, 'b',
|
||||
let canceled = applyAction(declaration, 'b',
|
||||
{ type: 'card', card: karama.id, mode: 'cancel' });
|
||||
assert.equal(canceled.pendingTreacheryDiscard?.continuation.kind, 'karamaMarketDiscard');
|
||||
const event = canceled.pendingTreacheryDiscard!.batch.event;
|
||||
for (let i = 0; canceled.pendingTreacheryDiscard?.batch.event === event && i < canceled.players.length; i++) {
|
||||
const reaction: NonNullable<Game['pendingTreacheryDiscard']>['reaction'] = canceled.pendingTreacheryDiscard!.reaction;
|
||||
assert.equal(reaction?.stage, 'offer');
|
||||
if (reaction?.stage !== 'offer') throw Error('The Semuta offer is missing.');
|
||||
const player = canceled.players.find(seat => !reaction.passed.includes(seat.id)); assert.ok(player);
|
||||
canceled = applyAction(canceled, player.id, {type:'semutaPass', event});
|
||||
}
|
||||
assert.ok(!canceled.pendingTreacheryDiscard);
|
||||
assert.equal(canceled.players[0].spice, 20);
|
||||
assert.equal(canceled.players[0].hand.filter(card => card.id === sold.id).length, 1);
|
||||
|
||||
Reference in new issue
Block a user