HonkaiStarRailWikiDataParser/models/light_cone.py

52 lines
949 B
Python
Raw Normal View History

2023-04-23 14:06:11 +00:00
# 光锥
2023-05-28 10:18:56 +00:00
from typing import List
2023-04-23 14:06:11 +00:00
from pydantic import BaseModel
2023-04-28 11:32:53 +00:00
from .enums import Quality, Destiny
from .material import Material
2023-04-23 14:06:11 +00:00
class LightConeItem(BaseModel):
2023-04-24 12:29:14 +00:00
item: Material
2023-04-23 14:06:11 +00:00
"""物品"""
count: int
"""数量"""
class LightConePromote(BaseModel):
2023-04-24 12:29:14 +00:00
required_level: int
2023-04-23 14:06:11 +00:00
"""突破所需等级"""
promote_level: int = 0
"""突破等级"""
max_level: int
"""解锁的等级上限"""
coin: int = 0
"""信用点"""
2023-05-28 10:18:56 +00:00
items: List[LightConeItem]
2023-04-23 14:06:11 +00:00
"""突破所需材料"""
class LightCone(BaseModel):
id: int
""""光锥ID"""
name: str
"""名称"""
desc: str
"""描述"""
icon: str
"""图标"""
big_pic: str
"""大图"""
quality: Quality
"""稀有度"""
destiny: Destiny
"""命途"""
2023-05-28 10:18:56 +00:00
promote: List[LightConePromote]
2023-04-23 14:06:11 +00:00
"""晋阶信息"""
2023-05-17 11:16:26 +00:00
@property
def rarity(self) -> int:
2023-05-28 10:21:49 +00:00
return 5 - list(Quality).index(self.quality)