The dread wraps: fear's diamond continues from the opposite rim

The maze is a torus — a wizard walking through walls off one edge
arrives at the other, so the crow flies around the wrap too.
dreadDistance measures toroidal manhattan; the aura's wash wraps with
it. No rev-32 game has cast fear yet, so the measure corrects in
place; older vintages replay flat as they were played.

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 22:00:29 -04:00
co-authored by Claude Fable 5
parent bcd2155fe0
commit 0a0108c48c
2 changed files with 22 additions and 8 deletions
+8 -3
View File
@@ -181,16 +181,21 @@
});
// FEAR's dread: three spaces in every direction, straight through walls
// ("even if walls separate you"), never diagonally — a manhattan diamond,
// the same measure the engine's refusal takes.
// ("even if walls separate you"), never diagonally — and the maze wraps,
// so the diamond continues from the opposite rim. Same measure the
// engine's refusal takes.
const fearCells = $derived.by(() => {
const out = new Set<string>();
const W = view.board.width;
const H = view.board.height;
for (const fp of view.players) {
if (!fp.alive) continue;
if (!view.sustained.some((e) => e.cardId === "fear" && e.targetId === fp.id)) continue;
for (let dx = -3; dx <= 3; dx++) {
for (let dy = -3 + Math.abs(dx); dy <= 3 - Math.abs(dx); dy++) {
const k = `${fp.position.x + dx},${fp.position.y + dy}`;
const wx = ((fp.position.x + dx) % W + W) % W;
const wy = ((fp.position.y + dy) % H + H) % H;
const k = `${wx},${wy}`;
if (view.board.cells[k]) out.add(k);
}
}