## Tile height variation (fix)
Tile tops now visibly vary (0.8–1.0) from a fixed bottom at world Y=0.
Previously the top was fixed and the variation was only visible underneath.
Heights are seeded by tile coordinate so they're deterministic per board.
Unit y_offsets and highlight positions update to match per-tile height.
## Stalagmite tile bottoms
Server: new TileBottomModel entity + migration (catalog.tile_bottom_models),
content.tile_bottoms handler returns all active CDN URLs.
Admin: "Tile Bottom Models" section in the Tile Model Manager page —
add/toggle active/delete entries with CDN picker.
Client: ContentCache fetches + disk-caches the URL pool; _try_load_tile_model
picks a random URL and attaches it flipped below the tile model as a
stalagmite using the existing _fit_model_to_tile scale logic.
## Live content refresh
ContentCache schedules start_sync() every 5 minutes after sync_complete so
card definitions, tile models, and bottom models are refreshed in the
background without restarting the client.
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 placeholder tile box is assigned a random visual height between 0.8 and
1.0. The mesh is shifted downward so the TOP surface stays fixed at world
Y=0.5 — collision shapes, unit y_offsets, and highlight positions are all
unchanged. The variation shows as more or less tile-side visible from the
camera angle, giving the grid an uneven, terrain-like appearance.
3D tile models (when loaded) replace the placeholder mesh and are unaffected.
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 the counterattack chain was only triggered when both units appeared
in damaged_iids (HP decreased). If the defender's defense stat absorbs the
attacker's hit entirely, their HP doesn't change, so they were never in
damaged_iids — the counterattack animation was silently skipped.
Fix: record _last_attack_target_iid in send_attack() and use it in
_play_damage_animations as the primary defender source. The tracked target is
consumed (cleared) on first use so it never bleeds into later state updates.
The old fallback (any other damaged unit) is kept for cases where no tracked
target is available.
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 both units played "damaged" simultaneously after the attacker's
attack animation. Now when both units take damage in the same state update
(= counterattack), the full chain fires:
1. Mob 1 finishes Attack animation
2. Mob 2 plays Damaged (hit by Mob 1)
3. Mob 2 plays Attack (counterattack)
4. Mob 1 plays Damaged (hit by Mob 2) + Mob 2 returns to Idle
Implementation:
- _override_oneshot(iid, cb): replaces a pending animation_finished ONE_SHOT
callback without leaving stale signal connections
- _play_counter_attack(defender, attacker): plays defender "attack", then
triggers attacker "damaged" + defender "idle" via _override_oneshot
- _play_counter_chain(defender, attacker, delay): tween-delayed entry into the
chain; starts with defender "damaged" then hands off to _play_counter_attack
- _play_damage_animations: detects counterattack (attacker_iid AND another unit
both in damaged_iids), routes to _play_counter_chain; falls through to the
existing simple-damage path otherwise
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>
Attack animations were being interrupted halfway through by "damaged"
because _play_damage_animations fired immediately on state arrival —
even for the attacker who also took counter-damage.
Fix:
- Track each unit's oneshot animation_finished callback in _oneshot_callbacks
so it can be replaced later without a stale lambda leak.
- _is_attack_track() helper matches current animation against ANIM_ALIASES.
- _play_damage_animations now sequences:
Attacker mid-attack → override idle-return callback with "damaged",
so attack plays fully, then damaged plays, then idle.
Defender → delay "damaged" tween by the attack's remaining duration
so the hit lands at the moment the swing connects.
No attack in progress → play "damaged" immediately (existing behaviour).
Result: Attack → (attack lands) defender damaged + attacker damaged → idle.
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>
_valid_move_tiles was gating on isExhausted, but the server tracks
movement and attacks independently. isExhausted=true only means the
unit has attacked this turn; movement is governed solely by currentMp.
Removing the exhaustion check restores move highlights after an attack.
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>
Model facing: GLB models exported from Blender arrive in Godot facing +Z,
not -Z. Changed _facing_to_base_angle default case from 0 (north/-Z) to
PI (south/+Z). Explicit "north" case added. Updated admin dropdown label
from "Default (north)" to "Default (south / Blender GLB)" to match.
Stale game state: when matchmaking.match_found is received, clear Game.state
so the new GameScreen always calls send_ready() rather than rendering the
previous (ended) game's state. Fixes same-players-re-match ending up in
the already-completed session.
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
- CardAsset gains ModelFacingDirection (string?), ModelScale (float?),
ModelTintColor (string?), ModelTintMaskUrl (string?) columns.
- CardAssetDto and ContentDtoMapper updated to expose them.
- EF migration AddModelConfig applied to pg-forge-01 / SOR DB.
CLIENT (game_screen.gd)
Animation loop:
- GLB standard: first 5 frames (ANIM_TRANSITION_SECS = 5/30s) are
entry frames that blend from idle into the action. Looping
animations now skip those frames on every iteration after the
first, eliminating the bind-pose flash at the loop seam.
- Manual loop management via animation_finished + CONNECT_ONE_SHOT
replaces LOOP_LINEAR so the seek-past-transition trick works.
- _idle_callbacks tracks active loop callables so they can be
disconnected when a one-shot animation interrupts idle.
- _idle_entry_done reset when a one-shot starts so the transition
frames play correctly when returning to idle after the action.
Model config:
- _find_model3d_asset() replaces _find_model3d_url() — returns the
full asset dict including the new fields.
- ModelFacingDirection → _facing_to_base_angle() → rotation.y applied
at load; stored in _model_base_angles for movement / idle reset.
- ModelScale applied uniformly to model_node.scale on load.
- ModelTintColor applied as multiplicative albedo_color tint to all
StandardMaterial3D surfaces (materials duplicated per-instance).
- ModelTintMaskUrl stored in DB/DTO; per-texel shader not yet wired.
Movement facing:
- _animate_unit_move pre-computes a facing angle per BFS step and
snaps model_node.rotation.y at the start of each step so units
face the direction they walk.
- On movement end, rotation resets to the idle/team direction.
Cleanup:
- _rebuild_units removal loop erases _idle_entry_done, _idle_callbacks,
_model_base_angles, _needs_face_rot for freed units.
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_units was destroying and recreating ALL unit bodies on every
state update, including echo broadcasts (delay=0, no animation needed).
Each recreation restarted idle from frame 0 — causing the bind-pose
flash the user sees as "T-pose then playing idle again."
Now _rebuild_units is incremental:
- Remove only units that left the board (died / discarded).
- Add only units newly present (just played / first connect).
- Leave existing unit bodies untouched so their animations continue
without interruption.
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 in _play_unit_anim:
1. Idle restarts mid-loop: the "don't restart" guard was `if not loop`,
so calling _play_unit_anim(iid,"idle",true) while idle was already
playing called ap.play() again, resetting to frame 0 (bind-pose flash).
Fixed: guard now applies to both loop and one-shot animations.
2. Bind-pose gap between one-shot end and idle: animation_finished
signal fires one process frame after the animation ends, leaving the
AnimationPlayer in a stopped state for that frame → T-pose flash.
Fixed: use ap.queue(idle_track) immediately after ap.play(one_shot),
so Godot transitions without any gap.
3. Dying animation transitions to idle: the one-shot path queued idle
after every non-loop animation including dying/death, overriding the
death-hold frame. Fixed: skip idle queue for dying/death/die.
Also remove [Anim]/[Move]/[Rebuild] debug prints now that animations
are confirmed working.
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>
Rapid echo state-updates (phase-change, turn-tick) arriving with
delay=0 used to cancel the pending movement tween, making unit travel
instant. Now a delay=0 call only updates _pending_rebuild so the
latest state is applied when the existing tween fires; the tween is
only cancelled when a new positive delay arrives.
Also: password min-length 12→8 (auth), anchor preset cleanup (tscn).
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>
CORS: Access-Control-Allow-Origin must be set before the CDN GetAsync
call so it is present even if the upstream throws (ASP.NET Core exception
handling resets responses, dropping headers set after an exception).
Added try/catch to return 502 cleanly on upstream failures.
Debug: [Move] prints in _play_move_animations and _schedule_rebuild to
diagnose why movement animation appears instant.
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>
Queue entries store paths as plain Array (nested in an untyped Array).
GDScript cannot implicitly upcast Array → Array[Vector2i] on pop_front.
Keep path variables untyped while building; use Array.assign() to
produce a typed Array[Vector2i] only at the final return point.
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>
Units now animate before their nodes are rebuilt:
Deferred rebuild
- _schedule_rebuild(state, delay) uses a Tween to hold off _rebuild_units
until animations finish; a new state cancels and replaces the pending rebuild
- POST_ANIM_SECS (1.2s) delay for attack / damaged / dying one-shots
- Hand and HUD update immediately; only the board is delayed
BFS movement animation
- _bfs_path() does 4-directional BFS avoiding other units' old positions
- _animate_unit_move() tweens the StaticBody3D through each grid step
(EASE_IN_OUT / TRANS_SINE, 0.28s per cell) while playing the Moving loop
- Returns to Idle automatically when the tween finishes
- rebuild delay = max(move duration, POST_ANIM_SECS if damage played)
- Model load callback skips position reset if a move tween owns the body
Housekeeping
- _play_damage_animations now returns bool (triggered any anim?)
- _update_prev_state() replaces HP/pos tracking that was in _rebuild_units
- _rebuild_units kills all in-flight move tweens before destroying 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>
GLB animations exported from DCC tools often prefix track names with
the model name using a dot (Merlock.Attack) or underscore (Merlock_IDLE).
The previous resolver only stripped the GLTF library prefix (before '/').
Now tries three forms after stripping the library prefix:
1. Direct match ("Idle" → "idle")
2. After last dot ("Merlock.Attack" → "attack")
3. After first underscore ("Merlock_IDLE" → "idle")
Each form is tried for the canonical action name and all its aliases,
so "Merlock.Attacked" maps to "damaged" via the "attacked" alias, and
"Merlock.Move" maps to "moving" via the "move" alias.
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 targeted print statements at 3 key checkpoints in the GLB
animation system to identify why animations don't play:
1. model_url presence (per unit, on every state rebuild)
2. AnimationPlayer presence + full track list (after model load)
3. Track resolution result in _play_unit_anim
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:
- CardAnimationBinding.AnimationTrackName: nullable override for GLB track name
(blank = case-insensitive convention match; Idle/Attack/Damaged/Moving/Dying)
- CardAnimationBindingDto: includes AnimationTrackName in content sync
- CardEditor: GLB Track Name column in animation bindings table
- CdnBrowser: model-viewer animation list + playback (JS interop on load event)
- Migration: AddAnimationTrackName applied to production
Client:
- ContentCache.get_anim_track(): resolves GLB track name from binding override
or falls back to convention with case-insensitive aliases
- game_screen.gd:
- _find_animation_player(): recursive search in loaded GLB scene tree
- _resolve_anim_track(): case-insensitive + alias resolution
- _play_unit_anim(): plays track, returns to Idle when one-shot finishes
- _play_damage_animations(): detects HP drops and unit deaths before rebuild
- Model facing: P1 units rotated 180deg Y to face opponent across board
- Idle loop starts automatically after real model loads
- Attack animation fires immediately on attack input (before ACK)
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 game.over was received, Game.state was not cleared. If both players
re-queued and matched again, the new GameScreen saw non-empty state and
called _on_state_updated instead of send_ready(), leaving the new session
stuck in Initializing. Clearing state = {} before emitting game_over fixes this.
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>
- Status label: connect Network.connected so "Connecting…" clears once the
WebSocket opens (previously the label stuck forever with no session)
- Remember Me: apply font_color override so the checkbox text is visible
- Register errors: map ASP.NET Identity password-policy error codes
(PasswordTooShort, PasswordRequiresUpper/Lower/NonAlphanumeric/Digit) to
user-friendly strings; old WEAK_PASSWORD kept as alias
- Chat poll: guard _on_message_poll_tick with Auth.user_id check so the timer
cannot send chat.get_messages as the first message on a fresh connection
when the user is not yet authenticated (caused by logout not stopping the
timer, leaving it running into the next reconnect cycle)
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>
_highlight_ability_targets was ignoring the target selector's filters array
entirely — it showed all ownership-matched units as clickable regardless of
spatial constraints. The server correctly rejected out-of-range selections
(after the previous fix) but the UI still offered them.
Added _unit_passes_filters() and _tile_passes_filters() which evaluate the
withinrange and isadjacenttosource filters using Manhattan distance from the
ability source unit before adding a tile highlight. Other filters (HasFlag,
AffinityMatches, etc.) are left as pass-through for now since they didn't
affect visibility in any reported case.
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: implement WithinRangeFilter (Manhattan distance min/max) and
IsAdjacentToSourceFilter in FilterMatches — both were falling through to
_ => true, so range constraints on targeting were silently ignored
- Program.cs: add GET /cdn/{**path} proxy endpoint with
Access-Control-Allow-Origin: * so browser web clients can fetch GLB models
(Ceph RadosGW / cdn.aeternalisgames.com has no CORS headers)
- ModelCache.gd: on web export, rewrite cdn.aeternalisgames.com URLs to go
through hub.aeternalisgames.com/cdn proxy; disk/memory cache still keyed
on the original CDN URL for consistency across platforms
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>
- Panel now appears to the right of the clicked spirit by projecting
its 3D world position to screen space via Camera3D.unproject_position,
with viewport-edge clamping so it never goes off-screen
- Removed ScrollContainer (height=0 caused buttons to be invisible);
replaced with plain VBoxContainer — panel auto-sizes to content
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 serialises AbilityDefinition with PascalCase property names
(Type, Actions, Target, Scope, Ownership, Count, All…). The client
was checking for lowercase keys (\"type\", \"actions\", etc.) so
ab.get(\"type\") always returned null, actives stayed empty, and the
panel was silently skipped.
Added _normalize_keys() which recursively lowercases all Dictionary
keys after JSON.parse_string(), making every subsequent lookup
case-insensitive without needing dual-key fallbacks 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>
- Ability panel now starts a per-action targeting flow instead of
immediately firing the ability
- Board abilities: blue tile highlights for unit/tile targets; click
to collect AbilityTarget and advance to the next action
- Player/zone abilities: left-side player panel with player name
buttons; zone (Hand/Deck/Discard) sub-buttons appear for zone-scoped
abilities
- Re-clicking a selected spirit toggles the ability panel open/closed
- Auto-skips actions whose ownership is Self/ExactSelf/Random or whose
count.all = true (server resolves those without player input)
- Game.send_activate_ability now accepts an optional targets array
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>
For WaitingForOpponent/Started, state always arrives via game.state_update push
not via the ack payload — calling _apply_state_from_payload on the ack was
producing a confusing warning with no real effect. Replace with a match that
only fetches state for AlreadyStarted.
Also add game.session_abandoned push handler: emits Game.session_abandoned
signal (new) and game_screen connects to it to navigate back to MainScreen,
so clients stuck on the loading screen after a server restart recover cleanly.
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 _fit_model_to_tile() + _model_local_aabb() helpers. After a tile
model loads, its AABB is computed from all descendant VisualInstance3D
nodes in the model's local space. The model is then uniformly scaled so
its largest XZ dimension = 0.98 units, and repositioned so it is
centred on XZ with its bottom at y = 0 of the tile body.
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>
_update_tile_affinity previously only repainted the placeholder material.
Now extracts model loading into _try_load_tile_model() which is called
both at initial board build (_add_tile) and on every affinity change
(_update_tile_affinity). Handles model swapping correctly — removes all
non-collision children before adding the new model so Lake→Hill transitions
don't stack meshes.
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>
- ModelCache._download: log result enum, HTTP code, body size,
Content-Type header, and first 16 bytes for every download — enough
to diagnose why Godot receives non-GLB data despite CDN serving valid GLB
- Moved disk-cache write to AFTER a successful parse so corrupt bytes
are never written; disk cache read now deletes + re-downloads on bad parse
- game_screen: replace raw `body` lambda captures with weakref to
eliminate "Lambda capture freed" noise (behavior unchanged)
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>
- ModelCache: switch GLTFDocument.append_from_buffer (was append_from_file
which returned ERR_BUSY/43); validate GLB magic bytes; explicit signal
disconnect before queue_free to avoid freed-lambda errors
- ContentCache: add tile model fetch (content.tile_models), disk cache at
user://content/tile_models.json, get_tile_model_url() API
- game_screen: _add_tile now loads tile CDN model via ModelCache when bound
- Server: ContentGetTileModelsHandler (content.tile_models msg), registered
in ServiceRegistration; TileModelDto / GetTileModelsResponse added to
ContentMessages
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>
Client:
- Added ModelCache autoload (autoloads/ModelCache.gd)
- Downloads .glb files from CDN via HTTPRequest
- Disk cache: user://remote_model_cache/<sha256>.glb
- Memory cache: PackedScene per URL for instant re-instantiation
- Concurrent requests for same URL queue and share one download
- Loads via GLTFDocument.append_from_file + generate_scene
- game_screen.gd: _add_unit_mesh now looks up cardDefinitionId
→ ContentCache.get_definition() → finds Model3D asset URL
→ calls ModelCache.load_model() to async replace placeholder geometry
- Placeholder (sphere/cylinder/box) shown immediately
- Real model swaps in on download completion
- Guards against body being freed before model arrives
- Added _unit_bodies dict for O(1) body lookup
- project.godot: registered ModelCache autoload
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>
Client (game_screen.gd):
- Scroll wheel no longer zooms camera when mouse is over the hand panel
- Clicking a friendly unit smoothly tweens camera pivot to that unit
(EASE_OUT CUBIC, 0.4s) — respects Settings.camera_follow_unit toggle
- Chat overlay instantiated from game screen and removed on exit
Client (Settings.gd + SettingsScreen):
- Added camera_follow_unit bool (default: on) to gameplay settings section
- Persisted to user://settings.cfg under [gameplay]
- Toggle visible in Settings screen under new GAMEPLAY section
Server Admin (MatchmakingQueuePage):
- "Clear History" button deletes all non-Searching matchmaking entries
Server Admin (GameSessionsPage):
- Per-row "Abandon" button for Active/Initializing sessions
- "Abandon All Active" bulk button marks all live sessions as Abandoned
with EndedAt=now and WinCondition="admin"
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>
Removes the broken CardDetailPopup overlay machinery entirely.
Double-clicking a battlefield unit now populates and shows the existing
ContextPopup with name/type/affinity header, HP/DEF/ATK/MP stats row,
and ability list (name + description bullets).
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 full-rect Control wrapper had default MOUSE_FILTER_STOP, eating
all clicks across the entire screen. Set MOUSE_FILTER_IGNORE so input
passes through to the 3D scene and HUD beneath 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>
CenterContainer/ScrollContainer require a proper Control parent to
compute sizes. Adding CardDetailPopup directly to a CanvasLayer broke
the nested container layout chain, causing zero-height Panel (invisible
content despite the grey overlay showing correctly).
Fix: spawn a dedicated CanvasLayer (layer 20, above HUD at layer 10)
containing a full-rect Control anchor, then parent the popup to that
Control. This restores proper anchor→Control→Container sizing.
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>
theme_override_constants["key"] and theme_override_font_sizes["key"]
throw on nodes not yet in the scene tree. Replaced with the proper
add_theme_constant_override() / add_theme_font_size_override() calls.
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>
Client (game_screen.gd):
- Fix crash when clicking a unit with null abilitiesJson: server sends the key
with a null value, so dict.get(key,default) returns null — guard both uses
(_show_ability_panel and _on_hold_timer_fired) with explicit null check.
- Add double-click on battlefield units to open a full CardDetailPopup showing
name, affinity, stats, and ability descriptions. Popup is instantiated once
in _ready() and reused; aliases movementPoints/abilities keys as expected.
Server (Filters.cs / AbilitySystem.cs):
- IsSelf filter now matches by CardDefinitionId (definition-level: any copy of
the same card). This is the appropriate semantic for "self" as a type scope.
- IsExactSelf filter added: matches by InstanceId (instance-level: only this
specific unit on the battlefield). Use this to prevent duplicate-instance
trigger bleed where two copies of a card both fire when only one acted.
- TriggerMatches now accepts the evaluating FieldCard and forwards its
InstanceId to Own() for all ownership checks.
- Own() gains "ExactSelf" scope: fires only when occ.Data.SourceId matches the
evaluating unit's InstanceId — eliminating the definition-level bleed bug.
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>
Root cause: _rebuild_hand used queue_free() alone, which keeps nodes in the
GUI tree (and receiving input events) until end-of-frame. When two state
updates arrive in the same frame, stale and live CardWidget instances overlap
at the same screen position — both emit card_pressed → _on_hand_card_clicked
fires twice per physical click, alternating select/deselect.
Fix 1 (root cause): _rebuild_hand now calls remove_child(c) before queue_free(c),
so the old widget is immediately detached from the HBoxContainer and can no
longer receive GUI input.
Fix 2 (defensive): _on_hand_card_clicked deduplicates calls within the same
engine frame for the same card instance using Engine.get_process_frames().
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>
Setting widget.z_index = 20 synchronously while a mouse button is held causes
Godot 4 to re-evaluate GUI focus and deliver a synthetic second pressed=true
event to the widget. This fired card_pressed a second time in the same frame,
making _on_hand_card_clicked see the card already selected → immediate deselect.
Fix: move tween creation and z_index assignment into a new _tween_hand_card()
helper, called via call_deferred() so it runs after the current input event is
fully processed (mouse button already released by then).
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>
Godot 4 fires two separate pressed=true InputEventMouseButton events for a
fast click: a normal press and a double_click press, both in the same frame.
The previous _gui_input emitted card_pressed for both, so the first emission
selected the card and the second (double_click) immediately deselected it.
Fix:
- Skip card_pressed emission when event.double_click is true
- Consume RELEASE as well as PRESS so neither can leak to the 3D board's
_unhandled_input handler (belt-and-suspenders over the _press_was_on_board
guard that already exists in game_screen.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>
- _add_highlight: use emission (emission_energy_multiplier=2) + 75% opaque base
so tiles glow visibly regardless of depth-sort/transparency ordering; raised
Y to 0.58 (clear of tile top at 0.50); thicker mesh (0.06 vs 0.02)
- Remove Godot-3-only flags_transparent property (no-op in Godot 4)
- _on_state_updated: preserve CARD_FROM_HAND / TERRAMORPHA_SELECT through server
state pushes if selected card is still in hand (re-apply highlights after
_rebuild_hand); only clear UNIT_SELECTED and other transient modes
- Add diagnostic prints to _add_highlight and _on_state_updated to trace when
state updates arrive relative to card 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>
- Spirit tile null safety: dict.get(key, default) only uses the default when
the key is absent. Server sends nullable ints as JSON null, so the key EXISTS
but the value is null. GDScript returns null which coerces to 0 on a typed int,
collapsing min_r/max_r to 0 and producing zero valid tiles. Fixed by reading
channel range as Variant and substituting the default (1/2) when null.
- Channel range source: read from arch (ArchSpirit), not the Spirit card — the
ArchSpirit defines how far away from itself it can channel Spirits.
- Ruin: auto-placed by server. Clicking a Ruin card now immediately calls
send_play_card without entering CARD_FROM_HAND mode or requiring a tile click.
Added Ruin to the board-click immediate-play guard as well.
- Deselect previous: before entering a new CARD_FROM_HAND selection, explicitly
call _set_mode(NONE) when already in CARD_FROM_HAND or TERRAMORPHA_SELECT.
This guarantees _refresh_hand_selection fires a deselect tween on the old
card before the new card's select tween begins.
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>