diff --git a/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor b/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor index b8ce6c6..0d0887f 100644 --- a/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor +++ b/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor @@ -1683,17 +1683,85 @@
+ @* ── Canvas usage ── *@ +
Canvas Mode
+

The canvas shows the current ability as a graph of connected nodes. Each node represents one part of the ability definition. Click a node to select it and edit its properties in the Inspector panel on the right.

+ + + + + + + + + +
InteractionAction
Click node headerSelect node and open Inspector
Drag node headerReposition node on canvas
Scroll wheelZoom in / out
Middle-mouse dragPan the canvas
Click canvas backgroundDeselect node
+

Use the left panel to switch between abilities and add new nodes (Action, Effect, Cost Entry, Sub-Group, Condition). The Form View button switches to the full form layout for any node type that needs it.

+

SummonToken effects must be configured in Form View — the token editor is too wide for the Inspector panel.

+ + @* ── Ability types ── *@
Ability Types
- - - - + + + +
TypeWhen it firesKey fields
ActivePlayer explicitly activates on their turnRange, Cost, UsesPerTurn
PassiveAlways in effect while unit is on battlefieldActions (target=Self)
AuraApplies Actions to units entering range; fires OnEnterAuraRange / OnLeaveAuraRange triggers. On Leave: Persist = keep effect duration, Clear = revert immediately, Linger = switch to linger durationAuraRange, Actions, ClearOnLeave / LingerDuration
TriggeredFires automatically when a specific game event occursTriggerEvent, TriggerLimitPerTurn, Actions
ActivePlayer explicitly activates on their turnRange, Cost, UsesPerTurn, Conditions
PassiveAlways in effect while unit is on the battlefield; fires once on enter and whenever the trigger re-evaluatesActions (target usually Self or ExactSelf)
AuraApplies effects to units within AuraRange. On Leave: Persist = keep effect duration, Clear = revert immediately, Linger = switch to a separate linger durationAuraRange Min/Max, Actions, ClearOnLeave / LingerDuration
TriggeredFires automatically when a specific game event occurs and all ActivationConditions passTriggerEvent + fields, TriggerLimitPerTurn, Actions
+ @* ── Action Groups ── *@ +
Action Groups — AND / OR / XOR
+

The Actions node controls how the ability's top-level action steps execute. Set Logic Op on the Actions node (or a Sub-Group node) to one of:

+ + + + + + + +
Logic OpBehaviour
AndAll actions in the group execute sequentially. Default for most abilities.
OrThe chooser picks exactly one action (or sub-group) to execute.
XorSame as Or — one branch fires; the choices are mutually exclusive by design.
+

When Logic Op is Or or Xor, set Chooser Role to control who picks:

+ + + + + + + +
Chooser RoleWho decides
SelfThe player who activated / owns the ability chooses
OpponentThe opposing player chooses
RandomServer picks immediately — no client prompt
+

Sub-Groups let you nest a second level of AND/OR/XOR logic inside the main action group. Add them from the left-panel palette, then add actions inside each sub-group.

+

ActionGroup vs ChooseOne: ActionGroup branches between independent action steps (each with their own targeting). ChooseOne (inside an Effect node) branches between effects on the same already-resolved target.

+ + @* ── Costs ── *@ +
Costs (Active abilities)
+

Add cost entries from the left-panel palette or via the Cost node's Inspector. The Cost node also supports AND / OR / XOR logic — for example, "pay 2 SP OR discard a card".

+ + + + + + + + + + + +
Cost TypeWhat the player pays
SpiritPointsSpend N SP
SacrificeTokensSpend N ST
DiscardFromHandDiscard N cards from hand (interactive pick if PickMode ≠ Random)
MillTopOfDeck / MillBottomOfDeckSend top/bottom N cards of deck to discard
DealDamageToOwnArchSpiritDeal N damage to your own ArchSpirit
DealDamageToOwnSpiritDeal N damage to a selected friendly Spirit
SendSpiritFromBattlefieldToDiscardSend a selected friendly Spirit to the discard
+

