Support group-funded Karama shipment pricing
Verify and publish checkpoint container / container (push) Canceled after 0s

This commit is contained in:
Quintine committed 2026-10-29 00:09:16 +11:00
1 parent 40c9651b80
commit 9cc659602c
7 files changed
+89 -10

No files matched your search

+24
View File
@@ -151,6 +151,30 @@ void test('Guild-allied group shipment uses half price and sends each non-Guild
conserved(done);
});
void test('a group-funded Karama shipment sends every payment to the bank', () => {
const {game: initial, karama} = fixture();
// Move the fixture's physical card to the shipper before buying the rate.
player(initial, 'h').hand = player(initial, 'h').hand.filter(card => card.id !== karama.id);
player(initial, 'a').hand.push(karama);
let game = fundAlly(initial);
game = send(game, 'a', {type:'card', card:karama.id, mode:'shipment'});
assert.equal(game.karamaShipping?.player, 'a');
assert.equal(viewGame(game, 'a').coalitionFunding?.incoming.length, 2,
'Both existing pledges remain available after purchasing the rate.');
game = send(game, 'a', discounted);
assert.equal(game.response ?? null, null, 'Karama shipment payments do not trigger Guild income.');
assert.equal(game.karamaShipping, null);
assert.equal(player(game, 'a').spice, 9);
assert.equal(player(game, 'g').spice, 7, 'Guild receives no payer share.');
assert.equal(player(game, 'e').spice, 8);
assert.equal(pledged(game, 'g', 'a'), 2);
assert.equal(pledged(game, 'e', 'a'), 1);
assert.equal(spiceIncludingEscrow(game), 37, 'All three spice went to the bank.');
assert.equal(player(game, 'a').forces['red_chasm:7'], 3);
assert.equal(game.discard.filter(card => card.id === karama.id).length, 1);
conserved(game);
});
void test('Karama removes the group Guild discount and preserves the declared donor shares', () => {
const {game: initial, karama} = fixture();
const declared = send(fundAlly(initial), 'a', discounted);
+29
View File
@@ -121,6 +121,35 @@ void test('group cross-planet shipment retains donor shares across permission an
conserved(game);
});
void test('group-funded purchased-rate cross-planet shipment keeps permission and pays the bank', () => {
const initial = fixture();
let {game} = initial;
// Keep Harkonnen's physical Karama available to exercise the permission
// window; the purchaser uses the other undealt physical Karama.
const index = game.deck.findIndex(card => card.effect === 'karama'); assert.ok(index >= 0);
const [karama] = game.deck.splice(index,1); seat(game,'e').hand.push(karama);
seat(game,'e').forces = {'imperial_basin:10':3}; seat(game,'e').reserves = 17;
game = fund(game,'e');
game = send(game,'e',{type:'card',mode:'shipment',card:karama.id});
assert.equal(game.karamaShipping?.player,'e');
game = send(game,'e',{type:'guildShip', forces:{'imperial_basin:10':3},
territory:'red_chasm', sector:7, allyPayment:0, coalitionContributions:shares('e')});
assert.equal(game.response?.kind,'guildTransportPermission');
assert.equal(seat(game,'e').forces['imperial_basin:10'],3);
assert.equal(pledge(game,'g','e'),2); assert.equal(pledge(game,'f','e'),2);
game = passKind(game,'guildTransportPermission');
assert.equal(game.response ?? null,null, 'Purchased rate and bank payment need no Guild-rate or income response.');
assert.equal(seat(game,'e').forces['red_chasm:7'],3);
assert.equal(seat(game,'e').forces['imperial_basin:10'] ?? 0,0);
assert.equal(seat(game,'e').spice,9);
assert.equal(seat(game,'g').spice,8, 'Guild receives none of the shipment payment.');
assert.equal(seat(game,'f').spice,8);
assert.equal(pledge(game,'g','e'),1); assert.equal(pledge(game,'f','e'),1);
assert.equal(game.karamaShipping,null);
assert.equal(game.discard.filter(card => card.id === karama.id).length,1);
conserved(game);
});
void test('Karama reprices the selected group shares while preserving cross-planet shipment and income', () => {
const initial = fixture();
let {game} = initial;