chooseAttackers
Sent during the declare-attackers step of combat. The engine tells the client which creatures are able to attack and which players, planeswalkers, or battles each one may attack — for example, choosing to swing with a Grizzly Bears at the opponent’s face while leaving an untapped blocker back.
Arguments
Section titled “Arguments”input.type is "chooseAttackers". The remaining fields:
interface ChooseAttackersInput { attackers: Array<AttackerOptionDto>; attackTargets: Array<AttackTargetDto>;}#[serde(rename_all = "camelCase")]pub struct ChooseAttackersInput { pub attackers: Vec<AttackerOptionDto>, pub attack_targets: Vec<AttackTargetDto>,}
References: AttackTargetDto , AttackerOptionDto
Response
Section titled “Response”type ChooseAttackersOutput = { type: "declareAttackers"; assignments: AttackAssignment[] };type AttackAssignment = { attackerId: string; targetId: string };Return one AttackAssignment per attacking creature: each assignment sends one
creature at one target. Creatures the player chooses not to attack with are
simply omitted.
Example
Section titled “Example”{ "promptId": 7, "decidingPlayerId": "player-0", "input": { "type": "chooseAttackers", "attackers": [ { "attackerId": "bf-3", "validTargetIds": ["player-1", "pw-1"] }, { "attackerId": "bf-4", "validTargetIds": ["player-1", "pw-1"] } ], "attackTargets": [ { "id": "player-1", "label": "Opponent", "kind": "player" }, { "id": "pw-1", "label": "Jace, the Mind Sculptor", "kind": "planeswalker" } ] }}{ "promptId": 7, "output": { "type": "declareAttackers", "assignments": [ { "attackerId": "bf-3", "targetId": "player-1" }, { "attackerId": "bf-4", "targetId": "pw-1" } ] }}