mirror of
https://github.com/PaiGramTeam/HonkaiStarRailWikiDataParser.git
synced 2024-11-16 06:25:25 +00:00
✨ support: relic config rarity
This commit is contained in:
parent
05aae5b7f3
commit
724f1e87d1
@ -142,3 +142,15 @@ class RelicPosition(str, Enum):
|
|||||||
""" 位面球 """
|
""" 位面球 """
|
||||||
OBJECT: str = "OBJECT"
|
OBJECT: str = "OBJECT"
|
||||||
""" 连结绳 """
|
""" 连结绳 """
|
||||||
|
|
||||||
|
@property
|
||||||
|
def num(self):
|
||||||
|
index_map = {
|
||||||
|
RelicPosition.HEAD: 0,
|
||||||
|
RelicPosition.HAND: 1,
|
||||||
|
RelicPosition.BODY: 2,
|
||||||
|
RelicPosition.FOOT: 3,
|
||||||
|
RelicPosition.NECK: 0,
|
||||||
|
RelicPosition.OBJECT: 1,
|
||||||
|
}
|
||||||
|
return index_map.get(self)
|
||||||
|
@ -37,11 +37,6 @@ class RelicAffixAll(BaseModel):
|
|||||||
sub_affix: Dict[str, SingleRelicAffix]
|
sub_affix: Dict[str, SingleRelicAffix]
|
||||||
""" 副词条 """
|
""" 副词条 """
|
||||||
|
|
||||||
@property
|
|
||||||
def rarity(self) -> int:
|
|
||||||
rarity_map = {9: 3, 12: 4, 16: 5}
|
|
||||||
return rarity_map.get(self.max_level, 2)
|
|
||||||
|
|
||||||
@root_validator(pre=True)
|
@root_validator(pre=True)
|
||||||
def transform_dicts(cls, values):
|
def transform_dicts(cls, values):
|
||||||
for data in ["main_affix", "sub_affix"]:
|
for data in ["main_affix", "sub_affix"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user