For interactive costs (Discard, DealDamage, SendSpirit), set PickMode:

+ + + + + + + + + +
PickModeWho picks the card(s)
SelfPickActivating player selects from their eligible cards
EnemyPickOpponent selects — they see the player's eligible cards
EnemySeePickOpponent selects but hand is otherwise hidden
EnemyRandomPickOpponent's choice is made randomly by server
RandomServer picks immediately — no prompt shown
+ + @* ── Targeting ── *@
Targeting — Scope

Scope defines the zone searched for targets.

@@ -1709,33 +1777,45 @@
Targeting — Ownership
-

Ownership narrows the candidate pool and determines whether the player is prompted to pick.

- - +

Ownership filters the valid target pool. Chooser is separate — it controls who picks the target from that pool.

+
OwnershipMeaningPlayer prompted?
+ - - - - - - - - + + + + + + + + + +
OwnershipPool includes…Auto-resolved?
SelfAny unit owned by the same controller as the ability sourceNo (auto)
ExactSelfThe exact unit instance that owns this abilityNo (auto)
OwnerEntities belonging to the ability ownerYes (if Count>1 or All)
AllyFriendly units other than selfYes
EnemyOpponent's unitsYes
AnyAny entity in the zone regardless of controllerYes
RandomEngine picks a random valid target; player is not promptedNo (auto)
TargetRe-uses the resolved target from the previous actionNo (chained)
SelfAny unit owned by the same controller as the sourceYes
ExactSelfThe exact unit instance that owns this abilityYes
OwnerEntities belonging to the ability ownerOnly if Count=1 and Chooser=Random
AllyFriendly units other than selfOnly if Chooser=Random
EnemyOpponent's unitsOnly if Chooser=Random
AnyAll entities in the zone regardless of controllerOnly if Chooser=Random
RandomAll valid targets — server picks one at random immediatelyYes
TargetRe-uses the resolved target from the previous action (chained)Yes
+

Chooser — who selects from the filtered pool:

+ + + + + + +
ChooserWho picks
SelfActivating / controlling player — a target-pick prompt is shown to them
OpponentOpponent is prompted to pick from the filtered pool
AllyAn allied player is prompted
RandomServer picks immediately — no prompt is shown to anyone
Targeting — Target Filters
+

Applied on top of Ownership to further narrow valid targets. Set on the Action node's Target Filter field.

- - + + - - + +
FilterMeaning
IsSelfTarget shares the same card definition as the source (matches all copies of this card type on the board)
IsExactSelfTarget is the exact unit instance that owns this ability (use when only this specific unit should be affected)
IsSelfTarget shares the same card definition as the source — matches all copies of this card type on the board
IsExactSelfTarget is the exact unit instance that owns this ability — use when only this specific unit should be targeted
IsAdjacentToSourceTarget must be orthogonally adjacent to the ability's source unit
IsAdjacentToUnitMatchingTarget is adjacent to a unit matching ownership/filter defaults
IsAdjacentToTileMatchingTarget is adjacent to a tile matching supplied tile filter(s)
IsAdjacentToUnitMatchingTarget must be adjacent to a unit matching the configured ownership / unit filters
IsAdjacentToTileMatchingTarget must be adjacent to a tile matching configured tile filters
+ @* ── ValueExpr ── *@
ValueExpr References

In any Amt field you can choose a dynamic reference instead of a fixed number. The engine resolves the reference at the moment the effect fires.

@@ -1762,94 +1842,145 @@
Multi-Action Cross-Reference Example

"Return a target Spirit to its owner's hand and refund its SP cost."

-

Action 2 uses Ownership: Target to re-target the owner of the card selected in Action 1. The Amt dropdown will show Action0.Target.* options once Action 2 exists.

+

