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)} +
+
+
Mega-Monster: the {beast ? cardDef(beast.kind).name : "monster"} grows
+
+ "Doubles the existing life-points OR movement rate of any one monster." Which? + {#if beast} + Now {Number.isFinite(beast.maxDamage) ? `${beast.maxDamage - beast.damage} of ${beast.maxDamage} hits` : "unkillable"} + and {beast.movesPerTurn} move{beast.movesPerTurn === 1 ? "" : "s"} a turn. + {/if} +
+
+ + + +
+
+
+ {/if} + {#if view?.pushPending && view.pushPending.pusheeId === view.you}
@@ -2424,12 +2457,7 @@ {/if} {/if} {#if selectedCard?.cardId === "mega-monster"} - — double its - - - — then tap the monster + — tap the monster, then choose whether to double its life-points or its movement {/if} {#if selectedCard?.cardId === "pick-lock" || selectedCard?.cardId === "master-key"}