Skip to main content

Stage and formula positions

A stage orders traits at a staged formula position. Each transform receives the previous transform's output. Declare stage on a Lua definition or TRAIT_STAGE(n) on a native trait; the default is 0.

Ordering a chain​

This invented chain shares one final damage position:

StageTraitOrder
0ward_aFirst
10ward_bSecond
20bonus_cThird

Native and Lua traits interleave in ascending stage order. Within a stage, character nodes run in creation order. A trait attached during dispatch does not run in that round. Target scanning stops when a trait hides the owner.

Stage applies to on_damage_taken_raw, on_damage_taken_final, on_damage_dealt_final, on_heal_taken_pre, on_hit_resolved, on_attack, and on_target_scan. Other hooks ignore stage: native nodes run first, then Lua nodes, each in node order.

Positions​

PositionLua hookEffect
Attacker damage intenton_damage_dealt_preBump points inside the guard.
Victim damage intenton_damage_taken_preBump points inside the guard.
Before defenseon_damage_taken_rawChange ctx.damage.
After amplifiers, attackeron_damage_dealt_finalChange ctx.damage before victim transforms.
After amplifiers, victimon_damage_taken_finalChange ctx.damage.
Resolved hiton_hit_resolvedObserve damage and flags; may end the gate.
Attack motionon_attackObserve; may end the gate.
Target acquisitionon_target_scanReturn true to hide the holder.
Received healon_heal_taken_preChange ctx.amount.
Point limitNoneNative-only TRAIT_POINT_LIMIT raises an upper cap.

The damage intent hooks are guarded bump sites, but are not stage ordered. Lua reaches the other positions in the table except point limit. Transform damage is rounded and clamped at zero. See hooks and native registration.