Fear's spaces are walked, not flown — warps carry the dread

The owner caught the metric: a wizard eight squares away as the crow
flies stood three WALKED spaces away through a warp, and the manhattan
check waved it through (while falsely blocking approaches manhattan-
near through solid walls). fearRepels now measures walkingDistance —
the same BFS the maze walks, warps included, walls respected. The
board's aura follows suit: the diamond becomes a violet wash on every
square within three walked spaces, computed by the same BFS, warp
mouths included. No rev-32 ledger existed yet, so the metric corrects
inside rev 32.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138A8CjeQRpvzKxuMfz1Bqc
This commit is contained in:
Eric Wagoner
2026-08-19 21:34:15 -04:00
co-authored by Claude Fable 5
parent 644d651ae0
commit 410ebc0135
3 changed files with 39 additions and 12 deletions
+4 -2
View File
@@ -3726,8 +3726,10 @@ function fearRepels(state: GameState, moverId: PlayerId | null, from: Cell, to:
for (const other of state.players) {
if (!other.alive || other.id === moverId) continue;
if (sustainedOn(state, other.id, "fear").length === 0) continue;
const d = Math.abs(other.position.x - to.x) + Math.abs(other.position.y - to.y);
const dBefore = Math.abs(other.position.x - from.x) + Math.abs(other.position.y - from.y);
// "Spaces" are counted through the maze — warps included, walls
// respected — exactly as feet would walk them.
const d = walkingDistance(state, other.position, to);
const dBefore = walkingDistance(state, other.position, from);
if (d <= 3 && d < dBefore) return true;
}
return false;
+1 -1
View File
@@ -739,7 +739,7 @@ describe("fear holds off monsters and unwilling feet alike (rules rev 32)", () =
wallPassesPerTurn: 0, wallPassUsed: 0, attackUsed: false, justCreated: false,
scorchedThisTurn: [],
} as never);
state.edgeOverrides[edgeKey({ x: 2, y: 8 }, "S")] = "open";
for (const y of [5, 6, 7, 8]) state.edgeOverrides[edgeKey({ x: 2, y }, "S")] = "open";
while (state.players[state.turn.activeIndex]!.id !== "a") {
const r = applyCommand(state, state.players[state.turn.activeIndex]!.id, { type: "endTurn", draw: 0 });
if (!r.ok) throw new Error(r.error);