The opening roll-off steps into the light
First wizard was never random: createGame has always rolled a die per player from the seed, re-rolling ties, and the gameStarted event carried every pip — straight into a log line that said only "X goes first." Now the table sees the ceremony: a dice modal as the boards flip, one row per wizard, the trophy on the high roll, a note when tied wizards rolled again — in online games and hotseat alike. The chronicle line keeps the full roll-off too. Pure presentation; the dice were always honest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
2950380e23
commit
22153b1e1b
@@ -49,6 +49,8 @@ class LocalGame {
|
||||
handoffTo = $state<PlayerId | null>(null);
|
||||
log = $state<string[]>([]);
|
||||
/** The finished game as a reel, each step from its actor's own seat. */
|
||||
/** The opening roll-off, shown once as the boards flip. */
|
||||
openingRolls = $state<{ rolls: Record<string, number[]>; first: string; players: string[] } | null>(null);
|
||||
replaySteps = $state<{ seq: number; actor: PlayerId; events: GameEvent[]; view: GameView }[] | null>(null);
|
||||
view = $derived(
|
||||
this.gameState && this.viewerId ? viewFor(this.gameState, this.viewerId) : null,
|
||||
@@ -135,6 +137,11 @@ class LocalGame {
|
||||
deckRev: 13,
|
||||
};
|
||||
const { state, events } = createGame(config);
|
||||
for (const e of events) {
|
||||
if (e.type === "gameStarted") {
|
||||
this.openingRolls = { rolls: e.dieRolls, first: e.firstPlayer, players: e.players };
|
||||
}
|
||||
}
|
||||
this.config = config;
|
||||
this.commands = [];
|
||||
this.gameState = state;
|
||||
|
||||
Reference in New Issue
Block a user