/** * Timed runs: a place you may only stay in for a set time, whether you are logged in or not. * * James, 2026-10-03: the rat caves gave never-ending XP, so a visit is capped by TIME instead. You get * TIMED_RUNS['rat-den'].durationMs inside, the rats keep coming for that long, then you are put back outside. The * harder caves to come ("complete them fast for good rewards") are the same thing with a shorter clock and a prize for * the time left over: add an entry here, a zone test in the backend (timedRun.ts) and a start where its door is. * * Not the same as timedAccess.ts. That is PAID time and a balance of milliseconds that only burns down while the * player is online. A run is free and a wall-clock deadline (`endsAtMs`), so it keeps running through a logout: the * character who closes the game inside a cave finds themselves outside when they come back. */ import { type TimedAreaId } from './timedAccess.js'; import { type WorldEventId } from './worldEvents.js'; /** The rat caves, a deep-sea trip on the Grey Gannet (deepSea.ts), and each Random World Event (worldEvents.ts) under its own id. */ export type TimedRunId = 'rat-den' | 'deep-sea' | WorldEventId; export type TimedRunDef = { id: TimedRunId; /** What the HUD timer calls it. */ label: string; /** How long a visit lasts. */ durationMs: number; }; export declare const TIMED_RUNS: Record; export declare function timedRunDef(id: TimedRunId): TimedRunDef; export declare function isTimedRunId(value: unknown): value is TimedRunId; /** Any place the HUD timer can be counting for: a paid area or a free timed run. */ export type TimedPlaceId = TimedAreaId | TimedRunId; /** The name the HUD timer shows for either kind. */ export declare function timedPlaceLabel(id: TimedPlaceId): string; /** A character's run in progress. One at a time: you can only be inside one timed place. */ export type TimedRun = { id: TimedRunId; /** Epoch milliseconds when time is up. */ endsAtMs: number; /** Which site of the kind (the forest den's id), so the way out is known after a relog. */ siteId?: string; }; /** * Reads a saved run. A hostile or corrupt document can never hold a character in a cave longer than one visit: the * deadline is capped at `nowMs` plus the run's own duration. */ export declare function normalizeTimedRun(raw: unknown, nowMs: number): TimedRun | null; export declare function startTimedRun(id: TimedRunId, nowMs: number, siteId?: string): TimedRun; export declare function timedRunRemainingMs(run: Pick, nowMs: number): number; //# sourceMappingURL=timedRun.d.ts.map