Extend Basic Emperor auction gifts to Nexus and Richese
Verify and publish checkpoint container / container (push) Canceled after 0s
Verify and publish checkpoint container / container (push) Canceled after 0s
This commit is contained in:
1 parent
b258c6867f
commit
dac1b432db
11 files changed
+509
-14
No files matched your search
@@ -14,8 +14,8 @@ function rejectsUnchanged(game: Game, actor: string, action: Action): void {
|
||||
}
|
||||
|
||||
for (const advanced of [false, true]) {
|
||||
for (const prepaidAid of [0, 1]) for (const cancelIncome of [false, true]) void test(
|
||||
`${advanced ? 'Advanced' : 'Basic'} genuine allied purchase reuses ${prepaidAid} prepaid spice and ${cancelIncome ? 'cancels' : 'allows'} original Emperor income`, () => {
|
||||
for (const prepaidAid of [0, 1]) for (const cancelIncome of (advanced ? [false] : [false, true])) void test(
|
||||
`${advanced ? 'Advanced' : 'Basic'} genuine allied purchase reuses ${prepaidAid} prepaid spice and ${advanced ? 'sends Emperor contribution to Bank' : `${cancelIncome ? 'cancels' : 'allows'} original Emperor income`}`, () => {
|
||||
const f = createNexusEmperorPaymentFixture({ advanced, prepaidAid });
|
||||
assert.equal(f.game.decision!.player, f.neutral);
|
||||
assert.deepEqual(f.game.pendingNexusEmperorPayment!.receipt.required, [f.neutral, f.owner]);
|
||||
@@ -51,6 +51,20 @@ for (const advanced of [false, true]) {
|
||||
assert.equal(nexusEmperorPaymentPlayer(game, f.emperor).spice, f.wallets.emperor - (f.price - prepaidAid),
|
||||
'Prepaid credit is already deducted; only the missing spice is newly escrowed');
|
||||
assert.deepEqual(game.aid[f.emperor], { recipient: f.winner, amount: 0 });
|
||||
if (advanced) {
|
||||
// The entire invoice is now Emperor's contribution, which Advanced
|
||||
// sends to Bank. No Emperor income exists to cancel; the original lot
|
||||
// therefore advances directly to the next Atreides inspection.
|
||||
assert.equal(nexusEmperorPaymentPlayer(game, f.emperor).spice, f.wallets.emperorBeforeAid - f.price);
|
||||
assert.equal(nexusEmperorPaymentPlayer(game, f.winner).hand.filter(card => card.id === f.acquired).length, 1);
|
||||
assert.equal(game.auction!.index, f.game.auction!.index + 1);
|
||||
assert.equal(game.response!.kind, 'atreidesAuction');
|
||||
assert.equal(game.nexusEmperorPayment!.completed.length, 1);
|
||||
rejectsUnchanged(game, f.owner, { type: 'nexusEmperorPayment', event: f.event, use: true });
|
||||
assert.deepEqual(nexusEmperorPaymentCards(game), f.originalCards);
|
||||
nexusEmperorPaymentInventory(game);
|
||||
return;
|
||||
}
|
||||
assert.equal(game.auction!.bid, f.price); assert.equal(game.auction!.bidder, f.winner);
|
||||
assert.equal(game.auction!.allyPayment, f.price);
|
||||
assert.equal(game.auction!.index, f.game.auction!.index);
|
||||
@@ -107,7 +121,7 @@ for (const advanced of [false, true]) {
|
||||
game = stepNexusEmperorPayment(game, { actor: f.winner, action: { type: 'decision', karama: false } });
|
||||
assert.equal(nexusEmperorPaymentPlayer(game, f.winner).spice, f.wallets.winner - f.price + prepaidAid);
|
||||
assert.equal(nexusEmperorPaymentPlayer(game, f.emperor).spice, f.wallets.emperor);
|
||||
assert.equal(game.response!.kind, 'emperorIncome');
|
||||
assert.equal(game.response!.kind, advanced && prepaidAid === f.price ? 'atreidesAuction' : 'emperorIncome');
|
||||
assert.equal(nexusEmperorPaymentPlayer(game, f.winner).hand.filter(card => card.id === f.acquired).length, 1);
|
||||
assert.equal(game.nexusEmperorPayment!.completed.length, 1, 'Ordinary settlement does not reopen the same obligation');
|
||||
nexusEmperorPaymentInventory(game);
|
||||
|
||||
Reference in new issue
Block a user