diff --git a/mihomo/models/equipment.py b/mihomo/models/equipment.py index 8d188e7f9..feca166ab 100644 --- a/mihomo/models/equipment.py +++ b/mihomo/models/equipment.py @@ -1,7 +1,7 @@ from pydantic import BaseModel, Field from .combat import Path -from .stat import Attribute, Property +from .stat import Attribute, MainAffix, Property, SubAffix class LightCone(BaseModel): @@ -66,8 +66,8 @@ class Relic(BaseModel): - set_name (`str`): The name of the relic set. - rarity (`int`): The rarity of the relic. - level (`int`): The level of the relic. - - main_property (`RelicProperty`): The main property of the relic. - - sub_property (list[`RelicProperty`]): The list of sub properties of the relic. + - main_property (`MainAffix`): The main affix of the relic. + - sub_property (list[`SubAffix`]): The list of sub-affixes of the relic. - icon (`str`): The relic icon. """ @@ -83,10 +83,10 @@ class Relic(BaseModel): """The rarity of the relic""" level: int """The level of the relic""" - main_property: Property = Field(..., alias="main_affix") - """The main property of the relic""" - sub_properties: list[Property] = Field(..., alias="sub_affix") - """The list of sub properties of the relic""" + main_affix: MainAffix + """The main affix of the relic""" + sub_affixes: list[SubAffix] = Field([], alias="sub_affix") + """The list of sub-affixes of the relic""" icon: str """The relic icon""" diff --git a/mihomo/models/stat.py b/mihomo/models/stat.py index 5dc5d5375..a458ee495 100644 --- a/mihomo/models/stat.py +++ b/mihomo/models/stat.py @@ -56,3 +56,42 @@ class Property(BaseModel): """The displayed value of the property""" is_percent: bool = Field(..., alias="percent") """Indicates if the value is in percentage""" + + +class MainAffix(Property): + """ + Represents a relic main affix. + + Attributes: + - type (`str`): The type of the affix. + - field (`str`): The field of the affix. + - name (`str`): The name of the affix. + - icon (`str`): The affix icon image. + - value (`float`): The value of the affix. + - displayed_value (`str`): The displayed value of the affix. + - is_percent (`bool`): Indicates if the value is in percentage. + """ + + ... + + +class SubAffix(MainAffix): + """ + Represents a relic sub-affix. + + Attributes: + - type (`str`): The type of the affix. + - field (`str`): The field of the affix. + - name (`str`): The name of the affix. + - icon (`str`): The affix icon image. + - value (`float`): The value of the affix. + - displayed_value (`str`): The displayed value of the affix. + - is_percent (`bool`): Indicates if the value is in percentage. + - count (`int`): The upgrade times of the affix. + - step (`int`): The additional value of the affix. + """ + + count: int + """The upgrade times of the affix""" + step: int + """The additional value of the affix""" diff --git a/pyproject.toml b/pyproject.toml index d482c7fc8..0577fd545 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "mihomo" -version = "1.1.2" +version = "1.1.3" authors = [ { name="KT", email="xns77477@gmail.com" }, ]