from sqlalchemy import ForeignKey from sqlalchemy.orm import Mapped, mapped_column from . import BaseDAO class UniqueItem(BaseDAO): filename = "UniqueItems.txt" __tablename__ = "unique_item" id: Mapped[int] = mapped_column(primary_key=True) index: Mapped[str] # string reference, often also human-readable code = mapped_column(ForeignKey("base.code")) rarity: Mapped[int] # drop frequency, relative to other uniques on this base lvl: Mapped[int] # minimum drop level def is_valid(self): return self.enabled == "1" # TODO: can we create fixed drop but not randomly available uniques by setting this to 0?