Phase 3 & 4: Team colors, player_eliminated push, board shapes, lobby team UI

Phase 3 – Team modes:
- GameState: TeamColors dictionary (int → hex color string) populated from palette
- GameMessages: PlayerEliminatedPush, PlayerOutcomeDto, extended GameOverPush
- GameHandlerBase: FinalizeMultiPlayerGameAsync (pairwise ELO), BroadcastPlayerEliminatedAsync, GetAllPlayerIds for N-player push
- GameAttackHandler: snapshot pre-attack elimination state; use FinalizeMultiPlayerGameAsync; push PlayerEliminatedPush for mid-game knockouts
- game_screen.gd: turn order strip chips carry team-color left border from state.teamColors
- lobby_room_screen.gd: _team_label() helper; team badges on host/guest/additional slots

Phase 4 – Board shape library:
- BoardShapeGenerator: AutoShape() picks shape by player count; adds Triangular (3p), RadialStar (5p, 5-arm star), HexRing (6p, hex perimeter zones); CoordsInRect helper
- GameLobbyReadyHandler: auto-selects board shape at game start; passes BoardShape+PlayerCount into rules snapshot

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>
This commit is contained in:
dingo
2026-03-26 05:50:55 -04:00
co-authored by Claude Happy
parent 00bf788ac8
commit 356e1a50e3
9 changed files with 462 additions and 43 deletions
+27 -7
View File
@@ -317,16 +317,35 @@ public sealed record ListActiveLobbiesResponse(
/// </summary>
public sealed record GameStateUpdatePush(GameStateDto State);
/// <summary>Pushed to both players when the game ends.</summary>
/// <summary>
/// Pushed to all active players when a player is eliminated mid-game (ArchSpirit destroyed)
/// but the game continues (more than one surviving team).
/// </summary>
public sealed record PlayerEliminatedPush(
Guid SessionId,
Guid EliminatedAccountId,
int SeatIndex,
int TeamIndex);
/// <summary>Per-player outcome entry for N-player game-over pushes.</summary>
public sealed record PlayerOutcomeDto(
Guid AccountId,
string Outcome, // "Winner" | "Loser"
int RankDelta,
int OpDelta);
/// <summary>Pushed to all players when the game ends.</summary>
public sealed record GameOverPush(
Guid SessionId,
Guid WinnerAccountId,
Guid LoserAccountId,
string WinCondition, // "health" | "concede" | "disconnect"
Guid WinnerAccountId, // primary winner (backward-compat; first of winners list)
Guid LoserAccountId, // primary loser (backward-compat; first of losers list)
string WinCondition, // "health" | "concede" | "disconnect" | "time_limit"
int WinnerRankDelta,
int LoserRankDelta,
int WinnerOpDelta,
int LoserOpDelta);
int LoserOpDelta,
// N-player: individual outcomes for every participant (null for 1v1 backward compat).
IEnumerable<PlayerOutcomeDto>? PlayerOutcomes = null);
/// <summary>
/// Pushed to both players when a session that was Initializing is abandoned
@@ -522,8 +541,9 @@ public sealed record GameStateDto(
int StateVersion, // monotonic; use for client mismatch detection
IEnumerable<PlayerStateDto> Players,
BoardDto? Board, // full board state including tile affinities
IEnumerable<string> SeatOrder, // account IDs in seat/turn order; empty = legacy 1v1
string GameMode); // "FFA" | "Teams" | "MultiTeam"
IEnumerable<string> SeatOrder, // account IDs in seat/turn order; empty = legacy 1v1
string GameMode, // "FFA" | "Teams" | "MultiTeam"
Dictionary<int, string> TeamColors); // teamIndex → hex color e.g. "4488FF"
public sealed record PlayerStateDto(
Guid AccountId,