Offer Semuta after independent-card Ix ally replacement
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
72f6ec2b12
commit
3f4925e6e1
8 files changed
+268
-10
No files matched your search
@@ -68,8 +68,11 @@ export function finishSemutaIxAllyCost(game: Game, actions: SemutaIxAllyCostStep
|
||||
|
||||
/** Original R/C/I/F/G setup, cache1, actual worm Nexus pact and ordinary paid
|
||||
* auction. Neither the delivered card nor a replacement is installed. */
|
||||
export function createSemutaIxAllyCostFixture(options: { advanced?: boolean } = {}) {
|
||||
const advanced = options.advanced ?? false;
|
||||
export function createSemutaIxAllyCostFixture(options: { advanced?: boolean; independent?: boolean; independentLot?: boolean } = {}) {
|
||||
const advanced = options.advanced ?? false, independent = options.independent ?? false;
|
||||
const independentLot = options.independentLot ?? false;
|
||||
assert.ok(!independentLot || independent, 'The selected independent card needs the variant');
|
||||
assert.ok(!advanced || !independent, 'The independent native Semuta source is Basic only');
|
||||
const richese = 'richese', holder = 'choam', owner = 'ixians', buyer = 'fremen', spender = 'guild';
|
||||
let game = createGame('SEMUTAIXALLYCOST', newPlayer(richese, 'Richese', 'richese'), advanced, ['choam', 'ix']);
|
||||
for (const faction of ['choam', 'ixians', 'fremen', 'guild'] as const) joinGame(game, newPlayer(faction, faction, faction));
|
||||
@@ -80,16 +83,20 @@ export function createSemutaIxAllyCostFixture(options: { advanced?: boolean } =
|
||||
const before = structuredClone(game), at = actions.length; run();
|
||||
return { before, steps: structuredClone(actions.slice(at)), after: structuredClone(game) };
|
||||
};
|
||||
if (independent) act(game.host, { type: 'moduleOption', module: 'ecazTreachery', enabled: true });
|
||||
for (const p of game.players) act(p.id, { type: 'ready' });
|
||||
const lobby = structuredClone(game);
|
||||
if (advanced) game = withClassicDiscoveryNexusLottery(() => initializeSemutaGameForAudit(game));
|
||||
else act(game.host, { type: 'start' });
|
||||
const setup = structuredClone(game);
|
||||
assert.equal(game.status, 'setup'); assert.equal(game.semutaPreview, true);
|
||||
assert.equal(game.status, 'setup');
|
||||
assert.equal(game.semutaPreview === true, !independent);
|
||||
assert.equal(game.semutaRecruitsPreview === true, independent);
|
||||
assert.equal(game.ecazTreachery === true, independent);
|
||||
assert.ok(game.players.every(p => p.hand.length === 0));
|
||||
assert.ok(!game.homeworlds && !game.nexusCards && !game.leaderSkills && !game.techTokens &&
|
||||
!game.strongholdCards && !game.discoveryEnabled && !game.ecazTreachery);
|
||||
const originalInventory = semutaIxAllyCostInventory(game); assert.equal(originalInventory.length, 57);
|
||||
!game.strongholdCards && !game.discoveryEnabled);
|
||||
const originalInventory = semutaIxAllyCostInventory(game); assert.equal(originalInventory.length, independent ? 60 : 57);
|
||||
const printed = game.deck.find(card => card.effect === 'karama' && !card.id.startsWith('ix-'));
|
||||
const shield = game.deck.find(card => card.kind === 'shield');
|
||||
const ordinary = game.deck.filter(card => card.kind === 'projectile' && !card.effect).slice(0, 3);
|
||||
@@ -141,10 +148,20 @@ export function createSemutaIxAllyCostFixture(options: { advanced?: boolean } =
|
||||
});
|
||||
assert.equal(semutaIxAllyCostPlayer(game, owner).ally, buyer);
|
||||
assert.equal(semutaIxAllyCostPlayer(game, buyer).ally, owner);
|
||||
// Optional source variation selects one still-unopened card into Ix's next
|
||||
// inspected pool. Ix returns the first inspected card, and controlled scalar
|
||||
// lottery leaves the rest in order, so Recruits becomes the first real lot.
|
||||
let selectedIndependentLot: string | null = null;
|
||||
if (independentLot) {
|
||||
const index = game.deck.findIndex(card => card.id === 'ecaz-recruits'); assert.ok(index >= 0);
|
||||
const [card] = game.deck.splice(index, 1); game.deck.splice(1, 0, card);
|
||||
selectedIndependentLot = card.id;
|
||||
}
|
||||
const beforeBidding = structuredClone(game), biddingAt = actions.length;
|
||||
reach(state => state.turn === 2 && state.phase === 3 && !!state.auction &&
|
||||
state.auction.index === 0 && state.auction.active === buyer && semutaIxAllyCostClean(state));
|
||||
const pool = { before: beforeBidding, steps: structuredClone(actions.slice(biddingAt)), after: structuredClone(game) };
|
||||
if (selectedIndependentLot) assert.equal(game.auction!.cards[game.auction!.index].id, selectedIndependentLot);
|
||||
let paymentBefore: Game | null = null, paymentAt = -1;
|
||||
const beforePurchase = structuredClone(game), purchaseAt = actions.length;
|
||||
const awaitingReplacement = (state: Game) => state.decision?.kind === 'ixAllyCard';
|
||||
@@ -171,7 +188,7 @@ export function createSemutaIxAllyCostFixture(options: { advanced?: boolean } =
|
||||
assert.ok(game.response?.kind === 'ixAllyCard'); assert.equal(game.response.owner, owner);
|
||||
assert.equal(game.response.recipient, buyer); assert.equal(game.decision ?? null, null);
|
||||
assert.ok(game.deck[0]); assert.deepEqual(semutaIxAllyCostInventory(game), originalInventory);
|
||||
return { game, kind: 'ixAllyCard' as const, advanced, blackMarket: false as const,
|
||||
return { game, kind: 'ixAllyCard' as const, advanced, independent, selectedIndependentLot, blackMarket: false as const,
|
||||
owner, holder, spender, buyer, recipient: buyer, richese, cost, karama: cost, semuta: SEMUTA_DRUG_ID,
|
||||
action: { type: 'card', card: cost, mode: 'cancel' } as Action,
|
||||
originalResponse: structuredClone(game.response), originalPending: structuredClone(game.pendingIxAlly!),
|
||||
@@ -182,10 +199,10 @@ export function createSemutaIxAllyCostFixture(options: { advanced?: boolean } =
|
||||
acquisition, acquired, cache: acquisition, alliance, pact: alliance, pool, purchase, payment, request,
|
||||
actions, steps: actions, sourceActionCount: actions.length,
|
||||
staging: [
|
||||
'Original public Basic start or original undealt Advanced initializer for R/C/I/F/G with native CHOAM/Ix decks. Only unopened deal/Spice positions and scalar lotteries are selected. Native Ix chooses its inspected Shield; Guild receives the printed Karama; CHOAM actually pays cache1 for Semuta.',
|
||||
`Original public Basic start${independent ? ' with independent Ecaz cards' : ''} or original undealt Advanced initializer for R/C/I/F/G with native CHOAM/Ix decks. Only unopened deal/Spice positions and scalar lotteries are selected. Native Ix chooses its inspected Shield; Guild receives the printed Karama; CHOAM actually pays cache1 for Semuta.`,
|
||||
'Original first-turn movement is unused. A real turn2 worm over the empty Funeral pile opens Nexus; Ix and Fremen actually propose and accept their pact. Native HMS, pool-return, optional Technology decline and other original controls remain real actions.',
|
||||
'Fremen bids and pays one own spice for an actual ordinary auction card. There is no Emperor seat, so the printed payment goes to the Bank. The card is delivered into the buyer hand and native pendingIxAlly/currentAuctionSale remain; Fremen really requests replacement before the cancellation cost.',
|
||||
'No played hand, wallet, card, ally, force, clock, pool, purchase, pending control or replacement is installed. Cache replacement and absent-Ix Secret Ally are outside these ordinary native sources.',
|
||||
`${independentLot ? 'One still-unopened Recruits was selected into Ix’s later inspected pool before bidding. ' : ''}No played hand, wallet, card, ally, force, clock, pool, purchase, pending control or replacement is installed. Cache replacement and absent-Ix Secret Ally are outside these ordinary native sources.`,
|
||||
] };
|
||||
}
|
||||
export type SemutaIxAllyCostFixture = ReturnType<typeof createSemutaIxAllyCostFixture>;
|
||||
Reference in new issue
Block a user