support: relic config type rarity

This commit is contained in:
xtaodada 2023-05-10 19:13:27 +08:00
parent 393316df10
commit 05aae5b7f3
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 23 additions and 2 deletions

View File

@ -127,3 +127,18 @@ class RelicAffix(str, Enum):
""" 雷属性伤害提高 百分比 """
WindAddedRatio: str = "WindAddedRatio"
""" 风属性伤害提高 百分比 """
class RelicPosition(str, Enum):
HEAD: str = "HEAD"
""""""
HAND: str = "HAND"
""""""
BODY: str = "BODY"
""" 躯干 """
FOOT: str = "FOOT"
""""""
NECK: str = "NECK"
""" 位面球 """
OBJECT: str = "OBJECT"
""" 连结绳 """

View File

@ -3,7 +3,7 @@ from typing import Optional, Dict
from pydantic import BaseModel, root_validator
from .enums import RelicAffix
from .enums import RelicAffix, RelicPosition
class SingleRelicAffix(BaseModel):
@ -24,6 +24,10 @@ class RelicAffixAll(BaseModel):
id: int
set_id: int
""" 套装ID """
type: RelicPosition
""" 遗器类型 """
rarity: int
""" 星级 """
main_affix_group: int
sub_affix_group: int
max_level: int

View File

@ -4,7 +4,7 @@ from typing import List, Dict
import aiofiles
import ujson
from models.enums import RelicAffix
from models.enums import RelicAffix, RelicPosition
from func.fetch_relics import read_relics, dump_relics, all_relics
from res_func.client import client
from res_func.url import relic_config, relic_main_affix_config, relic_sub_affix_config, relic_set_config
@ -22,6 +22,8 @@ async def fetch_all_relic():
relic_affix_all = RelicAffixAll(
id=int(key),
set_id=value["SetID"],
type=RelicPosition(value["Type"]),
rarity=int(value["Rarity"].replace("CombatPowerRelicRarity", "")),
main_affix_group=value["MainAffixGroup"],
sub_affix_group=value["SubAffixGroup"],
max_level=value["MaxLevel"],