🐛 fix: new wiki style

This commit is contained in:
xtaodada 2023-05-17 19:16:26 +08:00
parent 724f1e87d1
commit f4bf762c4f
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
5 changed files with 26 additions and 14 deletions

View File

@ -93,7 +93,7 @@ async def fetch_info(avatar: Avatar):
avatar.information.occupation = items[3].find("div", {"class": "obc-tmp-character__value"}).text
parse_promote(avatar, soup)
# 星魂
table = soup.find_all("table")[-1]
table = soup.find("div", {"style": "order: 4;"})
trs = table.find_all("tr")[1:]
for tr in trs:
ps = tr.find_all("p")

View File

@ -23,9 +23,9 @@ async def wiki(
if override_materials:
await fetch_materials(main_data[4])
await fetch_materials(main_data[5], "消耗品")
await fetch_materials(main_data[8], "任务道具")
await fetch_materials(main_data[9], "贵重物")
await fetch_materials(main_data[10])
await fetch_materials(main_data[9], "任务道具")
await fetch_materials(main_data[10], "贵重物")
await fetch_materials(main_data[12])
await fetch_materials_infos()
await dump_materials(data_path / "materials.json")
else:

View File

@ -2,7 +2,8 @@ from enum import Enum
class Quality(str, Enum):
""" 星级 """
"""星级"""
Five = "五星"
Four = "四星"
Three = "三星"
@ -11,7 +12,8 @@ class Quality(str, Enum):
class Destiny(str, Enum):
""" 命途 """
"""命途"""
HuiMie = "毁灭"
ZhiShi = "智识"
XunLie = "巡猎"
@ -22,7 +24,8 @@ class Destiny(str, Enum):
class Element(str, Enum):
""" 属性 """
"""属性"""
Physical = "物理"
Pyro = ""
Anemo = ""
@ -35,7 +38,8 @@ class Element(str, Enum):
class MonsterType(str, Enum):
""" 怪物种类 """
"""怪物种类"""
Normal = "普通"
Elite = "精英"
Leader = "首领"
@ -43,7 +47,8 @@ class MonsterType(str, Enum):
class Area(str, Enum):
""" 地区 """
"""地区"""
Herta = "空间站「黑塔」"
YaLiLuo = "雅利洛-VI"
LuoFu = "仙舟「罗浮」"
@ -51,7 +56,8 @@ class Area(str, Enum):
class MaterialType(str, Enum):
""" 材料类型 """
"""材料类型"""
AvatarUpdate = "角色晋阶材料"
XingJi = "行迹材料"
LightConeUpdate = "光锥晋阶材料"
@ -66,7 +72,8 @@ class MaterialType(str, Enum):
class PropType(str, Enum):
""" 遗器套装效果 """
"""遗器套装效果"""
HP = "基础-生命值"
Defense = "基础-防御力"
Attack = "基础-攻击力"

View File

@ -43,3 +43,7 @@ class LightCone(BaseModel):
"""命途"""
promote: list[LightConePromote]
"""晋阶信息"""
@property
def rarity(self) -> int:
return 5 - list(Quality).index(self.quality)

View File

@ -15,9 +15,10 @@ class SingleRelicAffix(BaseModel):
is_main: bool
max_step: Optional[int] = None
def get_value(self, level_or_step: int) -> float:
add_value = Decimal(self.level_value if self.is_main else self.base_value)
return float(Decimal(self.base_value) + add_value * Decimal(level_or_step))
def get_value(self, level_or_step: int, cnt: int = 1) -> float:
base_value = Decimal(self.base_value) * Decimal(cnt)
add_value = Decimal(self.level_value if self.is_main else self.step_value)
return float(base_value + add_value * Decimal(level_or_step))
class RelicAffixAll(BaseModel):