chooseBoardTargets
Sent when a spell or ability needs targets chosen from the board — players, permanents, or spells on the stack. For example, picking the creature or player Lightning Bolt will deal 3 damage to.
Arguments
Section titled “Arguments”input.type is "chooseBoardTargets". The remaining fields:
interface ChooseBoardTargetsInput { presentation: PromptPresentation; candidates: Array<TargetRef>; hostile: boolean; intent: TargetingIntent; minTargets: number; maxTargets: number; chosenTargets: number; cancellable: boolean;}#[serde(rename_all = "camelCase")]pub struct ChooseBoardTargetsInput { pub presentation: PromptPresentation, pub candidates: Vec<TargetRef>, #[serde(default)] pub hostile: bool, pub intent: TargetingIntent, pub min_targets: i32, pub max_targets: i32, pub chosen_targets: i32, pub cancellable: bool,}
References: PromptPresentation , TargetRef , TargetingIntent
Each candidates entry is a TargetRef:
| Field | Type | Description |
|---|---|---|
kind | "player" | "card" | "spell" | What kind of object the target is. |
id | string | Id of the player/card/spell. |
Response
Section titled “Response”type ChooseBoardTargetsOutput = { type: "boardTargets"; chosen: TargetRef[] };Return the chosen TargetRefs — between minTargets and maxTargets of them,
drawn from candidates.
Example
Section titled “Example”{ "promptId": 5, "decidingPlayerId": "player-0", "sourceCard": { "id": "hand-2", "identity": { "name": "Lightning Bolt", "setCode": "M11", "cardNumber": "149", "isToken": false }, "color": "R", "manaCost": "{R}", "cmc": 1, "types": ["Instant"], "subtypes": [], "supertypes": [], "power": null, "toughness": null, "text": "Lightning Bolt deals 3 damage to any target.", "controllerId": "player-0", "ownerId": "player-0", "tapped": false, "keywords": [], "counters": {}, "damage": 0, "summoningSick": false, "isDoubleFaced": false, "isTransformed": false, "isFaceDown": false, "isBestowed": false, "phasedOut": false, "exerted": false }, "input": { "type": "chooseBoardTargets", "candidates": [ { "kind": "player", "id": "player-1" }, { "kind": "card", "id": "bf-7" } ], "hostile": true, "intent": "damage", "minTargets": 1, "maxTargets": 1, "chosenTargets": 0, "label": "Damage" }}{ "kind": "response", "promptId": 5, "action": { "type": "chooseBoardTargets", "output": { "type": "boardTargets", "chosen": [ { "kind": "card", "id": "bf-7" } ] } }}