v0.7.0 — four game types, a lobby you can read and leave, and a multiplayer game that makes a sound

The multiplayer set-up, the lobby, the start of a game, and four signals a remote client had never
been sent. Reasoning, the preset table and what was verified how: CHANGELOG.md.

- Co-op, Competitive, Cutthroat, Solitaire and Custom, on both screens, from one shared block —
  they had drifted, and each was missing a question the other asked.
- A player reads the whole rule set before taking a seat, may leave a lobby or a running game, and
  keeps a seat across a reload. The host may clear a chair. The browser remembers every game it is
  in, not just the last one.
- The start of a game is drawn: a handoff beat, an announcement, the code and type in the header.
- Sound, the timetable flash, announcements and the just-drawn badge now reach a remote client;
  justDrawn goes to the seat that drew it and nobody else.
- Played on StartOS, which found the rest: an Extra belongs to the player who played it, the board
  never named the Superintendent, bot seats were reported as absent players, and rule section
  numbers are out of every string a player reads.

Also carries the previous session's Heavy Grade documentation work — asked again, answer unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016JczK5i33ZNSf2PtzZqdhS
This commit is contained in:
Jesse.Markowitz
2026-08-23 05:46:42 -04:00
co-authored by Claude Opus 5
parent 42adfda390
commit 06db36e5b5
41 changed files with 4387 additions and 588 deletions
+15 -1
View File
@@ -121,6 +121,14 @@ export type NewGameOptions = {
minCombinedRevenue?: number;
maxCollisionsPerDay?: number;
maxCollisionsTotal?: number;
/**
* Appendix B's three, added 2026-08-23 when the New Game dialog gained them.
*
* The lobby has offered these since v0.6.0 and the solitaire dialog could not, which meant a
* solitaire game could never be played under Employee Rotation or the Emergency Toolbox at all.
* Partial like `houseRules`: a caller names only what it is setting.
*/
optionalRules?: Partial<GameConfig['optionalRules']>;
};
/** The same config with the New Game dialog's answers in it. */
@@ -131,6 +139,7 @@ export function configWith(opts: NewGameOptions): GameConfig {
minCombinedRevenue: opts.minCombinedRevenue ?? SOLO_CONFIG.minCombinedRevenue,
maxCollisionsPerDay: opts.maxCollisionsPerDay ?? SOLO_CONFIG.maxCollisionsPerDay,
maxCollisionsTotal: opts.maxCollisionsTotal ?? SOLO_CONFIG.maxCollisionsTotal,
optionalRules: { ...SOLO_CONFIG.optionalRules, ...(opts.optionalRules ?? {}) },
houseRules: houseRules(opts.houseRules ? { houseRules: opts.houseRules } : {}),
};
}
@@ -1136,10 +1145,15 @@ function configFor(save: Save, config: GameConfig): GameConfig {
*
* Returns null when there is nothing to undo, so the caller can leave the button disabled.
*/
export function undo(game: Game, config: GameConfig = SOLO_CONFIG): Game | null {
export function undo(game: Game, config: GameConfig = game.state.config): Game | null {
if (game.history.length === 0) return null;
// `toSave` first, so the rules this game was dealt under come with it. Rebuilding the save by hand
// here dropped them, and undo re-dealt the game under the defaults instead of its own settings.
//
// THE VICTORY DIALS COME FROM THE GAME ITSELF for the same reason (2026-08-23). `Save` carries only
// the house rules, so defaulting this parameter to `SOLO_CONFIG` meant undoing a game dealt over
// eight Days replayed it as a five-Day game — the length, the Revenue floor and both collision
// caps all quietly reverting to the defaults.
return fromSave({ ...toSave(game), history: game.history.slice(0, -1) }, config);
}