feat: Add max_level property

Add max_level property to character and light cone.
This commit is contained in:
KT 2023-06-10 13:25:36 +08:00
parent 51968448e5
commit b43884fa5b
2 changed files with 18 additions and 6 deletions

View File

@ -60,8 +60,9 @@ class Character(BaseModel):
- id (`str`): The character's ID. - id (`str`): The character's ID.
- name (`str`): The character's name. - name (`str`): The character's name.
- rarity (`int`): The character's rarity. - rarity (`int`): The character's rarity.
- level (`int`): The character's level. - level (`int`): The character's current level.
- ascension (`int`): Ascension level. - max_level (`int`): The maximum character level according to the current ascension phase.
- ascension (`int`): Ascension phase.
- eidolon (`int`): The character's eidolon rank. - eidolon (`int`): The character's eidolon rank.
- Image - Image
- icon (`str`): The character avatar image - icon (`str`): The character avatar image
@ -91,7 +92,7 @@ class Character(BaseModel):
level: int level: int
"""Character's level""" """Character's level"""
ascension: int = Field(..., alias="promotion") ascension: int = Field(..., alias="promotion")
"""Ascension Level""" """Ascension phase"""
eidolon: int = Field(..., alias="rank") eidolon: int = Field(..., alias="rank")
"""Character's eidolon rank""" """Character's eidolon rank"""
@ -122,3 +123,8 @@ class Character(BaseModel):
"""The list of character's additional attributes""" """The list of character's additional attributes"""
properties: list[Property] properties: list[Property]
"""The list of character's properties""" """The list of character's properties"""
@property
def max_level(self) -> int:
"""The maximum character level according to the current ascension phase"""
return 20 + 10 * self.ascension

View File

@ -12,8 +12,9 @@ class LightCone(BaseModel):
- name (`str`): The name of the light cone. - name (`str`): The name of the light cone.
- rarity (`int`): The rarity of the light cone. - rarity (`int`): The rarity of the light cone.
- superimpose (`int`): The superimpose rank of the light cone. - superimpose (`int`): The superimpose rank of the light cone.
- level (`int`): The level of the light cone. - level (`int`): The current level of the light cone.
- ascension (`int`): The ascension level of the light cone. - max_level (`int`): The maximum light cone level according to the current ascension phase.
- ascension (`int`): The ascension phase of the light cone.
- icon (`str`): The light cone icon image. - icon (`str`): The light cone icon image.
- preview (`str`): The light cone preview image. - preview (`str`): The light cone preview image.
- portrait (`str`): The light cone portrait image. - portrait (`str`): The light cone portrait image.
@ -33,7 +34,7 @@ class LightCone(BaseModel):
level: int level: int
"""The level of the light cone""" """The level of the light cone"""
ascension: int = Field(..., alias="promotion") ascension: int = Field(..., alias="promotion")
"""The ascension level of the light cone""" """The ascension phase of the light cone"""
icon: str icon: str
"""The light cone icon image""" """The light cone icon image"""
preview: str preview: str
@ -47,6 +48,11 @@ class LightCone(BaseModel):
properties: list[Property] properties: list[Property]
"""The list of properties of the light cone""" """The list of properties of the light cone"""
@property
def max_level(self) -> int:
"""The maximum light cone level according to the current ascension phase"""
return 20 + 10 * self.ascension
class Relic(BaseModel): class Relic(BaseModel):
""" """