support: relic config rarity

This commit is contained in:
xtaodada 2023-05-10 19:26:09 +08:00
parent 05aae5b7f3
commit 724f1e87d1
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 12 additions and 5 deletions

View File

@ -142,3 +142,15 @@ class RelicPosition(str, Enum):
""" 位面球 """
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)

View File

@ -37,11 +37,6 @@ class RelicAffixAll(BaseModel):
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)
def transform_dicts(cls, values):
for data in ["main_affix", "sub_affix"]: