Allow Advanced Emperor gifts during Guild rate responses
Verify and publish checkpoint container / container (push) Successful in 11m3s

This commit is contained in:
Quintine committed 2026-11-16 17:48:41 +11:00
1 parent b3843bf18e
commit 5e7f7b45e4
14 files changed
+475 -6

No files matched your search

+13
View File
@@ -48,6 +48,8 @@ function declare(g: Game, id: 'g' | 'e', amount: number, destination = 'arrakeen
}
function cancel(g: Game, card: string): Game {
assert.equal(g.response?.kind, 'guildRate');
const priority = viewGame(g, 'e').emperorGuildRatePriority;
if (priority?.canContinue) g = applyAction(g, 'e', {type:'emperorGuildRateContinue', event:priority.event});
return applyAction(reload(g), 'a', { type: 'card', mode: 'cancel', card });
}
function reject(g: Game, actor: string, action: Action) {
@@ -197,6 +199,17 @@ void test('the Advanced Guild stop decision precedes the separate Karama rate re
assert.equal(player(done, 'e').forces['arrakeen:10'], 3);
});
void test('an Advanced Emperor shipper cannot gift spice reserved for its pending Guild-rate payment', () => {
const {g:initial} = fixture('e', true);
const declared = declare(initial, 'e', 3);
const offered = applyAction(declared, 'g', {type:'decision',allow:true});
const gift = viewGame(offered, 'e').emperorGuildRateGift; assert.ok(gift);
assert.equal(gift.maximum, player(offered, 'e').spice - offered.pendingShipment!.cost);
reject(offered, 'e', {type:'emperorGift',amount:gift.maximum + 1});
const accepted = applyAction(offered, 'e', {type:'emperorGift',amount:gift.maximum});
assert.equal(accepted.response?.kind, 'emperorGift');
});
void test('an unstamped saved Advanced declaration gains a turn stamp before its new rate response', () => {
const { g: initial, karama } = fixture('e', true);
const legacy = declare(initial, 'e', 3);