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 @@
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.
+| Interaction | Action |
|---|---|
| Click node header | Select node and open Inspector |
| Drag node header | Reposition node on canvas |
| Scroll wheel | Zoom in / out |
| Middle-mouse drag | Pan the canvas |
| Click canvas background | Deselect 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 ── *@| Type | When it fires | Key fields |
|---|---|---|
| Active | Player explicitly activates on their turn | Range, Cost, UsesPerTurn |
| Passive | Always in effect while unit is on battlefield | Actions (target=Self) |
| Aura | Applies Actions to units entering range; fires OnEnterAuraRange / OnLeaveAuraRange triggers. On Leave: Persist = keep effect duration, Clear = revert immediately, Linger = switch to linger duration | AuraRange, Actions, ClearOnLeave / LingerDuration |
| Triggered | Fires automatically when a specific game event occurs | TriggerEvent, TriggerLimitPerTurn, Actions |
| Active | Player explicitly activates on their turn | Range, Cost, UsesPerTurn, Conditions |
| Passive | Always in effect while unit is on the battlefield; fires once on enter and whenever the trigger re-evaluates | Actions (target usually Self or ExactSelf) |
| Aura | Applies effects to units within AuraRange. On Leave: Persist = keep effect duration, Clear = revert immediately, Linger = switch to a separate linger duration | AuraRange Min/Max, Actions, ClearOnLeave / LingerDuration |
| Triggered | Fires automatically when a specific game event occurs and all ActivationConditions pass | TriggerEvent + fields, TriggerLimitPerTurn, Actions |
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 Op | Behaviour |
|---|---|
| And | All actions in the group execute sequentially. Default for most abilities. |
| Or | The chooser picks exactly one action (or sub-group) to execute. |
| Xor | Same 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 Role | Who decides |
|---|---|
| Self | The player who activated / owns the ability chooses |
| Opponent | The opposing player chooses |
| Random | Server 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 ── *@ +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 Type | What the player pays |
|---|---|
| SpiritPoints | Spend N SP |
| SacrificeTokens | Spend N ST |
| DiscardFromHand | Discard N cards from hand (interactive pick if PickMode ≠ Random) |
| MillTopOfDeck / MillBottomOfDeck | Send top/bottom N cards of deck to discard |
| DealDamageToOwnArchSpirit | Deal N damage to your own ArchSpirit |
| DealDamageToOwnSpirit | Deal N damage to a selected friendly Spirit |
| SendSpiritFromBattlefieldToDiscard | Send a selected friendly Spirit to the discard |
For interactive costs (Discard, DealDamage, SendSpirit), set PickMode:
+| PickMode | Who picks the card(s) |
|---|---|
| SelfPick | Activating player selects from their eligible cards |
| EnemyPick | Opponent selects — they see the player's eligible cards |
| EnemySeePick | Opponent selects but hand is otherwise hidden |
| EnemyRandomPick | Opponent's choice is made randomly by server |
| Random | Server picks immediately — no prompt shown |
Scope defines the zone searched for targets.
Ownership narrows the candidate pool and determines whether the player is prompted to pick.
-| Ownership | Meaning | Player prompted? |
|---|
| Ownership | Pool includes… | Auto-resolved? |
|---|---|---|
| Self | Any unit owned by the same controller as the ability source | No (auto) |
| ExactSelf | The exact unit instance that owns this ability | No (auto) |
| Owner | Entities belonging to the ability owner | Yes (if Count>1 or All) |
| Ally | Friendly units other than self | Yes |
| Enemy | Opponent's units | Yes |
| Any | Any entity in the zone regardless of controller | Yes |
| Random | Engine picks a random valid target; player is not prompted | No (auto) |
| Target | Re-uses the resolved target from the previous action | No (chained) |
| Self | Any unit owned by the same controller as the source | Yes |
| ExactSelf | The exact unit instance that owns this ability | Yes |
| Owner | Entities belonging to the ability owner | Only if Count=1 and Chooser=Random |
| Ally | Friendly units other than self | Only if Chooser=Random |
| Enemy | Opponent's units | Only if Chooser=Random |
| Any | All entities in the zone regardless of controller | Only if Chooser=Random |
| Random | All valid targets — server picks one at random immediately | Yes |
| Target | Re-uses the resolved target from the previous action (chained) | Yes |
Chooser — who selects from the filtered pool:
+| Chooser | Who picks |
|---|---|
| Self | Activating / controlling player — a target-pick prompt is shown to them |
| Opponent | Opponent is prompted to pick from the filtered pool |
| Ally | An allied player is prompted |
| Random | Server picks immediately — no prompt is shown to anyone |
Applied on top of Ownership to further narrow valid targets. Set on the Action node's Target Filter field.
| Filter | Meaning |
|---|---|
| IsSelf | Target shares the same card definition as the source (matches all copies of this card type on the board) |
| IsExactSelf | Target is the exact unit instance that owns this ability (use when only this specific unit should be affected) |
| IsSelf | Target shares the same card definition as the source — matches all copies of this card type on the board |
| IsExactSelf | Target is the exact unit instance that owns this ability — use when only this specific unit should be targeted |
| IsAdjacentToSource | Target must be orthogonally adjacent to the ability's source unit |
| IsAdjacentToUnitMatching | Target is adjacent to a unit matching ownership/filter defaults |
| IsAdjacentToTileMatching | Target is adjacent to a tile matching supplied tile filter(s) |
| IsAdjacentToUnitMatching | Target must be adjacent to a unit matching the configured ownership / unit filters |
| IsAdjacentToTileMatching | Target must be adjacent to a tile matching configured tile filters |
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.
| Duration | When the effect expires |
|---|---|
| Instant | Applied once, never removed (stat changes etc.) |
| UntilEndOfTurn | Expires at end of the active player's turn |
| UntilStartOfOwnerTurn | Expires at start of the ability owner's next turn |
| UntilStartOfSourceOwnerTurn | Expires at start of the source unit owner's next turn |
| Instant | Applied once and never removed (permanent stat change, etc.) |
| UntilEndOfTurn | Expires at end of the currently active player's turn |
| UntilStartOfOwnerTurn | Expires at the start of the ability owner's next turn |
| UntilStartOfSourceOwnerTurn | Expires at the start of the source unit owner's next turn |
| UntilEndOfSequence | Expires when the current ability resolution sequence ends (within-turn only) |
| ForNTurns | Expires after N complete turns have elapsed |
| WhileSourceOnBattlefield | Expires when the source unit leaves the battlefield |
| PermanentInMatch | Never expires for the rest of this game |
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 are grouped in the Effect Type picker. Key categories:
| Condition | Passes when… |
|---|---|
| Category | Examples |
| IsOwnTurn / IsOpponentTurn | It is (or isn't) the owner's turn |
| HealthBelow / HealthAbove N | Subject's current HP < N or > N |
| DefenseIs / SPAtLeast / STAtLeast | Stat comparisons |
| HasGenus / HasAbility | Subject has a genus tag / named ability |
| IsOnTileWithAffinity | Subject's tile matches the specified affinity |
| DestinationTileAffinityIs / PreviousTileAffinityIs | On move-triggered abilities, checks the moved-to / moved-from tile affinity |
| MovedFromOrIntoAffinity | On move-triggered abilities, passes if either origin or destination tile matches affinity |
| IsAdjacentToTileWithAffinity / IsOnOrAdjacentToTileWithAffinity | Positional affinity checks around the subject unit |
| IsCurrentlyMoving | True only inside movement-trigger context for the moving source |
| ControlledTileCountWithAffinity | Counts occupied tiles by affinity and compares via comparator/N |
| IsAdjacentTo | Subject is adjacent to a unit matching Ownership |
| WithinRangeOf | Subject is within N tiles of a unit matching Ownership |
| UnitCountOnBattlefield | Total matching units on board satisfies comparator |
| CardInZone | A matching card exists in the specified zone |
| AND / OR / XOR | Composite — combines nested conditions |
| Damage / Heal | DealDamage, DealDamagePlusStat, DOT (damage over time), RestoreHealth, HOT (heal over time), PreventNextDamage, PreventDeath |
| Stat modification | ModifyStat, ModifyMaxStat, SetStatModMultiplier, ModifyChannelRange, SetAttackRange |
| Resource | GainSP, SpendSP, GainST, SpendST, ModifySP, ModifySPAccumulation, ModifyCardsDrawnThisTurn |
| Movement / Position | MoveUnit, PushUnit, PullUnit, DisplaceUnit, RepositionUnit |
| Zone / Card | ReturnToHand, ReturnToDeck, PlaceOnDeck, ReturnToBattlefield, ChannelCard, AscendFromZone, TransitionFromZone, DrawCards, DiscardCards, SearchDeck, RevealCards, StackDeck |
| Token | SummonToken, DestroyToken, CloneSpiritAsToken |
| Control / Flags | TakeControl, KillUnit, DestroyUnit, SkipTurn, SetHealthMinimum, SetFixedSacrificeReturn, ModifyCost, ChangeAttackType, ObstructMovementType, SetMovementType, GrantAdditionalAttack, GrantMovementControl |
| Ability / Genus | AddAbility, RemoveAbility, EnableAbility, DisableAbility, AddGenus, RemoveGenus |
| Tile / Ruin | ChangeTileAffinity, DisableRuinForDuration |
| Board state | ModifyPlayerProperty, ShuffleDeck, ApplyOnEvent |
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.
| Condition | Passes when… | Key parameters |
|---|---|---|
| IsOwnTurn / IsOpponentTurn | It is (or isn't) the owner's turn | — |
| IsActivePlayerTurn | Subject's controller is the currently active player | Ownership |
| HealthBelow / HealthAbove | Subject's current HP < N or > N | N |
| DefenseIs / SPAtLeast / STAtLeast etc. | Resource stat comparison | N |
| UnitPropertyCompare | Named unit stat vs comparator vs value | PropertyName, Comparator, Value |
| PlayerPropertyCompare | Player resource (SP/ST/HandSize/DeckSize etc.) vs comparator | PropertyName, Comparator, Value |
| UnitTypeIs | Subject is of the given card type (Spirit / ArchSpirit / SpiritToken) | UnitType |
| OwnershipIs | Subject is owned by Self / Ally / Opponent relative to ability owner | Ownership |
| IsThisCard | Subject is the exact source card instance | — |
| HasGenus / HasAbility | Subject has a genus tag / named ability | Tag / AbilityRef |
| IsOnTileWithAffinity | Subject's tile affinity matches | Affinity |
| DestinationTileAffinityIs / PreviousTileAffinityIs | On move-triggers: destination / origin tile affinity | Affinity |
| MovedFromOrIntoAffinity | On move-triggers: either origin or destination matches | Affinity |
| IsAdjacentToTileWithAffinity / IsOnOrAdjacentToTileWithAffinity | Positional affinity check around subject | Affinity |
| IsAdjacentTo | Subject is adjacent to a unit matching Ownership + UnitType | Ownership, UnitType |
| WithinRangeOf | Subject is within Min–Max tiles of a unit matching filters | Min, Max |
| IsInRangeOfUnit | Source within Min–Max tiles of a unit matching Type + Ownership | Min, Max, UnitType, Ownership |
| UnitCountOnBattlefield | Count of matching units on board satisfies comparator | Ownership, UnitType, Comparator, N |
| HandContainsCount | N cards of a given type/affinity are in hand | CardType, Affinity, Comparator, N |
| CardInZone | A matching card exists in the specified zone | CardRef, Zone |
| CardDefinitionCountInZone | N copies of this card definition exist in a zone | Zone, Ownership, Comparator, N |
| ControlledTileCountWithAffinity | Occupied tiles matching affinity satisfies comparator | Ownership, Affinity, Comparator, N |
| TileIsOccupied / TileOccupant | Subject's tile is occupied by a unit of the given type/ownership | UnitType, Ownership |
| SurroundingTile | N or more tiles within Min–Max distance satisfy tile conditions | Min, Max, Comparator, TileCount |
| MovementTypeIs | Subject's movement type matches | MovementType |
| SPAccumulationCompare | Subject player's SP-per-turn satisfies comparator | Comparator, Value |
| CostOfCardsInHand | Aggregate SP/ST cost of cards in hand satisfies comparator | CostType, CardType, Affinity, Comparator, Value |
| IsCurrentlyMoving | True only inside movement-trigger context for the moving unit | — |
| AND / OR / XOR / NOT | Composite — combine nested conditions with boolean logic | Inner conditions / JSON |
Available for Triggered abilities. The engine fires the ability whenever the event occurs and all ActivationConditions pass.
@tTrigger Ownership controls whose actions fire the trigger:
-| Value | Meaning |
|---|
| Value | Meaning |
|---|---|
Any | Any unit's action fires the trigger |
Owner | Any unit owned by the same player fires the trigger |
Ally | Alias for Owner (same-player units) |
Enemy | Only opponent units fire the trigger |
Enemy | Only opponent-controlled units fire the trigger |
ExactSelf | Only this specific unit instance fires the trigger — use this to react to your own movement/actions, not teammates' |
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 value | Fires when the killer is… |
|---|---|
| Trigger | Extra fields |
| (empty) | Any killer — trigger fires regardless of who caused the discard |
ExactSelf | This specific unit instance — the unit that owns this ability was the one that dealt the killing blow (Bloodlust pattern) |
Owner | Any unit controlled by the same player as this unit |
Enemy | Any opponent-controlled unit caused the discard |
Any | Same as empty — any killer |
| OnUnitSentToDiscard | CausedBy — filters by killer identity (see below) |
| OnDamageDealt / OnHealed / OnUnitMPSpent | Amount — optional minimum threshold |
| OnStatModified | Stat — optional stat name to filter on |
| OnChanneled | CardType — optional card type filter |
| OnSPGained / OnSPSpent etc. | Player — which player's resource event fires the trigger |
| OnDamagePrevented / BeforeDamageApplied | Source and target ownership filters |
| OnRuinActivation | OccupantOwnership — optional occupant filter |
| OnEnterAuraRange / OnLeaveAuraRange | AuraOwnership + UnitOwnership |
| OnCardDiscarded | Cause — optional cause string (e.g. "AbilityEffect") |
| TriggerLimitPerTurn | Max 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:
| CausedBy | Fires when the killer is… |
|---|---|
| (empty) | Anyone — fires regardless of who caused the discard |
ExactSelf | This specific unit instance dealt the killing blow |
Owner | Any unit controlled by the same player as this unit |
Enemy | Any opponent-controlled unit |
Any | Same 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":
+OnUnitSentToDiscard, UnitType: Spirit, Ownership: Any, CausedBy: ExactSelfModifyStat, Stat Damage, Amt +1, Duration UntilEndOfTurnOnUnitDeath 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.