feat: add active effects inspector to tile drawer

- Track active effects with human-readable labels in AbilitySystem
  (LabelFromReversal/LabelFromTick for stat mods, status flags, DOT/HOT)
- Add ActiveEffectDto to GameStateDto and GameStateDelta; delta now
  always includes the full effects list so clients are never stale
- Add ResolveLabelFromEffectJson fallback for effects stored before the
  Label field was introduced (old game sessions show correct labels)
- Client _append_active_effect_lines helper filters activeEffects by
  targetRef and appends formatted lines to the tile drawer for spirits,
  archspirits, spirit tokens, and ruins

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-04-14 11:52:37 -04:00
co-authored by Claude Happy
parent 144ad84cac
commit b4062d8179
8 changed files with 239 additions and 6 deletions
+15 -2
View File
@@ -519,7 +519,8 @@ public sealed record GameStateDelta(
IReadOnlyDictionary<string, PlayerStatsDelta>? PlayerStatsByAccount,
IReadOnlyDictionary<string, PublicCountsDelta>? PublicCountsByAccount,
PrivateViewerDelta? PrivateByViewer,
GameMetaDelta? MetaDelta);
GameMetaDelta? MetaDelta,
IReadOnlyList<ActiveEffectDto>? ActiveEffects = null); // full replacement when changed
public sealed record TileDelta(
int X,
@@ -624,7 +625,19 @@ public sealed record GameStateDto(
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"
Dictionary<int, string> TeamColors); // teamIndex → hex color e.g. "4488FF"
Dictionary<int, string> TeamColors, // teamIndex → hex color e.g. "4488FF"
IEnumerable<ActiveEffectDto> ActiveEffects); // currently tracked duration effects
/// <summary>
/// Client-facing view of a single duration-tracked active effect.
/// </summary>
public sealed record ActiveEffectDto(
string SourceInstanceId,
string SourceName, // resolved display name of the source unit
string TargetRef, // InstanceId of target unit or AccountId of target player
string Label, // human-readable description of the applied effect e.g. "ATK +2"
string DurationType, // e.g. "UntilEndOfTurn", "ForNTurns", "WhileSourceOnBattlefield"
int TurnsRemaining); // non-zero only for ForNTurns
public sealed record PlayerStateDto(
Guid AccountId,