diff --git a/packages/web/src/App.svelte b/packages/web/src/App.svelte index 2a0b7d8..8edc4f8 100644 --- a/packages/web/src/App.svelte +++ b/packages/web/src/App.svelte @@ -294,7 +294,15 @@ /** pick-lock / master-key: prop the door for others once it opens. */ let holdDoor = $state(false); /** mega-monster: which stat the chosen monster doubles. */ - let megaBoost = $state<"life" | "movement">("life"); + /** MEGA-MONSTER aimed at a monster: which of its two numbers to double. */ + let megaPrompt = $state<{ instanceId: string; creatureId: string } | null>(null); + function castMega(boost: "life" | "movement") { + const m = megaPrompt; + if (!m) return; + megaPrompt = null; + dispatch(withMods({ type: "cast", instanceId: m.instanceId, target: { kind: "creature", creatureId: m.creatureId }, params: { boost } })); + clearSelection(); + } /** teleport: the marked destination awaiting its confirming second tap. */ let pendingTeleport = $state<{ x: number; y: number } | null>(null); /** Cards marked for discard. */ @@ -536,7 +544,6 @@ tradeFrom = null; selectedCreature = null; selectedCard = null; - megaBoost = "life"; holdDoor = false; pickChoice = false; pendingTeleport = null; @@ -1054,11 +1061,16 @@ clickCell(creature.position); return; } + if (selectedCard && selectedCard.cardId === "mega-monster") { + // "Doubles the existing life-points OR movement rate": the choice is + // asked, not defaulted — the cast waits on the answer. + megaPrompt = { instanceId: selectedCard.instanceId, creatureId }; + return; + } if (selectedCard && (CREATURE_TARGET_CARDS.has(selectedCard.cardId) || cardDef(selectedCard.cardId).cardType === "attack")) { dispatch(withMods({ type: "cast", instanceId: selectedCard.instanceId, target: { kind: "creature", creatureId }, - ...(selectedCard.cardId === "mega-monster" ? { params: { boost: megaBoost } } : {}), })); clearSelection(); return; @@ -1681,6 +1693,27 @@ {/if} {/if} + {#if megaPrompt && view} + {@const beast = view.creatures.find((c) => c.id === megaPrompt!.creatureId)} +