mirror of
https://github.com/PaiGramTeam/HonkaiStarRailWikiDataParser.git
synced 2025-01-30 18:38:36 +00:00
✨ support: relic config type rarity
This commit is contained in:
parent
393316df10
commit
05aae5b7f3
@ -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"
|
||||
""" 连结绳 """
|
||||
|
@ -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
|
||||
|
@ -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"],
|
||||
|
Loading…
Reference in New Issue
Block a user