M6.13: Sex picker + species variant schema

Adds character Sex (male/female) as a top-level CharacterDraft field
required for every character, and species variants as a layer on top
of the base species record. Two variant axes:

  - "sex": auto-resolves from CharacterDraft.Sex for purebreds; for
           hybrids, pinned by parent role (sire = male, dam = female)
           by definition. No picker needed beyond Step 0.
  - "lineage": explicit per-species pick (Ram-Folk's sheep/goat). Has
               its own picker on Step 1 (purebred path under the grid;
               hybrid path embedded into the per-parent pick column).

Schema (Theriapolis.Core/Data):
  - SpeciesDef gains VariantAxis (string) and Variants (array of
    SpeciesVariantDef { Id, Name, Traits, Detriments }).
  - JSON content not yet populated — that's M6.14.

CharacterDraft adds:
  - Sex (required by Step 0 validation)
  - SpeciesVariant / SireSpeciesVariant / DamSpeciesVariant
  - ResolveVariantId(species, role) that returns the active variant
    id for a given context — used by Aside to layer variant traits
    onto the base species traits.

Step 0 (StepClade): sex picker row above the hybrid toggle. Two
toggle buttons radio-style.

Step 1 (StepSpecies): purebred path renders a lineage picker below
the grid when the picked species has VariantAxis == "lineage";
hybrid path embeds a lineage picker at the top of each parent's
pick column. Hover popovers summarise each variant's contents.

Validation: Sex is required at Step 0. Lineage variant required at
Step 1 for any picked species (purebred or per-hybrid-parent) with
VariantAxis == "lineage".

Aside: AddVariantContent layers the resolved variant's extra
traits/detriments onto the base species rendering, for both purebred
and hybrid paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Christopher Wiebe
2026-05-04 21:03:56 -07:00
parent 44b2ec111f
commit e1fb988969
6 changed files with 301 additions and 9 deletions
+39
View File
@@ -35,4 +35,43 @@ public sealed record SpeciesDef
[JsonPropertyName("detriments")]
public TraitDef[] Detriments { get; init; } = Array.Empty<TraitDef>();
/// <summary>
/// "sex" (male/female) or "lineage" (e.g. sheep/goat for Ram-Folk).
/// Empty when the species has no variants. Determines how the variant
/// is resolved: sex-axis is auto-keyed off character Sex (purebred) or
/// parent role for hybrids (sire = male, dam = female); lineage-axis
/// requires an explicit per-species pick.
/// </summary>
[JsonPropertyName("variant_axis")]
public string VariantAxis { get; init; } = "";
/// <summary>
/// Variant entries layered onto the species' base traits/detriments.
/// The variant's id keys it: for sex-axis variants, "male" or "female";
/// for lineage variants, the lineage tag (e.g. "sheep", "goat").
/// Empty when the species has no variants.
/// </summary>
[JsonPropertyName("variants")]
public SpeciesVariantDef[] Variants { get; init; } = Array.Empty<SpeciesVariantDef>();
}
/// <summary>
/// One sex- or lineage-keyed variant of a species. Layered on top of the
/// base species' traits and detriments — the player ends up with both
/// sets, not one or the other.
/// </summary>
public sealed record SpeciesVariantDef
{
[JsonPropertyName("id")]
public string Id { get; init; } = "";
[JsonPropertyName("name")]
public string Name { get; init; } = "";
[JsonPropertyName("traits")]
public TraitDef[] Traits { get; init; } = Array.Empty<TraitDef>();
[JsonPropertyName("detriments")]
public TraitDef[] Detriments { get; init; } = Array.Empty<TraitDef>();
}