"""Mirrors upstream src/2024/schemas/5e-SRD-Equipment.ts."""

from dnd5e_db.models.base import SRDModel
from dnd5e_db.models.common import APIReference, Damage, DifficultyClass


class Cost(SRDModel):
    quantity: int
    unit: str


class ArmorClass(SRDModel):
    base: int
    dex_bonus: bool
    max_bonus: int | None = None


class Range(SRDModel):
    normal: int
    long: int | None = None


class ThrowRange(SRDModel):
    normal: int
    long: int


class Content(SRDModel):
    item: APIReference
    quantity: int


class Utilize(SRDModel):
    name: str
    dc: DifficultyClass


class Equipment(SRDModel):
    index: str
    name: str
    equipment_categories: list[APIReference]
    cost: Cost
    url: str
    description: str | None = None
    weight: float | None = None
    ammunition: APIReference | None = None
    armor_class: ArmorClass | None = None
    contents: list[Content] | None = None
    ability: APIReference | None = None
    craft: list[APIReference] | None = None
    damage: Damage | None = None
    doff_time: str | None = None
    don_time: str | None = None
    image: str | None = None
    mastery: APIReference | None = None
    notes: list[str] | None = None
    properties: list[APIReference] | None = None
    quantity: int | None = None
    storage: APIReference | None = None
    range: Range | None = None
    stealth_disadvantage: bool | None = None
    str_minimum: int | None = None
    throw_range: ThrowRange | None = None
    two_handed_damage: Damage | None = None
    utilize: list[Utilize] | None = None
