Reorganize cardgen repo by bibles, decks, and revision

This commit is contained in:
Prime
2026-04-11 20:23:05 +00:00
parent e6778f769c
commit dd892ec85e
81 changed files with 18733 additions and 0 deletions
@@ -0,0 +1,288 @@
# Deck R1 Residual Gap Synthesis After Ability-System Revision
This document re-reads the existing `decks-r1/` audit set against the current live ability engine in `SOR/Server/src/SOR.Game/Abilities`.
It intentionally focuses on **what is still materially blocked or still ambiguous after the latest engine revision**. Older audits identified many gaps that are now at least partly or fully covered; those are only mentioned here when prior conclusions should be considered outdated.
## What changed since the earlier deck audits
Several prior “missing engine feature” conclusions are now outdated because the live engine now includes support for:
- **Triggered once-per-turn / frequency caps** via `AbilityDefinition.TriggerLimitPerTurn`
- **Pre-death replacement windows** via `BeforeUnitDeathTrigger`
- **Death / damage prevention primitives** via `PreventDeathEffect`, `PreventNextDamageEffect`, and `BeforeDamageAppliedTrigger`
- **End-of-sequence durations** via `DurationType.UntilEndOfSequence`
- **Negation / inverse checks** via `NotCondition`
- **Tile-control counting** via `ControlledTileCountWithAffinityCondition`
- **Relational adjacency filters** via `IsAdjacentToUnitMatchingFilter` and `IsAdjacentToTileMatchingFilter`
- **A true reposition primitive** via `RepositionUnitEffect`
- **Source-filtered damage triggers** via `OnDamageDealtTrigger.SourceFilter`
Because of that, a meaningful portion of the original “needs engine work” list should now be treated as solved or substantially reduced.
---
## Residual gaps that still look real
### 1. Chosen-tile memory for delayed markers is still the cleanest unresolved systems gap
The engine can now defer effects with `ApplyOnEventEffect`, but it still does **not** cleanly persist a chosen tile target as first-class deferred state that later trigger logic can compare against.
#### Still blocked example
- **Eclipse Frontier — Mark the Safe Route**
- Old concern: “mark a specific chosen tile; the next friendly unit to move onto it gains protection.”
- That is **still not cleanly expressible**.
#### Why it still fails cleanly
What is missing is the combination of:
- storing a selected tile coordinate in deferred effect state
- comparing future trigger event data to that stored tile
- consuming the marker only when the matching move occurs
`ApplyOnEventEffect` currently stores a `TargetRef` that can point to a card/player target, but not a robust arbitrary tile-memory payload. The condition system also lacks an equality primitive like “`EventData.DestinationTile == stored deferred tile ref`”.
#### Practical consequence
Any “mark this tile; the next unit entering it gets X” design is still awkward enough that the old audit remains basically correct here.
---
### 2. Branching / modal choice execution is still incomplete in practice
`ChooseOne` exists in the models, but the current runtime path executes `Action[]` directly and does not appear to traverse `ChooseOne` branches from `AbilityDefinition.Actions`.
#### Still blocked / still ambiguous examples
- **Eclipse Frontier — Glassfire Deceiver-Advocate** (`CanBeBlocked` or `CanUseAbility` rider)
- **Eclipse Frontier — Shrine-Canopy Witness** (`+1 Defense` or `+1 Damage`)
- **Frosthallow — Icewake Undertow** (push or pull)
- **Tidecrown — Drowned Archive Diver** (“draw 1, or if on Island draw 2 then discard 1 instead” as true mutually exclusive branching)
- Many Instinct cards across decks that ask for “choose one mode” rather than a single fixed template
#### Why this remains a real gap
There are two separate needs here:
1. **player-selected modal branching** (`ChooseOne`)
2. **mutually exclusive conditional branching** (“instead” / otherwise logic)
The current action executor only walks `Action[]`, with no visible branch-resolution layer. So even though the data model hints at branch support, the engine path still makes many earlier modal cards effectively templating-only.
#### Conclusion
This is still one of the main residual blockers for exact card-text fidelity.
---
### 3. Arbitrary player-chosen movement is only partially covered
The new `RepositionUnitEffect` is a real improvement and invalidates some older “no reposition support” claims. But it still does **not** fully solve the broader family of “choose exactly where this unit moves” cards.
#### What is now covered better than the old docs claim
Cards that merely needed a generic one-tile reposition are no longer in the same category as before. Old blanket statements like “arbitrary one-tile reposition is not a first-class effect” are now outdated.
#### What still remains awkward
`RepositionUnitEffect` currently:
- picks from legal candidates **randomly**
- can constrain destination relative to source or a prior target ref
- can filter destination tiles
What it does **not** obviously provide is:
- explicit **player choice of destination tile** among legal candidates
- exact “move into or adjacent to the chosen tile” UX/selection flow
- precise multi-step selection patterns where the user chooses tile A, then unit B, then destination C from a constrained subset
#### Examples still not cleanly exact
- **Amberthrone — Declare Common Right**
- **Eclipse Frontier — Rewrite the Boundary**
- **Frosthallow — Drag Them to Safety**
- **Red Shift — Declare Humanitarian Corridor**
- **Tidecrown — Recall the Convoy / Joren, Last Writ Through the Gale**
#### Revised conclusion
Old audits that treated all one-tile movement riders as hard-blocked are now too pessimistic. But **player-directed exact reposition flows** are still not cleanly solved.
---
### 4. Destination/history-sensitive movement text is still only partly covered
The revision added movement-related event data and several movement/tile conditions:
- `DestinationTileAffinityIsCondition`
- `PreviousTileAffinityIsCondition`
- `MovedFromOrIntoAffinityCondition`
- `IsCurrentlyMovingCondition`
That closes a lot of earlier “move onto X” and “from/into X” concerns. However, some movement text still remains ambiguous or not fully captured.
#### Now mostly covered, but old docs should be revised
- **Amberthrone — Ditchline Militia Captain** (“attacks from or into Plains”): still attack-specific and not cleanly solved by movement conditions alone
- **Red Shift — Pressure-Veil Djinn** (“if it crosses onto Marsh”): old wording is less blocked than before if “ends on Marsh” is acceptable, but exact crossing semantics are still fuzzy
- **Tidecrown — Storm Coast Interceptor** (“friendly units moving into Island gain `CanBeBlocked = false` this turn”): destination-affinity part is much closer now than earlier docs suggested
- **Frosthallow — Hask, Fang Against the Feud** (“friendly units entering Swamp gain `CanMove = true` this turn”): destination-affinity trigger support is much closer now
#### What still seems missing for exactness
- clean attack-event payload with both attacker origin and defender/attack destination terrain context
- robust distinction between “moved into”, “ended movement on”, and “crossed through” when displacement effects are involved
- clearer trigger/filter hooks that bind event movement context directly to the affected target without template gymnastics
#### Residual judgment
This category is no longer a broad blocker, but **attack-terrain context** and some **crossing/entry semantics** still remain ambiguous.
---
### 5. Channel-cost modification conditioned on destination tile still appears genuinely unsupported
This remains the cleanest unresolved economic/rules hook in the deck set.
#### Still blocked example
- **Red Shift — Allotment Exarch**
- “your Spirits cost 1 less SP to channel onto Marsh this turn”
#### Why it still looks unsupported
The engine has `ModifyCostEffect`, but that modifies card cost generically on a target card. There is still no obvious hook for:
- while channeling
- card type restricted to Spirit
- destination tile affinity check
- temporary rule-layer cost reduction during the payment/legality step
#### Conclusion
This old audit conclusion still holds.
---
### 6. Strong tile-marker / tile-reference comparison logic remains thin
Related to chosen-tile memory, but broader: the condition/filter system can reason about tile affinities and adjacency well, yet it still does not expose a general tile-reference equality language.
#### Why that matters
Some designs want:
- “the same tile chosen earlier”
- “the tile this unit moved to equals Action1.Target”
- “move into or adjacent to that chosen tile” with exact destination validation
`RepositionUnitEffect.RelativeToTargetRef` helps for some destination-generation cases, but there is still no broad condition language for comparing runtime tile references outside those bespoke effect fields.
#### Deck pressure points
- **Eclipse Frontier — Mark the Safe Route**
- **Red Shift — Declare Humanitarian Corridor**
- several “convert this tile, then route a unit relative to it” ArchSpirit signatures
---
## Areas that are now covered enough that prior audits should be considered outdated
These are not the main purpose of this memo, but they matter because several old “gap” calls no longer reflect the live engine.
### A. Once-per-turn trigger limits are now covered
Old docs repeatedly list “triggered once-per-turn caps” as missing. That is now outdated.
#### Examples affected
- **Amberthrone — Public Witness / Feed the Line**
- **Frosthallow — Shared Hearth / Long Night Covenant Whale**
- **Greenveil — Recover the Name / Crownseed Memory-Stag**
- **Sunscar — Caravan Counted / Proper Distribution / Open Wells Colossus**
- **Tidecrown — Harbor Testimony / Safe Passage Recognized / Shellfather Convoyback / Tidecrown Leviathan**
`TriggerLimitPerTurn` does not solve every wording nuance, but the old blanket “cap not present” conclusion is no longer correct.
### B. Death-prevention suites are now much better supported
Old docs often marked “would die; prevent that death and set to 1” as not cleanly implementable.
That conclusion is now at least partly outdated because the engine supports:
- `BeforeUnitDeathTrigger`
- `PreventDeathEffect`
- `SetHealthMinimumEffect`
#### Examples affected
- **Amberthrone — No Village Abandoned**
- **Eclipse Frontier — Witness-Covenant**
- **Frosthallow — Covenant of Survival / No Blood on the Oathground**
- **Greenveil — No Name Erased / Crownseed Restorer**
- **Sunscar — No Caravan Seized**
- **Tidecrown — No Convoy Turned Away**
There is still some implementation nuance around exact “first time each turn” plus terrain scoping, but these are no longer obvious hard engine blockers.
### C. End-of-sequence templating is now supported
Older Instinct audits often recommended downgrading to end of turn because end-of-sequence duration was said to be missing.
That is now outdated due to `DurationType.UntilEndOfSequence` and explicit cleanup in `ExpireEndOfSequenceEffects`.
#### Examples affected
- **Amberthrone — Public Accusation**
- **Eclipse Frontier — Objection Under Witness**
- **Frosthallow — Turn Them from the Shelter**
- **Greenveil — Branch Between Fangs / Silent Verdict**
- **Sunscar — Sand-Swerve Intercept / Canyon Rebuke**
- **Tidecrown — Cut the Smuggler’s Line / The Dead Point and Speak**
### D. Not / inverse terrain conditions are covered now
At least one older audit called out lack of negation support. That is now outdated because `NotCondition` exists.
#### Example affected
- **Eclipse Frontier — Tested Claim** (“if that enemy is not on Fort”)
### E. Relational adjacency filtering is broader now than several audits assumed
The new filters close some previously cited relational-scan gaps.
#### Examples where old conclusions should be revisited
- **Eclipse Frontier — Gate-Spire Intercessor** (“enemies adjacent to Fort units”)
- **Sunscar — Samir, Grace of Shared Water** (“enemies adjacent to Steppe tiles”)
These are not automatic slam-dunks in every exact wording case, but earlier audits often described the whole category as unavailable. That is now too strong.
### F. Tile-control counting is now covered
#### Example affected
- **Frosthallow — Rimefjord Ledger Warden** (“if you control a Swamp tile, gain 1 SP”)
This should now be expressible with `ControlledTileCountWithAffinityCondition`.
### G. Source-qualified damage triggers are less blocked than before
`OnDamageDealtTrigger` now supports `SourceFilter`, and the trigger matcher can evaluate that source card.
#### Examples affected
- **Amberthrone — Red Harvest Standard-Dead**
- **Eclipse Frontier — Tusk-Lord of the Audit Storm**
These should be reconsidered as closer to implementable than the original audits suggested.
---
## Current best synthesis: residual blocker list
If we strip away the now-outdated conclusions, the strongest remaining cross-deck residual gaps are:
1. **Deferred effects that must remember and later compare against a specific chosen tile**
- clearest example: **Mark the Safe Route**
2. **Actual branch execution / modal choice support in the runtime**
- affects many Instincts and several enter/aura cards
3. **Player-directed exact reposition flows**
- improved by `RepositionUnitEffect`, but still not fully solved where destination choice itself matters
4. **Channel-cost modification based on destination tile state**
- clearest example: **Allotment Exarch**
5. **Certain attack-context and move-history exactness questions**
- especially “attacks from or into X” and “crosses onto X” wording, where current hooks are closer but not perfectly exact
Those now look like the real post-revision gap set. Everything else in the old audits should be re-checked before being treated as still blocked.
---
## Recommended follow-up for the deck audit corpus
If the R1 deck audits are going to remain living references, the next cleanup pass should specifically revise or remove old “missing engine feature” claims in these categories:
- trigger caps
- death/damage prevention timing
- end-of-sequence duration
- negation
- tile-control counting
- adjacency relation filters
- source-filtered damage triggers
- blanket “no reposition support” language
The highest-value next engine work, based on the residual deck pressure, would be:
1. runtime `ChooseOne` support
2. tile-bound deferred marker state / tile equality comparisons
3. player-chosen destination support for reposition effects
4. channel-cost modifiers that inspect destination tile state
5. richer attack-context event payloads if exact text fidelity matters
+325
View File
@@ -0,0 +1,325 @@
# Deck R1 Residual Gap Redesigns
This document redesigns the **remaining cards that were still awkward primarily because of exact attack/move-history semantics**, rather than because of the bigger still-open systems gaps like modal branching, tile-bound deferred markers, or destination-tile channel cost rules.
The goal is not to preserve every word of the original prose.
The goal is to preserve the **gameplay intent** while making the cards fit the **current live ability system** cleanly.
---
## Design rule used here
When a card depended on one of these fuzzy/exact states:
- “attacks from or into X”
- “crosses onto X”
- “enters X” in a way that needed richer event context than is comfortable
- “started on X”
- “while moving” in a game that does not really have a continuous combat-time movement window
…I rewrote it toward one of these cleaner patterns:
- **if this is on X when it attacks**
- **when this moves onto X**
- **after this moves, if it is on X**
- **friendly units on X gain Y**
- **friendly units entering aura range gain Y**
That produces clearer tactics-game text and better engine fit.
---
# 1. Red Shift Exodus
## Pressure-Veil Djinn
### Original
> Active: push a unit 1 tile; if it crosses onto Marsh, deal 1 damage.
### Problem
This wants exact crossing / destination semantics after displacement.
That is much closer now than before, but still fussier than it needs to be.
### Redesigned version
> **Active — Pressure Break**: Push a unit 1 tile. If it ends on **Marsh**, deal 1 damage to it.
### Why this redesign works better
- preserves the “hydraulic displacement plus marsh punishment” feel
- uses the final board state, which is the tactically meaningful result anyway
- cleaner for rules and easier for players to reason about
### JSON-friendly direction
- target unit
- `PushUnit 1`
- second action targets same unit
- condition: `DestinationTileAffinityIs(Marsh)` or current tile on Marsh after resolution
- `DealDamage 1`
---
# 2. Eclipse Frontier
## Storm-Pledge Lancer
### Original
> If this attacks from or into Fort, it gains +1 Damage.
### Problem
This wants attacker-origin / attack-context terrain logic that is still a little too exact for the current model.
### Redesigned version
> **Fort-Crashing Charge**: If this unit is on **Fort** when it attacks, it gains +1 Damage for that attack.
### Why this redesign works better
- keeps the core identity: Fort is the launch platform for disciplined violent sorties
- removes the fuzzy “or into” half, which is the awkward part
- gives a clean tactical incentive: stage on Fort, then strike
### Alternate version if you want slightly more punch
> If this unit attacks while on **Fort**, it gains +1 Damage and `CanBeObstructed = false` until end of turn.
That makes it feel more like a downhill assault unit without invoking confusing “while moving” language.
---
## Sunken Tribunal Raykeeper
### Original
> Target enemy on Fort or adjacent to Fort loses `CanMove` and `CanAttack` until end of turn.
### Problem
The “adjacent to Fort” part is much more plausible now than before, but still more relationally fiddly than it needs to be.
### Redesigned version
> **Tribunal Lock**: Target enemy **on Fort** loses `CanMove` and `CanAttack` until end of turn.
### Why this redesign works better
- keeps the strongest thematic center: the tribunal dominates the sanctuary ground itself
- removes the extra adjacency complexity
- cleaner target scan, cleaner mental model
### If you want to keep some perimeter feel
A second passive or aura on another card can handle “near Fort” policing rather than forcing this one ability to do both jobs.
---
# 3. Amberthrone Fields
## Ditchline Militia Captain
### Original
> If this attacks from or into Plains, it gains +1 Damage.
### Problem
Same exactness issue as Storm-Pledge Lancer.
### Redesigned version
> **Field Drill Charge**: If this unit is on **Plains** when it attacks, it gains +1 Damage for that attack.
### Why this redesign works better
- preserves the intended battlefield story: organized attacks are stronger when launched from communal ground
- cleaner attack check
- easier to teach and easier to implement
### Optional stronger version
> If this unit is on **Plains** when it attacks, it gains +1 Damage and the target loses `CanMove` until end of turn.
That would make it feel like a line-breaker without depending on path/context weirdness.
---
# 4. Frosthallow Oaths
## Glacier Forgebinder
### Original
> If this attacks a unit on Swamp, that unit also loses `CanMove` until end of turn.
### Problem
This one is actually pretty close already, but still depends on attack target tile context in a way that can be annoying.
### Redesigned version
> **Freeze the Escape**: If **this unit is on Swamp when it attacks**, the attacked unit loses `CanMove` until end of turn.
### Why this redesign works better
- shifts the terrain condition from target-context to source-context
- preserves the feel of a Swamp hunter pinning prey in bad ground
- much cleaner mechanically
### Alternate if you want target-terrain flavor instead
> On attack, if the target is **currently on Swamp**, it loses `CanMove` until end of turn.
That may already be feasible depending on how conveniently the attack target is exposed into follow-up conditions, but the source-on-Swamp version is cleaner.
---
## Thawland Oathbound
### Original
> Enemies entering adjacent Swamp lose `CanAttack` until end of turn.
### Problem
This wanted a compound movement relation: destination tile is Swamp and destination is adjacent to source.
That is much closer now, but still more complex than the card probably needs.
### Redesigned version
> **Cold Perimeter**: When an enemy enters this aura range, if it is on **Swamp**, it loses `CanAttack` until end of turn.
### Why this redesign works better
- preserves the territorial warning / freezing border feeling
- uses aura + terrain check, which is a great fit for current engine patterns
- avoids bespoke adjacency-to-destination coupling
---
## Hask, Fang Against the Feud
### Original
> Friendly units entering Swamp gain `CanMove = true` this turn.
### Problem
`CanMove = true` is weak/odd unless something was removing movement, and the trigger wanted terrain-entry semantics.
### Redesigned version
> **Trail Through Mire**: When a friendly unit enters **Swamp**, it gains +1 MP this turn.
### Why this redesign works better
- this is what the design actually wants: momentum through bad terrain
- +1 MP is meaningful even when movement wasn’t disabled
- much better tactical card text
### Alternative cleaner version if you want aura-localized support
> When a friendly unit enters this aura range, if it is on **Swamp**, it gains +1 MP this turn.
That version is also strong and easier to localize to Hask.
---
# 5. Tidecrown Intrigue
## Storm Coast Interceptor
### Original
> Friendly units moving into Island gain `CanBeBlocked = false` this turn.
### Problem
Two issues:
1. “moving into Island” is a movement-history/state trigger
2. `CanBeBlocked = false` is probably the wrong mechanic language anyway for a turn-based tactics game
### Redesigned version
> **Breakwater Escort**: When a friendly unit enters **Island**, it gains `CanBeAttacked = false` until end of turn.
### Why this redesign works better
- preserves the intent: Island entry creates a moment of protected passage
- uses a cleaner and more meaningful tactical protection flag
- avoids the weird “while moving” / “blocked” semantic mess entirely
### Alternate milder version
> When a friendly unit enters **Island**, it gains +1 Defense until end of turn.
That’s softer if temporary untargetability feels too strong.
---
## Tidecrown Leviathan
### Original trigger rider
> the first one to enter Island each turn draws 1 then discards 1.
### Problem
This is much closer now because per-turn caps exist and destination-aware movement context exists, but if you want to simplify further:
### Redesigned version
> **Tide-Scribed Passage**: The first friendly unit to **enter Island** each turn draws 1 then discards 1.
### Why this redesign still works
Honestly this one may not even need redesign anymore. I’m listing it here only because it used to be in the awkward bucket.
Now it is probably fine as-is if the move-entry trigger path behaves correctly.
So my real recommendation is:
- **keep it** unless testing shows edge-case weirdness
---
# 6. Global cleanup recommendation for “while moving” text
Several earlier deck abilities used phrasing like:
- `CanBeBlocked = false while moving`
Based on your later rules clarification, I think those should generally be redesigned away from movement-window combat language.
## Better replacements by intent
### If the intent is mobility
Use:
- `CanBeObstructed = false`
- `+1 MP`
- “when this moves onto X…”
- reposition effects
### If the intent is safe passage
Use:
- `CanBeAttacked = false until end of turn`
- `+1 Defense until end of turn`
- prevent next damage
### If the intent is attack setup
Use:
- “if this unit is on X when it attacks…”
- “after this moves, it gains +1 Damage this turn”
Those all fit the game’s actual turn structure much better.
---
# 7. Short list: redesigned cards
These are the cards I would actually revise in the source deck docs or future card specs:
- **Pressure-Veil Djinn**
- from: “crosses onto Marsh”
- to: **ends on Marsh**
- **Storm-Pledge Lancer**
- from: “attacks from or into Fort”
- to: **attacks while on Fort**
- **Sunken Tribunal Raykeeper**
- from: “on Fort or adjacent to Fort”
- to: **on Fort**
- **Ditchline Militia Captain**
- from: “attacks from or into Plains”
- to: **attacks while on Plains**
- **Glacier Forgebinder**
- from: target-terrain attack condition
- to: **attacks while on Swamp** (cleanest version)
- **Thawland Oathbound**
- from: “entering adjacent Swamp”
- to: **enters aura range and is on Swamp**
- **Hask, Fang Against the Feud**
- from: `CanMove = true`
- to: **+1 MP on entering Swamp**
- **Storm Coast Interceptor**
- from: `CanBeBlocked = false` on moving into Island
- to: **CanBeAttacked = false until end of turn** on entering Island
---
# 8. Final read
At this point, the residual exactness cards are not a big engine crisis.
They are mostly a **design-language cleanup problem**.
That’s good news.
The best version of these cards is not necessarily the one that preserves every original poetic phrase. It’s the one that:
- matches the actual turn structure
- matches the current engine hooks
- remains tactically legible
- still feels like the same card
And for these, that’s very achievable.
@@ -0,0 +1,626 @@
# Proposed Changes for `SOR.Game/Abilities`
This document is meant to sit beside the copied reference snapshot in:
- `reference/SOR.Game/Abilities/`
It is a practical draft of what should be added or changed in the **current** ability system based on:
- the deck conversion audits in `decks-r1/`
- the cross-deck gap synthesis
- the freshly pulled current source from `SOR/Server/src/SOR.Game/Abilities`
The goal is not to redesign everything.
The goal is to make a **targeted set of additions** that unlocks a lot more card text cleanly.
---
# Design principles
1. **Prefer additive changes over rewrites**
- the current system is already strong
- we should extend the model, not tear it up
2. **Keep JSON authoring coherent**
- new conditions/effects/triggers should look like they belong beside the existing ones
3. **Favor generally useful primitives**
- e.g. `RepositionUnitEffect` is better than a bespoke “move one friendly unit adjacent to marsh tile” special case
4. **Preserve reversibility where possible**
- temporary effects should continue to use tracked durations and undo logic
5. **Support deck conversion first**
- the audited decks are a good real-world test suite
---
# Priority 1 — highest-value additions
## 1. Trigger frequency caps for Triggered abilities
## Problem
Current `UsesPerTurn` exists on `Active` only.
That makes these common lines awkward or impossible:
- once per turn
- first time each turn
- first friendly unit each turn
This came up repeatedly across deck audits.
## Proposed model change
### File
- `reference/SOR.Game/Abilities/Models/AbilityDefinition.cs`
### Add
```csharp
// ── Triggered only / shared runtime limiter ─────────────────────────────
/// <summary>
/// Maximum times this ability may resolve per turn.
/// 0 or null = unlimited.
/// Intended primarily for Triggered abilities.
/// </summary>
public int? TriggerLimitPerTurn { get; set; }
```
Optionally, if you want a more semantic flag:
```csharp
public bool FirstTimeEachTurn { get; set; }
```
but I think `TriggerLimitPerTurn = 1` is cleaner and more general.
## Engine work
### File
- `AbilitySystem.cs`
Need per-turn runtime tracking keyed by something like:
- source instance id
- ability name or ability index
- turn number
Pseudo-shape:
```csharp
Dictionary<(Guid SourceInstanceId, string AbilityKey, int TurnNumber), int> TriggerCounts
```
Before resolving a triggered ability:
- look up count
- if `TriggerLimitPerTurn` reached, skip
- otherwise resolve, then increment
## Why this is high value
This unlocks a huge amount of card text with very little authoring complexity.
---
## 2. First-class `RepositionUnitEffect`
## Problem
The engine has:
- `PushUnit`
- `PullUnit`
- `DisplaceUnit`
- `GrantMovementControl`
But many designs want:
- “move target unit 1 tile”
- “another friendly unit may move 1 tile”
- “move into or adjacent to a target tile”
Push/pull are not the same thing.
Granting MP is only an approximation.
## Proposed model change
### File
- `Models/Effects.cs`
### Add polytype + effect
```csharp
[PolyType(typeof(RepositionUnitEffect), "RepositionUnit")]
```
```csharp
public sealed class RepositionUnitEffect : Effect
{
/// <summary>
/// Maximum number of tiles the unit may be repositioned.
/// Most first-pass use cases are 1.
/// </summary>
public int Tiles { get; set; } = 1;
/// <summary>
/// When true, destination must be adjacent to the source unit.
/// </summary>
public bool AdjacentToSource { get; set; }
/// <summary>
/// Optional reference to a previously selected tile target,
/// e.g. "Action1.Target". Useful for “into or adjacent to that tile”.
/// </summary>
public string? RelativeToTargetRef { get; set; }
/// <summary>
/// If set, destination must be adjacent to the tile/entity referenced by RelativeToTargetRef.
/// </summary>
public bool AdjacentToRelativeTarget { get; set; }
/// <summary>
/// If set, destination may be exactly the referenced tile.
/// </summary>
public bool AllowRelativeTargetTile { get; set; }
/// <summary>
/// Optional additional tile legality filters for destination selection.
/// </summary>
public Filter[]? DestinationTileFilters { get; set; }
}
```
## Engine work
### File
- `AbilitySystem.cs`
Needs:
1. resolve the unit target
2. compute legal destination tiles
3. if client target selection is required, validate chosen destination
4. move unit directly without consuming normal MP unless intended otherwise
5. fire appropriate move-related triggers if reposition should count as movement
## Important decision
Decide whether reposition:
- counts as movement for `OnUnitMove`
- triggers “moves onto Marsh” effects
My recommendation:
- **yes**, unless you deliberately add a flag like `CountsAsMovement = false`
That will make card text feel more intuitive.
---
## 3. Replacement/prevention timing
## Problem
The system currently has good post-event triggers, but weak pre-resolution hooks.
That blocks text like:
- if it would die, prevent that death and set health to 1
- prevent the next damage
- prevent damage this action
## Proposed additions
### File
- `Models/Triggers.cs`
Add:
```csharp
[PolyType(typeof(BeforeUnitDeathTrigger), "BeforeUnitDeath")]
[PolyType(typeof(BeforeDamageAppliedTrigger), "BeforeDamageApplied")]
```
```csharp
public sealed class BeforeUnitDeathTrigger : TriggerEvent
{
public string UnitType { get; set; } = "Unit";
public string Ownership { get; set; } = "Any";
public Filter? Filter { get; set; }
}
public sealed class BeforeDamageAppliedTrigger : TriggerEvent
{
public string SourceOwnership { get; set; } = "Any";
public string TargetOwnership { get; set; } = "Any";
public Filter? Filter { get; set; }
}
```
### File
- `Models/Effects.cs`
Add:
```csharp
[PolyType(typeof(PreventDeathEffect), "PreventDeath")]
[PolyType(typeof(PreventNextDamageEffect), "PreventNextDamage")]
[PolyType(typeof(SetHealthMinimumEffect), "SetHealthMinimum")]
```
```csharp
public sealed class PreventDeathEffect : Effect { }
public sealed class PreventNextDamageEffect : Effect
{
public ValueExpr? MaxAmount { get; set; }
}
public sealed class SetHealthMinimumEffect : Effect
{
public int Minimum { get; set; } = 1;
}
```
## Engine work
This is the trickiest part.
You need a pre-resolution pathway where:
- impending lethal damage / death is recognized
- triggered prevention abilities can fire
- damage/death resolution can be altered or canceled
A practical first pass:
1. before finalizing death, emit `BeforeUnitDeath`
2. allow effects to set a unit-level transient marker like `PreventDeathThisResolution`
3. if set, suppress death and optionally apply `SetHealthMinimum`
For damage prevention:
1. before applying damage, emit `BeforeDamageApplied`
2. collect prevention effects / caps
3. reduce or cancel the damage payload
4. emit `OnDamagePrevented` if relevant
## Why this matters
This is what unlocks the most iconic “mercy / covenant / rescue / shield” cards.
---
## 4. Destination-aware movement context
## Problem
A lot of cards want to know:
- where a unit moved from
- where it moved to
- whether it moved onto a terrain type
- whether it moved from or into an affinity
Right now movement triggers are not rich enough.
## Proposed change
### File
- `AbilityContext.cs`
Extend movement trigger event data with something like:
```csharp
public sealed class TriggerEventData
{
// existing fields...
public Coord? PreviousTile { get; set; }
public Coord? DestinationTile { get; set; }
}
```
Or richer:
```csharp
public Affinity? PreviousTileAffinity { get; set; }
public Affinity? DestinationTileAffinity { get; set; }
```
### File
- `Models/Conditions.cs`
Add:
```csharp
[PolyType(typeof(DestinationTileAffinityIsCondition), "DestinationTileAffinityIs")]
[PolyType(typeof(PreviousTileAffinityIsCondition), "PreviousTileAffinityIs")]
[PolyType(typeof(MovedFromOrIntoAffinityCondition), "MovedFromOrIntoAffinity")]
```
Example shapes:
```csharp
public sealed class DestinationTileAffinityIsCondition : Condition
{
public Affinity Affinity { get; set; }
}
public sealed class PreviousTileAffinityIsCondition : Condition
{
public Affinity Affinity { get; set; }
}
public sealed class MovedFromOrIntoAffinityCondition : Condition
{
public Affinity Affinity { get; set; }
}
```
## Why this matters
It directly improves:
- move triggers
- reposition effects
- terrain identity gameplay
And it avoids a pile of awkward card-specific hacks.
---
# Priority 2 — strong cleanup additions
## 5. `NotCondition`
## Problem
You have `AND`, `OR`, `XOR` but not `NOT`.
That makes inverse card text clunky.
## Proposed change
### File
- `Models/Conditions.cs`
Add:
```csharp
[PolyType(typeof(NotCondition), "NOT")]
```
```csharp
public sealed class NotCondition : Condition
{
public Condition Condition { get; set; } = null!;
}
```
## Engine work
Add evaluation support in condition resolver.
## Why it matters
Tiny change, big templating payoff.
---
## 6. More relational conditions and filters
## Problem
You can target tiles adjacent to units now, which is good.
But we still need things like:
- target unit adjacent to Fort tile
- enemies adjacent to a friendly Fort unit
- unit on or adjacent to Marsh
## Proposed additions
### File
- `Models/Conditions.cs`
Add:
```csharp
[PolyType(typeof(IsAdjacentToTileWithAffinityCondition), "IsAdjacentToTileWithAffinity")]
[PolyType(typeof(IsOnOrAdjacentToTileWithAffinityCondition), "IsOnOrAdjacentToTileWithAffinity")]
```
```csharp
public sealed class IsAdjacentToTileWithAffinityCondition : Condition
{
public Affinity Affinity { get; set; }
}
public sealed class IsOnOrAdjacentToTileWithAffinityCondition : Condition
{
public Affinity Affinity { get; set; }
}
```
### File
- `Models/Filters.cs`
Add:
```csharp
[PolyType(typeof(IsAdjacentToUnitMatchingFilter), "IsAdjacentToUnitMatching")]
[PolyType(typeof(IsAdjacentToTileMatchingFilter), "IsAdjacentToTileMatching")]
```
```csharp
public sealed class IsAdjacentToUnitMatchingFilter : Filter
{
public string Ownership { get; set; } = "Any";
public Filter[]? UnitFilters { get; set; }
}
public sealed class IsAdjacentToTileMatchingFilter : Filter
{
public Filter[]? TileFilters { get; set; }
}
```
## Why it matters
This unlocks a lot of positional deck identity without weird special-cases.
---
## 7. `UntilEndOfSequence`
## Problem
Interrupt cards and prevention windows often want:
- until this action resolves
- until end of current sequence
End-of-turn is too broad.
## Proposed change
### File
- `Models/DurationModel.cs`
Add:
```csharp
UntilEndOfSequence
```
## Engine work
Need a clear definition of “sequence.”
I would define it as:
- one top-level action resolution block
- including all chained actions/effects inside it
- but ending before the next interrupt window / new top-level action
## Why it matters
This makes Instinct/protection design dramatically cleaner.
---
# Priority 3 — useful but can wait a bit
## 8. Movement-state-sensitive conditions
## Problem
Cards often want:
- can’t be blocked while moving
- gains X only during movement
## Proposed additions
### File
- `Models/Conditions.cs`
Add:
```csharp
[PolyType(typeof(IsCurrentlyMovingCondition), "IsCurrentlyMoving")]
```
```csharp
public sealed class IsCurrentlyMovingCondition : Condition { }
```
You may also want a movement-phase duration concept later, but I’d avoid overcomplicating this first.
---
## 9. Source-qualified damage triggers
## Problem
Some card text wants:
- enemies damaged by **this**
- whenever **this unit** deals damage
`OnDamageDealt` is broad, but exact source matching is important.
## Proposed addition
### File
- `Models/Triggers.cs`
Extend `OnDamageDealtTrigger` with:
```csharp
public Filter? SourceFilter { get; set; }
```
or a direct exact-self option.
---
## 10. Tile-control / tile-count conditions
## Problem
Decks often want:
- if you control a Marsh tile
- if you control 3+ Grove tiles
## Proposed addition
### File
- `Models/Conditions.cs`
Add something like:
```csharp
[PolyType(typeof(ControlledTileCountWithAffinityCondition), "ControlledTileCountWithAffinity")]
```
```csharp
public sealed class ControlledTileCountWithAffinityCondition : Condition
{
public Affinity Affinity { get; set; }
public Comparator Comparator { get; set; } = Comparator.GreaterThanOrEqual;
public int N { get; set; }
public string Ownership { get; set; } = "Owner";
}
```
Need to define “control” clearly. Likely:
- occupied by your unit
- or in your starting side / claimed side if such system exists
If “control” is not fully formalized yet, defer until game-side semantics are settled.
---
## 11. Reveal-result references
## Problem
Future designs may want:
- reveal top card; if it is X, do Y
## Proposed addition
Expose reveal results in action context for chained actions.
This is useful, but not as urgent as the others.
---
# Current features that should be kept and leaned into
These are already solid and should remain the backbone:
- terrain-conditioned passives
- aura entry/leave triggers
- push/pull displacement
- tile affinity mutation
- draw/discard/zone actions
- ruin randomization pattern
- reversible temporary stat/flag effects
- `ApplyOnEvent` deferred effects
- `ClearOnLeave` / `LingerDuration` on auras
- `ChooseOne` support if it is indeed now functional in execution
---
# Suggested concrete implementation order
If I were actually patching the code, I would do this order:
## Phase 1
1. `TriggerLimitPerTurn`
2. `NotCondition`
3. `RepositionUnitEffect`
4. destination-aware movement context + conditions
## Phase 2
5. `BeforeUnitDeath` / `BeforeDamageApplied`
6. `PreventDeathEffect` / `PreventNextDamageEffect`
7. `UntilEndOfSequence`
## Phase 3
8. relational adjacency filters/conditions
9. movement-state-sensitive conditions
10. source-qualified damage triggers
11. tile-control conditions
That order gives the biggest card-authoring payoff early.
---
# Example of what this unlocks immediately
With just:
- `TriggerLimitPerTurn`
- `RepositionUnitEffect`
- destination-aware movement conditions
- prevention timing
…a huge amount of the audited deck text becomes native instead of templated compromises.
Examples:
- “once per turn, when a Spirit enters aura range…”
- “move another friendly unit 1 tile”
- “if it moved onto Marsh, draw 1 then discard 1”
- “if that unit would die, prevent that death and set it to 1”
- “prevent the next damage this sequence”
That’s a big payoff for a relatively focused tranche of engine work.
---
# Final read
The current ability system is already good.
This proposal is not about fixing a broken design.
It’s about making a strong design noticeably more expressive with a handful of additions that repeatedly showed up across real deck conversions.
If you end up copy-pasting parts of this into the live system planning, my strongest recommendation is:
> implement the things that remove the most templating compromises first, not the flashiest features.
That means:
- trigger caps
- reposition
- prevention timing
- movement destination awareness
Those four pull the most weight.
@@ -0,0 +1,353 @@
# SOR Ability System Gaps Found via Deck Conversion
This document summarizes the recurring engine gaps found while converting the R1 deck audits for:
- `red_shift_exodus_deck_orison_migration_covenant.md`
- `eclipse_frontier_deck_lattice_witness_compact.md`
- `amberthrone_fields_deck_grain_oath_concord.md`
- `frosthallow_oaths_deck_white_truce_covenant.md`
- `greenveil_reckoning_deck_crownseed_remembrance.md`
- `sunscar_caravans_deck_sun_ledger_procession.md`
- `tidecrown_intrigue_deck_open_harbors_claim.md`
The current SOR ability system is already pretty capable for:
- terrain-conditioned passives
- straightforward actives with costs and ranges
- aura entry triggers
- stat buffs/debuffs
- flag changes like `CanMove`, `CanAttack`, `CanBeAttacked`, `CanUseAbility`
- tile affinity rewriting
- push/pull displacement
- random ruin activations
- zone actions like draw, discard, and simple return-to-hand
The repeated pressure points are not about raw complexity so much as **state memory, relational targeting, and replacement timing**.
---
## 1. Highest-value engine additions
If only a few additions are made, these would unlock the most design space across all audited decks.
### 1.1 Trigger frequency caps for triggered abilities
Repeated need:
- “once per turn”
- “the first time each turn”
Examples:
- Brakka / Sevra / Ilyra / Elowen / Ulla tier-1 economy triggers
- aura-entry riders on multiple tier-2/tier-3 leaders and mythics
- Polyphonic Sanctuary Hydra / Long Night Covenant Whale / Open Wells Colossus / Tidecrown Leviathan
**Current issue:** `UsesPerTurn` exists only for Active abilities.
**Recommended addition:**
- `TriggerLimitPerTurn` or `UsesPerTurn` on `Triggered` abilities
- optional per-source vs per-card-definition semantics
**Impact:** very high. This fixes a huge class of nearly-implementable text without touching targeting or combat rules.
---
### 1.2 First-class reposition effect
Repeated need:
- “move a friendly unit 1 tile”
- “another friendly unit may move 1 tile”
- “move into or adjacent to target tile”
Examples:
- multiple courier/escort cards across all decks
- many ArchSpirit tier-3 “target tile becomes X, then a friendly unit may move 1 tile” abilities
- many Repentance and Instinct cards using emergency repositioning
**Current issue:**
The engine has `PushUnit`, `PullUnit`, `DisplaceUnit`, and `GrantMovementControl`, but not a clean “choose adjacent legal destination” effect.
**Recommended addition:**
- `RepositionUnitEffect`
- destination constraints:
- adjacent legal tile
- adjacent to source
- into / adjacent to a previously targeted tile
- optional ownership/pathing restrictions
**Impact:** very high. This would remove the single most common templating compromise in the audits.
---
### 1.3 Replacement / prevention timing
Repeated need:
- “would die instead survive at 1”
- “prevent damage”
- “before damage finalizes”
Examples:
- all tier-3 leader survival covenants
- Crownseed Restorer
- Night Dock Amnesty / No Blood on the Oathground style effects
**Current issue:**
The engine has `OnUnitDeath` and `OnDamagePrevented`, but no clean **pre-resolution replacement window**.
**Recommended addition:**
- new triggers like `BeforeUnitDeath`, `BeforeDamageApplied`, or `WouldTakeLethalDamage`
- effects such as:
- `PreventDeathEffect`
- `SetHealthMinimumEffect`
- `PreventNextDamageEffect`
- optional sequence-scoped durations
**Impact:** very high. This unlocks the decks’ most iconic “mercy / rescue / covenant” mechanics.
---
### 1.4 Destination-aware movement event data
Repeated need:
- “when this moves onto X” is fine if current tile check is enough
- but many cards need more: “moves into X,” “enters Island,” “crosses onto Marsh,” “entering adjacent Swamp,” “moving into Island gain unblockable,” etc.
Examples:
- Pressure-Veil Djinn
- Thawland Oathbound
- Hask, Fang Against the Feud
- Storm Coast Interceptor
- Tidecrown Leviathan trigger rider
- attack / move riders involving “from or into” terrain
**Current issue:**
Movement triggers do not expose previous tile, destination tile, or path-crossing info in a broadly usable condition model.
**Recommended addition:**
- movement event payload fields:
- `SourceTile`
- `DestinationTile`
- `CrossedTiles` or at least destination
- conditions:
- `DestinationTileAffinityIs`
- `PreviousTileAffinityIs`
- `MovedFromOrIntoAffinity`
**Impact:** high.
---
## 2. Strongly recurring secondary gaps
### 2.1 Movement-state-sensitive flag application
Repeated need:
- `CanBeBlocked = false while moving`
- sometimes similar “only during movement” text
Examples across multiple decks:
- Serai tier-2
- Brakka roads package
- Ulla tier-2
- Elowen tier-2
- Sevra tier-2
**Current issue:**
The engine can set `CanBeBlocked`, but not condition it on “currently resolving movement.”
**Recommended addition:**
- movement-phase condition/state flag
- or support for scoped effect windows like `DuringMovement`
**Impact:** medium-high. Very common rider text.
---
### 2.2 Relational targeting / filtering beyond source adjacency
Repeated need:
- enemies adjacent to **Fort units**
- enemies adjacent to **Steppe tiles**
- unit on Fort **or adjacent to Fort**
- unit adjacent to a tile with affinity X
Examples:
- Gate-Spire Intercessor
- Sunken Tribunal Raykeeper
- Samir, Grace of Shared Water
- several other adjacency-to-terrain ideas
**Current issue:**
The engine has `IsAdjacentToSourceFilter` and some tile filters, but not richer relational filters from one arbitrary set to another.
**Recommended addition:**
- `IsAdjacentToUnitMatching(Filter...)`
- `IsAdjacentToTileMatching(Filter...)`
- `UnitOnOrAdjacentToAffinityCondition`
**Impact:** high for positional deck design.
---
### 2.3 Negation / NOT conditions
Repeated need:
- “if that enemy is not on Fort”
- inverse terrain checks
**Current issue:**
Conditions support `AND`, `OR`, `XOR` but no explicit `NOT`.
**Recommended addition:**
- `NotCondition`
**Impact:** medium. Small implementation, broad templating payoff.
---
### 2.4 Modal branch support / ChooseOne execution
Repeated need:
- “choose one” modes
- “A or B” on enter or in Instinct/Repentance cards
- “instead” branches that want exclusive resolution
Examples:
- Shrine-Canopy Witness
- Glassfire Deceiver-Advocate
- Root-Memory Appeal
- Return the Name variants
- many Instinct cards with protection-or-move / push-or-pull / one flag or another
**Current issue:**
`ChooseOne` types exist in `Action.cs`, but `AbilityDefinition.Actions` is still `Action[]`, and `AbilitySystem.ExecuteActions` only processes `Action[]`.
**Recommended addition:**
- lift `Actions` to support `Action | ChooseOne` nodes
- add resolver path and client choice plumbing
**Impact:** high for card variety and cleaner templating.
---
### 2.5 End-of-sequence / action-window duration
Repeated need:
- “until end of sequence”
- “this action” prevention
- interrupt-window-only safety effects
Examples:
- many Instinct cards
- action-window damage prevention cards
**Current issue:**
Current durations include `UntilEndOfTurn`, `UntilStartOfOwnerTurn`, `ForNTurns`, etc., but not a stack/sequence lifetime.
**Recommended addition:**
- `UntilEndOfSequence`
- possibly `UntilCurrentActionResolves`
**Impact:** medium-high for reactive card design.
---
## 3. Niche but still valuable additions
### 3.1 Named-card / card-ref presence conditions
Needed for text like:
- “if Brakka is in play”
**Recommended addition:**
- battlefield condition by definition ID / ability source card name / card ref
### 3.2 Player tile-control conditions
Needed for text like:
- “if you control a Swamp tile”
**Recommended addition:**
- `ControlledTileCountWithAffinityCondition`
- or general tile-count query conditions
### 3.3 Reveal-result references
Needed for text like:
- “reveal top card; if it is Repentance or Instinct, draw it”
**Recommended addition:**
- revealed card references in action context
- card-type conditions on revealed cards
### 3.4 Source-qualified damage triggers
Needed for text like:
- “enemies damaged by this”
**Recommended addition:**
- `OnDamageDealt` filtering by exact source instance or source filter
### 3.5 Tile-bound delayed markers
Needed for text like:
- “mark target tile; the next friendly unit to move onto it gains X”
**Recommended addition:**
- deferred effects anchored to tile coordinates with one-shot consumption
---
## 4. What the current system already does well
These deck passes also confirm that the current engine is already strong in a lot of useful ways.
### 4.1 Terrain-conditioned passives
Using:
- `IsOnTileWithAffinityCondition`
- passive actions
- `WhileSourceOnBattlefield` tracking
This supports a lot of deck identity already.
### 4.2 Basic tempo control
Very common card text already works:
- lose `CanMove`
- lose `CanAttack`
- lose `CanUseAbility`
- gain `CanBeAttacked = false`
- gain/lose stats until end of turn
### 4.3 Aura entry triggers
`OnEnterAuraRange` is genuinely useful and already enables a lot of “escort / witness / support” gameplay.
### 4.4 Random ruin activations
The ruin execution model is a great fit for “choose one at random from three triggered abilities.”
### 4.5 Core zone actions
Draw, discard, simple return-to-hand, and some discard recursion already cover a lot of deck glue.
---
## 5. Recommended implementation order
If the goal is to improve deck conversion throughput quickly, this is the order I would implement.
### Phase 1: highest deck-conversion payoff
1. Trigger frequency caps on triggered abilities
2. First-class `RepositionUnitEffect`
3. Replacement/prevention timing (`BeforeUnitDeath`, damage prevention)
4. Destination-aware movement event payload / conditions
### Phase 2: make card text cleaner and less compromised
5. `NotCondition`
6. Relational adjacency filters (`adjacent to unit matching`, `adjacent to tile matching`)
7. Movement-state-sensitive flag windows
8. `UntilEndOfSequence`
### Phase 3: expand expressive card design
9. Full `ChooseOne` / modal branch execution
10. Source-qualified damage triggers
11. Player tile-control conditions
12. Reveal-result references
13. Tile-bound delayed markers
---
## 6. Bottom line
The R1 audits show that the current SOR ability system is **already good enough for a large percentage of these decks**.
Most failures are not because the decks are wildly overdesigned. They fail in a few repeated categories:
- **once-per-turn trigger control**
- **real reposition instead of push/pull approximations**
- **death/damage prevention timing**
- **movement destination/state memory**
- **relational targeting around terrain or other units**
That is good news.
It means the next tranche of engine work should not be a giant rewrite. A focused set of additions would convert a lot of currently “templating choice” or “not cleanly implementable” text into fully native card designs.