Two-player decks shed LIFESAVER, as the card itself instructs
"Not applicable in a 2-player game." — the card face. New games deal from deck revision 2, which removes it when exactly two wizards sit down; three or more keep it. The revision travels in GameConfig and the persisted start line, and stored games without one replay against the original build — changing an existing game's deck composition would scramble its deterministic replay. Test pins all three cases: removed at two, present at three, present in legacy two-player games. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
26c4b6efdf
commit
efec82e88d
@@ -200,6 +200,12 @@ export interface GameConfig {
|
||||
* standees: green, red, magenta, blue, light blue, yellow). Defaults to
|
||||
* seat order. */
|
||||
colors?: number[];
|
||||
/**
|
||||
* Deck revision. Absent = the original build, which stored games replay
|
||||
* against forever. Revision 2 removes LIFESAVER from two-player decks
|
||||
* ("Not applicable in a 2-player game." — the card face).
|
||||
*/
|
||||
deckRev?: number;
|
||||
}
|
||||
|
||||
export interface GameState {
|
||||
@@ -2895,7 +2901,11 @@ export function createGame(config: GameConfig): { state: GameState; events: Game
|
||||
})),
|
||||
);
|
||||
|
||||
const [deckShuffled, rng3] = shuffle(rng, buildDeck(config.sets));
|
||||
let fullDeck = buildDeck(config.sets);
|
||||
if ((config.deckRev ?? 1) >= 2 && n === 2) {
|
||||
fullDeck = fullDeck.filter((c) => c.cardId !== "lifesaver");
|
||||
}
|
||||
const [deckShuffled, rng3] = shuffle(rng, fullDeck);
|
||||
rng = rng3;
|
||||
const deck = [...deckShuffled];
|
||||
const discard: CardInstance[] = [];
|
||||
|
||||
Reference in New Issue
Block a user