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
+12 -12
View File
@@ -267,7 +267,7 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
case 'secondSectionOrdered':
return {
tone: 'bad',
text: `SECOND SECTION ordered on Train ${e.trainNumber} — an identical train will run right behind it, which forces the Superintendent to rule on a following train (§8.1)`,
text: `SECOND SECTION ordered on Train ${e.trainNumber} — an identical train will run right behind it, which forces the Superintendent to rule on a following train`,
};
/**
* WHERE THE PLAYER PUT IT, not where its number would have sent it.
@@ -382,7 +382,7 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
return {
tone: 'good',
text: bumped
? `Train ${e.trainNumber} SCHEDULED at Stage ${e.slot + 1} — rolled ${e.roll}, but Stage ${e.roll} was already taken, so it moved down the column to the next free Stage (§7)`
? `Train ${e.trainNumber} SCHEDULED at Stage ${e.slot + 1} — rolled ${e.roll}, but Stage ${e.roll} was already taken, so it moved down the column to the next free Stage`
: `Train ${e.trainNumber} SCHEDULED to depart at Stage ${e.slot + 1} (rolled ${e.roll}) — it will run at this time EVERY Day from now on`,
};
}
@@ -400,9 +400,9 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
// player the score had changed and nothing else.
const why =
e.reason === 'no free A/D track'
? `it arrived at ${e.where} with every A/D track already occupied — there was nowhere to put it (§8.3)`
? `it arrived at ${e.where} with every A/D track already occupied — there was nowhere to put it`
: e.reason === 'cars fouling the Running Track'
? `it ran into cars left standing on ${e.where} between the Limits and the Office (§8.3)`
? `it ran into cars left standing on ${e.where} between the Limits and the Office`
: e.reason;
const wrecked = e.trains
.map((t) => `${t.label} (${t.consist.length ? carsLabel(t.consist) : 'no cars'})`)
@@ -411,7 +411,7 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
tone: 'bad',
text:
`COLLISION — ${wrecked} destroyed: ${why}. Engines and cabooses go back to the Division ` +
`Yard, all other cars to the Classification Yard (§10). A Timetabled train card returns ` +
`Yard, all other cars to the Classification Yard. A Timetabled train card returns ` +
`to its slot and runs again next Day; an Extra is gone for good.`,
};
}
@@ -420,7 +420,7 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
return {
tone: 'bad',
text:
`SUPERINTENDENT MUST RULE (§8.1): ${train(e.trainId)} wants to enter the Mainline card ` +
`SUPERINTENDENT MUST RULE: ${train(e.trainId)} wants to enter the Mainline card ` +
`that ${train(e.occupiedBy)} is still crossing. Allow it and ${train(e.trainId)} may run ` +
`into the back of ${train(e.occupiedBy)} — a collision costs 5 Revenue. Hold it and it ` +
`waits where it is, losing time but safe.`,
@@ -440,13 +440,13 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
return {
tone: 'good',
where: e.at,
text: `Porter boarded passengers at ${at(e.at)} — one coach per Porter per Stage (§9.2)`,
text: `Porter boarded passengers at ${at(e.at)} — one coach per Porter per Stage`,
};
case 'passengersDetrained':
return {
tone: 'good',
where: e.at,
text: `Porter de-trained passengers at ${at(e.at)} — one coach per Porter per Stage (§9.2)`,
text: `Porter de-trained passengers at ${at(e.at)} — one coach per Porter per Stage`,
};
// -- freight pipeline
@@ -562,7 +562,7 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
why: blockedByBox
? 'green box has a load but MEN is occupied'
: `a load is staged but no empty ${want} is spotted on this industry's track — it stays ` +
'in the green box until a crew sets one out here (§9.3)',
'in the green box until a crew sets one out here',
severity: blockedByBox ? 'waiting' : 'stuck',
});
}
@@ -583,7 +583,7 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
why: spotted
? 'green box empty — nothing to load (needs a Freight Agent action)'
: `green box empty — the Freight Agent can stage a load now, but no empty ${want} is ` +
'spotted here, so a crew must set one out before Laborers can work it (§9.3)',
'spotted here, so a crew must set one out before Laborers can work it',
severity: 'waiting',
});
}
@@ -668,7 +668,7 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
if (pf.porters < 1) {
say(
'this Office has NO Porters — a Whistle Post is not a Passenger Facility (§9) and cannot ' +
'this Office has NO Porters — a Whistle Post is not a Passenger Facility and cannot ' +
'work passengers at all. Upgrade it to a Depot or better.',
'stuck',
);
@@ -691,7 +691,7 @@ export function impediments(s: GameState, player: PlayerIndex = 0): Impediment[]
);
}
if (loadedOnTrain && !s.yards.divisionYard.some((c) => c.type === 'coach' && !c.loaded)) {
say('no EMPTY coach in the Division Yard to swap into the train (§9.2 requires one)');
say('no EMPTY coach in the Division Yard to swap into the train — one is required');
}
}
}