Server engine (SOR.Game):
- Zone-scope card targets (Hand/Deck/Discard/AnyZone) pause with a server-
enumerated candidates list (PendingTargetPick.CandidatesJson) instead of
failing when the client submits player accountIds for hidden zones
- Missing mandatory target picks now prompt (PendingTargetPick) rather than
throwing INSUFFICIENT_TARGETS; all post-pick resume flows run with
requireClientTargets so actions never silently auto-hit the first candidate
- ChannelCardFromZone: Filters + InOwn/InTargetChannelRange enforced via shared
IsWithinChannelConstraints (incl. player-picked tile validation)
- TakeControl duration reversal via internal __ReturnControl effect; board
occupant-owner kept in sync both ways
- TrackedDuration gains SourceOwnerAccountId (UntilStartOfSourceOwnerTurn now
anchors correctly) and IsAura (aura reapply no longer strips unrelated buffs)
- RevealCards honours N for player targets; IsAllyTurn means teammate's turn;
content-keyed ParseAbilities cache; AbilityValidator for save-time linting;
duplicate PolyType attributes removed (converter reads base registry only)
Admin builder (AbilityBuilder/CardEditor):
- Full multi-filter editor (28 filter types with parameter fields) replacing
the single param-less dropdown; raw-JSON ChooseOne editor per action
- Cost PickMode, TriggerLimitPerGame, SourceZoneGate inputs
- Save-time ability validation with error list (blocks invalid saves)
Client (Godot):
- Card-list picker for zone-scope target picks; OR/XOR-root abilities skip
speculative upfront targeting; ally units included in team-aware highlight
pools (Game.get_ally_units); state re-sync on rejected pick responses
Tests: new SOR.Game.Tests project (21 passing) covering the regression suite
from SOR.Abilities-Review-and-solutions.md §8 plus validator rules.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SOR.Bazaar has no project reference to SOR.Collection, so the using
in BazaarGetSuggestedPriceHandler caused CS0234.
- Move CardSalvageValues class to SOR.Database (shared by both assemblies)
- Replace SOR.Collection/CardSalvageValues.cs with a global using alias
so Collection handlers continue to work without changes
- Update BazaarGetSuggestedPriceHandler to use SOR.Database instead of SOR.Collection
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Server:
- CardSalvageValues: rarity-base + (SpCost+StCost)*CostMultiplier formula, foil 2x
- CollectionSalvageCardHandler: collection.salvage_card — validates ownership,
tradeable, not listed, deck copy check, then atomically deletes card + credits OP
- BazaarGetPlayerShopHandler: bazaar.get_player_shop — paginated active listings
for any seller with their display name (public read endpoint)
- BazaarGetSuggestedPriceHandler: bazaar.get_suggested_price — recent sale avg
if ≥3 sales, otherwise 4× salvage floor
- Added GetPlayerShopRequest/Response + GetSuggestedPriceRequest/Response DTOs
- Added SalvageCardRequest/Response DTOs
- Registered all 3 new handlers in their respective ServiceRegistration files
Client:
- card_detail_popup: List for Sale form (with live price suggestion) + Salvage
button with OP preview; both gated on IsTradeable
- salvage_confirm_popup: confirmation modal that calls collection.salvage_card,
emits confirmed(player_card_id, op_awarded) on success
- bazaar_screen: My Shop tab (own active listings + cancel), player storefront
search by account ID, sort options for own listings
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Remove max_players == 2 gate; use per-seat Add AI buttons in the
additional players panel instead of the guest-slot button
- Fix seat-indexed panel rendering: unified loop over all additional
seats detects AI slots, human players, and empty seats correctly
- Add _ai_adding guard to prevent concurrent add-AI requests that
caused the server race (second request overwrote first AI slot)
- Fix push handler reading wrong key ("slots" → "currentAiSlots")
which wiped ai_slots on every push, leaving only the newest AI
- Fix ACK handler reading wrong keys ("aiId"/"displayName" →
"aiAccountId"/"aiDisplayName")
- Server: fix all-ready check that required GuestAccountId.HasValue,
blocking start for no-guest lobbies filled via AdditionalPlayersJson
- Server: fix StartGameAsync null-deref on GuestAccountId and add
no-guest branch (host=P1, first additional=P2, rest=seats 2+)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- AbilitySystem: add static ILogger + InitLogger(ILoggerFactory)
- Log [ABILITY] START/END with actor ST/SP, PayCostGroup before/after,
ExecuteActions entry count
- Log [COST] SacrificeTokens/SpiritPoints before and after deduction
- Log [EFFECT] SummonToken coord, tile state, token affinity, every
silent break path, and SUCCESS with ST at placement time
- Program.cs: call AbilitySystem.InitLogger at startup
- appsettings.json: add Debug override for SOR.Game.AbilitySystem
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- §2 UnitDelta: note Art2dUrl/ModelUrl removed; only in UnitSnapshot
- §6 Push Decision: note spectator registry is now Redis-backed
- §9 Push Dispatch: note _fetch_state is guarded by _syncing flag
- §11 _merge_unit_delta: remove stale art2dUrl/modelUrl snippet; add note
that URLs are applied once on unitsAdded and stay on the unit dict
- §12 Fallback/Resync: update _fetch_state row (_syncing guard, session-id
validation); update arch spirit null row (is Dictionary guard)
- §14: replace "Known Issues & Planned Fixes" with "Fixes Applied" —
documents all 6 commits with root cause, resolution, and files changed
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Add _syncing: bool flag; _fetch_state() returns immediately if a
game.get_state request is already in-flight — prevents multiple
concurrent full-sync requests on poor connections or reconnect bursts
- _syncing cleared in both success and error callbacks, and in _clear_state()
so it resets cleanly when the session ends
- _apply_state_from_payload: reject responses whose sessionId doesn't match
the current session_id, discarding stale full-state responses that were
in-flight when the player left or started a new game
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- New Platform.gd autoload: is_ios_safari() detects iPhone/iPad Safari
via JavaScriptBridge UA check (no Chrome/CriOS), gating all iOS memory paths
- ModelCache.release_model(url, etag): evicts a model from in-memory cache
on iOS Safari when a unit leaves the board; no-op on other platforms so
disk cache is always preserved for fast reload
- unit_mesh_builder: stores resolved model URL+ETag per unit (_unit_model_urls,
_unit_model_etags); calls ModelCache.release_model in the to_remove loop so
PackedScene refs are freed as soon as the unit is pooled or freed
- ContentCache.get_model_url_for_definition: stub for looking up a card's
Model3D CDN URL without a loaded unit dict (foundation for future eviction paths)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
These URLs are fixed for the lifetime of a card definition and are
already delivered once in the initial UnitSnapshot (CardInstanceDto).
Sending them again in every UnitDelta was wasting bandwidth on every
stat change, move, and attack.
Server:
- GameStateDiffer.DiffUnit: remove Art2dUrl/ModelUrl from the anyChange
detection block and from the UnitDelta constructor call
- GameMessages.UnitDelta record: remove string? Art2dUrl and ModelUrl
fields (CardInstanceDto/UnitSnapshot retains both — first placement
delivery is unaffected)
Client:
- Game.gd _merge_unit_delta: remove the five URL merge lines
(art2dUrl, Art2dUrl, modelUrl, ModelUrl, modelurl). Values on the
unit dict are set once via unitsAdded and stay for the unit's lifetime.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
GDScript dict.get(key, fallback) only returns the fallback when the key
is absent. When a player disconnects the server sets archSpirit to null
(key present, value null), so .get("archSpirit", {}) returns null and
the next .get("instanceId") call crashes with 'Nonexistent function
get in base Nil'.
- get_unit_by_id (~line 276): replace typed Dictionary assignment with
Variant + 'is Dictionary' guard (same pattern already used correctly
in get_all_enemy_units)
- _apply_delta §7 (~line 633): replace typed Dictionary assignment with
Variant + null/type guard before casting; null or non-Dictionary
triggers request_sync() the same as an empty baseline would
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Spectator registrations were held in a per-process ConcurrentDictionary,
causing spectators to miss updates when game actions were handled by a
different pod than the one that processed game.spectate.
Changes:
- SpectatorRegistryService: replace ConcurrentDictionary with Redis Set
operations (SADD/SREM/SMEMBERS/DEL) via IConnectionMultiplexer.
All four methods are now async (RegisterAsync, UnregisterAsync,
GetSpectatorsAsync, RemoveSessionAsync). TTL of 24h on each SADD
for self-expiry on abnormal session end.
- RedisKeys: add SpectatorSet(Guid sessionId) -> "spectators:{id}"
- SOR.Game.csproj: add StackExchange.Redis package reference
- GameHandlerBase: all GetSpectators/RemoveSession call sites updated
to await the new async methods (BroadcastToAllViewersAsync,
PushStateToPlayersAsync x3, FinalizeGame x2, BroadcastPlayerEliminated)
- GameSpectateHandler: await RegisterAsync
- GameStopSpectatingHandler: make HandleAsync truly async, await UnregisterAsync
- ServiceRegistration: update comment to reflect Redis backing
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Issue 1: SpectatorRegistryService is in-memory per-process; spectators
miss updates in scaled deployments due to load-balancer routing mismatch.
Fix: move registry to Redis.
- Issue 2: get_unit_by_id null crash when arch is null (not absent) on
player disconnect. Fix: use 'is Dictionary' guard instead of .get({}).
- Issue 3: ChangedTiles must only include actually-changed tiles; fix is
server-side only.
- Issue 4: modelUrl/art2dUrl sent in every UnitDelta; strip from delta,
derive from card definition; iOS Safari: cache on first sight.
- Issue 5: iOS Safari memory crash from unbounded asset cache; layered
fix: scoped loading, lazy load, disk cache for non-iOS, evict on removal.
- Issue 6: _fetch_state() race on version gap; fix with _syncing flag.
- §12: clarified IsEmpty should never fire in practice (MP always regenerates).
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Covers data model, channeling flow, FireRuinAbilities activation logic,
priority/ordering rules, ruin-specific effects, observer triggers,
double-fire guard (6-D), network deltas, and full client handling.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Adds six new sections:
- §23 Failure/Error paths — all GameException codes with line refs, client error propagation behavior
- §24 State version & delta sync — full vs delta push decision, client version gap handling, _fetch_state
- §25 Trigger re-entrancy & ordering — no depth guard, iteration order, TriggerLimit as only loop protection
- §26 Cost atomicity & rollback — costs-before-effects invariant, interactive pause semantics, no rollback
- §27 Known caveats & gotchas — line drift, ActionGroup/Actions exclusivity, ChooserRole defaults, error opacity
- §28 Minimal JSON examples — Active, Triggered with PendingTriggeredTarget, OR ActionGroup with chooser
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Documents the full ability lifecycle — data models, all four ability types
(Active/Passive/Aura/Triggered), ActionGroup resolution, target resolution,
effect execution, interactive pause states, cost handling, duration tracking,
network message flow, and client-side targeting with line numbers throughout.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Documents the complete delta lifecycle from server action handler
through GameStateDiffer computation, PushStateToPlayersAsync dispatch,
Redis transport, and client-side application in Game.gd/_apply_delta.
Includes line numbers, code snippets, wire types, and design invariants.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Three bugs fixed for abilities like Demonate Leviathan (SummonToken + TileFilter):
1. Server: AbilityUsesThisTurn was incremented (and costs paid) before effect-level
TileFilter validation ran. Added PreValidateClientTileTargets() called before the
use-count increment so an invalid tile pick wastes no uses and no sacrificed tokens.
2. Server: SummonToken silently break'd when TileFilter or token-affinity check failed,
giving the client no error. Changed both to throw GameException("INVALID_TILE").
3. Client: tile_passes_filters() only checked the target selector's filters, not the
effect-level TileFilter (e.g. SummonToken.tileFilter). Added _collect_effect_tile_filters()
and TileAffinityMatches handling so invalid tiles are never highlighted or accepted.
Also includes: Art2dUrl/ModelUrl deltas in GameStateDiffer/GameMessages/GameEngine,
unit_mesh_builder token-model URL fallback + shader/tint helpers, ModelCache v3 bump,
Game.gd unit delta merging for art2dUrl/modelUrl.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Server:
- Add AbilityPlaceholderVisualPush DTO (sourceInstanceId, abilityName,
sourceAffinity, targets, targetMode: Self|Unit|Tile|PlayerZone|None)
- Promote ComputeVisualTargets to GameHandlerBase (protected static)
- Add ComputeAbilityVisualTargets — extends Repentance logic with
Self/ExactSelf + All-count detection, falls back to enemy ArchSpirit
- Add ComputeAbilityTargetMode — derives mode from visual targets +
sourceInstanceId (PlayerZone when target is a player account ID)
- Add FindSourceUnit helper — searches Field + ArchSpirit across all players
- GameActivateAbilityHandler captures source unit + ability def before
ActivateAbility, skips push when Animation.AssetUrl is set
Client:
- Add ability_placeholder_visual signal and push router case in Game.gd
- New AbilityPlaceholderFx component: Self/None → radial glow burst + two
expanding rings on source; Unit/Tile/PlayerZone → orb projectile from
source unit body to resolved target, impact ring + burst motes on arrival
- Wire component in game_screen.gd (_ready, _exit_tree, handler)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Medium: replace .First() with .FirstOrDefault() ?? throw new
GameException("CARD_NOT_IN_HAND") so a bad/stale CardInstanceId
produces a normal game error instead of a raw InvalidOperationException.
Low/Medium: ComputeVisualTargets fallback now uses GameState.GetEnemyIds
which filters by different TeamIndex and !IsEliminated, preventing the
placeholder projectile from targeting an ally or an already-eliminated
player in team and multiplayer modes.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
High: server now computes visual targets after resolution — prefers
client-provided unit InstanceId or tile Coord, falls back to the first
live opponent ArchSpirit so targetless/server-resolved effects always
have a destination.
Medium: source ArchSpirit fallback now looks up the actor's player
in game state rather than get_my_player(), fixing opponent and
spectator views.
Medium: player color now uses teamIndex from the player DTO instead
of deriving it from seatOrder, fixing team and multiplayer modes.
Low: hasCustomAnimation check now scans all Active ability definitions
for a non-empty AssetUrl, not just abilities[0].
Low: server no longer sends the push (or the HasCustomAnimation field)
when a custom animation exists; client-side guard removed accordingly.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Server:
- Add RepentancePlaceholderVisualPush DTO to GameMessages.cs
- Add BroadcastToAllViewersAsync helper on GameHandlerBase
- GamePlayCardHandler emits game.visual.repentance_placeholder to all
players and spectators after a Repentance card resolves; sets
hasCustomAnimation based on ability Animation.AssetUrl presence
Client:
- Add repentance_placeholder_visual signal and push-router case in Game.gd
- New RepentancePlaceholderFx component: resolves source/target world
positions, picks affinity + player team colors, tweens a glowing orb
projectile to target and plays a torus ring + burst-mote impact
- Wire component in game_screen.gd (_ready, _exit_tree, signal handler)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Fix 3 killed all shader tweens at the top of every rebuild_units() call.
This interrupted materialize/ascend-arrival tweens mid-animation for units
that were staying on the board. Because tween.kill() skips the completion
callback, the mi.material_override was never restored, leaving every model
permanently frozen in the reveal=0..1 shader state with no actual mesh
visible.
Tweens run to completion naturally. The WeakRef + is_instance_valid guards
inside each tween callback already handle pooled/freed nodes safely, so
there is no leak when a unit is removed while its tween is still running.
_exit_tree() still kills all tweens on scene teardown.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
When a spirit is returned to hand and re-channeled, the old in-flight
ModelCache.load_model() callback could fire after the unit was pooled and
re-created, clobbering the new placeholder and causing the 3D model to
not appear. The browser logged "!is_inside_tree()" hundreds of times/sec
as a result.
Fix: add a per-unit load-generation counter (_unit_load_gen). Each call
to add_unit_mesh() increments the counter and captures it in the closure.
The callback checks on entry whether the generation still matches; if not,
it treats itself as stale, frees the downloaded model_node, and returns
without touching any scene state.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Adds _pool_unit() / _acquire_from_pool() keyed by card_type.
_ready() creates an off-tree _pool_root node to hold retired bodies.
_pool_unit() frees MeshInstance3D children immediately then reparents
the StaticBody3D shell to _pool_root; overflows beyond _MAX_POOL_PER_TYPE
are freed() synchronously to cap memory. _acquire_from_pool() fully
resets transform, collision layers, groups and stale metadata before
reparenting back to units_root. rebuild_units() now calls _pool_unit()
instead of queue_free() for normal unit removal. add_unit_mesh() tries
the pool first; fresh allocs still get a new CollisionShape3D added once.
_exit_tree() frees _pool_root (and all pooled children) on scene teardown.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Adds _active_tweens list to UnitMeshBuilder. Both materialize and
dissolve shader tweens are appended on creation and auto-erased via
CONNECT_ONE_SHOT on finish. rebuild_units() kills all tracked tweens
before diffing so ShaderMaterial refs are released immediately instead
of up to 1.35s later. _exit_tree() kills remaining tweens on scene
teardown to prevent refs surviving a mid-animation forfeit or disconnect.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Adds evict_all() to ModelCache which sets _shutting_down before flushing
_pending with null callbacks, then clears _mem and _job_queue. This
prevents in-flight HTTP completions from firing into a freed game scene
and ensures each new game starts with a clean WASM heap. Called from
game_screen._exit_tree() after all signal disconnections.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Caps simultaneous GLB parses and HTTP downloads at _MAX_JOBS=4 via a
shared job budget. Disk-cache hits when slots are full queue as
parse_from_disk:true and drain correctly without re-downloading. Replaces
the no-op get_signal_connection_list().clear() with CONNECT_ONE_SHOT.
Adds _shutting_down flag so evict_all() can null-out pending callbacks.
Adds debug-gated logging on all hot paths.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Patches all 8 gaps from code review: CONNECT_ONE_SHOT replaces no-op
signal clear, evict_all flushes pending callbacks, disk-cache hits queue
correctly without re-downloading, pool reset covers transform/meta/groups,
pool size is capped, instrumentation added, _exit_tree cleanup added to
unit_mesh_builder for both tweens and pool nodes.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Documents root cause (WKWebView WASM heap exhaustion), four proposed
fixes (download throttle, cache eviction, tween tracking, unit pooling),
and a write-up of how each fix addresses the 60s crash and the rejoin loop.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
ModifyMP(Current) and similar per-turn aura bonuses were only applied
once when a unit entered the aura range. The CurrentMp reset at turn
start wiped the bonus without re-applying it.
Added ReapplyAurasAtTurnStart which strips stale tracked effects
(without reversal — the stat reset already undid them) and re-applies
ApplyAuraEffects for active-player units still in range. Called in
NextTurn after the Mp/Defense restore and ExpireActiveEffects.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- FireTrigger(UnitAttack) now fires BEFORE ApplyDamage so triggered abilities
can modify attacker/target stats before damage lands
- AbilitySystem.KillUnit is now leader-aware: killing an ArchSpirit (in field
or ArchSpirit slot) calls GameEngine.EliminatePlayer instead of silently failing
- MoveToDiscard and RemoveFromAllZones both clear Position = null on zone transitions
- RemoveFromAllZones guards against direct ArchSpirit removal (throws InvalidOperationException)
- EliminatePlayer made internal for cross-class access from AbilitySystem
- Client: improved JSON parsing error handling in Network.gd; debug_output enabled in Game.gd
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- ApplyReversal and TickActiveEffects were searching p.Field/Hand/Deck/Discard
but not p.ArchSpirit, so effects applied to an ArchSpirit (e.g. SetCanBeAttacked=false
from "Branch Between Fangs") were never reverted — the tracking entry was removed
but CanBeAttacked stayed false permanently
- Fixes by adding p.ArchSpirit to the target lookup in both functions, matching
the existing pattern in FindTargetByRef
- AbilityBuilder: add action-level Duration field to ActionDraft, compile/parse it
in CompileActionNode/ParseActionNode, and expose a UI dropdown on each action
- ClearOnLeave now defaults to true in AbilityDefinition and AbilityBuilder
- Instinct/Repentance card click now correctly enters ABILITY_TARGET mode
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Adds collection.get_owned endpoint that returns { definitionId → count }
for the player's entire collection in a single DB round-trip. The client
caches this map and filters/sorts entirely client-side using definitions
already in ContentCache, eliminating all pagination and "load more" UI.
- Search, type, and affinity filters now work across the full collection
instantly with no network round-trips
- deck_editor_panel: arch spirit picker also uses the owned map —
removes a separate collection.get_cards request
- cards_view: same pattern, grid rebuilds client-side on filter change
- CollectionCache: persists owned map to disk (owned.json per player)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
SceneTreeTimer callbacks captured _sync_timeout by reference rather
than by identity, so a replaced timer's closure still passed the
null-check and called _on_sync_failed even though progress was
actively arriving. Fix by capturing the timer instance in the closure
and bailing out if _sync_timeout no longer points to it.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Prebuilt Decks filter now lists each deck by name in addition to the
existing "In any deck" / "Not in any deck" options, allowing the report
to be narrowed to cards belonging to a single specific deck.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Leaderboard: each tab now shows only the stat it ranks by (#, Channeler,
stat value) so rank #1 on Rank Score is visually distinct from rank #1
on Games Played, etc. Removed the multi-column highlight approach.
AI Asset Report: replaced Object Key + Prefix columns with a friendly
Name (filename extracted from the object key) and mapped ContentType to
a human-readable Type label (Image / Audio / Video / Model).
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- HowToPlay.cshtml: CMS content now replaces the entire body (nav +
sections) instead of just the sections — hardcoded nav no longer
bleeds through when custom HTML is saved
- HowToPlayEditor.razor: add "Load static content as starting point"
button so admins can bootstrap from the existing static copy rather
than writing HTML from scratch
- HowToPlayEditor.razor.cs: static fallback HTML extracted to
code-behind partial to avoid Razor parser issues with raw string
literals containing double-quoted HTML attributes
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- /auth/challenge: validate returnUrl with IsLocalUrl before passing to
Keycloak redirect — blocks open-redirect phishing flows
- Dead local-auth pages (Login, Register, ForgotPassword, ResetPassword,
VerifyEmail) all injected SignInManager which is no longer registered;
replaced page models with simple redirects to /auth/challenge
- Stubbed their .cshtml views so the Razor compiler doesn't error on
missing model properties
- Added belt-and-suspenders MapGet guards in Program.cs for /auth/login,
/auth/register, /auth/forgot-password, /auth/reset-password
- Removed [EnableRateLimiting("auth-login")] dead attribute (Keycloak
handles brute-force; AddRateLimiter was never wired in this project)
Stored-HTML XSS (NewsPost / HowToPlay) is accepted by policy: content is
admin-only and the existing CSP (script-src 'self', no inline/eval) blocks
script injection.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- SOR.Website now uses Keycloak OIDC (same realm as webclient) for SSO;
clicking Play no longer re-prompts for login
- /webclient redirects directly to webclient.aeternalisgames.com (no auth gate)
- Leaderboard: 4 ranked tabs — Rank Score, Games Played, Games Won, Win Rate
(Win Rate requires min 10 games; active column highlighted)
- HowToPlay page reads body HTML from catalog.website_contents (key=howtoplay);
falls back to built-in static content when no DB entry exists
- Admin: HowToPlayEditor at /website/how-to-play with live HTML preview + clear
- Admin NavMenu: How To Play link added under Website section
- WebsiteContent entity + EF migration (catalog schema)
- appsettings.json: added Keycloak config skeleton (values from k8s secrets)
- Index page: branding corrected to "Origin: Stone of Revival" / Aeternalis Games;
hero image sourced from CDN
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Manual migration was missing the .Designer.cs file EF Core requires to
recognise it. Deleted the stub, ran 'dotnet ef migrations add AddNewsPosts',
and applied the generated migration to the database.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Website fixes:
- /how-to-play and /ai-assets and /ai-assets/report: add explicit @page routes
(default Razor Pages routes were PascalCase, nav links used kebab-case)
- Webclient: redirect to webclient.aeternalisgames.com instead of /webclient/app
- Login: accept display name (username) or email; looks up by email first, then
by DisplayName — uses TUser overload of PasswordSignInAsync with lockout support
Leaderboard:
- Add GamesPlayed, GamesWon, WinRate columns
- Inject GameDbContext; query completed sessions for the top-N account IDs and
aggregate wins/plays in memory (cross-schema, no EF join)
News CMS:
- NewsPost entity in catalog schema (slug, title, summary, bodyHtml, heroImageUrl,
author, published state, timestamps)
- CatalogDbContext: add DbSet<NewsPost> + model config
- Migration: 20260423000001_AddNewsPosts
- Website Program.cs: register AddGameDatabase
- News/Index.cshtml: list published posts with hero image + summary
- News/Post.cshtml: individual post detail page at /news/{slug}
- Admin NewsPostList.razor: list all posts, delete with confirm modal
- Admin NewsPostEditor.razor: full CRUD editor — title, slug (auto from title),
summary, HTML body with live preview toggle, hero image with preview,
publish toggle + date/time, author
- Admin NavMenu: add Website section with News Posts link
CDN art:
- Index.cshtml.cs: inject IConfiguration, expose CdnBaseUrl
- Index.cshtml: add hero-bg-img <img> sourced from {cdnBase}/website/hero-bg.jpg
(upload hero-bg.jpg to CDN /website/ to activate; no image = no broken element)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- deployment-website.yaml + service-website.yaml: new ClusterIP deployment
for sor-website image; injects only the three secrets it needs (Postgres,
Redis, Cdn__PublicBaseUrl) — no NATS or ENABLED_SERVICES
- ingress.yaml: add TLS + rules for aeternalisgames.com and www.aeternalisgames.com
pointing to sor-website service
- appsettings.json: remove localhost ConnectionStrings (dev defaults already
live in appsettings.Development.json; prod values come from k8s secrets)
- build-push.yml: build and push sor-website image from Dockerfile.website
- build-push-client.yml: add paths filter so Godot export only runs on
Client/** changes; add --network host to docker build
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Adds the complete SOR.Website ASP.NET Core Razor Pages project:
Security architecture:
- SecurityHeadersMiddleware sets strict CSP (script-src/style-src 'self',
form-action 'self', frame-ancestors 'none', object-src 'none')
— all XSS injection is dead on arrival
- __Host- cookie prefix on session + CSRF cookies (forces Secure, Path=/,
no Domain — prevents subdomain-compromise cookie theft)
- Anti-forgery tokens on every POST by default (Razor Pages default)
- AuthorizeFolder("/Account") — unauthenticated access to any /account/*
redirected to login at the routing layer, no per-page [Authorize] needed
- Rate limiting per-IP: login (10/5min), register (5/hr), reset (3/15min)
- Open redirect prevention: all returnUrl values checked with Url.IsLocalUrl
- Anti-enumeration: ForgotPassword/Register never reveal whether email exists
- Account lockout: 5 failed login attempts → 30min lockout
- ChangePasswordAsync requires current password before accepting new one
- Leaderboard only projects DisplayName + RankScore (email/ID never exposed)
- Data Protection keys in Redis (shared key ring across pods)
- ForwardedHeaders middleware for accurate IP under TLS-terminating ingress
Pages implemented:
- Public: Home, Story, How To Play, Cards (catalog + detail), Leaderboard,
AI Assets (explanation + report), News, Support, Privacy, Terms, Webclient
- Auth: Login, Register, Logout (POST-only), ForgotPassword, ResetPassword,
VerifyEmail — all with rate limiting and anti-enumeration controls
- Account (auth-gated): Overview, Profile (display name), Security
(change password), Game stats
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Rewrote the help offcanvas to cover every feature of the ability system:
- Canvas Mode usage guide (new section)
- Action Groups AND/OR/XOR with Chooser Role (new section)
- Costs with Cost Type and PickMode tables (new section)
- Conditions expanded with all types and key parameters
- Trigger-Specific Fields expanded into full reference table
- Effects Categories table grouping all effects
- Duration Types, Targeting, Filters updated/improved
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
The Conditions node only renders when count > 0, so there was no way to
add the first condition from the canvas. The "Add Node" palette now has a
Condition button that adds a blank ConditionDraft, lays out the node, and
auto-selects it so the inspector opens immediately for editing.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
PayCosts now filters rawCandidates through FiltersMatch before building
CandidatesJson, so only eligible cards are offered to the picker.
ResumeCostPick now deserialises FiltersJson, resolves the source unit early
for a complete filter context, and validates each client-selected card against
the stored filters before executing the cost — rejecting invalid selections
with INVALID_COST_PICK_SELECTION.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
1. JSON case normalization
Parse CostGroupJson, ActionGroupJson, BranchesJson, RevealedCardsJson
through _normalize_keys in game_screen.gd — server serialises these
inner payloads with _jsonOpts (no naming policy = PascalCase), but the
client was reading lowercase keys, producing empty option lists.
2. Cost pick candidate list
- Add CandidatesJson to PendingCostPick; populated in AbilitySystem.PayCosts
with the actor's eligible cards (hand for DiscardFromHand, field spirits
for SendSpiritFromBattlefieldToDiscard / DealDamageToOwnSpirit).
- Thread CandidatesJson through CostPickRequestPush → GameHandlerBase push.
- Client _on_cost_pick_request now uses candidatesJson from the push instead
of Game.get_my_player().hand, fixing opponent-pick and battlefield-cost UIs.
3. Reconnect recovery via game.get_state
- Extract all pending-prompt pushes into static PushPendingPromptsAsync in
GameHandlerBase (called from PushStateToPlayersAsync as before).
- Inject IClientPush into GameGetStateHandler; call PushPendingPromptsAsync
after building the reply so any active pause prompt is re-sent to the
chooser on manual state sync / reconnect.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Server:
- GameMessages.cs: add push DTOs for CostGroupPick, ActionGroupPick,
BranchPick, TargetPick, TilePick, PlayerPick, RevealChoicePick
- GameHandlerBase.PushStateToPlayersAsync: push all 8 pending types
(including existing CostPick which was missing its push) to the
chooser player after every state update and on reconnect
Client:
- Game.gd: add 8 signals, 8 send functions, 8 push routes matching
game.ability.{cost,cost_group,action_group,branch,target,tile,player,
reveal_choice}_pick_request
- game_screen.gd: add handlers for all 8 types:
- cost_pick: hand-card selection panel with confirm
- cost_group_pick / action_group_pick: option-button panels
- branch_pick: same UI as local ChooseOne but sends game.branch_pick
- target_pick: reuses ABILITY_TARGET mode, flag routes to game.target_pick
- tile_pick: highlights valid tiles, click sends game.tile_pick
- player_pick: player-button panel from server-supplied validPlayerIds
- reveal_choice_pick: click-to-order card list, sends game.reveal_choice_pick
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
When ApplyIntraActionContinuation replays IntraActionStep items and a step's
effect itself pauses (emitting PendingTilePick / PendingPlayerPick /
PendingRevealChoicePick), the new pause model may already have an
IntraActionContinuationJson written by BuildIntraActionContinuationJson.
That value is wrong in the replay context because BuildIntraActionContinuationJson
assumes all remaining targets get the same homogeneous effect list, whereas
IntraActionStep items each carry their own per-step effect list.
Fix: convert ApplyIntraActionContinuation loops to indexed, set ctx position
fields (CurrentEffectIndex, CurrentActionAllEffects, CurrentActionTargets,
CurrentTargetIndex, CurrentActionDuration) per iteration for consistency, then
after any nested pause override the IntraActionContinuationJson directly via
new SetPendingIntraActionContinuation helper. The override is built from the
precise remaining slice:
- remaining effects on the current step's target (effects[(ei+1)..])
- all remaining steps as-is (steps[(si+1)..])
This is correct regardless of whether different steps have different effect lists.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Previously, pausing effects (CloneSpiritAsToken/TargetTile,
ChannelCardFromZone/TargetTile+Choice, StackDeck interactive) only stored
the outer action-sequence continuation. Any effects after the pausing one on
the same target, and any remaining targets in the same action, were silently
dropped on resume. This commit makes pause/resume fully general.
Mechanism:
- New IntraActionStep private class: { TargetRef, EffectsJson }
- BuildIntraActionContinuationJson(currentTarget, ctx) captures:
• remaining effects on the paused target (effects[effectIndex+1..])
• all effects applied to each remaining target (targets[targetIndex+1..])
- ApplyIntraActionContinuation applies those steps at resume time before
the outer continuation actions
- FindTargetByRef / GetTargetRef round-trip any resolved target type
(FieldCard, CardInstance, PlayerState, Coord) through a string ref
AbilityContext gains 5 per-iteration tracking fields set by ExecuteSingleAction:
CurrentEffectIndex, CurrentTargetIndex, CurrentActionTargets,
CurrentActionAllEffects, CurrentActionDuration
ExecuteSingleAction target/effect loops converted from foreach to indexed
for-loops so ctx position fields stay in sync with each ExecuteEffect call.
IntraActionContinuationJson added to PendingTilePick, PendingPlayerPick,
and PendingRevealChoicePick. All three pause-emitting cases (CloneSpiritAsToken,
ChannelCardFromZone x2, StackDeck) populate it. All three resume methods
(ResumeTilePick, ResumePlayerPick, ResumeRevealChoicePick) call
ApplyIntraActionContinuation before executing outer continuation.
ChannelCardFromZone player-pick-to-tile-pick chain now forwards
IntraActionContinuationJson so it survives a double-pause sequence.
The "DESIGN CONSTRAINT: pausing effects must be terminal" comment is removed
as it is no longer true.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Issue 1 — ActionGroup AND continuation ordering:
The old code prepended `all` (preceding AND-group actions) into
ContinuationActionsJson, so resume ran [chosen, preceding, outer] instead
of the correct [preceding, chosen, outer]. Fix: add PrecedingActionsJson
to PendingActionGroupPick; AND-case stores preceding there (prepending to
any inner-group preceding); ResumeActionGroupPick reads it and uses
preceding.Concat(chosen).Concat(continuation) for final execution.
Nested remaining-group pauses also accumulate preceding correctly.
Issue 2 — Effect-level pause terminal contract:
Documented as a design constraint: pausing effects (CloneSpiritAsToken
TargetTile, ChannelCardFromZone TargetTile/Choice) must be last in their
action's Effects list. Remaining effects / remaining targets are silently
dropped on pause. No functional change; constraint is now explicit in code.
Issue 3 — StackDeck pause loses continuation:
PendingRevealChoicePick already had ContinuationActionsJson/RangeJson/
ForceDurationJson fields but StackDeckEffect never populated them and
ResumeRevealChoicePick never executed them. Both are now fixed: pause
stores ctx.ContinuationActions + ctx.ActivationRange + duration; resume
runs ExecuteActions on the stored continuation after ordering the deck.
Issue 4 — ResumeTargetPick ActionIndex=0 contract:
Added a clear CONTRACT comment: the paused action replays at index 0, so
the client must submit targets with ActionIndex=0 in its response.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Implement ChannelCardFromZoneEffect: zone lookup, dest-player resolution
(Self/Target/Opponent/Ally/Random/Choice), channel-range tile selection,
affinity check, cost deduction, KeepInZone, TargetTile pause, board
placement with aura/passive hooks and Channeled trigger
- Add PendingPlayerPick.EffectType="ChannelCardFromZone" dispatch in
ResumePlayerPick: random-tile path + chained PendingTilePick for
TargetTile=true
- Add ResumeTilePick case "ChannelCardFromZone": place card at chosen tile
under DestPlayerAccountId, affinity/cost/KeepInZone-aware
- Implement ObstructMovementTypeEffect: stores ActiveEffect marker;
ApplyReversal is no-op (duration:null guard); BuildBlockedSet extended
via AbilitySystem.GetUnitsObstructingMovementType to honour obstructors
for pathfinding (e.g. Walk unit blocking Flight paths)
- Add PendingTilePick.DestPlayerAccountId and .EffectJson fields
- Add PendingPlayerPick.EffectJson field
- Thread ctx.ContinuationActions + ctx.ActivationRange through
AbilityContext so ExecuteEffect can populate pause models without an
extra method parameter
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Fix pause propagation: ExecuteActions for-loop breaks on HasPendingInteraction();
effect loop in ExecuteSingleAction also stops when any pending state is set
- Add HasPendingInteraction() helper to GameState covering all 7 pending types
- Create 4 missing handlers: GameCostGroupPickHandler, GameActionGroupPickHandler,
GameBranchPickHandler, GameRevealChoicePickHandler + register in ServiceRegistration
- Add corresponding request/response records to GameMessages.cs
- Fix ActionNeedsClientTargets: short-circuit false when Chooser == Random
- Add ChooserActorId to PendingTriggeredTarget; FireTrigger sets it to opponent/ally
when Chooser.Opponent/Ally; GameHandlerBase pushes to ChooserActorId
- ResumeTriggeredAbility validates against ChooserActorId (falls back to ActorId)
- Fix ApplyOnEventEffect: Action[] -> ActionGroup?; PendingDeferredEffect gains
ActionGroupJson field; deferred firing uses ResolveActionGroup + ExecuteActions
- Wire OnEnterAuraActions / OnLeaveAuraActions into FireAuraTransition (one-shot,
restricted to the entering/leaving unit)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Phase 6-B — Preflight check in _channel_ruin():
Iterate board tiles before sending play_card; skip any tile that already
has a ruinId (non-null, non-empty) or that doesn't match the card's
affinity. If zero valid tiles exist, show an AcceptDialog
"No valid tile available for this Ruin." and abort the send.
Phase 6-A — Confirmation dialog in _confirm_channel_ruin():
After passing preflight, show ConfirmationDialog "Channel Ruin /
Ruin placement is random. Continue?" with Channel / Cancel buttons.
Only calls Game.send_play_card on explicit confirm.
Replaces the previous immediate Game.send_play_card(iid, 0, 0) on click.
Follows the existing _confirm_ascend / _confirm_transition dialog pattern.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Phase 5.1a — ActionGroup backward-compat in AbilitySystem:
- Add GetEffectiveActions(def): prefers ActionGroup.Actions (AND=sequential,
OR/XOR=random pick); falls back to obsolete def.Actions for pre-Phase-1 rows.
- Wire all FireAbility, FireCardEffects, FireTrigger, FireRuinAbilities call
sites to use GetEffectiveActions instead of def.Actions directly.
Phase 5.9 — 12 new EvaluateCondition cases (§6.6):
UnitTypeIs, OwnershipIs, IsThisCard, UnitPropertyCompare, PlayerPropertyCompare,
HandContainsCount, CardDefinitionCountInZone, IsInRangeOfUnit, TileOccupant,
SurroundingTile, SPAccumulationCompare, CostOfCardsInHand.
Add CompareInt(Comparator, int, int) helper to DRY up comparator switch.
Phase 6-D — Fix double-fire of source Ruin's OnRuinActivation abilities:
Insert source-skip guard in FireTrigger after TriggerMatches check:
skip OnRuinActivationTrigger on the card whose InstanceId == occurrence.Data.SourceId.
FireRuinAbilities already executed the chosen ability directly; the subsequent
FireTrigger is only for observer cards.
Phase 6-C — Ruin tile placement must not overwrite existing Ruins (GameEngine.cs):
Add `&& t.RuinId == null` to the validTiles Where clause.
Change error code NO_VALID_TILE → NO_VALID_RUIN_TILE for this path.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Replace tab navigation with Bootstrap accordion (all sections open by default)
- Type-contextual Stats section: ArchSpirit+Spirit+SpiritToken show combat/movement/
flags/genus; Terramorpha shows mode selector; Repentance/Instinct show RequiresLOS
checkbox only with note about ArchSpirit LOS origin (Resolved Decision #6)
- CanBeSacrificed flag hidden for ArchSpirit (Spirit and SpiritToken only)
- Section completion badges: green check when Name filled / abilities JSON present /
assets added
- Abilities section badge shows constraint reminder for Repentance/Instinct
- Replace _tabs string array with _openSections HashSet + ToggleSection helper
- Remove stale EffectsJson/CardType branching in save logic (already done Phase 2)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Add CardType.SpiritToken enum value (stored as text, no Postgres enum change)
- Drop catalog.card_definitions.effects column (migration 20260419170135)
with safety-pass to copy any remaining effects -> abilities before drop
- Remove CardDefinition.EffectsJson property and CatalogDbContext mapping
- Remove CardInstance.EffectsJson snapshot from GameState/GameEngine
- Remove EffectsJson from all DTOs: UnitDelta, CardUpdateDto, ContentCardDto
- Remove EffectsJson from GameStateDiffer, ContentDtoMapper, CardEditor, CardReport
- Simplify AbilitySystem.FireCardEffects to use AbilitiesJson only (no fallback)
- Enforce SpiritToken exclusion in CollectionAddCardHandler (deck builds)
- Enforce SpiritToken exclusion in BazaarBuyBoosterPackHandler (pack draws)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
From Ruin-IssueResolution.md -- four fixes in priority order:
6-D (highest): stop double OnRuinActivation execution -- source Ruin's abilities
fire once via FireRuinAbilities; FireTrigger must skip source unit to prevent
the same abilities re-firing through the general trigger pipeline.
Note: new ActivateRuinAbilityEffect (Phase 1.8/5.7) must use the same guard.
6-C: server enforce tile.RuinId == null in candidate set + NO_VALID_RUIN_TILE error code
6-B: client preflight -- compute valid no-ruin tiles before showing confirm dialog;
block and show message if none available
6-A: client confirm dialog before channeling a Ruin card
Delivery note: Phase 6-D must land before Phase 5.7 so the source-skip guard
is in place before ActivateRuinAbilityEffect can trigger through the pipeline.
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
Introduces ActionGroup { LogicOp, ChooserRole, Actions[], Groups[] } to
replace the flat Action[] on AbilityDefinition. Mirrors CostGroup pattern.
- Axiom A updated: ActionGroup is the ability-level grouping; ChooseOne is
the within-action effect-branching mechanism -- distinct and complementary
- Axiom B: adds PendingActionGroupPick to the Pending* prompt table
- Axiom C renamed to cover ActionGroup + ChooseOne + CostGroup all having ChooserRole
- Phase 1.3 (new): ActionGroup model, execution semantics (AND/OR/XOR), and
clear distinction from ChooseOne with concrete examples
- Phase 1.10: AbilityDefinition gains ActionGroup, marks Actions [Obsolete]
with backwards-compat read rule (wrap Actions in And group if ActionGroup null)
- Phase 4: ActionGroup node type added to palette, canvas layouts show the
ActionGroup container with AND/OR/XOR header and nested Action children;
ActionGroup property inspector section added
- Phase 5: 5.1a -- ActionGroup recursive descent in the engine
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Explicit Active ability field list: Range.Min/Max/RequiresLos/LinearOnly, UsesPerTurn
(verify-and-expose pattern; fields already exist in model, must be wired in builder)
- Enumerate all 40 trigger types with explicit exists/new status table -- no more
"most already exist" hand-waving
- Split TargetOwnership (whose entities qualify) from TargetChooser (who makes the
pick); add TargetChooser enum + TargetSelector.Chooser field; map to PendingTargetPick
- Repentance/Instinct: exactly ONE ability per card, Name locked = card Name, no
additional abilities permitted -- not just "first ability"
- Animation/sound: AbilityAnimationDefinition already on AbilityDefinition; builder
must expose track name + cast/impact sound URLs in Meta node inspector
- Document CostEntry existing fields (PickMode, Filters) -- confirms no changes needed
- Rewrite entire file in ASCII-safe characters (no mojibake em-dash, arrows, box-drawing)
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
- Lock RecursiveAbility + FullClientPrompt as axioms (Axiom A/B/C)
- Resolve all 6 open questions: SpiritToken constraints, hard EffectsJson
cutover (migration tool for ~100 cards, column drop), RequiresLOS via
ArchSpirit as LOS origin, ChooseOne.ChooserRole confirmed, custom drag
- Expand Phase 5 with PendingBranchPick/TilePick/PlayerPick/RevealChoice,
LOS engine rule, ChooserRole resolution paths
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>