Admit original Advanced Tleilaxu Ixian Nexus replacement

This commit is contained in:
Quintine committed 2026-10-16 03:26:49 +11:00
1 parent 2c6bb02ccb
commit 7ef00e0a65
10 files changed
+80 -57

No files matched your search

+4 -3
View File
@@ -13,6 +13,7 @@ import {
export type NativeIxianReplacementOptions = {
initial?: Game;
advanced?: boolean;
buyerFaction?: 'atreides' | 'tleilaxu';
purchasedId?: string;
replacementId?: string;
@@ -78,7 +79,7 @@ function orderStartingCards(game: Game, buyer: string, reserved: readonly string
...pool.filter(card => reserved.includes(card.id))];
}
/** Basic native Tleilaxu + classic setup, a full first turn, an actual alliance-
/** Native Tleilaxu + classic setup, a full first turn, an actual alliance-
* qualified closing Nexus draw, and an original paid normal-auction purchase.
* The unplayed deck is ordered before native auction allocation, not the row. */
export function createNativeIxianReplacementFixture(
@@ -91,11 +92,11 @@ export function createNativeIxianReplacementFixture(
game.nexusIxianReplacementPreview === true && game.turn === 1 && game.phase === 0 &&
game.players.every(player => player.hand.length === 0)));
} else {
game = createGame('NATIXREP', newPlayer('a', 'Atreides', 'atreides'), false, ['ix']);
game = createGame('NATIXREP', newPlayer('a', 'Atreides', 'atreides'), options.advanced ?? false, ['ix']);
joinGame(game, newPlayer('e', 'Emperor', 'emperor'));
joinGame(game, newPlayer('t', 'Tleilaxu', 'tleilaxu'));
}
assert.equal(game.advanced, false);
if (options.advanced !== undefined) assert.equal(game.advanced, options.advanced);
assert.deepEqual(game.expansions, ['ix']);
assert.ok(game.players.some(player => player.faction === 'tleilaxu'));
const buyer = game.players.find(player => player.faction === (options.buyerFaction ?? 'atreides'))!.id;
+6 -4
View File
@@ -20,10 +20,11 @@ function reject(game: Game, id: string, action: Action): void {
assert.deepEqual(game, before);
}
for (const advanced of [false, true])
for (const buyerFaction of ['atreides', 'tleilaxu'] as const)
void test(`Basic native ${buyerFaction} paid Ix special replacement preserves its purchase and settles the real suffix once`, () => {
void test(`${advanced ? 'Advanced' : 'Basic'} native ${buyerFaction} paid Ix special replacement preserves its purchase and settles the real suffix once`, () => {
const endingAuction = buyerFaction === 'tleilaxu';
const f = createNativeIxianReplacementFixture({ buyerFaction, endingAuction });
const f = createNativeIxianReplacementFixture({ advanced, buyerFaction, endingAuction });
assert.equal(f.beforeNexusDraw.nexusCards!.cards!.hands[f.buyer], null);
assert.equal(owner(f.beforeNexusDraw, f.buyer).ally, null);
const partners = f.beforeNexusDraw.players.filter(player => player.id !== f.buyer);
@@ -62,8 +63,9 @@ for (const buyerFaction of ['atreides', 'tleilaxu'] as const)
reject(use, f.buyer, { type: 'nexusIxianReplacementPass', event: f.event });
});
void test('native Pass keeps the purchased Ix special and genuinely acquired Nexus without a draw or repayment', () => {
const f = createNativeIxianReplacementFixture();
for (const advanced of [false, true])
void test(`${advanced ? 'Advanced' : 'Basic'} native Pass keeps the purchased Ix special and acquired Nexus without another draw or payment`, () => {
const f = createNativeIxianReplacementFixture({ advanced });
const offer = viewGame(f.game, f.buyer).nexusIxianReplacement!;
const pass = settleIxianReplacementFixture(applyAction(reload(f.game), f.buyer,
{ type: 'nexusIxianReplacementPass', event: offer.event }));