- HexSides now stores radius+1 (for hex coordinate math); HexPolygonSides stores the corner count (3–10)
- Board.IsTemplateBased: template boards use tile existence for IsInBounds/GetNeighbors instead of the hexagonal formula, so N-gon and other custom shapes work correctly
- HexGrid.AllNeighbors: unfiltered 6-neighbor generator for template board use
- ApplyHexConfig: generates a regular N-gon on the hex canvas — tiles outside the polygon are marked absent; N corner zones auto-generated for each player count 2..N
- Admin builder UI: separate "Polygon Sides" (3–10 corners) and "Radius (tiles)" inputs
- BoardTemplate entity and migration: HexPolygonSides column added to board_templates
- BoardTemplateDto exposes HexPolygonSides to 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>
- Admin builder: SVG hex canvas renders when GridType=Hexagon (pointy-top hexagons, correct axial layout); square CSS grid otherwise
- Admin builder: ApplyHexSides / OnGridTypeChanged handle dimension/tile pruning; canvas header shows N/diameter for hex
- BoardTemplateDto now includes GridType and HexSides so clients can filter
- rules_editor_dialog: Board Width/Height/Shape hidden when hex selected; Hex Sides hidden when square; template picker filtered to matching grid type with live toggle
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>
_idle_rotation now:
- Finds the nearest enemy body in _unit_bodies by XZ distance
- Returns atan2 toward that position minus the model's base angle
- Falls back to the original north/south heuristic when no enemy exists yet
Also refreshes idle rotation for all units on every state rebuild (step 4 in
_rebuild_units), skipping any unit currently in a move tween, so rotations
stay correct as units reposition across turns.
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 - MakeHexagon starting zones:
- Zones are now corner-based instead of full-edge: each zone is the corner
tile plus (N-1)/2 tiles along each of the two edges meeting at that corner
- 2 players → opposite corners (0, 3 = right/left); 3 → every-other corner
(0,2,4); 4 → (0,1,3,4); 5 → (0-4); 6 → all 6 corners
Client - game_screen.gd:
- Add HEX_TILE_SPACING = TILE_SPACING * 0.5 constant
- _coord_to_world: use HEX_TILE_SPACING for hex world positions
- _add_tile: tile cylinder radius scaled by HEX_TILE_SPACING
- _add_highlight: highlight cylinder radius scaled by HEX_TILE_SPACING
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:
- CustomRulesOverride: add HexSides (int?) field
- CustomLobby entity: add HexSidesOverride (int?) column
- GameUpdateLobbyRulesHandler: save HexSidesOverride, include HexSides in
effective rules preview
- GameLobbyReadyHandler: set rules.HexSides from lobby.HexSidesOverride on
game start
- GameSavePresetHandler: capture BoardShape + HexSides in saved presets
- Migration 20260401222603_AddCustomLobbyHexSides: adds HexSidesOverride to
custom_lobbies; applied to pg-forge-01 via dotnet ef database update
Client:
- rules_editor_dialog: send null (not "") for boardTemplateIdOverride when no
template selected — empty string crashed Guid? deserialisation on the server
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>
Replaces burying "Hexagon" in the Board Shape list with a dedicated
Grid Type dropdown at the top of the BOARD section. When "Hexagon" is
selected, boardShape is forced to "Hexagon" on confirm; square boards
use the Board Shape field as before. Hex Sides remains visible for
the sides setting.
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 no Hex CDN model exists for an affinity, hex tiles now keep their
coloured CylinderMesh (radial_segments=6) placeholder rather than loading
a Square model or texture. Square boards are 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>
- rules_editor_dialog: add "Hexagon" to Board Shape picker and a Hex Sides
spinner (3–10, default 5) so custom lobbies can configure hex boards
- game_screen _add_tile: has_model check now looks for Hex-shape CDN models
(falls back to Square), so hex tiles get height variance when a Hex model is
registered on the CDN instead of always using the flat placeholder height
- game_screen _try_load_tile_model: texture fallback now checks shape_key
("Hex") first, then falls back to "Square" — consistent with model loading
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>
DB columns are PascalCase (e.g. BoardWidth, not board_width). The previous
migration used snake_case names — renamed grid_type→GridType and hex_sides→HexSides
on pg-forge-01, and updated the migration file to match so future re-runs are correct.
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>
Movement tiles (_valid_move_tiles):
- Walk: BFS blocked by all occupied tiles (can't walk through units)
- Flight: BFS blocked only by other Flight units (flies over Walk units)
- Jump: Manhattan range, unoccupied only (was already correct)
- Teleport: Manhattan range + LOS to destination
Attack highlights (_attack_range_tiles, _valid_attack_target_coords,
_valid_attack_target_ids):
- Added AttackRequiresLos field to CardInstanceDto / ToCardInstanceDto
- Client now checks _client_has_los() for LOS-required attackers
- Tiles/units blocked by occupants are no longer highlighted as targets
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, clicking an ArchSpirit showed the abilities panel AND a
separate OS-level PopupMenu for arch-spirit actions. Now everything
lives in one floating panel:
[Abilities] ← shown only if unit has active abilities
──────────
<ability buttons>
[ArchSpirit] ← shown only for friendly ArchSpirit
──────────
Sacrifice a Spirit (only when valid candidates adjacent)
Ascend (only when tier+1 card in hand)
Transition (only when tier-1 card in hand)
Removed the _show_arch_spirit_menu() PopupMenu call from _select_unit().
_show_ability_panel() now builds both sections and returns early only
when both would be 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>
If sync_complete or sync_failed never fires (e.g. background refresh
_is_syncing guard eats the start_sync call and signals were already
emitted before init_screen connected them, or a server request is
in-flight with no reply), the player was silently stranded with no
retry path and had to relaunch.
Adds a SYNC_TIMEOUT_SEC = 20 watchdog timer started in _do_sync() and
reset on each sync_progress page. If it fires, surfaces the retry
button with a "Timed out" message.
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-finger pinch/pan, 3-finger pan, MagnifyGesture, and PanGesture are
now gated behind gesture mode. In buttons mode only single-finger drag
(controlled by the active toggle button) affects the camera.
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>
Cumulative drag distance (_touch_drag_total) is the wrong metric for tap
detection: natural finger jitter (A→B→A) can exceed 36 px even on a clean
tap, silently suppressing board clicks (unit moves, card plays, etc.).
Switch the board-click gate to start-to-end distance (< 50 px = tap).
_touch_drag_active now only means "camera mode fired during this touch" and
is set by the gesture timer or when an active camera mode consumes a drag.
This means taps always reach _handle_board_click regardless of finger wobble.
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>
_touch_drag_active was set unconditionally on 36px drag, silently eating
board taps even when no camera action occurred. Now only set when a camera
mode (orbit/pan/zoom) is actually active. Gesture timer also immediately
marks drag-active on activation so the 3s hold doesn't fire a board click.
Buttons enlarged to 44px minimum height for touch usability.
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>
- Settings: new touch_camera_mode ("gesture"|"buttons"), persisted to camera section
- GameScreen: CamGestureTimer (3 s), CamCtrlPanel with Orbit/Pan/Zoom toggle buttons
- game_screen: gesture timer fires orbit/pan/zoom after 3-second stationary hold;
button mode shows on-screen toggles; single-finger drag now gated behind active mode
- InGameSettings: Camera Controls section with Touch Camera OptionButton
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>
Left-click drag was orbiting the camera on desktop, so any mouse movement
>2px during a click would suppress _handle_board_click. Moved camera orbit
to right-mouse drag (_orbit_active flag) leaving left-click exclusively for
board actions regardless of mouse movement. Touch single-finger orbit is
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>
4px per-event threshold was too sensitive — normal finger tremor during
a tap could exceed it, causing _touch_drag_active to suppress the click.
Now accumulates total drag distance since touch-down; requires 12px total
movement before classifying the touch as a camera orbit.
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>
Added _touch_drag_active flag set only when finger moves > 4px threshold.
Camera orbit now requires meaningful drag; taps no longer jiggle camera
or get swallowed — board clicks fire correctly for gameplay actions.
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 _was_multi_touch flag: set when second finger lands, cleared only
when all fingers lift — prevents single-finger orbit logic from running
during a pinch even if ScreenDrag(finger-0) arrives before ScreenTouch(finger-1)
- Handle InputEventMagnifyGesture (trackpad/browser pinch-to-zoom) and
InputEventPanGesture (two-finger pan) which browsers emit instead of
raw dual ScreenDrag events
- Initialize _last_mouse from touch pair midpoint when second finger lands
so two-finger pan has a correct delta baseline
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 Triggered ability fires and any of its actions require a human target
pick, the server now pauses execution instead of auto-resolving:
Server:
- AbilitySystem.FireTrigger detects actions needing client input via
ActionNeedsClientTargets(); stores PendingTriggeredTarget in GameState and
returns early rather than executing the ability
- PushStateToPlayersAsync (GameHandlerBase) checks for PendingTriggeredTarget
after every state push and sends a game.ability.triggered_target_request push
to the owning player carrying the action definition and range
- New GameTriggeredTargetHandler (game.triggered_target) receives the player's
picks, calls AbilitySystem.ResumeTriggeredAbility, and broadcasts the result
- PendingTriggeredTarget model stored in GameState.PendingTriggeredTarget (JSONB)
Client:
- Game.gd handles the triggered_target_request push and emits a signal
- game_screen.gd connects the signal, re-uses the existing ABILITY_TARGET mode
and _start_ability_targeting() flow, then sends game.triggered_target instead
of game.activate_ability when done
- A brief banner ("Triggered: <name> — select a target") informs the player
"Warrant Cover" (OnChanneled, Owner unit pick) will now correctly prompt the
player to select which friendly unit gains +1 Defense.
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>
- Right-side slide-in drawer shows tile coords, affinity, base1/base2, ruin,
and occupant name when any tile is clicked in NONE mode; auto-closes on mode change
- New 'Focus camera when clicking a tile' setting (Settings.click_to_focus_camera),
toggled in in-game settings panel, tweens camera to clicked tile
- Clicking a tile occupied by a unit now redirects to that unit in both NONE
and UNIT_SELECTED modes, so you no longer need to hit the unit mesh exactly
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>
- AbilityTarget: add BranchIndex for ChooseOne branch selection
- Action: add ChooseOne? property; when set the action is a branch selector
- AbilitySystem: ExecuteSingleAction handles ChooseOne — reads BranchIndex
from client targets, executes chosen branch actions (auto-resolved)
- game_screen.gd: count.N > 1 — input handler now accumulates targets until
N collected before advancing to next action
- game_screen.gd: count.UpTo — show "Done Selecting" confirm button so player
can finish with fewer than N targets
- game_screen.gd: ChooseOne — detect chooseone key in action dict, show branch
panel with labelled buttons, record branchIndex in target payload
- game_screen.gd: LinearOnly — _is_linear() filter applied to both tile and
unit highlights when ability range has linearonly=true
- game_screen.gd: RequiresLos — _client_has_los() supercover DDA (matches
server LineOfSight.HasLos) applied to highlights when requireslos=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>
card.get("abilitiesJson", "") returns null when the key exists but
the server sent null — the default only fires for absent keys.
Assigning null to a typed String variable throws in GDScript 4.
Use an explicit null check instead of relying on the dict default.
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 4's `or` is a logical operator that returns bool, not the
left/right value like Python. `player.get("archSpirit") or {}` was
putting true/false into the iteration array instead of the dict,
causing `is_empty` to fail with 'base bool'.
Replace with an explicit null check:
var _arch_list = [] if arch_raw == null else [arch_raw]
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>
Spirits may only be channeled onto tiles whose resolvedAffinity
matches the card's affinity. Previously all unoccupied in-range tiles
were highlighted regardless of affinity.
Also:
- Cache Game.get_tile() result to avoid double lookup per cell
- Add sparse-board guard (_tile_bodies existence check)
- Remove stray debug print statements
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 IsAvailableInShop to the buy query so decks not marked for sale
cannot be purchased directly by ID (store listing already filtered
this, but the buy endpoint did not)
- Remove the unconditional starter-deck block; IsAvailableInShop is
now the single gate — if an admin explicitly marks a starter deck
as available in shop it can be purchased like any other 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>