Add anatomical character customization at initial creation

This commit is contained in:
dingo
2026-09-12 16:00:15 -04:00
parent 90e33cbcd9
commit 4aca703b6f
25 changed files with 733 additions and 133 deletions
+26
View File
@@ -23,3 +23,29 @@ func TestAppearanceValidation(t *testing.T) {
}
}
}
func TestHumanoidAppearanceBounds(t *testing.T) {
base := DefaultCharacterAppearance()
if err := ValidateAppearance(base, "human"); err != nil {
t.Fatal(err)
}
for _, mutate := range []func(*Appearance){
func(a *Appearance) { a.Body.HeadWidth = math.NaN() },
func(a *Appearance) { a.Body.LegLength = 1.2 },
func(a *Appearance) { a.Body.NoseHeight = .1 },
func(a *Appearance) { a.Body.EyeColor = "red" },
func(a *Appearance) { a.Body.Eyebrows = "unknown" },
func(a *Appearance) { a.Body.Chest = "unknown" },
func(a *Appearance) { a.Body.MouthStyle = "unknown" },
func(a *Appearance) { a.Family = "creature" },
func(a *Appearance) { a.Width = 1.1 },
func(a *Appearance) { a.Body = nil },
func(a *Appearance) { a.Version = 1 },
} {
a := DefaultCharacterAppearance()
mutate(a)
if ValidateAppearance(a, "human", "creature") == nil {
t.Fatal("invalid anatomy accepted", a)
}
}
}