feat(data): per-level spell slots for 8 PCs

This commit is contained in:
2026-09-04 22:55:50 +02:00
parent 1893072b5d
commit fd94522546
12 changed files with 74 additions and 9 deletions
+4
View File
@@ -142,6 +142,10 @@ def load_combatant(path: Path) -> Combatant:
# spells stays as list[str] — Pydantic validates it directly
raw_slots = data.pop("spell_slots", None)
if isinstance(raw_slots, dict):
validate_payload["spell_slots"] = {int(k): v for k, v in raw_slots.items()}
try:
return Combatant.model_validate(validate_payload)
except ValidationError as exc: