- Skip ActivationConditions with Subject=="Target" in ActivateAbility (mirrors
AbilitiesJson code path) so conditions like IsOnTileWithAffinity{Target,Lake}
aren't evaluated against the source unit at activation time
- Add RevokePassivesForSource call in ReturnToHandEffect before removing the
unit from the field, matching SendToDiscardEffect 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>
Add CustomLobbyStatus.Completed; in FinalizeGameAsync, query the lobby
linked via GameSessionId and set Status=Completed when the game ends.
This removes finished games from the active-games browser (list_active
only returns Started lobbies) and from the admin "active" count.
Admin page: add Completed filter option, dark badge, include Started
lobbies in the always-loaded set so stale in-progress games are visible.
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>
- init_screen.gd: handle null sessionId from game.get_active_session.ack
properly — str(null)="<null>" which passed the is_empty() check causing
every player to see "active game in progress (null phase)" on login
- CustomLobby.gd: call clear_state() at the start of create() and join() so
that i_am_ready/partner_ready are reset between lobbies — fixes players
appearing instantly ready when entering a new lobby after a previous game
- game_screen.gd: in _setup_spectator_ui(), hide _settings_btn (prevents
accessing the Concede button) and add a programmatic "Leave" button that
calls Game.stop_spectating() and navigates back to FreePlayScreen
- CustomLobbiesPage.razor: add Cancel button (admin) for Open/Full lobbies;
directly sets Status=Cancelled and refreshes the list
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>
- GameLeaveCustomLobbyHandler: return success silently for Started/Cancelled
status (allows the Leave button to work regardless of lobby state); inject
IClientPush and send LobbyPartnerLeftPush to remaining participant when
someone leaves a Full lobby; reset ready flags when guest leaves
- GameMessages: add LobbyPartnerLeftPush(LobbyId, Reason)
- CustomLobby.gd: add partner_left signal; handle game.custom.lobby.partner_left
push by calling clear_state() then emitting partner_left
- lobby_room_screen.gd: connect/disconnect partner_left; show toast + navigate
back to FreePlayScreen when partner leaves
- free_play_screen.gd: extract auto-select into _auto_select_deck() helper to
fix GDScript parse error (comma inside multi-line if-body within lambda)
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>
- Cache _all_decks from server; auto-select first deck on load
- Join flow: if multiple decks, show inline deck-picker dialog
before proceeding to password prompt / join
- Remove stub _get_first_deck_id() (was always returning "")
- _populate_create_deck_buttons now uses _all_decks cache and
auto-presses first button to reflect the default selection
- Guard in _do_join: show alert if _selected_deck still empty
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.custom.get returns full CustomLobbyDetailDto: all effective rules (overrides
merged with GameRules.Default), host/guest account IDs, status, GameSessionId.
- CustomLobbyDetailDto includes Status string, GuestAccountId (nullable),
GameSessionId (nullable); richer than the browse-list CustomLobbyDto.
- GetCustomLobbyRequest / GetCustomLobbyResponse added to GameMessages.cs.
- ServiceRegistration: registered GameGetLobbyHandler as transient IMessageHandler.
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>
- VoteSessionService singleton: ConcurrentDictionary<Guid, ActiveVote> keyed by lobbyId.
TryStart prevents concurrent votes; Cast resolves immediately on any rejection or all approval.
- GameSavePresetHandler (game.custom.preset.save): captures lobby override columns into
CustomRulesOverride JSON and persists as LobbyPreset; participants only.
- GameListPresetsHandler (game.custom.preset.list): returns all presets owned by caller.
- GameDeletePresetHandler (game.custom.preset.delete): owner-only delete.
- GameProposePresetHandler (game.custom.preset.propose): host-only in Full lobby;
starts vote with guest as sole voter; pushes game.custom.preset.vote_requested to guest.
- GameVotePresetHandler (game.custom.preset.vote): casts yes/no;
Approved → applies preset overrides to lobby DB + pushes game.custom.lobby_updated to both;
Rejected → pushes game.custom.preset.vote_rejected to both.
- GameMessages.cs: SavePreset/ListPresets/DeletePreset/ProposePreset/VotePreset
request/response types; LobbyPresetDto; PresetVoteRequestedPush, LobbyUpdatedPush,
PresetVoteRejectedPush.
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>
- SpectatorRegistryService singleton: ConcurrentDictionary<Guid, ImmutableHashSet<Guid>>
tracking spectators per session. Static Instance for use in static base-class helpers.
- GameEngine.ToDtoSpectator: delegates to ToDto(state, "") — both hands hidden.
- GameHandlerBase.PushStateToPlayersAsync: extended to push hand-hidden state_update
to all registered spectators via SpectatorRegistryService.Instance.
- GameHandlerBase.FinalizeGameAsync: pushes game.over to spectators then calls
RemoveSession to evict the entry from the registry.
- GameSpectateHandler (game.spectate): validates session Active, registers spectator,
returns current spectator-view state as ack.
- GameStopSpectatingHandler (game.spectate.stop): unregisters the caller.
- GameMessages.cs: SpectateRequest/Response, StopSpectatingRequest/Response.
- ServiceRegistration.cs: register SpectatorRegistryService singleton + both handlers.
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 2 — GameEngine:
- Draw(): now draws DrawPerTurn+DrawPerTurnBonus cards per call (was always 1);
enforces HandSizeCap with block-draw or auto-discard (DiscardOnMaxHand)
- EndTurn(): returns (GameState, bool gameOver); applies MpBuff to all next-player
units at turn start; checks TurnLimit and sets GameOver phase if exceeded
- GetTurnLimitWinner(): helper returning winner/loser by ArchSpirit HP (P1 on tie)
- ValidateDeck(): new public method checking MinDeckSize, MaxDeckSize, MaxArchTier1
- GameRules note: new fields are already in place from Phase 1
Phase 7 — Handlers + Messages:
- CustomRulesOverride: +9 new nullable fields (HandSizeCap, DiscardOnMaxHand,
MaxDeckSize, MinDeckSize, MaxArchTier1, TurnTimerSeconds, TimeLimitMinutes,
TurnLimit, MpBuff)
- CustomRulesDto: +9 matching fields + HasPassword bool
- CreateCustomLobbyRequest: +Password field
- JoinCustomLobbyRequest: +Password field; handler now validates password
- ListCustomLobbiesRequest: +NameSearch, ShowPasswordProtected filters
- GameCreateCustomLobbyHandler: full rule merge + ToDto covers all new fields
- GameJoinCustomLobbyHandler: password check + full rules construction incl. new fields
- GameListCustomLobbiesHandler: full DTO mapping + NameSearch/password filters
- GameEndTurnHandler: injected identityDb+eventBus; handles TurnLimit game-over
using same pattern as GameAttackHandler (set session fields before SaveStateAsync)
- GameDrawHandler: update deconstruct to discard unused drawn list (_)
- CustomLobbyGuestJoinedPush: new push type (used in Phase 6)
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>
- Extend CustomLobby with 12 new rule override columns (Password,
HandSizeCap, DiscardOnMaxHand, MaxDeckSize, MinDeckSize, MaxArchTier1,
TurnTimerSeconds, TimeLimitMinutes, TurnLimit, MpBuff, BoardWidth/Height)
- Extend GameRuleSet with matching non-nullable rule fields (same set)
- Extend GameRules record with 9 new rule fields (all default to 0/false)
- Add LobbyPreset entity (owner-scoped named rule presets)
- Register LobbyPreset in GameDbContext with index on OwnerAccountId
- Migration: AddCustomGameExtensions (applied to pg-forge-01)
- Add custom-game-system-plan.md with full 8-phase architecture plan
and deferred features tracking list
- Also includes: AbilityBuilder ValueExpr dropdowns + help panel,
Affinity enum/system fixes (from prior sessions)
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>
Two root causes fixed:
1. Race condition (primary cause): SaveStateAsync committed the
transaction with Phase=GameOver in StateJson, but session.Status
was not set to Completed until a separate SaveChangesAsync in
FinalizeGameAsync. If the server crashed or any exception was
thrown between those two calls, the session was left Active with
a GameOver state — causing the "active game" prompt on next login.
Fix: each game-over handler (concede, force_concede, attack) now
sets session.Status/WinnerAccountId/WinCondition/EndedAt BEFORE
calling SaveStateAsync, so all fields commit atomically in the
same transaction.
2. Wrong save order in FinalizeGameAsync: identityDb.SaveChangesAsync
(ELO update) ran before gameDb.SaveChangesAsync (Status=Completed).
Any transient identity-DB error left the session permanently Active.
Fix: gameDb is saved first; ELO runs after, so a failed ELO update
never causes a ghost match.
3. Defensive startup heal (GameStartupCleanupService): on server
start, Active sessions whose StateJson contains Phase=GameOver are
now detected and marked Completed. game.over is pushed to any
still-connected clients so they can exit 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>
Client: Repentance/Instinct cards with Active abilities in abilitiesJson now
enter ABILITY_TARGET mode instead of sending play_card immediately. Units on
matching tile affinities (IsOnTileWithAffinity) are highlighted in blue; the
player clicks a target unit and the card is sent with the selected unit target.
Server: FireCardEffects now also processes Active abilities from AbilitiesJson
(after the existing EffectsJson path). Source-side ActivationConditions are
checked; target-side conditions (Subject=Target) are trusted from the client.
New Game.gd helper: send_play_card_with_targets sends play_card with a targets
array so the server can route unit selections to the active ability 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>
Issue 1 — ActivationConditions on passives were never checked:
- ApplyPassivesForSource and ApplyPassivesToNewTarget now evaluate
ActivationConditions against the source unit before executing each
passive ability (e.g. IsOnTileWithAffinity: Lake only grants the buff
when the unit is actually on a Lake tile).
Issue 1 — Passives not re-evaluated on movement / tile changes:
- Added ReEvaluateConditionalPassives(state): for every unit with at
least one conditional passive, revoke all WhileSourceOnBattlefield
effects then reapply with conditions re-checked. Units without
conditional passives are skipped with zero overhead.
- Called after MoveUnit (unit changes tile affinity),
ActivateAbility (ability may change board state),
and ChannelCard Terramorpha path (tile affinities change).
Issue 2 — INSUFFICIENT_TARGETS thrown from ApplyPassivesToNewTarget:
- ResolveTargets: when restrictTargets is set (passive-to-new-target
mode only) and filtering produces zero candidates, return [] silently
instead of throwing. An ExactSelf source-buff simply has no valid
target among the new unit — that is expected, not an error.
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>
PureVoid tiles are meant to appear as empty floating platforms — attaching
stalagmite decoration below them breaks the visual. The affinity is checked
at the start of _try_load_tile_model and both attach points (placeholder
path and 3D-model-loaded path) are skipped when affinity == "PureVoid".
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 admin replaces a model/art file via the CDN browser, the S3 ETag is
now captured and stored on CardAsset.ContentETag. The ETag is included in
the content sync DTO (CardAssetDto) so clients receive it on every sync.
Client-side ModelCache now keys its disk cache on sha256(url + "#" + etag)
instead of sha256(url), so updating a file at the same CDN path busts the
disk cache automatically. A _CACHE_VER="v2" sentinel purges old-scheme
.bin files on first launch after the client update.
Changes:
- CdnUploadResult: add string? ETag field
- S3CdnClient: capture ETag from PutObjectAsync response
- CardAsset: add string? ContentETag property
- Migration 20260318000001_AddAssetContentETag: add content_etag text column
- ContentMessages: add string? ContentETag to CardAssetDto
- ContentDtoMapper: map ContentETag in CardAsset → CardAssetDto
- CdnBrowser.razor: UploadFileToKeyAsync returns Task<string?> (ETag);
ReplaceAsync calls PropagateAssetETagAsync which updates CardAsset rows
and touches CardDefinition.UpdatedAt to trigger a version bump
- ModelCache.gd: versioned disk key + cache migration + etag parameter on
load_model() and evict()
- game_screen.gd: pass model_asset.contentETag to load_model / retry chain
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>
AbilityDefinition gains an optional Duration property. When set it is used
as forceDuration for every ExecuteActions call that resolves that ability,
overriding whatever per-action Duration individual effects specify.
- Active abilities: def.Duration is threaded through as forceDuration
- Triggered abilities: same
- Passive abilities: def.Duration ?? WhileSourceOnBattlefield (both
ApplyPassivesForSource and ApplyPassivesToNewTarget paths)
AbilityBuilder admin panel:
- Duration row added after type-specific fields (dropdown + N input for ForNTurns)
- "WhileSourceOnBattlefield" added to the DurationTypeValues list
- Parse and compile paths updated for the new Duration field
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 attack resolution and sacrifice paths in GameEngine.cs bypassed
RevokePassivesForSource (and EvaluateAurasOnLeave for combat deaths).
Now all three exit points call both aura/passive cleanup before removing
the unit from the board.
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>
DefinitionToInstance and ToFieldCard both omitted copying Genus, so
HasGenusCondition and GenusContainsFilter always evaluated against null
(returning false). All three data-flow gaps are now fixed:
- DefinitionToInstance: def.Genus?.ToList() → CardInstance.Genus
- ToFieldCard: source.Genus?.ToList() → FieldCard.Genus
- FilterMatches: GenusContainsFilter now handled (was falling to _ => 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>
Passive abilities (e.g. 'All Merfolk +1 attack') were never executed
because AbilityType.Passive had no runtime processing.
Three root causes fixed:
1. Passive abilities are now applied when units enter the battlefield
and reversed when they leave (new DurationType.WhileSourceOnBattlefield).
- ApplyPassivesForSource: runs a unit's passives against all current targets
- ApplyPassivesToNewTarget: applies existing passives to a newly-entered unit
- RevokePassivesForSource: reverses all passive effects on source death/leave
- Hooked into GameEngine.Channel, Transition and AbilitySystem
ReturnToBattlefield, SummonToken, KillUnit, SendToDiscard
2. Action conditions with Subject="Target" now filter per-target instead of
aborting the entire action (which evaluated against ctx.Source).
Source-level conditions still gate the whole action; target-level ones
are evaluated individually and skip non-matching targets.
3. ExecuteActions/ResolveTargets gain a restrictTargets parameter used by
ApplyPassivesToNewTarget to avoid double-applying existing passive buffs
to units that already received them when the passive source entered.
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 raw JSON textarea for trigger event with per-type dropdown
and input fields. Each of the 39 trigger types now renders only its
relevant fields (Player, Ownership, SourceOwnership, TargetOwnership,
UnitType, CardType, DamageType, Amount, Stat, Cause, CausedBy,
RuinOwnership, OccupantOwnership, UnitOwnership, AuraOwnership).
- AbilityDraft gains 15 structured trigger fields replacing TriggerJson
- RenderTriggerFields: per-type RenderFragment (mirrors RenderConditionFields)
- CompileTrigger: builds TriggerEvent JsonObject from draft fields
- ParseJson: reads all trigger fields from existing TriggerEvent JSON
- SelectTrigger: resets all fields to sensible defaults on type change
- New helpers: BuildStringInput, BuildOptionalAmountInput, BuildOptionalStringSelect
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 tracked_target consume before the early-return path so fully-blocked
hits (zero HP change on all units) still trigger the defender's blockedSoundUrl
after attack_remaining seconds, matching the timing of a landed hit.
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>
- SFX.gd autoload: fire-and-forget CDN audio player with 8-slot pool,
session-level stream cache, OGG/MP3 support via HTTPRequest download,
uses Settings BUS_SFX so volume/mute work automatically
- Register SFX in project.godot autoloads
- game_screen.gd:
- _sfx_for_unit(iid, key) helper — looks up CardDefinition SFX URL
from ContentCache using the unit's def ID
- Attack sound: played when player initiates attack + counter-attack
- Damaged sound: played at all damage animation sites (immediate,
delayed bystander, post-attack callback, counter-chain)
- Death sound: played when dying animation fires
- Move sound: played when movement animation starts
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>
**Feature 1 — Model retry (client)**
- `ModelCache.gd`: add `evict(url)` to remove failed entries so re-download is possible
- `game_screen.gd`: when GLB load fails, `_schedule_model_retry` queues a 60-second
retry (up to 10 attempts); `_do_model_retry` evicts + re-downloads and swaps the
placeholder mesh for the real model if/when it succeeds
**Feature 2 — Rejoin on login (server + client)**
- Server: `GameGetActiveSessionHandler` (`game.get_active_session`) — returns the
caller's active session ID + phase, or null when no session exists
- Client: `init_screen.gd` checks for an active session after content sync; shows
a "Rejoin / Concede" dialog when one is found; rejoin navigates to GameScreen with
the session ID already set so `send_ready` → `AlreadyStarted` → `_fetch_state`
**Feature 3 — 5-minute inactivity detection (server + client)**
- `GameSession`: add `LastActionAt` column + EF migration
(`20260317000001_AddLastActionAt`)
- `GameHandlerBase.SaveStateAsync`: sets `session.LastActionAt` on every action
- `GameInactivityMonitorService`: background poll every 60 s; when a session hasn't
had an action in ≥ 5 min, pushes `game.inactive_warning` to the stalled player and
`game.opponent_inactive` to their opponent (once per session per server lifetime)
- `GameForceConcedeHandler` (`game.force_concede`): lets the waiting player claim
the win; validates caller is not the active player and `LastActionAt` is stale
- `Game.gd`: new `opponent_inactive` / `inactive_warning` signals + push handlers +
`send_force_concede()` helper
- `game_screen.gd`: handles `opponent_inactive` with Accept/Wait dialog;
handles `inactive_warning` with informational 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>
Replace the plain hex text input + static swatch with a native
<input type="color"> (Bootstrap form-control-color) + text field
combo. Clicking the swatch opens the browser's colour picker and
updates the hex field in real-time. An × button clears the value
back to null (no tint). The text field still accepts manual hex
entry and the picker reflects the change on the next interaction.
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 Scale and Tint Colour from Basic tab into Assets tab under a
new "3D Model Config" section (defaults: Scale=null→1.0, Tint=null)
- Model3D assets: folder icon opens a CDN picker modal that lists all
*.glb / *.gltf from the models/ bucket (cached after first load),
filterable by filename, with a list-group UI
- Art2D assets: same picker pattern but pulls from cardart/ bucket and
shows image thumbnails in a responsive grid
- Model3D inline 3D preview via <model-viewer> appears below the URL
when set; "Load animations" button invokes the same JS interop as
CdnBrowser and populates an animation dropdown
- Art2D inline image preview appears below the URL when set
- Changing or uploading a URL clears cached animation state so the
Load button reappears for the new file
- JS guard (window.sorCdn = window.sorCdn || {}) prevents double-
definition when CdnBrowser is also loaded in the same 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>
Root cause: _animate_unit_move computed unit_above by subtracting
from_tile_top from body.position.y. If a state update arrived before
the board rebuilt (body still mid-tween), that subtraction produced a
value > 0.28 which then compounded each successive move.
Secondary: from_tile_top was typed :int, silently truncating the float
sum of tile_base + tile_h.
Fix: store above_tile as body metadata in _add_unit_mesh (0.28/0.4/0.5
per card type). _animate_unit_move reads the stored constant directly —
it is immune to board rebuild timing.
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>
Every tile now has a deterministic vertical offset (±0.15 units) in
addition to its existing height variety, giving the board a natural
uneven terrain look. Units placed on tiles and highlight rings account
for the stagger offset. Move animations step through correct per-tile
Y heights so units don't float or sink as they walk across the board.
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>
Visual changes (client):
- 0.1 gap between all tiles (TILE_SPACING = 1.1)
- Placeholder tiles (no 3D model) are now 0.5 height instead of random
0.8-1.0, making undecorated tiles visually distinct
- Placeholder tiles load a 2D CDN texture via HTTP and apply it as the
albedo on the BoxMesh (same affinity-per-shape lookup as 3D models)
- Placeholder tiles also attach a stalagmite bottom model, matching the
look of fully-decorated tiles
Server:
- TileModelBinding.TexturePublicUrl (nullable text) added to entity,
migration 20260317000001_AddTileTexture applied to DB
- TileModelDto extended with TexturePublicUrl
- ContentGetTileModelsHandler includes TexturePublicUrl in response
Admin (/content/tile-models):
- New "Square Texture" and "Hex Texture" columns in the bindings table
- Texture picker modal browses the CDN textures/ prefix and shows image
thumbnails; select + assign writes TexturePublicUrl to the binding
- Texture can be assigned without a 3D model (creates a binding row
with empty model fields)
ContentCache:
- Caches texturePublicUrl alongside modelPublicUrl from tile_models response
- New get_tile_texture_url(affinity, shape) → String accessor
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>
CardInstanceDto lacks the `assets` array, so card art never loaded.
Look up the full CardDefinitionDto from ContentCache (which has assets,
genus, abilitiesJson, and all base stats) and pass it as the `def`
argument to widget.setup().
Also remove the old "compact" code that was hiding the stats grid and
shrinking the art area — the full CardWidget now shows as intended.
Field alias retained: maxMp → movementPoints for CardWidget._load_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>
The affinity model's visual base is at body-local Y=0 (= world Y=tile_h/2,
the tile centre), because _fit_model_to_tile seats AABB bottom there.
The stalagmite base (AABB top) must sit at the same height so it connects
seamlessly.
Previous shift -(tile_h/2 + scaled_h) placed the base at body-local
Y=-tile_h/2 (world Y=0 = tile physical bottom), creating a gap of tile_h/2
between the affinity model and the stalagmite.
Fix: shift by -scaled_h only, bringing AABB top to body-local Y=0.
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>
MeshInstance3D.get_aabb() returns a zero AABB when the node is not yet
in the scene tree, so the previous code's _fit_model_to_tile call was
a no-op (early return on zero footprint) and scaled_h was always 0.
Fix: add_child the stalagmite to the tile body FIRST (matching the same
order used by _try_load_tile_model for tile top models), then call
_fit_model_to_tile, then read the now-valid AABB to compute scaled_h
and apply the correct downward shift so the wide base lands flush with
the tile underside.
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>
- Stalagmite: remove erroneous flip; models are spike-at-AABB-bottom so
no rotation needed — shift down by (tile_h/2 + scaled_h) so the wide
base lands flush with the tile underside and spike hangs below
- Tile affinity models: revert accidental +tile_h*0.5 lift (those models
were not the subject of the grounding complaint)
- Unit/card models: replace naive (tile_h - y_offset) offset with
AABB-based formula that works regardless of model origin placement
(feet, geometric centre, etc.):
model.position.y = (tile_h - y_offset) - scale.y * aabb.position.y
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>