Skip to main content

Target Selection

Guide

Keep card text, player input, and FlowGraph target resolution aligned so every rule affects only its intended objects

Card Target defines player input

Editor LabelRuntime EnumPlayer actionExpected source in Behavior
NoneCardTargetMode.NoneSelect no unitThe Graph decides whether it needs a unit, card, or no target
Single EnemyCardTargetMode.SingleEnemyUnitSelect one living enemyOpponent reads the submitted enemy from Card Context
All EnemiesCardTargetMode.AllEnemyUnitsSelect no unitAllEnemies resolves every living enemy
SelfCardTargetMode.SelfSelect no unitSelf resolves the player

Single Enemy: Before the UI submits the selection, the card shows the pending target with an aiming arrow and unit highlight.

A Single Enemy card targeting one highlighted living enemy

All Enemies: The card skips this selection. Its Behavior must resolve AllEnemies so every living enemy receives the range effect promised by the text. Meteor Strike therefore displays the same damage on all three enemies.

Meteor Strike resolving 15 damage on three living enemies at the same time

UnitSource resolves units from context

SourceResolved result
SelfThe current Host: the player in a player Card, the owner in a Status, or the acting enemy in an Enemy Graph
OpponentFor a Player Host, the submitted living enemy, falling back to the first living enemy when none was submitted. For an Enemy Host, the player
AllEnemiesEvery living enemy, excluding dead units
AllUnitsThe living player and all living enemies

Use Self for healing, armor, and self-Buffs, Opponent for a single-target card effect on the selected enemy, and AllEnemies for area rules.

A connected Target Port overrides the Source Field

When a node has both a target input pin, or Target Port, and a static target field, or Source Field, the connection takes priority.

  • Connected pin: The node uses the value or reference supplied by the connection. The TargetSource dropdown in the static panel is ignored automatically.
  • Unconnected pin: The node falls back to the default contextual target selected in TargetSource, such as Self or Active Unit.

CardSource and live card-instance resolution

CardSource resolves matching card-instance collections at runtime. Whenever a downstream node executes, these Sources read the latest state from the current battle.

SourceResolved result
ThisCardThe CardInstance currently resolving
HandPileThe current hand
DrawPileThe current draw pile
DiscardPileThe current discard pile
ExhaustPileThe current exhaust pile
AllPilesThe combined hand, draw pile, discard pile, and exhaust pile

Filtering Selector collections

Use a Selector when game logic, rather than manual player input, decides the target of a card effect. Connections can filter, sort, and limit an initial collection until only the exact target objects remain.

  • Filter: Retains objects that meet specific conditions, such as damage cards or enemies carrying Poison.
  • Sort: Orders the retained objects, such as highest to lowest cost or lowest to highest HP.
  • Pick / Take / Random: Extracts the exact objects needed by the next Action, such as 1 random card or the first 2 elements.

The graph below filters the draw pile to all Basic Attack cards, selects one at random, then moves it into the hand.

Card Piles passing through Filter and Random Elements before Move Cards moves one matching card into the hand

Unit selection follows the same logic. To resolve the enemy with the lowest HP, connect All Enemies to a Filter that retains living units, connect that to a Sort ordered by ascending HP, then use Pick Element to extract the first element and pass it to the damage node.

Fault tolerance and design rules for empty results

Runtime fault tolerance through silent execution

Built-in FlowGraph Actions protect against empty values.

  • When an Action resolves its targets, it skips missing, dead, or invalid objects automatically.
  • If the final target collection is empty, such as when damage targets all enemies after every enemy has died, the Action does not throw an error or stop the rest of the Graph. It skips safely and continues.

Do not rely on silent skipping to communicate a rule

The code may remain error-free, but if nothing happening would violate player expectations, do not leave the result to silent skipping. Follow these design rules:

  1. Intercept with a Branch: Use a Condition and Branch to test whether the target is empty. When it is, follow another path with a visible fallback effect or message.
  2. Make the text explicit: State the restriction in the card description so the player is not misled.
  3. Localize player-facing text correctly:
    • Player-facing text in the description field: Use direct, readable in-game language, such as "Deal 8 damage to the selected enemy" or "Apply 2 Burn to all enemies."
    • Never expose implementation fields: Terms such as Opponent, UnitSource, CardSource, and Collection Operator exist only for Editor graph construction and must never appear in player-facing card descriptions or UI.