Skip to main content

FlowGraph Recipes

GCS ยท FlowGraph Authoring

Sixteen graph patterns covering the behaviors most card games need, each verified against the built-in node set. Reuse the structure, then adjust fields to your design.

For authors who know the FlowGraph basics and want a working starting point instead of a blank canvas.

Each recipe below lists the nodes in control order, with the field settings that matter. The demo content uses these same shapes, so you can cross-reference any of them against the shipped cards, statuses, and enemies.


Deal damage to the chosen targetโ€‹

For ordinary attack cards.

  1. On Card Played
  2. Deal Damage with TargetSource = Opponent and Amount set to the card's damage
  3. Wire Deal Damage.Dealt into Show Floating Text.Amount
  4. Play VFX and Play SFX after the damage node

Opponent resolves to the unit the player targeted with the card. And show the Dealt output, never the Amount field: armor, hooks, and prevention can all shrink the number on the way in.


Deal damage to all enemiesโ€‹

For AoE attacks.

  1. On Card Played
  2. Deal Damage with TargetSource = AllEnemies
  3. Shake Camera or a screen-wide Play VFX after the damage

No selector nodes needed; the enum option is the whole target set. Switch to wiring (All Enemies -> Filter -> Deal Damage.Target) only when the set needs narrowing, and use Foreach when each enemy needs its own presentation beat.


Hit random enemies several timesโ€‹

The demo's Rapid Fire card, and the pattern behind every multi-hit flurry. The card text reads "Deal 3 damage to a random enemy 4 times", and the graph is exactly that sentence.

Rapid Fire card graph: a Loop node drives Deal Damage inside its body, with All Enemies wired through Random Elements into the target port

  1. On Card Played
  2. Loop with Count = 4
  3. On Body, Deal Damage with Amount = 3
  4. Wire All Enemies -> Random Elements (Count = 1) -> Deal Damage.Target
  5. Presentation inside the loop body, one beat per hit

The target re-rolls on every iteration because Random Elements is re-evaluated each time Deal Damage pulls it. Four hits, potentially four different enemies.


Heal when below half HPโ€‹

For conditional healing.

  1. Select the unit with Self Unit or the entry's Target output
  2. Wire it into Unit Info
  3. Wire Unit Info.HP% into Condition input A, set Op = Less, and feed 50 into input B (a Constant works)
  4. Wire Condition into Branch.Condition
  5. On True, Change HP with Affect = Current, Mode = Delta, and a positive Amount
  6. Heal text from Change HP.Changed

Compare HP%, not raw HP. "Below half" means percent, and max HP differs between units.


Gain armor per card played this turnโ€‹

For combo and momentum cards.

  1. On Card Played
  2. Cards Played This Turn -> Count
  3. Optional Math Binary to scale the count
  4. Change Armor with TargetSource = Self, with the computed number wired into Amount

A flat "gain 5 armor" card needs none of this: set the field and stop.


Apply a status to all enemiesโ€‹

For poison, burn, weaken, and similar spreads.

  1. On Card Played
  2. Change Status with the status selected in Status, Mode = Delta, Amount set to the stacks, and TargetSource = AllEnemies

Add All Enemies -> Filter -> Change Status.Target when only some enemies should receive it, for example only damaged ones.


Consume a status for bonus damageโ€‹

For payoff cards that spend stacks.

  1. On Card Played
  2. Unit Status Stacks for the target unit and the status
  3. Condition with Op = Greater against 0, into Branch
  4. On True, Math Binary computes the bonus, then Deal Damage
  5. Change Status with a negative Amount to remove the spent stacks

Remove the stacks after the damage. Hooks and branches may still need the original count while the hit resolves.


Draw up to the hand limitโ€‹

  1. On Card Played
  2. Draw Cards with Mode = ToHandLimit

Use Mode = Count with a Count value when the card promises a fixed number of draws, even if the hand fills partway through.


Create a card in the draw pileโ€‹

For generated-card mechanics.

  1. On Card Played
  2. Add Cards with the card picked in CardId, Pile = Draw, and Position set to Top, Bottom, or Random
  3. Use the Added output if the new card should immediately be upgraded, moved, or shown

Add Cards creates instances; Move Cards relocates existing ones. Reaching for Move Cards on a card that does not exist yet is the classic mistake here.


Discount cards for N turnsโ€‹

For temporary cost reductions.

  1. Modify Card Cost with CardsSource set to the pile you want (or a wired card collection)
  2. Mode = Delta with a negative Amount
  3. Duration = ForNTurns and Turns set to the length

Duration also offers ThisTurn and WholeBattle. For a cost that must be recomputed from live state every time the card is checked, use Card Cost Hook instead of a stored modifier.


Block a card from being playedโ€‹

For silence, stun, and resource-lock statuses.

  1. Card Playable Hook on the status's graph
  2. Card Info to inspect the card the hook is asking about
  3. Condition or Contains logic into Branch
  4. On the blocked path, Write Hook with Kind = Bool and BoolValue = false

On Card Played cannot do this job. By the time it fires, the card has already passed the playability check.


Reduce incoming damageโ€‹

For defensive statuses.

  1. Damage Taken Hook
  2. Unit Status Stacks for the hook's Target
  3. Branch on whether stacks are present
  4. On True, Math Binary subtracts the mitigation from Value
  5. Clamp with Min = 0 if mitigation must never turn a hit into a heal
  6. Write Hook with Kind = Int

When the modifier conceptually belongs to the attacker ("this unit hits harder"), move the logic to Damage Dealt Hook on the attacker's status instead.


Enemy sequence intentโ€‹

For enemies that repeat a known rotation.

Mire Reaper enemy behavior graph with an intent pattern tree branching into per-intent behavior paths

The Mire Reaper, the demo's Hunter boss, is built exactly this way.

  1. On Enemy Behavior Start
  2. Sequence Pattern, with one branch per step and RepeatCounts controlling how many turns each step repeats before advancing
  3. A Leaf Intent on each branch declares the intent icon the player sees, then continues into that step's behavior nodes

Use Weighted Random Pattern (per-branch Weights) for unpredictable enemies.


Enemy HP threshold phasesโ€‹

For bosses that change behavior when wounded.

  1. On Enemy Behavior Start
  2. HP Threshold Pattern with Thresholds such as 15, 40, 70 (HP percent)
  3. One behavior path per threshold band, each fronted by its Leaf Intent

Tiers are checked top to bottom; the first tier whose threshold is at or above the current HP wins. Put the most wounded tier first: with 15, 40, 70, an enemy at 30% HP matches the 40 tier. Default runs while HP is above every threshold, so it carries the opening rotation.


One-time and periodic enemy movesโ€‹

For an enrage that fires once, or a special every third turn. Both nodes live in the Intent group, so they are enemy-graph tools.

  1. Inside the enemy's pattern tree, insert Once Per Battle
  2. The one-time move goes on Body; the normal rotation continues from Done

Every N Turns works the same way with an N field: Body runs on the matching turns, Done on all others.

info

Player-side "once per battle" effects are not built with these nodes. Track them with a battle-scope variable instead: Set Variable with BattleScope on, and a Branch that checks it before the effect runs.


Raise an internal eventโ€‹

For one graph notifying another without direct wiring.

  1. The sender runs Raise Internal Event with an EventName and optional argument bindings
  2. The receiver starts from On Internal Event with the same name
  3. The receiver reads values through Event Arg

Skip events for sequencing inside a single graph; a control wire is clearer. Events earn their cost when the sender and receiver are different assets that should not know about each other.