V1.2.0
Bring games 9-18 in line with GAMES-NEW.md: - Library sorts easiest first, filters by category and difficulty; difficulty 5 shows a Nightmare chip, and a no-hint finish earns Nightmare Survivors. - Time limits end on "Out of time" (no rank); Deep Lab Nereid's countdown is a rising water gauge behind the header. - Evidence Locker search, chapter filter and starred clues (partner sees a count). - One-shot accusations ask "One shot. Are you both sure?" first. - Symbol font fallback, tight monospace blocks for grids/keypads/SQL. - Rank rounds reorder by drag or up/down buttons; reveal highlights #1 and #4. - Telepathy capped at 30 characters; maze:move accepts forward/left/right/back; gate buttons read "Gate (won't open from this side)". - Overtime solver tables checked against Appendix A; keypad generator re-rolls. - More content checks (rank items, password fixtures, glyphs/gates on traps) and sanitize tests for all ten new games. - GAMES.md carries the full spoiler guide for 9-18. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,8 @@ export interface StoryState {
|
||||
agreed: boolean;
|
||||
attempts: number;
|
||||
};
|
||||
/** Starred clue ids per role. The partner only ever learns how many. */
|
||||
pins?: Partial<Record<Role, string[]>>;
|
||||
}
|
||||
|
||||
export function initStory(): StoryState {
|
||||
@@ -30,6 +32,7 @@ export function initStory(): StoryState {
|
||||
wrong: {},
|
||||
lastSubmit: {},
|
||||
finale: { proposal: null, agreed: false, attempts: 0 },
|
||||
pins: {},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -53,6 +56,7 @@ export function tickStory(game: StoryGame, ctx: Ctx): boolean {
|
||||
false,
|
||||
finale.failEnding ?? "**Time's up.** The clock beat you this time. Run it back?",
|
||||
finale.type === 'accusation' ? finale.reveal : null,
|
||||
true,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
@@ -109,6 +113,24 @@ export function requestHint(game: StoryGame, ctx: Ctx, lockId: string): ActionRe
|
||||
return OK;
|
||||
}
|
||||
|
||||
/** Every clue id this role can see so far. */
|
||||
export function visibleClueIds(game: StoryGame, s: StoryState, role: Role): string[] {
|
||||
const chapters = game.chapters.slice(0, Math.min(s.chapter, game.chapters.length - 1) + 1);
|
||||
const ids = chapters.flatMap((ch) => [...ch.clues[role], ...ch.clues.shared].map((c) => c.id));
|
||||
if (atFinale(game, s) && game.finale.type === 'escape') ids.push(...game.finale.clues[role].map((c) => c.id));
|
||||
return ids;
|
||||
}
|
||||
|
||||
/** Stars or un-stars one of your own clues. */
|
||||
export function togglePin(game: StoryGame, ctx: Ctx, role: Role, clueId: string): ActionResult {
|
||||
const s = state(ctx);
|
||||
if (!visibleClueIds(game, s, role).includes(clueId)) return fail('no_clue', "You don't have that clue.");
|
||||
const pins = (s.pins ??= {});
|
||||
const mine = pins[role] ?? [];
|
||||
pins[role] = mine.includes(clueId) ? mine.filter((id) => id !== clueId) : [...mine, clueId];
|
||||
return OK;
|
||||
}
|
||||
|
||||
export function continueChapter(game: StoryGame, ctx: Ctx): ActionResult {
|
||||
const s = state(ctx);
|
||||
if (!s.awaitingContinue) return fail('not_ready', 'Solve the lock first.');
|
||||
|
||||
Reference in New Issue
Block a user