StarRailCopilot/tasks/rogue/keywords/classes.py

71 lines
1.7 KiB
Python
Raw Normal View History

2023-08-10 09:12:17 +00:00
from dataclasses import dataclass
from typing import ClassVar
2023-08-10 18:43:06 +00:00
from dev_tools.keyword_extract import UI_LANGUAGES
2023-08-10 09:12:17 +00:00
from module.ocr.keyword import Keyword
@dataclass(repr=False)
class RogueBlessing(Keyword):
instances: ClassVar = {}
path_id: int
rarity: int
enhancement: str
2023-08-10 09:12:17 +00:00
2023-08-10 18:43:06 +00:00
@property
def path_name(self):
path = RoguePath.instances[self.path_id]
return path.path_name
@property
def blessing_name(self):
return [self.__getattribute__(f"{server}_parsed")
for server in UI_LANGUAGES if hasattr(self, f"{server}_parsed")]
2023-08-10 09:12:17 +00:00
@dataclass(repr=False)
class RoguePath(Keyword):
instances: ClassVar = {}
2023-08-10 18:43:06 +00:00
@property
def path_name(self):
return [self.__getattribute__(f"{server}_parsed").replace("the", '')
2023-08-10 18:43:06 +00:00
for server in UI_LANGUAGES if hasattr(self, f"{server}_parsed")]
2023-08-10 09:12:17 +00:00
@dataclass(repr=False)
class RogueResonance(Keyword):
instances: ClassVar = {}
path_id: int
rarity: int
2023-08-10 18:43:06 +00:00
@property
def resonance_name(self):
return [self.__getattribute__(f"{server}_parsed")
for server in UI_LANGUAGES if hasattr(self, f"{server}_parsed")]
2023-08-12 07:15:25 +00:00
@dataclass(repr=False)
class RogueCurio(Keyword):
instances: ClassVar = {}
@property
def curio_name(self):
return [self.__getattribute__(f"{server}_parsed")
for server in UI_LANGUAGES if hasattr(self, f"{server}_parsed")]
@dataclass(repr=False)
class RogueBonus(Keyword):
instances: ClassVar = {}
@dataclass(repr=False)
class RogueEnhancement(Keyword):
instances: ClassVar = {}
@property
def enhancement_keyword(self):
return [self.__getattribute__(f"{server}_parsed")
for server in UI_LANGUAGES if hasattr(self, f"{server}_parsed")]