Skip to content

chooseNumber

Sent when the engine needs the player to choose an integer — for example, how many times to replicate a spell, or a value for an “X” choice that isn’t part of a mana cost.

input.type is "chooseNumber". The remaining fields:

interface ChooseNumberInput {
presentation: PromptPresentation;
min: number;
max: number;
}

References: PromptPresentation

How the field is presented depends on the size of the range — both forms send the same numberDecision response.

A row of number buttons from 4 to 12

For a small range the client enumerates every legal value as a button. The player taps one and the choice is sent immediately — no confirm step.

A number stepper with a free-entry field

For a large range it falls back to a free-entry stepper: the player types or steps to a value within [min, max], then confirms.

type ChooseNumberOutput = { type: "numberDecision"; chosenNumber: number | null };

chosenNumber is null only if the choice is cancelled where cancelling is legal; otherwise return the chosen integer in [min, max].

{
"promptId": 7,
"decidingPlayerId": "player-0",
"input": {
"type": "chooseNumber",
"presentation": {
"title": "Replicate",
"description": "Choose how many times to copy this spell.",
"text": "Pay {2} for each replicate.",
"targets": []
},
"min": 0,
"max": 5
}
}
{ "promptId": 7, "output": { "type": "numberDecision", "chosenNumber": 3 } }