Add Ascend, Transition, and Terramorpha implementations

- CardInstance: add Tier, PreviousTierId (ascension chain), TerramorphaMode
- GameEngine.Ascend (§6.7.2): any-zone search, tier+lineage validation, full HP/Def/MP on entry
- GameEngine.Transition (§6.7.1): hand-only, Tier 1 guard, full HP/Def/MP on entry
- GameEngine.ChannelCard: Terramorpha path (Mono/Di/Tri tile count + adjacency + affinity push);
  non-Spirit, non-Terramorpha cards now correctly go to Discard instead of Field
- GamePlayCardRequest: add TargetTiles for multi-tile Terramorpha; handler routes accordingly
- CardInstanceDto: expose Tier and TerramorphaMode to clients
- New handlers: game.ascend, game.transition

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-02-26 12:45:23 -05:00
co-authored by Claude Happy
parent 9b6b7191f0
commit b46f4e9157
7 changed files with 412 additions and 58 deletions
+34 -5
View File
@@ -18,10 +18,17 @@ public sealed record GameDrawRequest(Guid SessionId);
public sealed record GamePlaceArchSpiritRequest(Guid SessionId, CoordDto Position);
/// <summary>
/// Channel (play) a card from hand. Spirit cards require a TargetTile within
/// the ArchSpirit's channeling range; other card types may omit it.
/// Channel (play) a card from hand.
/// Spirit cards require TargetTile (single tile within ArchSpirit's channeling range).
/// Terramorpha cards require TargetTiles (1 tile for Mono, 2 for Di, 3 for Tri — each
/// subsequent tile must be orthogonally adjacent to the previous).
/// Other card types (Repentance, Instinct, Ruin) may omit both.
/// </summary>
public sealed record GamePlayCardRequest(Guid SessionId, string CardInstanceId, CoordDto? TargetTile = null);
public sealed record GamePlayCardRequest(
Guid SessionId,
string CardInstanceId,
CoordDto? TargetTile = null,
IReadOnlyList<CoordDto>? TargetTiles = null);
/// <summary>Move a unit on the board to a new tile.</summary>
public sealed record GameMoveUnitRequest(Guid SessionId, string UnitInstanceId, CoordDto TargetPosition);
@@ -44,6 +51,22 @@ public sealed record GameEndTurnRequest(Guid SessionId);
/// <summary>Concede the game (forfeit).</summary>
public sealed record GameConcedeRequest(Guid SessionId);
/// <summary>
/// Ascend the active player's ArchSpirit to the next tier (§6.7.2).
/// IncomingCardInstanceId is the instance ID of the higher-tier ArchSpirit — it may
/// reside in any zone (hand, deck, discard, or even field in edge cases).
/// The incoming ArchSpirit must be exactly one tier above the current and must link
/// back to it via PreviousTierId. Cost is the incoming ArchSpirit's SP/ST cost.
/// </summary>
public sealed record GameAscendRequest(Guid SessionId, string IncomingCardInstanceId);
/// <summary>
/// Transition the active player's ArchSpirit with a Tier 1 ArchSpirit from hand (§6.7.1).
/// The current ArchSpirit goes to discard; the incoming enters with full HP/Defense/MP.
/// Cost is the incoming ArchSpirit's SP/ST cost.
/// </summary>
public sealed record GameTransitionRequest(Guid SessionId, string IncomingCardInstanceId);
// ── Custom lobby requests ─────────────────────────────────────────────────────
/// <summary>Create a new custom lobby. Host provides their deck and optional rule overrides.</summary>
@@ -98,6 +121,10 @@ public sealed record GameEndTurnResponse(GameStateDto State);
public sealed record GameConcedeResponse(GameStateDto State);
public sealed record GameAscendResponse(GameStateDto State);
public sealed record GameTransitionResponse(GameStateDto State);
// ── Custom lobby responses ─────────────────────────────────────────────────────
public sealed record CreateCustomLobbyResponse(
@@ -188,10 +215,12 @@ public sealed record CardInstanceDto(
int? Damage,
bool IsExhausted,
bool IsLeader,
CoordDto? Position, // null when not on field or not yet placed
CoordDto? Position, // null when not on field or not yet placed
int? CurrentMp,
int? MaxMp,
string? MovementType); // enum as string, null for non-unit cards
string? MovementType, // enum as string, null for non-unit cards
int? Tier, // ArchSpirit only; 1 = base form
string? TerramorphaMode); // Terramorpha only: "Mono" | "Di" | "Tri"
public sealed record BoardDto(
int Width,