diff --git a/packages/web/src/App.svelte b/packages/web/src/App.svelte index 6bd71c4..cc15c37 100644 --- a/packages/web/src/App.svelte +++ b/packages/web/src/App.svelte @@ -108,6 +108,17 @@ ); const youMustDiscard = $derived(view != null && view.pendingDiscard === view.you); const youMustShield = $derived(view?.chaosPending?.queue[0] === view?.you && view != null); + /** Picking up an object ends the turn's actions: the hand goes quiet until + * the draw — but never while a counter, shield, or discard is owed. */ + const actionsSpent = $derived( + view != null && isYourTurn && view.turn.actionsEnded && + !youMustRespond && !youMustShield && !youMustDiscard, + ); + const commandedCreature = $derived( + selectedCreature && view + ? (view.creatures.find((c) => c.id === selectedCreature) ?? null) + : null, + ); const holdingWard = $derived(view?.yourHand.some((c) => c.cardId === "ward") ?? false); /** A live moment to interrupt: another wizard acts, no attack is pending. */ const canInterruptNow = $derived( @@ -228,6 +239,7 @@ discardSelection = next; return; } + if (actionsSpent) return; // picking up an object ended the turn's actions if (!isYourTurn) { // Live interruption: Interrupt / Opportunity Fire may be played during // another player's turn (when no attack is pending). @@ -571,15 +583,10 @@ } const mine = creature.controllerId === view.you || creature.kind === "democratic-monster"; if (mine) { - const selecting = selectedCreature !== creatureId; - selectedCreature = selecting ? creatureId : null; - if (selecting) { - peekCard = { instanceId: `peek-${creature.kind}`, cardId: creature.kind }; - peekCreatureId = creature.id; - } else { - peekCard = null; - peekCreatureId = null; - } + // Commanding your own creature docks its card in the rail instead of + // opening the centered peek — a modal would block the very board + // squares you are about to march it across. + selectedCreature = selectedCreature !== creatureId ? creatureId : null; } else { peekAt(creature.position); } @@ -1153,6 +1160,18 @@ Tap its token to command it. {/each} + {#if commandedCreature} +