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.

Each option carries a weight, and the selection is constrained by total weight: the sum of the chosen options’ weights must land within minTotalmaxTotal. For ordinary modal choices every weight is 1, so the totals are simply choice counts. Pawprint cards (“choose up to five {P} worth of modes”) use the weights as pawprint costs. An option with canRepeat may be chosen more than once.

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

interface ChooseFromSelectionInput {
presentation: PromptPresentation;
options: Array<SelectionOption>;
minTotal: number;
maxTotal: number;
}

References: PromptPresentation , SelectionOption

The control depends on how many options may be chosen.

A list of single-choice option buttons

For a single choice (maxTotal 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 minTotalmaxTotal, then confirms.

Mode rows prefixed with pawprint pips and a running total against a budget

For more complex situations, it is possible to use the additional fields canRepeat and weight to properly prompt for a response.

Clicking a canRepeat option adds another copy of it and its row shows the count with a stepper to remove copies; the counter tracks the running weight total against maxTotal.

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. An index may appear more than once only when its option has canRepeat, and the summed weights of the chosen options must be within minTotalmaxTotal.

{
"promptId": 7,
"decidingPlayerId": "player-0",
"input": {
"type": "chooseFromSelection",
"presentation": {
"title": "Choose one or both",
"targets": []
},
"options": [
{ "label": "Destroy target artifact.", "weight": 1, "canRepeat": false },
{ "label": "Destroy target enchantment.", "weight": 1, "canRepeat": false }
],
"minTotal": 1,
"maxTotal": 2
}
}
{
"kind": "response",
"promptId": 7,
"action": {
"type": "chooseFromSelection",
"output": {
"type": "selectionDecision",
"chosenIndices": [
0
]
}
}
}