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>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
namespace Theriapolis.Core.Rules.Character;
|
||||
|
||||
/// <summary>
|
||||
/// Whose side an actor is on at the moment. Drives encounter-trigger logic:
|
||||
/// hostile → auto-trigger combat on LOS; friendly/neutral → "[F] Talk to ..."
|
||||
/// prompt. Phase 5 sets this from <see cref="Data.NpcTemplateDef.DefaultAllegiance"/>;
|
||||
/// faction logic in Phase 6 may mutate it at runtime.
|
||||
/// </summary>
|
||||
public enum Allegiance : byte
|
||||
{
|
||||
Player = 0,
|
||||
Allied = 1,
|
||||
Neutral = 2,
|
||||
Friendly = 3,
|
||||
Hostile = 4,
|
||||
}
|
||||
|
||||
public static class AllegianceExtensions
|
||||
{
|
||||
public static Allegiance FromJson(string raw) => raw.ToLowerInvariant() switch
|
||||
{
|
||||
"player" => Allegiance.Player,
|
||||
"allied" => Allegiance.Allied,
|
||||
"neutral" => Allegiance.Neutral,
|
||||
"friendly" => Allegiance.Friendly,
|
||||
"hostile" => Allegiance.Hostile,
|
||||
_ => throw new ArgumentException($"Unknown allegiance: '{raw}'"),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user