ADD joins two number cards on movement, as printed

"You may add two NUMBER cards together for any single action" —
movement included. The engine accepts a second movement number when an
ADD accompanies it (once per turn); the client spends your Add
automatically and says so on the button. 120 tests passing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Eric Wagoner
2026-08-15 23:41:37 -04:00
co-authored by Claude Fable 5
parent 42ea9b8f2c
commit 89961bbb59
3 changed files with 52 additions and 7 deletions
+12 -3
View File
@@ -149,8 +149,17 @@
]);
function playNumberForMovement() {
if (!selectedCard) return;
net.command({ type: "playNumberForMovement", instanceId: selectedCard.instanceId });
if (!selectedCard || !view) return;
const cmd: Parameters<typeof net.command>[0] = {
type: "playNumberForMovement",
instanceId: selectedCard.instanceId,
};
// A second movement number needs an ADD — spend one from hand automatically.
if (view.turn.numberPlayedForMovement) {
const add = view.yourHand.find((c) => c.cardId === "add");
if (add) cmd.addInstanceId = add.instanceId;
}
net.command(cmd);
clearSelection();
}
@@ -592,7 +601,7 @@
{/if}
{#if selectedCard && isNumberCard(selectedCard.cardId)}
<button class="stamp tiny" onclick={playNumberForMovement}>
Play for +{cardDef(selectedCard.cardId).value} movement
Play for +{cardDef(selectedCard.cardId).value} movement{view.turn.numberPlayedForMovement ? " (uses your Add)" : ""}
</button>
{/if}
<button class="hint-cancel" onclick={clearSelection}>cancel</button>