Resolve the single target combatant of an automated attack from the
client's targeted tokens. Automated combat targets a combatant, not just a
token: tokens that are not combatants of the current combat are ignored, so a
player may have other (non-combatant) tokens targeted without ambiguity.
Exactly one targeted token must map to a combatant — zero or more than one
throws (with a user-facing message).
Pure: targeted is the current target list and toCombatant maps a token to
its combatant (or null), so the rule is unit-testable without canvas/combat
globals.
Resolve the single target combatant of an automated attack from the client's targeted tokens. Automated combat targets a combatant, not just a token: tokens that are not combatants of the current combat are ignored, so a player may have other (non-combatant) tokens targeted without ambiguity. Exactly one targeted token must map to a combatant — zero or more than one throws (with a user-facing message).
Pure:
targetedis the current target list andtoCombatantmaps a token to its combatant (ornull), so the rule is unit-testable without canvas/combat globals.