Action 2 uses Ownership: Target to re-target the owner of the card chosen in Action 1. The Amt dropdown shows Action0.Target.* options once Action 2 exists.

+ @* ── Duration ── *@
Duration Types
+

Set on individual Effect nodes or overridden for all effects via Duration override on the Meta node.

- - - - + + + + +
DurationWhen the effect expires
InstantApplied once, never removed (stat changes etc.)
UntilEndOfTurnExpires at end of the active player's turn
UntilStartOfOwnerTurnExpires at start of the ability owner's next turn
UntilStartOfSourceOwnerTurnExpires at start of the source unit owner's next turn
InstantApplied once and never removed (permanent stat change, etc.)
UntilEndOfTurnExpires at end of the currently active player's turn
UntilStartOfOwnerTurnExpires at the start of the ability owner's next turn
UntilStartOfSourceOwnerTurnExpires at the start of the source unit owner's next turn
UntilEndOfSequenceExpires when the current ability resolution sequence ends (within-turn only)
ForNTurnsExpires after N complete turns have elapsed
WhileSourceOnBattlefieldExpires when the source unit leaves the battlefield
PermanentInMatchNever expires for the rest of this game
-
Conditions
-

Conditions can be added to Ability-level (ActivationConditions) or Action-level. All must pass for the ability/action to fire. The Subject dropdown selects whose state is checked: Self = ability source, Target = the resolved target.

+ @* ── Effects ── *@ +
Effects — Categories
+

Effects are grouped in the Effect Type picker. Key categories:

