# hexlock-game-spec > Complete game rules and mechanics for Hexlock. Reference this skill when implementing any gameplay feature, validating moves, or understanding win conditions. - Author: JordanLzG - Repository: JordanLzG/Hexlock_ - Version: 20260120173455 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/JordanLzG/Hexlock_ - Web: https://mule.run/skillshub/@@JordanLzG/Hexlock_~hexlock-game-spec:20260120173455 --- --- name: hexlock-game-spec description: Complete game rules and mechanics for Hexlock. Reference this skill when implementing any gameplay feature, validating moves, or understanding win conditions. --- # Hexlock Game Specification This is the **source of truth** for all Hexlock game rules and mechanics. ## Overview Hexlock is a minimal, turn-based hex strategy game for two online players. - **Board:** 37 hexes in a hexagonal pattern - **Players:** 2 (online multiplayer only) - **Win condition:** First to control 19 hexes (majority) - **Turn structure:** Alternating turns, one action per turn ## Board Layout ``` ⬡ ⬡ ⬡ ⬡ (4 hexes) ⬡ ⬡ ⬡ ⬡ ⬡ (5 hexes) ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ (6 hexes) ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ (7 hexes - center row) ⬡ ⬡ ⬡ ⬡ ⬡ ⬡ (6 hexes) ⬡ ⬡ ⬡ ⬡ ⬡ (5 hexes) ⬡ ⬡ ⬡ ⬡ (4 hexes) Total: 37 hexes ``` ## Coordinate System Using axial coordinates (q, r): - Center hex: (0, 0) - Board radius: 3 - Valid hex: |q| ≤ 3, |r| ≤ 3, |q + r| ≤ 3 ## Starting Positions - **Player 1:** Top corner (q: 0, r: -3) - **Player 2:** Bottom corner (q: 0, r: 3) Each player starts with 1 hex at 3 HP. ## Actions Players take one action per turn: ### EXPAND Claim an empty hex adjacent to your territory. | Attribute | Value | |-----------|-------| | Target | Empty hex adjacent to any owned hex | | Cost | None | | Result | Hex becomes yours at 3 HP | ### ATTACK Attack an enemy hex adjacent to your territory. | Attribute | Value | |-----------|-------| | Source | Any hex you own | | Target | Enemy hex adjacent to source | | Mechanic | Dice roll (see Combat) | ## Combat System ### Attack Roll ``` YOUR ROLL: d20 + (your adjacent hexes to SOURCE) THEIR DEFENSE: 10 + (their adjacent hexes to TARGET) ``` ### Results | Roll | Result | |------|--------| | Natural 1 | CRITICAL FAIL — Miss AND your attacking hex takes 1 damage | | < Defense | Miss — no damage | | ≥ Defense | HIT — target takes 1 damage | | ≥ Defense + 5 | STRONG HIT — target takes 2 damage | ### Example ``` You attack from hex A to hex B. - You have 2 other hexes adjacent to A → Attack bonus: +2 - Enemy has 1 other hex adjacent to B → Defense: 10 + 1 = 11 You roll d20: 14 Total attack: 14 + 2 = 16 16 ≥ 11 → HIT (1 damage) 16 ≥ 16 (11+5)? → Yes! STRONG HIT (2 damage instead) ``` ### Critical Fail Rolling a natural 1 is dangerous: - Your attack misses (0 damage to enemy) - Your attacking hex takes 1 damage - If your hex was at 1 HP, you lose it! This adds risk to attacking from weak positions. ## Hex Health (HP) | HP | Display | Status | |----|---------|--------| | 3 | ●●● | Full health | | 2 | ●●○ | Damaged | | 1 | ●○○ | Critical | | 0 | — | Captured | When a hex reaches 0 HP: - Ownership transfers to the attacker - HP resets to 3 ## Enclosure Surround an enemy hex completely = instant capture If ALL hexes adjacent to an enemy hex are owned by you: - The surrounded hex is captured immediately - No combat roll needed - HP resets to 3 Enclosure is checked after every action (EXPAND or ATTACK). ### Edge Cases - Corner hexes have 3 neighbors (easier to enclose) - Edge hexes have 4 neighbors - Center hexes have 6 neighbors (hardest to enclose) ## Fog of War HP-only fog: You see all hex ownership, but only see HP of hexes you can "reach." ### Visibility Rules You can see HP of: - ✅ All hexes you own - ✅ All hexes adjacent to hexes you own - ❌ Enemy hexes not adjacent to your territory (HP hidden) ### What's Always Visible - All hex positions (the 37-hex board) - All hex ownership (who owns what) - Scores (hex count per player) ### What's Hidden - HP of distant enemy hexes This creates uncertainty: "Should I attack that distant hex? Is it weak or strong?" ## Win Condition First player to control 19 hexes wins. - 19 = majority of 37 - Game ends immediately when threshold is reached - Winner determined by hex count, not HP ## Turn Structure 1. Game starts → Random player goes first 2. Current player takes one action (EXPAND or ATTACK) 3. Enclosure check runs 4. Win condition check runs 5. Turn passes to opponent 6. Repeat until someone wins ## Forfeit A player may forfeit at any time: - Opponent wins immediately - Counts as a loss in stats ## Disconnect If a player disconnects: - 60 second grace period to reconnect - After timeout: auto-forfeit - Opponent wins ## Summary Card ``` ╔═══════════════════════════════════════╗ ║ H E X L O C K ║ ╠═══════════════════════════════════════╣ ║ EXPAND Claim empty adjacent hex ║ ║ ATTACK d20 + adj vs 10 + adj ║ ║ ║ ║ HIT ≥ defense → 1 damage ║ ║ STRONG ≥ def + 5 → 2 damage ║ ║ NAT 1 miss + YOU take 1 damage ║ ║ ║ ║ HP 3 max (●●●) ║ ║ CAPTURE 0 HP → flips at 3 HP ║ ║ ENCLOSURE surround → instant capture ║ ║ ║ ║ FOG see ownership, not far HP ║ ║ WIN first to 19 hexes ║ ╚═══════════════════════════════════════╝ ```