Skip to content

chooseFromSelection

Sent when the player must choose modes of a modal spell — for example, picking “choose one or both” on a charm, or selecting the modes of a Command.

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

interface ChooseFromSelectionInput {
presentation: PromptPresentation;
options: Array<string>;
minChoices: number;
maxChoices: number;
}

References: PromptPresentation

The control depends on how many options may be chosen.

A list of single-choice option buttons

For a single choice (maxChoices of 1) the options are plain buttons — clicking one sends it immediately.

Option rows with checkboxes and a confirm button

For multiple choices each option gets a checkbox and a counter; the player selects within minChoicesmaxChoices, then confirms.

Beyond six options the list collapses into a type-to-filter field (search and pick), keeping long lists manageable.

type ChooseFromSelectionOutput = { type: "selectionDecision"; chosenIndices: number[] };

Return the indices (into options) of the chosen modes.

{
"promptId": 7,
"decidingPlayerId": "player-0",
"input": {
"type": "chooseFromSelection",
"presentation": {
"title": "Choose one or both",
"targets": []
},
"options": ["Destroy target artifact.", "Destroy target enchantment."],
"minChoices": 1,
"maxChoices": 2
}
}
{ "promptId": 7, "output": { "type": "selectionDecision", "chosenIndices": [0] } }