Say who is playing, what you can press, and where you are in the Stage

Mostly presentation, plus one rules fix found on the way.
This commit is contained in:
Jesse
2026-08-04 08:37:42 -04:00
parent 982952fd6c
commit ec792dfc15
12 changed files with 392 additions and 62 deletions
+6 -4
View File
@@ -59,9 +59,9 @@ export function phaseLabel(phase: string): string {
case 'mainline':
return 'Mainline';
case 'loadUnload':
return 'Load / Unload';
return 'Cargo';
case 'shiftChange':
return 'Shift Change';
return 'Supervisor Shift';
default:
return phase;
}
@@ -74,7 +74,7 @@ export function phaseLabel(phase: string): string {
export type Narration = {
text: string;
/** Colours the line in the viewer. */
tone: 'plain' | 'good' | 'bad' | 'clock' | 'quiet';
tone: 'plain' | 'good' | 'bad' | 'clock' | 'quiet' | 'phase';
/** Board cell to highlight, if the event happened somewhere. */
where?: GridCoord;
};
@@ -104,7 +104,9 @@ export function narrate(e: GameEvent, ctx: NarrateContext = {}): Narration {
case 'stageBegan':
return { tone: 'clock', text: `── Day ${e.day}, Stage ${e.stage} — ${clockTime(e.stage)} ──` };
case 'phaseBegan':
return { tone: 'quiet', text: `${phaseLabel(e.phase)}` };
// Its own tone, not `quiet`. A phase marker sat in the same grey as the events inside it, so
// the log read as one undifferentiated column and you could not see where a phase began.
return { tone: 'phase', text: `▸ ${phaseLabel(e.phase)} phase` };
case 'actorChanged':
return {
tone: 'quiet',
+6 -3
View File
@@ -111,6 +111,8 @@ export type Frame = {
stage: number;
clock: string;
phase: string;
/** The raw phase, so a caller can mark WHICH of the five is current without parsing the label. */
phaseKey: string;
actor: number | null;
superintendent: number;
revenue: number;
@@ -332,11 +334,11 @@ export function describeIntent(s: GameState, i: Intent): string {
case 'draw.fromHomeOffice':
return `draw blind from the Home Office deck (${s.decks.homeOffice.length} left)`;
case 'draw.end':
return 'done drawing — end my turn';
return 'End my turn';
case 'switch.end':
return 'done switching — end my turn';
return 'End my switching turn';
case 'loadUnload.end':
return 'done working — end the Load/Unload phase';
return 'End my Cargo phase';
case 'newTrain.passCar':
return 'add no more cars to this train';
case 'newTrain.secondSection':
@@ -459,6 +461,7 @@ export function snapshot(
stage: s.clock.stage,
clock: clockTime(s.clock.stage),
phase: phaseLabel(s.clock.phase),
phaseKey: s.clock.phase,
actor: s.clock.currentActor,
superintendent: s.clock.superintendent,
revenue: s.players[0]?.revenue ?? 0,