From 6e6691c6c0e70f2cf818755d1499f2570ac6dce0 Mon Sep 17 00:00:00 2001 From: Eric Wagoner Date: Sun, 16 Aug 2026 10:46:35 -0400 Subject: [PATCH] Creatures step through board-edge warps by click, like wizards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The engine always warped a creature marched off a lettered opening — verified headless — but the table offered no way to ask for it: cell clicks for a selected creature matched only geometric neighbors, and the warp arrows moved only your wizard. Now a selected creature standing on an opening lights the arrow (and, per the existing cue, its destination), the arrow marches the creature through, and clicking the far mouth directly does the same. Co-Authored-By: Claude Fable 5 --- packages/web/src/App.svelte | 16 +++++++++++++--- packages/web/src/Board.svelte | 4 +++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/web/src/App.svelte b/packages/web/src/App.svelte index ebc9a04..7ec8d20 100644 --- a/packages/web/src/App.svelte +++ b/packages/web/src/App.svelte @@ -348,6 +348,13 @@ return; } } + // Standing on a board-edge opening: clicking the far mouth warps it. + const w = view.board.warps.find((w) => + cellKey(w.from.cell) === cellKey(creature.position) && cellKey(w.to.cell) === cellKey(cell)); + if (w) { + dispatch({ type: "moveCreature", creatureId: selectedCreature, direction: w.from.side }); + return; + } } selectedCreature = null; return; @@ -404,9 +411,12 @@ function clickWarp(cell: { x: number; y: number }, side: Side) { if (!view || !isYourTurn || !me) return; - // Standing on the opening: step through. Otherwise treat it as a cell - // click on the opening square (e.g. to walk toward it). - if (me.position.x === cell.x && me.position.y === cell.y) { + // Standing on the opening: step through — the selected creature first, + // your wizard otherwise. Elsewhere it is just a cell click. + const creature = selectedCreature ? view.creatures.find((c) => c.id === selectedCreature) : null; + if (creature && creature.position.x === cell.x && creature.position.y === cell.y) { + dispatch({ type: "moveCreature", creatureId: creature.id, direction: side }); + } else if (me.position.x === cell.x && me.position.y === cell.y) { dispatch({ type: "move", direction: side }); } else { clickCell(cell); diff --git a/packages/web/src/Board.svelte b/packages/web/src/Board.svelte index 0a875c6..d597671 100644 --- a/packages/web/src/Board.svelte +++ b/packages/web/src/Board.svelte @@ -329,7 +329,9 @@ {@const wy = w.from.cell.y * CELL + CELL / 2 + (w.from.side === "S" ? CELL * 0.42 : w.from.side === "N" ? -CELL * 0.42 : 0)} {@const standing = view.players.some((p) => - p.id === view.you && p.position.x === w.from.cell.x && p.position.y === w.from.cell.y)} + p.id === view.you && p.position.x === w.from.cell.x && p.position.y === w.from.cell.y) || + view.creatures.some((c) => c.id === selectedCreatureId && + c.position.x === w.from.cell.x && c.position.y === w.from.cell.y)} {@const letter = warpLetters.get(`${w.from.cell.x},${w.from.cell.y}`) ?? ""}