Fable test

This commit is contained in:
dingo
2026-07-02 13:09:05 -04:00
parent ed300d4e4f
commit b96b8b89c0
29 changed files with 7462 additions and 169 deletions
+34
View File
@@ -55,6 +55,28 @@ public sealed class GameState
/// </summary>
public List<ActiveEffect> ActiveEffects { get; set; } = new();
// ── Ability runtime state ─────────────────────────────────────────────────
// Formerly static fields on AbilitySystem. Kept on the state so they are
// per-game, serialize with StateJson, and roll back when a handler fails.
/// <summary>Active PreventNextDamage shields: unit InstanceId → remaining absorb cap (null = unlimited).</summary>
public Dictionary<string, int?> PreventNextDamageByUnit { get; set; } = new();
/// <summary>Active PreventDeath markers, keyed by unit InstanceId.</summary>
public Dictionary<string, PreventDeathMarker> PreventDeathMarkers { get; set; } = new();
/// <summary>Triggered-ability uses this turn, keyed "instanceId:abilityKey:turnNumber". Pruned at turn start.</summary>
public Dictionary<string, int> TriggerUsesThisTurn { get; set; } = new();
/// <summary>Triggered-ability uses for the whole game, keyed "instanceId:abilityKey".</summary>
public Dictionary<string, int> TriggerUsesThisGame { get; set; } = new();
/// <summary>
/// Current top-level ability resolution depth (UntilEndOfSequence bookkeeping).
/// Always returns to 0 by the end of each handler invocation.
/// </summary>
public int SequenceDepth { get; set; }
// ── Multi-player helpers ──────────────────────────────────────────────────
/// <summary>Seat IDs in order, skipping eliminated players.</summary>
@@ -169,6 +191,18 @@ public sealed class GameState
PendingTargetPick is not null;
}
/// <summary>
/// Options captured from a <c>PreventDeathEffect</c> when it is applied to a unit.
/// Consumed the first time the unit would die (or take lethal damage, for DamageIgnored).
/// </summary>
public sealed class PreventDeathMarker
{
/// <summary>After preventing death, set the unit's HP to this value. Null = 1.</summary>
public int? DamageTakenSetToHp { get; set; }
/// <summary>When true, the lethal hit's damage is fully ignored (unit takes 0).</summary>
public bool DamageIgnored { get; set; }
}
public sealed class PlayerState
{
public string AccountId { get; set; } = string.Empty;