- 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>
Phase breakdown covering: ability model expansion (cost groups, 12 new
conditions, 15 new effects, trigger enrichments, filter additions),
DB migration, mobile-first card editor revamp, visual node-canvas
ability builder, and engine update work items.
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>
- Throttle hand scroll to one step per 150 ms so each wheel tick advances exactly one card
- Deselect selected card when clicking outside the hand area (deferred flag pattern so board clicks still play the card)
- Extend spin and click-outside deselect to cover TERRAMORPHA_SELECT and card-triggered ABILITY_TARGET (Repentance/Instinct), not just CARD_FROM_HAND
- Show Repentance/Instinct cards as visually selected in hand when in ABILITY_TARGET mode
- Drop stale spectator state_update pushes from wrong sessions
- Auto-create missing audio buses on Settings._ready to avoid bus-not-found errors
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>
- Game.state_updated (and other game signals) now connected before any UI
setup that could error. Previously they were at line ~340, after hand spin
button setup — if anything between _configure_hand_spin_buttons and those
connects threw, spectators would never receive live state pushes (no player
actions to trigger ACK-based updates as fallback)
- _rebuild_hand now uses str(raw) if raw != null else "" for IID extraction;
card.get("instanceId", "") returns null (not the default) when the key
exists with a null value, which would error on append to Array[String]
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>
- Removed the outer _is_spectating guard on _rebuild_hand; blocking it
entirely left _cached_hand_iids stale and skipped other bookkeeping
- Spectator early-exit now inside _rebuild_hand after updating the cache,
clearing the display hand cleanly
- Replaced Array[Dictionary].filter() (returns untyped Array, silent type
mismatch on reassignment) with explicit loops into typed Array[Dictionary]
- Same fix for the display_hand build: explicit typed loop instead of
hand.filter() with Variant cast
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>
AiMatchService:
- GetActiveMatchesAsync: queries CustomLobbies joined to GameSessions
to return all running AI vs AI sessions with display names.
- ForceEndMatchAsync: marks session Abandoned + lobby Completed; the AI
polling loops detect the status change within ~1 s and exit cleanly.
- ActiveAiMatch DTO returned by both methods.
AiMatchPage:
- Active AI Matches section loads on page init and has a Refresh button;
each row has an End button that calls ForceEndMatchAsync and refreshes.
- Created This Session table also gets an End button per row.
- Spinner shown on the End button while the request is in flight.
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 Settings.draw_card_popup bool (default true, persisted)
- Toggle in InGameSettings under Gameplay: "Show drawn card popup"
- _rebuild_hand detects brand-new cards and queues them in
_pending_popup_cards instead of adding to hand immediately
- _show_next_card_popup builds a CanvasLayer overlay (layer 20) with a
dimmed background + full-size card widget; click card or background to
dismiss
- _dismiss_card_popup pops the queue, adds the card to hand via
_apply_display_hand in server order, then shows the next queued popup
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>
- _rebuild_hand now diffs existing widgets against new hand: only removes
cards that left, only creates widgets for cards that arrived; everything
else stays in place with no rebuild flash
- New card widgets snap to their fan position on first layout instead of
tweening from (0,0), eliminating the slide-from-corner jitter on draw
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>
- Skip widget rebuild when hand IIDs are unchanged; only refresh selection
- Store _fan_slot metadata so _restack_hand_cards can reorder children by
z-index (for correct GUI input routing) without corrupting fan positions
- Double spin arrow hit targets from 22x22 to 44x44
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>
move_child was changing child indices which _layout_hand_cards uses to
compute fan positions, causing the whole hand to shuffle on every spin
or selection. z_index alone handles draw order correctly.
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>
Clicking a card now selects it and brings it visually to the front (via
z_index + lift boost) without re-centering the fan. Scroll arrows deselect
the active card before spinning. Hover lift and tween-based fan layout added.
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>
AiMatchPage:
- Add Grid Type dropdown (Square / Hexagon) and HexSides input (shown
only when Hexagon selected) to the Board section, wired to GridType
and HexSides in GameRules.
- Add SameAi computed property: true when both players share the same
difficulty + strategy (i.e. resolve to the same account GUID).
- Show a warning banner and disable the Create button when SameAi,
preventing the broken game state that occurs when a player is matched
against itself.
AiMatchService:
- Server-side guard: throw ArgumentException if id1 == id2 so the
broken state is impossible even if the UI check is bypassed.
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>
AiTurnContext.OpponentIds was everyone-except-self, so in team games the
AI would attack its own allies and score them as enemy material. The game
model already has TeamIndex on PlayerState and GameState.GetEnemyIds() /
AreAllies() helpers — the AI just never used them.
- AiTurnContext: use state.GetEnemyIds() so OpponentIds excludes allies
(fixes attack targeting, threat detection, positional advance)
- MaterialScore: use state.AreAllies() so allied units/ArchSpirit score
positively instead of as enemy material
- PositionalScore: skip allied players when collecting enemy positions
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>
Each entity type (Spirit, SpiritToken, ArchSpirit, Ruin) now gets its own
"Active Effects (N)" section immediately below its stats section. The section:
- starts collapsed to keep the drawer compact
- shows a count badge in the header ("Active Effects (3)")
- scrolls when the effect list is longer than the visible area (~90 px)
- hides entirely when the entity has no active effects
Effects are no longer appended inline to the stat labels list; they live in
dedicated scrollable sections built by _create_scrollable_section /
_set_effects_section helpers.
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>
- Track active effects with human-readable labels in AbilitySystem
(LabelFromReversal/LabelFromTick for stat mods, status flags, DOT/HOT)
- Add ActiveEffectDto to GameStateDto and GameStateDelta; delta now
always includes the full effects list so clients are never stale
- Add ResolveLabelFromEffectJson fallback for effects stored before the
Label field was introduced (old game sessions show correct labels)
- Client _append_active_effect_lines helper filters activeEffects by
targetRef and appends formatted lines to the tile drawer for spirits,
archspirits, spirit tokens, and ruins
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>