diff --git a/packages/web/src/App.svelte b/packages/web/src/App.svelte index b2f6172..6195616 100644 --- a/packages/web/src/App.svelte +++ b/packages/web/src/App.svelte @@ -470,7 +470,11 @@ return; } if (selectedCard?.cardId === "boobytrap") { - trapCells = [...trapCells, cell]; + // Tapping a placed token lifts it again; the four must be distinct. + const already = trapCells.findIndex((c) => cellKey(c) === cellKey(cell)); + trapCells = already !== -1 + ? trapCells.filter((_, i) => i !== already) + : [...trapCells, cell]; if (trapCells.length === 4) { dispatch({ type: "cast", instanceId: selectedCard.instanceId, params: { cells: trapCells } }); clearSelection(); @@ -1224,6 +1228,7 @@ onCreatureClick={clickCreature} onWarpClick={clickWarp} markedCell={tradeFrom ?? pendingTeleport} + markedCells={trapCells.length > 0 ? trapCells : null} markedSector={pendingSectorOrigin} ghostSlots={relocateGhosts} onGhostClick={clickGhostSlot} diff --git a/packages/web/src/Board.svelte b/packages/web/src/Board.svelte index 6100ab1..9dd67b6 100644 --- a/packages/web/src/Board.svelte +++ b/packages/web/src/Board.svelte @@ -17,6 +17,7 @@ onWarpClick, onCellPeek, markedCell = null, + markedCells = null, litCells = null, markedSector = null, ghostSlots = null, @@ -34,6 +35,9 @@ onCellPeek?: (cell: { x: number; y: number }) => void; /** First square of a two-square spell: marked so the click reads as taken. */ markedCell?: { x: number; y: number } | null; + /** A multi-square placement in progress (boobytrap tokens), in click + * order — the first is the real trap, so each mark shows its number. */ + markedCells?: { x: number; y: number }[] | null; /** When set, squares NOT in this set dim — the targeting aid. */ litCells?: Set | null; /** Origin of a picked-up 5x5 sector: the whole sector outlines as taken. */ @@ -430,6 +434,19 @@ /> {/if} + + {#each markedCells ?? [] as m, i (`${m.x},${m.y}`)} + + {i + 1} + {/each} + {#if markedSector}