Add ten new games (18 in total) and the engine features they need.

Story: Dead Air, The Masquerade at Montague House, The Kalahari Expedition,
The Alchemist's Vault, Submerged: Deep Lab Nereid, The Kestrel Bank Job.
Games can now set their own hint penalty and a hard time limit, shown as a
countdown; running out ends the game with the fail ending.

Defuse: Tick Tock: Overtime. Manuals are now rulesets, so each game has its
own solver. Adds indicator lights, per-level strike limits, and the
Passwords, Morse Light and Say It Back modules.

Sync: In Sync: Deep Cuts. Adds telepathy (typed word) and ranking rounds,
and a per-round bar for the key.

Labyrinth: The Drowned Catacombs and The Mirror Maze. Adds one-way gates, a
relative (no compass) Explorer, a mirrored Navigator map, and mazes with a
lantern count other than three. Validation now rejects a maze where a gate
can leave the Explorer stuck.

Difficulty runs from 1 to 5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 23:34:11 +02:00
co-authored by Claude Opus 5.5
parent 62245ca67a
commit bbe44e84c4
38 changed files with 4201 additions and 197 deletions
+74 -7
View File
@@ -35,6 +35,8 @@ export interface GameSummary {
theme: Theme;
roles: Record<Role, RoleInfo>;
totalKeys: number;
/** Hard time limit, for the games that have one. */
timeLimitMinutes: number | null;
}
export interface GameMeta extends GameSummary {
@@ -83,6 +85,8 @@ export interface LockView {
/** Revealed hint tiers only. */
hints: string[];
hintsTotal: number;
/** What the next hint costs. */
hintPenaltySeconds: number;
wrongAttempts: number;
nudge: boolean;
successText: string | null;
@@ -162,7 +166,42 @@ export interface KeypadModuleView {
solved: boolean;
symbols: { id: string; label: string; pressed: boolean }[];
}
export type DefuseModuleView = WiresModuleView | ButtonModuleView | KeypadModuleView;
export interface PasswordsModuleView {
id: 'passwords';
solved: boolean;
/** The letters each column cycles through, top to bottom. */
columns: string[];
}
export interface MorseModuleView {
id: 'morse';
solved: boolean;
/** Same format as a signal clue. Never print it as text. */
signal: string;
/** Dial range in kHz (3500 = 3.500 MHz). */
minKhz: number;
maxKhz: number;
}
export interface SimonModuleView {
id: 'simon';
solved: boolean;
colors: string[];
/** The flashes of the current stage. */
flashes: string[];
stage: number;
stages: number;
/** Presses accepted so far in this stage. */
entered: number;
}
export type DefuseModuleView =
| WiresModuleView
| ButtonModuleView
| KeypadModuleView
| PasswordsModuleView
| MorseModuleView
| SimonModuleView;
export const DEFUSE_MODULES = ['wires', 'button', 'keypad', 'passwords', 'morse', 'simon'] as const;
export type DefuseModuleId = (typeof DEFUSE_MODULES)[number];
interface DefuseCommon {
engine: 'defuse';
@@ -175,7 +214,12 @@ interface DefuseCommon {
}
export interface TechnicianView extends DefuseCommon {
seat: 'technician';
device: { serial: string; batteries: number; modules: DefuseModuleView[] } | null;
device: {
serial: string;
batteries: number;
indicators: { label: string; lit: boolean }[];
modules: DefuseModuleView[];
} | null;
}
export interface ExpertView extends DefuseCommon {
seat: 'expert';
@@ -188,10 +232,18 @@ export type DefuseAction =
| { type: 'tap' }
| { type: 'hold' }
| { type: 'release' }
| { type: 'press'; symbol: string };
| { type: 'press'; symbol?: string; color?: string }
| { type: 'submit'; word: string }
| { type: 'transmit'; frequency: string };
// ---------- Sync engine ----------
export const SYNC_ROUND_TYPES = ['match', 'predict', 'telepathy', 'rank'] as const;
export type SyncRoundType = (typeof SYNC_ROUND_TYPES)[number];
/** An option index (match/predict), a typed word (telepathy), or item indexes, best first (rank). */
export type SyncAnswer = number | string | number[];
export interface SyncView {
engine: 'sync';
status: 'intro' | 'question' | 'reveal' | 'summary';
@@ -199,8 +251,9 @@ export interface SyncView {
index: number;
total: number;
title: string;
type: 'match' | 'predict';
type: SyncRoundType;
blurb: string;
/** Who the current question is about (predict and rank rounds). */
subject: Role | null;
};
isReplay: boolean;
@@ -208,12 +261,13 @@ export interface SyncView {
questionsPerRound: number;
pointsForKey: number;
points: number;
/** `options` holds the items to order in a rank round, and is empty for telepathy. */
question: { id: string; text: string; options: string[] } | null;
iAmSubject: boolean;
myAnswer: number | null;
myAnswer: SyncAnswer | null;
partnerAnswered: boolean;
/** Both answers, only once both are in. */
reveal: { A: number; B: number; match: boolean } | null;
reveal: { A: SyncAnswer; B: SyncAnswer; match: boolean } | null;
/** Match / miss for each question revealed so far this round. */
marks: boolean[];
summary: { earned: boolean; canReplay: boolean; keyName: string } | null;
@@ -222,12 +276,19 @@ export interface SyncView {
// ---------- Labyrinth engine ----------
export type Dir = 'n' | 'e' | 's' | 'w';
/** Forward / left / right / back, for mazes where the Explorer has no compass. */
export type RelDir = 'f' | 'l' | 'r' | 'b';
export type MoveDir = Dir | RelDir;
export interface ExplorerView {
engine: 'labyrinth';
seat: 'explorer';
glyphLabel: string | null;
open: Record<Dir, boolean>;
compass: 'absolute' | 'relative';
/** Keyed by n/e/s/w, or by f/l/r/b when the compass is relative. */
open: Partial<Record<MoveDir, boolean>>;
/** Directions blocked by a one-way gate rather than a wall. */
gates: MoveDir[];
keysCarried: number;
totalKeys: number;
atExit: boolean;
@@ -242,6 +303,9 @@ export interface NavigatorView {
grid: string[];
glyphs: { x: number; y: number; label: string }[];
lanterns: { x: number; y: number; name: string; collected: boolean }[];
/** One-way gates: passable from (x, y) in `dir` only. */
oneWay: { x: number; y: number; dir: Dir }[];
banner: string | null;
keysCarried: number;
totalKeys: number;
moves: number | null;
@@ -281,6 +345,9 @@ export interface RoomState {
finishedAt: number | null;
penaltySeconds: number;
serverNow: number;
/** Hard limit on elapsed + penalty time, if the game has one. */
limitSeconds: number | null;
limitLabel: string | null;
};
stats: { hintsUsed: number; wrongGuesses: number };
/** One view per role this socket may see: own role, or both in couch mode. */