"""Mirrors upstream src/2014/schemas/5e-SRD-Traits.ts."""

from dnd5e_db.models.base import SRDModel
from dnd5e_db.models.common import APIReference, AreaOfEffect, Choice, DifficultyClass


class BreathWeaponUsage(SRDModel):
    type: str
    times: int


class BreathWeaponDamage(SRDModel):
    damage_type: APIReference
    damage_at_character_level: dict[str, str]


class BreathWeapon(SRDModel):
    name: str
    desc: str
    area_of_effect: AreaOfEffect
    usage: BreathWeaponUsage
    dc: DifficultyClass
    damage: list[BreathWeaponDamage]


class TraitSpecific(SRDModel):
    damage_type: APIReference | None = None
    breath_weapon: BreathWeapon | None = None
    spell_options: Choice | None = None
    subtrait_options: Choice | None = None


class Trait(SRDModel):
    index: str
    name: str
    desc: list[str]
    races: list[APIReference]
    subraces: list[APIReference]
    proficiencies: list[APIReference] | None = None
    proficiency_choices: Choice | None = None
    language_options: Choice | None = None
    parent: APIReference | None = None
    trait_specific: TraitSpecific | None = None
    url: str
