Idiot enforces its card (rev 23) + attack sight-line tracing
Rules rev 23 — IDIOT, per the card and FAQ: - No handling items: pick up / drop of treasures and objects refused (dropping was the exploit: capturing a stolen treasure on your own home, or dropping your own treasure underfoot for an instant cure) - No punching, no thrown dagger / large rock (attacks on players) - No effect on a victim already carrying one of their own treasures Ungated (permissive): counteractions are now castable while idiotized (the one thing the card expressly allows — the gate wrongly blocked them), and goal-aiding spells (IDIOT_AIDS: destroy-wall, teleport, mad-dash, ...) per the FAQ's 'you could, however, destroy a wall'. Sight tracing: while an LOS attack sits on the stack, the board draws the line it traveled — straight when direct, leg by leg through both warp mouths (with pulsing rings) when the maze's wraparound carried it. Engine traceSight/traceSightFor/stackSightTrace; overlay in Board.svelte; shown live and in replays. Verified against H3PC's cross-board Idiot cast. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138A8CjeQRpvzKxuMfz1Bqc
This commit is contained in:
co-authored by
Claude Fable 5
parent
7372bfc5e8
commit
cdeb3d5103
@@ -360,6 +360,41 @@ export function hasWarpLineOfSight(
|
||||
to: Cell,
|
||||
blockedCells?: Record<string, true>,
|
||||
): boolean {
|
||||
return warpSightTrace(board, from, to, blockedCells) !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* How a sight line reached its target — the material for drawing it. A warp
|
||||
* trace carries the two mouths and the exact rim-crossing points (in board
|
||||
* coordinates, where cell (x,y) spans [x,x+1]) so a renderer can draw the
|
||||
* near leg to `entry` and the far leg from `exit`.
|
||||
*/
|
||||
export type SightTrace =
|
||||
| { kind: "direct" }
|
||||
| {
|
||||
kind: "warp";
|
||||
mouthA: { cell: Cell; side: Side };
|
||||
mouthB: { cell: Cell; side: Side };
|
||||
entry: { x: number; y: number };
|
||||
exit: { x: number; y: number };
|
||||
};
|
||||
|
||||
export function traceSight(
|
||||
board: AssembledBoard,
|
||||
from: Cell,
|
||||
to: Cell,
|
||||
blockedCells?: Record<string, true>,
|
||||
): SightTrace | null {
|
||||
if (hasLineOfSight(board, from, to, blockedCells)) return { kind: "direct" };
|
||||
return warpSightTrace(board, from, to, blockedCells);
|
||||
}
|
||||
|
||||
function warpSightTrace(
|
||||
board: AssembledBoard,
|
||||
from: Cell,
|
||||
to: Cell,
|
||||
blockedCells?: Record<string, true>,
|
||||
): Extract<SightTrace, { kind: "warp" }> | null {
|
||||
const DIR: Record<Side, { x: number; y: number }> = {
|
||||
N: { x: 0, y: -1 }, S: { x: 0, y: 1 }, E: { x: 1, y: 0 }, W: { x: -1, y: 0 },
|
||||
};
|
||||
@@ -423,10 +458,16 @@ export function hasWarpLineOfSight(
|
||||
segmentClear(board, Pfar.x, Pfar.y, to.x + 0.5, to.y + 0.5, blockedCells,
|
||||
[cellKey(to), cellKey(mouthB)])
|
||||
) {
|
||||
return true;
|
||||
return {
|
||||
kind: "warp",
|
||||
mouthA: { cell: mouthA, side: sideA },
|
||||
mouthB: { cell: mouthB, side: w.to.side },
|
||||
entry: P,
|
||||
exit: Pfar,
|
||||
};
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
/** The game's full line-of-sight check: direct, or through a wraparound opening. */
|
||||
|
||||
Reference in New Issue
Block a user