from pydantic import BaseModel, ConfigDict

from .item_bundle import ItemBundle
from .item_type import ItemType
from .shared_models import ActivityTable


class ActivityRoguelikeData(BaseModel):
    model_config: ConfigDict = ConfigDict(extra="forbid")  # pyright: ignore[reportIncompatibleVariableOverride]

    outBuffInfos: dict[str, "ActivityRoguelikeData.OuterBuffUnlockInfoData"]
    apSupplyOutOfDateDict: dict[str, int]
    outerBuffToken: str
    shopToken: str
    relicUnlockTime: int
    milestoneTokenRatio: float
    outerBuffTokenRatio: float
    relicTokenRatio: float
    relicOuterBuffTokenRatio: float
    reOpenCoolDown: int
    tokenItem: ItemBundle
    charStoneId: str
    milestone: list["ActivityRoguelikeData.MileStoneItemInfo"]
    unlockConds: list[ActivityTable.CustomUnlockCond]

    class OuterBuffUnlockInfo(BaseModel):
        model_config: ConfigDict = ConfigDict(extra="forbid")  # pyright: ignore[reportIncompatibleVariableOverride]

        buffLevel: int
        name: str
        iconId: str
        description: str
        usage: str
        itemId: str
        itemType: ItemType
        cost: int

    class OuterBuffUnlockInfoData(BaseModel):
        model_config: ConfigDict = ConfigDict(extra="forbid")  # pyright: ignore[reportIncompatibleVariableOverride]

        buffId: str
        buffUnlockInfos: dict[str, "ActivityRoguelikeData.OuterBuffUnlockInfo"]

    class MileStoneItemInfo(BaseModel):
        model_config: ConfigDict = ConfigDict(extra="forbid")  # pyright: ignore[reportIncompatibleVariableOverride]

        mileStoneId: str
        orderId: int
        tokenNum: int
        item: ItemBundle
