Files
TheriapolisV3/Theriapolis.Core/Rules/Stats/Condition.cs
T
Christopher Wiebe b451f83174 Initial commit: Theriapolis baseline at port/godot branch point
Captures the pre-Godot-port state of the codebase. This is the rollback
anchor for the Godot port (M0 of theriapolis-rpg-implementation-plan-godot-port.md).
All Phase 0 through Phase 6.5 work is included; Phase 7 is in flight.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-30 20:40:51 -07:00

52 lines
1.7 KiB
C#

namespace Theriapolis.Core.Rules.Stats;
/// <summary>
/// Status effects applied during combat or by environment. Phase 5 ships
/// the most common subset; the enum is open-ended for additions in later
/// phases without renumbering existing values.
/// </summary>
public enum Condition : byte
{
None = 0,
Prone = 1,
Frightened = 2,
Restrained = 3,
Grappled = 4,
Dazed = 5,
Blinded = 6,
Stunned = 7,
Unconscious = 8,
Charmed = 9,
Poisoned = 10,
Deafened = 11,
Invisible = 12,
Petrified = 13,
Incapacitated = 14,
/// <summary>1..6 levels per d20; tracked separately on Character.ExhaustionLevel rather than as a binary flag.</summary>
Exhausted = 15,
}
public static class ConditionExtensions
{
public static Condition FromJson(string raw) => raw.ToLowerInvariant() switch
{
"none" => Condition.None,
"prone" => Condition.Prone,
"frightened" => Condition.Frightened,
"restrained" => Condition.Restrained,
"grappled" => Condition.Grappled,
"dazed" => Condition.Dazed,
"blinded" => Condition.Blinded,
"stunned" => Condition.Stunned,
"unconscious" => Condition.Unconscious,
"charmed" => Condition.Charmed,
"poisoned" => Condition.Poisoned,
"deafened" => Condition.Deafened,
"invisible" => Condition.Invisible,
"petrified" => Condition.Petrified,
"incapacitated" => Condition.Incapacitated,
"exhausted" => Condition.Exhausted,
_ => throw new ArgumentException($"Unknown condition: '{raw}'"),
};
}