docs: document story engine and PR2 playable loop
CI / verify (push) Failing after 58s
CI / verify (pull_request) Failing after 41s

This commit is contained in:
ginnoir
2026-06-11 19:00:49 -05:00
parent 1461510a4b
commit c76265d648
14 changed files with 137 additions and 30 deletions
+4 -10
View File
@@ -6,21 +6,17 @@ import {
isActionAvailable,
tickGame,
} from '../engine/game';
import {
applyChoice as engineApplyChoice,
enterStoryNode,
initStory,
} from '../engine/story';
import { applyChoice as engineApplyChoice, enterStoryNode, initStory } from '../engine/story';
import { advance, createTickLoop, TICK_MS, type TickLoop } from '../engine/tickLoop';
import { createDefaultBackend, loadGame, type SaveBackend, saveGame } from './persistence';
import { getPrefs } from './prefs';
import { useGameStore } from './store';
import {
processStoryTriggers,
type StoryUiEffect,
shouldAutoOpenPanel,
storyEventsToLogEntries,
type StoryUiEffect,
} from './storyOrchestration';
import { useGameStore } from './store';
import { formatOfflineDuration, toView } from './viewModel';
/**
@@ -153,9 +149,7 @@ class GameRuntime {
const store = useGameStore.getState();
for (const entry of entries) store.appendStoryLog(entry);
for (const entry of entries) {
store.appendLog(
`Story: ${content.storyNodesById[entry.nodeId]?.prose.slice(0, 40)}`,
);
store.appendLog(`Story: ${content.storyNodesById[entry.nodeId]?.prose.slice(0, 40)}`);
}
const prefs = store.prefs;
if (shouldAutoOpenPanel(prefs, 'fork_choice', content)) {
+1 -1
View File
@@ -1,5 +1,5 @@
import { create } from 'zustand';
import { getPrefs, setPrefs as persistPrefs, type GamePrefs } from './prefs';
import { type GamePrefs, getPrefs, setPrefs as persistPrefs } from './prefs';
import type { GameView } from './viewModel';
/**
+1 -1
View File
@@ -2,8 +2,8 @@ import type { GameContent } from '../content/index';
import {
canAffordAction,
canUnlockAction,
isActionAvailable,
type GameState,
isActionAvailable,
} from '../engine/game';
import { getAvailableChoices, getCurrentNode } from '../engine/story';