# Game Rules 1. **Alliances (Solo vs Solo)**: 1. Two single players who encounter each other may form an alliance. 2. The bot with greater strength (or higher score if tied) becomes the party leader. 3. Bots are not required to ally, but larger parties have a significant advantage in battle. 2. **Party vs Party Battles**: 1. Two opposing parties that encounter each other must battle. 2. Battles consist of 3 bouts: each party rolls a D20 die, multiplied by their squad's total strength. The highest score wins the bout. Best 2 out of 3 bouts wins the battle. 3. The winning party leader receives **+2 score points**, and each original winning member receives **+1 score point**. 4. The losing party leader receives **-1 score point** and respawns at a random free position. All other members of the losing party are absorbed into the winning party. 5. All members of the losing party (including the leader) lose **1 to 3 health points** (randomized). The health setting defaults to **10 HP** for all bots upon registration. 3. **Solo Bot vs Party Encounters**: 1. A solo bot will willingly join a party if the party leader's strength is greater than or equal to its own. 2. If the party leader has lower strength, the solo bot refuses to join, and the party responds by engaging in battle. 4. **Party Movement**: 1. The party leader controls the movement direction. 2. Squad members follow the leader in a single-file line (each member steps into the spot vacated by the bot ahead of them) while maintaining a distance of 1. 3. **Forced Unstuck Maneuver (2 Subsequent Passes)**: - When larger squads navigate tight terrain bottlenecks, dead ends, or corners surrounded by mountains and forests, the leader may have no valid moves to advance or turn without breaking squad connectivity, making "pass" the only option. - If a party leader passes their turn **2 subsequent times** (consecutive passes >= 2), the forced unstuck maneuver triggers automatically. - All characters in the party are forced to move around by exactly 1 space (Chebyshev distance == 1, nobody stays stationary). - The party leader moves 1 space away from the nearest obstacle(s), and each squad member moves 1 space to follow suit while maintaining Chebyshev distance <= 1 chain connectivity. - Executing any successful move, attack, or action resets the party's consecutive pass counter back to 0. 5. **Obstacles & Terrain Squeeze**: 1. Mountains and forests are impassable. 2. Bots can squeeze diagonally between adjacent obstacle corners. 3. When squeezing through a diagonal bottleneck: - A solo bot loses **0.1 strength**. - In a party, the leader loses **0.2 strength**, and follower members each lose **0.1 strength**. 4. Moving along the open outer edge of an obstacle incurs no penalty. Minimum bot strength cannot fall below 0.1. 6. **Gary the Wizard (NPC Encounter & Challenge)**: 1. Gary the Wizard is a special Non-Player Character (NPC) roaming the map at a random passable location. 2. Players (or party leaders) who find Gary the Wizard (adjacent or on the same coordinate, distance <= 1) may voluntarily **choose to challenge** him. 3. **Challenge Resolution (3-Bout D20)**: - Challenges consist of 3 bouts: each side rolls a D20 die, multiplied by their strength (Gary the Wizard has a strength of 3.0; a party uses its squad total strength). - Highest bout score wins the bout. Best 2 out of 3 bouts wins the challenge. 4. **Victory Rewards & Defeat Penalties**: - **Victory**: The player (or party leader) must decide and choose which reward to receive: - **+2 Score Points**: Adds +2 points to their tournament score. - **+2 Strength**: Adds +2.0 strength to the bot (recalculating squad total strength if in a party). - **+2 Health**: Adds +2 health points (HP) to the bot (expanding max health if current health exceeds initial maximum). - **Defeat**: The player (or party leader) loses **2 health** (or **2 score points** if they do not have health to lose). 5. **Wizard Relocation**: - Following any challenge, Gary the Wizard teleports to a new random open coordinate on the map. 7. **Player Health, Damage & Death**: 1. All bots register with default **10 HP** (configurable via `--health` / `-H`). 2. Health damage is sustained by losing battles (-1 to -3 HP) or losing Gary the Wizard challenges (-2 HP). 3. When a player's health points reach **0 HP**, they are **dead**. 4. **Death Consequences**: - **Party Disconnection**: The dead player is immediately disconnected from any existing party. If the dead player was the party leader, squad leadership transfers to the strongest surviving member (or the party dissolves if no living members remain). Dead followers are not absorbed into opposing parties. - **Gravestone Marker**: A **gravestone replaces their icon on the board** at their final coordinate. Deceased leaders do not respawn at a random coordinate. - **No Turns or Actions**: Dead players are removed from the turn rotation and can **no longer move, duel, or perform any actions**. - **Scoreboard Preservation**: Dead players **remain listed on the scores and scoreboard rankings** with their final achieved score, strength, and stats. 8. **Trolls (Character Type & Unique Mechanics)**: 1. **Registration**: Trolls register with `character_type: "troll"` and `piece_type: "troll"`. 2. **No Alliances**: Trolls never form or join parties. They remain lone hunters throughout the game. 3. **Troll Truce**: Trolls do not battle each other. When trolls encounter each other on adjacent coordinates, they ignore each other and continue their hunt. 4. **Player Hunting & Mandatory Combat**: Trolls seek out player characters and player squads. When a troll is adjacent to a player or player party, battle is mandatory. 5. **Battle Resolution & Scoring**: - Battles follow the standard 3-bout D20 format. - **Victory**: If a troll wins, it receives **+2 victory points (score)**. Trolls **do not gain strength** and **never absorb** defeated followers. - **Defeat**: If a troll loses, it takes **1 to 3 health damage** (randomized). 6. **Damage & Death**: Trolls can die when their health reaches **0 HP**, placing a gravestone marker on the board. Dead trolls cease taking turns but remain preserved on the scoreboard. 7. **No Wizard Duels**: Trolls cannot engage or duel with Gary the Wizard NPC. 8. **Rest & Sleep Action (+0.1 HP)**: - A troll may choose to take a turn sleeping (`POST /api/players/{id}/sleep`). - Choosing to sleep forfeits the troll's movement for that turn and regenerates **+0.1 health points**. # Game Conclusion The game reaches its conclusion and triggers the final scoreboard when any of the following end conditions are met: 1. **All Players Joined into One Party**: When all surviving players on the board have joined into a single remaining party, even if trolls remain on the board. This is a win condition for the united party. 2. **Single Surviving Entity**: When exactly 1 living entity (player or troll) remains on the board (sole survivor). 3. **Only Trolls Remain**: When all players have been defeated and only trolls remain on the board (since trolls observe a mutual truce and do not battle or band together). All characters (both living and deceased, players and trolls) are listed on the final scoreboard rankings. Final rankings and trophies (1st, 2nd, and 3rd place) are awarded based on **Score** (with **Strength** as the tiebreaker). Trolls can win the match and achieve 1st place champion status on the final scores like players.