A cast that resolved at once draws the sight line it was accepted on

The attack on the stack has always shown its line; a creation or a
curse resolved in the same breath showed nothing, so a legal aim
through a Visionstone and out a lettered opening (PPL7, move 309)
looked like a cheat. The line a cast was accepted on — plain, through
the one wall a VISIONSTONE dissolves, or AROUND THE CORNER's two legs —
now draws on the live board for a few seconds and on that move of any
reel, traced after the fact so the cast's own dust cloud cannot blind it.

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-16 23:05:32 -04:00
co-authored by Claude Fable 5.1
parent 12a655868b
commit 7d0c1c68a3
3 changed files with 112 additions and 42 deletions
+14 -2
View File
@@ -9,7 +9,7 @@
import { fpFxForEvents, smoothstep, type FpFx } from "./fpv/fx3d";
import { castRay, edgeMid } from "./fpv/raycast";
import { cutawayStand, aimOfEvents, gatherGlides, hurledIn, shortestArc, sightline } from "./fpv/director";
import { cardDef, isPermanentDuration, stackSightTrace } from "@wizwar/engine";
import { cardDef, isPermanentDuration, stackSightTrace, castSightTrace } from "@wizwar/engine";
import type { GameEvent, GameView } from "@wizwar/engine";
let {
@@ -187,7 +187,19 @@
// The reel draws the same sight line the live table shows for an LOS
// attack in progress, so a replay-watcher can see how a spell reached them.
const sightTrace = $derived(stackSightTrace(step.view));
/** The attack's line, or the line a cast in this step was accepted on —
* traced after the fact, so the cast's own dust cloud does not blind it. */
const sightTrace = $derived.by(() => {
const onStack = stackSightTrace(step.view);
if (onStack) return onStack;
for (let i = step.events.length - 1; i >= 0; i--) {
const e = step.events[i]!;
if (e.type !== "spellCast") continue;
const line = castSightTrace(step.view, e, step.events, true);
if (line) return line;
}
return null;
});
/** Every wall destroyed so far in the reel leaves a mound of rubble on
* the first-person floor for the rest of it. */