- + - - - - - - - - - - - - - - - + + + + + + + + + +
ConditionPasses when…
CategoryExamples
IsOwnTurn / IsOpponentTurnIt is (or isn't) the owner's turn
HealthBelow / HealthAbove NSubject's current HP < N or > N
DefenseIs / SPAtLeast / STAtLeastStat comparisons
HasGenus / HasAbilitySubject has a genus tag / named ability
IsOnTileWithAffinitySubject's tile matches the specified affinity
DestinationTileAffinityIs / PreviousTileAffinityIsOn move-triggered abilities, checks the moved-to / moved-from tile affinity
MovedFromOrIntoAffinityOn move-triggered abilities, passes if either origin or destination tile matches affinity
IsAdjacentToTileWithAffinity / IsOnOrAdjacentToTileWithAffinityPositional affinity checks around the subject unit
IsCurrentlyMovingTrue only inside movement-trigger context for the moving source
ControlledTileCountWithAffinityCounts occupied tiles by affinity and compares via comparator/N
IsAdjacentToSubject is adjacent to a unit matching Ownership
WithinRangeOfSubject is within N tiles of a unit matching Ownership
UnitCountOnBattlefieldTotal matching units on board satisfies comparator
CardInZoneA matching card exists in the specified zone
AND / OR / XORComposite — combines nested conditions
Damage / HealDealDamage, DealDamagePlusStat, DOT (damage over time), RestoreHealth, HOT (heal over time), PreventNextDamage, PreventDeath
Stat modificationModifyStat, ModifyMaxStat, SetStatModMultiplier, ModifyChannelRange, SetAttackRange
ResourceGainSP, SpendSP, GainST, SpendST, ModifySP, ModifySPAccumulation, ModifyCardsDrawnThisTurn
Movement / PositionMoveUnit, PushUnit, PullUnit, DisplaceUnit, RepositionUnit
Zone / CardReturnToHand, ReturnToDeck, PlaceOnDeck, ReturnToBattlefield, ChannelCard, AscendFromZone, TransitionFromZone, DrawCards, DiscardCards, SearchDeck, RevealCards, StackDeck
TokenSummonToken, DestroyToken, CloneSpiritAsToken
Control / FlagsTakeControl, KillUnit, DestroyUnit, SkipTurn, SetHealthMinimum, SetFixedSacrificeReturn, ModifyCost, ChangeAttackType, ObstructMovementType, SetMovementType, GrantAdditionalAttack, GrantMovementControl
Ability / GenusAddAbility, RemoveAbility, EnableAbility, DisableAbility, AddGenus, RemoveGenus
Tile / RuinChangeTileAffinity, DisableRuinForDuration
Board stateModifyPlayerProperty, ShuffleDeck, ApplyOnEvent
+ @* ── Conditions ── *@ +
Conditions
+

Conditions can be on Ability-level (ActivationConditions — add via the Condition palette button) or Action-level (add via the action Inspector). All conditions must pass for the ability/action to fire.

+

The Subject dropdown sets whose state is evaluated: Self = ability source unit, Target = the resolved target of this action.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ConditionPasses when…Key parameters
IsOwnTurn / IsOpponentTurnIt is (or isn't) the owner's turn—
IsActivePlayerTurnSubject's controller is the currently active playerOwnership
HealthBelow / HealthAboveSubject's current HP < N or > NN
DefenseIs / SPAtLeast / STAtLeast etc.Resource stat comparisonN
UnitPropertyCompareNamed unit stat vs comparator vs valuePropertyName, Comparator, Value
PlayerPropertyComparePlayer resource (SP/ST/HandSize/DeckSize etc.) vs comparatorPropertyName, Comparator, Value
UnitTypeIsSubject is of the given card type (Spirit / ArchSpirit / SpiritToken)UnitType
OwnershipIsSubject is owned by Self / Ally / Opponent relative to ability ownerOwnership
IsThisCardSubject is the exact source card instance—
HasGenus / HasAbilitySubject has a genus tag / named abilityTag / AbilityRef
IsOnTileWithAffinitySubject's tile affinity matchesAffinity
DestinationTileAffinityIs / PreviousTileAffinityIsOn move-triggers: destination / origin tile affinityAffinity
MovedFromOrIntoAffinityOn move-triggers: either origin or destination matchesAffinity
IsAdjacentToTileWithAffinity / IsOnOrAdjacentToTileWithAffinityPositional affinity check around subjectAffinity
IsAdjacentToSubject is adjacent to a unit matching Ownership + UnitTypeOwnership, UnitType
WithinRangeOfSubject is within Min–Max tiles of a unit matching filtersMin, Max
IsInRangeOfUnitSource within Min–Max tiles of a unit matching Type + OwnershipMin, Max, UnitType, Ownership
UnitCountOnBattlefieldCount of matching units on board satisfies comparatorOwnership, UnitType, Comparator, N
HandContainsCountN cards of a given type/affinity are in handCardType, Affinity, Comparator, N
CardInZoneA matching card exists in the specified zoneCardRef, Zone
CardDefinitionCountInZoneN copies of this card definition exist in a zoneZone, Ownership, Comparator, N
ControlledTileCountWithAffinityOccupied tiles matching affinity satisfies comparatorOwnership, Affinity, Comparator, N
TileIsOccupied / TileOccupantSubject's tile is occupied by a unit of the given type/ownershipUnitType, Ownership
SurroundingTileN or more tiles within Min–Max distance satisfy tile conditionsMin, Max, Comparator, TileCount
MovementTypeIsSubject's movement type matchesMovementType
SPAccumulationCompareSubject player's SP-per-turn satisfies comparatorComparator, Value
CostOfCardsInHandAggregate SP/ST cost of cards in hand satisfies comparatorCostType, CardType, Affinity, Comparator, Value
IsCurrentlyMovingTrue only inside movement-trigger context for the moving unit—
AND / OR / XOR / NOTComposite — combine nested conditions with boolean logicInner conditions / JSON
+ + @* ── Triggers ── *@
Trigger Events

Available for Triggered abilities. The engine fires the ability whenever the event occurs and all ActivationConditions pass.

-

Trigger Ownership controls whose actions fire the trigger:

- - +

Trigger Ownership / Source fields — filter which units or players cause the trigger to fire:

+
ValueMeaning
+ - +
ValueMeaning
AnyAny unit's action fires the trigger
OwnerAny unit owned by the same player fires the trigger
AllyAlias for Owner (same-player units)
EnemyOnly opponent units fire the trigger
EnemyOnly opponent-controlled units fire the trigger
ExactSelfOnly this specific unit instance fires the trigger — use this to react to your own movement/actions, not teammates'
Trigger-Specific Fields
-

Some trigger types expose extra filtering fields beyond Ownership and UnitType.

- -

OnUnitSentToDiscard — CausedBy

-

Fires whenever a unit is sent to the discard pile from the battlefield. This includes:

- -

The optional CausedBy field narrows the trigger to units killed by a specific owner class:

+

Trigger parameters appear automatically in the Inspector (and Form View) once a trigger event is selected. Common extras:

- + - - - - - + + + + + + + + + +
CausedBy valueFires when the killer is…
TriggerExtra fields
(empty)Any killer — trigger fires regardless of who caused the discard
ExactSelfThis specific unit instance — the unit that owns this ability was the one that dealt the killing blow (Bloodlust pattern)
OwnerAny unit controlled by the same player as this unit
EnemyAny opponent-controlled unit caused the discard
AnySame as empty — any killer
OnUnitSentToDiscardCausedBy — filters by killer identity (see below)
OnDamageDealt / OnHealed / OnUnitMPSpentAmount — optional minimum threshold
OnStatModifiedStat — optional stat name to filter on
OnChanneledCardType — optional card type filter
OnSPGained / OnSPSpent etc.Player — which player's resource event fires the trigger
OnDamagePrevented / BeforeDamageAppliedSource and target ownership filters
OnRuinActivationOccupantOwnership — optional occupant filter
OnEnterAuraRange / OnLeaveAuraRangeAuraOwnership + UnitOwnership
OnCardDiscardedCause — optional cause string (e.g. "AbilityEffect")
TriggerLimitPerTurnMax times this trigger fires per turn (0 / blank = unlimited)
-

Note: Ownership still filters the unit being discarded; CausedBy filters the killer. Use Ownership: Any, CausedBy: ExactSelf to react whenever this unit kills anything.

-

Bloodlust example — "When this spirit sends another spirit to the discard, gain +1 attack":

-
{"$type":"OnUnitSentToDiscard","UnitType":"Spirit","Ownership":"Any","CausedBy":"ExactSelf"}
-

Action: Scope Battlefield, Ownership ExactSelf, Effect ModifyStat — Stat Damage, Amt +1, Duration PermanentInMatch (or UntilEndOfTurn for temporary buff).

+

OnUnitSentToDiscard — CausedBy

+

Fires when a unit is sent to the discard from the battlefield (combat kill or ability effect). The optional CausedBy narrows by killer identity:

+ + + + + + + + + +
CausedByFires when the killer is…
(empty)Anyone — fires regardless of who caused the discard
ExactSelfThis specific unit instance dealt the killing blow
OwnerAny unit controlled by the same player as this unit
EnemyAny opponent-controlled unit
AnySame as empty
+

Ownership still filters the unit being discarded; CausedBy filters the killer. Example: Ownership=Any, CausedBy=ExactSelf fires whenever this unit kills anything.

+ +

Bloodlust example — "When this spirit kills another spirit, gain +1 Damage until end of turn":

+

OnUnitDeath vs OnUnitSentToDiscard

-

Use OnUnitDeath to react to any unit being killed (e.g. opponent's unit dies anywhere). Use OnUnitSentToDiscard when you specifically want the killer identity via CausedBy, or when you need to distinguish combat-killed units from sacrificed/returned units (sacrificed units fire OnSpiritSacrificed, not OnUnitSentToDiscard).

+

Use OnUnitDeath to react to any unit dying anywhere. Use OnUnitSentToDiscard when you need the killer identity via CausedBy. Note: sacrificed units fire OnSpiritSacrificed, not OnUnitSentToDiscard.