Credibility pass: one teleport step, one bell, one step type, and the comments that argued are gone

Since 6e49fc9. Engine: the teleport BFS in the view and the engine's
wallIgnoringDistance share teleportStep; the counter trail is weighed
between steps instead of on six arms; the bush attack takes its
adjacency from SIDES like the wall does; a dead redirected clause, a
one-member set, an identity ternary, and a stray try/catch are gone;
two tests now assert what their names promise. Server: KEEPER and
MAX_SEATS live in rooms.ts, the three Sentry bells ring through one
helper, the unread reply field is dropped, actingSeat comes from the
engine, and the protocol header names every message. Web: ReplayStep
is one type, cardName one helper, the say box and the reference section
one snippet each, the keeper's name arrives from the server rather than
the source, and the lifesaver ruling that ruled nothing is out.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
This commit is contained in:
Eric Wagoner
2026-09-22 09:56:49 -04:00
co-authored by Claude Fable 5.1
parent c4a555f8df
commit 66b5c06f17
21 changed files with 245 additions and 239 deletions
+8 -5
View File
@@ -2,9 +2,12 @@
// read from the missed steps as the server redacted them for you, so it
// tells you only what you would have seen at the table.
import { cardDef, type GameEvent, type GameView } from "@wizwar/engine";
import type { GameEvent, GameView } from "@wizwar/engine";
import { cardName } from "./reference";
export interface MissedStep {
/** One step of a replayed stretch: who acted, what happened, the table
* after, and any talk that landed alongside. */
export interface ReplayStep {
seq: number;
actor: string;
events: GameEvent[];
@@ -19,8 +22,7 @@ export interface MissedFact {
}
function spell(id: string | null): string {
if (!id) return "a punch";
try { return cardDef(id).name; } catch { return id; }
return id ? cardName(id) : "a punch";
}
function nearHome(view: GameView, you: string, cell: { x: number; y: number }): boolean {
@@ -31,7 +33,7 @@ function nearHome(view: GameView, you: string, cell: { x: number; y: number }):
/** The facts of the missed steps that touch you, in order, capped so the
* slip stays a slip. Each fact points at its step for the reel. */
export function summarizeMissed(steps: readonly MissedStep[], you: string, now: GameView | null): MissedFact[] {
export function summarizeMissed(steps: readonly ReplayStep[], you: string, now: GameView | null): MissedFact[] {
const facts: MissedFact[] = [];
let lifeLost = 0;
let lifeLostStep = -1;
@@ -77,6 +79,7 @@ export function summarizeMissed(steps: readonly MissedStep[], you: string, now:
}
}
});
// Life lost reads second: the first fact names who came for you.
if (lifeLost > 0) facts.splice(Math.min(facts.length, 1), 0, { text: `You lost ${lifeLost} life.`, step: lifeLostStep });
if (facts.length === 0) {
// Nothing touched you: say what each wizard was up to, all the same.