mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-15 22:19:18 +00:00
Fix: Teleport to forgotten hall
This commit is contained in:
parent
9a0c231ce7
commit
696a04e9ac
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.0 KiB |
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_CHECK.png
Normal file
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_CHECK.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_CLICK.png
Normal file
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_CLICK.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_LOADED.SEARCH.png
Normal file
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_LOADED.SEARCH.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_LOADED.png
Normal file
BIN
assets/share/dungeon/ui/TREASURES_LIGHTWARD_LOADED.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
@ -606,9 +606,10 @@ class KeywordExtract:
|
||||
yield hash_
|
||||
|
||||
def generate(self):
|
||||
self.load_keywords(['模拟宇宙', '拟造花萼(金)', '拟造花萼(赤)', '凝滞虚影', '侵蚀隧洞', '历战余响', '忘却之庭'])
|
||||
self.load_keywords(['模拟宇宙', '拟造花萼(金)', '拟造花萼(赤)', '凝滞虚影', '侵蚀隧洞', '历战余响',
|
||||
'忘却之庭', '虚构叙事'])
|
||||
self.write_keywords(keyword_class='DungeonNav', output_file='./tasks/dungeon/keywords/nav.py')
|
||||
self.load_keywords(['行动摘要', '生存索引', '每日实训'])
|
||||
self.load_keywords(['行动摘要', '生存索引', '每日实训', '逐光捡金', '战术训练'])
|
||||
self.write_keywords(keyword_class='DungeonTab', output_file='./tasks/dungeon/keywords/tab.py')
|
||||
self.load_keywords(['前往', '领取', '进行中', '已领取', '本日活跃度已满'])
|
||||
self.write_keywords(keyword_class='DailyQuestState', output_file='./tasks/daily/keywords/daily_quest_state.py')
|
||||
|
@ -77,10 +77,10 @@ FORGOTTEN_HALL_CHECK = ButtonWrapper(
|
||||
name='FORGOTTEN_HALL_CHECK',
|
||||
share=Button(
|
||||
file='./assets/share/base/page/FORGOTTEN_HALL_CHECK.png',
|
||||
area=(44, 27, 71, 47),
|
||||
search=(24, 7, 91, 67),
|
||||
color=(91, 87, 90),
|
||||
button=(44, 27, 71, 47),
|
||||
area=(41, 21, 73, 53),
|
||||
search=(21, 1, 93, 73),
|
||||
color=(150, 136, 108),
|
||||
button=(41, 21, 73, 53),
|
||||
),
|
||||
)
|
||||
GACHA_CHECK = ButtonWrapper(
|
||||
|
@ -113,3 +113,33 @@ SURVIVAL_INDEX_LOADED = ButtonWrapper(
|
||||
button=(451, 286, 476, 302),
|
||||
),
|
||||
)
|
||||
TREASURES_LIGHTWARD_CHECK = ButtonWrapper(
|
||||
name='TREASURES_LIGHTWARD_CHECK',
|
||||
share=Button(
|
||||
file='./assets/share/dungeon/ui/TREASURES_LIGHTWARD_CHECK.png',
|
||||
area=(437, 96, 459, 132),
|
||||
search=(417, 76, 479, 152),
|
||||
color=(120, 120, 120),
|
||||
button=(437, 96, 459, 132),
|
||||
),
|
||||
)
|
||||
TREASURES_LIGHTWARD_CLICK = ButtonWrapper(
|
||||
name='TREASURES_LIGHTWARD_CLICK',
|
||||
share=Button(
|
||||
file='./assets/share/dungeon/ui/TREASURES_LIGHTWARD_CLICK.png',
|
||||
area=(438, 96, 459, 132),
|
||||
search=(418, 76, 479, 152),
|
||||
color=(108, 106, 106),
|
||||
button=(438, 96, 459, 132),
|
||||
),
|
||||
)
|
||||
TREASURES_LIGHTWARD_LOADED = ButtonWrapper(
|
||||
name='TREASURES_LIGHTWARD_LOADED',
|
||||
share=Button(
|
||||
file='./assets/share/dungeon/ui/TREASURES_LIGHTWARD_LOADED.png',
|
||||
area=(1029, 288, 1047, 306),
|
||||
search=(1024, 283, 1052, 311),
|
||||
color=(149, 149, 152),
|
||||
button=(1029, 288, 1047, 306),
|
||||
),
|
||||
)
|
||||
|
@ -60,6 +60,15 @@ class DungeonList(Keyword):
|
||||
return True
|
||||
return False
|
||||
|
||||
@cached_property
|
||||
def is_Pure_Fiction(self):
|
||||
for word in [
|
||||
'Pure_Fiction',
|
||||
]:
|
||||
if word in self.name:
|
||||
return True
|
||||
return False
|
||||
|
||||
@cached_property
|
||||
def is_daily_dungeon(self):
|
||||
return self.is_Calyx_Golden or self.is_Calyx_Crimson or self.is_Stagnant_Shadow or self.is_Cavern_of_Corrosion
|
||||
@ -85,6 +94,8 @@ class DungeonList(Keyword):
|
||||
return KEYWORDS_DUNGEON_NAV.Echo_of_War
|
||||
if self.is_Forgotten_Hall:
|
||||
return KEYWORDS_DUNGEON_NAV.Forgotten_Hall
|
||||
if self.is_Pure_Fiction:
|
||||
return KEYWORDS_DUNGEON_NAV.Pure_Fiction
|
||||
|
||||
raise ScriptError(f'Cannot convert {self} to DungeonNav, please check keyword extractions')
|
||||
|
||||
|
@ -66,3 +66,12 @@ Forgotten_Hall = DungeonNav(
|
||||
jp='忘却の庭',
|
||||
es='Salón olvidado',
|
||||
)
|
||||
Pure_Fiction = DungeonNav(
|
||||
id=8,
|
||||
name='Pure_Fiction',
|
||||
cn='虚构叙事',
|
||||
cht='虛構敘事',
|
||||
en='Pure Fiction',
|
||||
jp='虚構叙事',
|
||||
es='Pura ficción',
|
||||
)
|
||||
|
@ -30,3 +30,21 @@ Daily_Training = DungeonTab(
|
||||
jp='デイリー訓練',
|
||||
es='Entrenamiento diario',
|
||||
)
|
||||
Treasures_Lightward = DungeonTab(
|
||||
id=4,
|
||||
name='Treasures_Lightward',
|
||||
cn='逐光捡金',
|
||||
cht='逐光撿金',
|
||||
en='Treasures Lightward',
|
||||
jp='光を追い、黄金を掴む',
|
||||
es='En busca de fortuna',
|
||||
)
|
||||
Strategic_Training = DungeonTab(
|
||||
id=5,
|
||||
name='Strategic_Training',
|
||||
cn='战术训练',
|
||||
cht='戰術訓練',
|
||||
en='Strategic Training',
|
||||
jp='戦術訓練',
|
||||
es='Entrenamiento estratégico',
|
||||
)
|
||||
|
@ -57,6 +57,11 @@ SWITCH_DUNGEON_TAB.add_state(
|
||||
check_button=SURVIVAL_INDEX_CHECK,
|
||||
click_button=SURVIVAL_INDEX_CLICK
|
||||
)
|
||||
SWITCH_DUNGEON_TAB.add_state(
|
||||
KEYWORDS_DUNGEON_TAB.Treasures_Lightward,
|
||||
check_button=TREASURES_LIGHTWARD_CHECK,
|
||||
click_button=TREASURES_LIGHTWARD_CLICK
|
||||
)
|
||||
|
||||
|
||||
class OcrDungeonNav(Ocr):
|
||||
@ -145,7 +150,10 @@ class DungeonUI(DungeonState):
|
||||
self._dungeon_wait_daily_training_loaded()
|
||||
elif state == KEYWORDS_DUNGEON_TAB.Survival_Index:
|
||||
logger.info(f'Tab goto {state}, wait until loaded')
|
||||
self._dungeon_wait_survival_loaded()
|
||||
self._dungeon_wait_survival_index_loaded()
|
||||
elif state == KEYWORDS_DUNGEON_TAB.Treasures_Lightward:
|
||||
logger.info(f'Tab goto {state}, wait until loaded')
|
||||
self._dungeon_wait_treasures_lightward_loaded()
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@ -173,7 +181,7 @@ class DungeonUI(DungeonState):
|
||||
logger.info('Daily training loaded')
|
||||
return True
|
||||
|
||||
def _dungeon_wait_survival_loaded(self, skip_first_screenshot=True):
|
||||
def _dungeon_wait_survival_index_loaded(self, skip_first_screenshot=True):
|
||||
"""
|
||||
Returns:
|
||||
bool: True if wait success, False if wait timeout.
|
||||
@ -195,6 +203,28 @@ class DungeonUI(DungeonState):
|
||||
logger.info('Survival index loaded')
|
||||
return True
|
||||
|
||||
def _dungeon_wait_treasures_lightward_loaded(self, skip_first_screenshot=True):
|
||||
"""
|
||||
Returns:
|
||||
bool: True if wait success, False if wait timeout.
|
||||
|
||||
Pages:
|
||||
in: page_guide, Survival_Index
|
||||
"""
|
||||
timeout = Timer(2, count=4).start()
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
self.device.screenshot()
|
||||
|
||||
if timeout.reached():
|
||||
logger.warning('Wait treasures lightward loaded timeout')
|
||||
return False
|
||||
if self.appear(TREASURES_LIGHTWARD_LOADED):
|
||||
logger.info('Treasures lightward loaded')
|
||||
return True
|
||||
|
||||
def _dungeon_wait_until_forgotten_hall_stabled(self, skip_first_screenshot=True):
|
||||
"""
|
||||
Returns:
|
||||
@ -273,6 +303,10 @@ class DungeonUI(DungeonState):
|
||||
# Update points if possible
|
||||
if DUNGEON_NAV_LIST.is_row_selected(button, main=self):
|
||||
self.dungeon_update_simuni()
|
||||
# Treasures lightward is always at top
|
||||
elif DUNGEON_NAV_LIST.keyword2button(KEYWORDS_DUNGEON_NAV.Forgotten_Hall, show_warning=False) \
|
||||
or DUNGEON_NAV_LIST.keyword2button(KEYWORDS_DUNGEON_NAV.Pure_Fiction, show_warning=False):
|
||||
logger.info('DUNGEON_NAV_LIST at top')
|
||||
else:
|
||||
# To start from any list states.
|
||||
logger.info('DUNGEON_NAV_LIST not at top')
|
||||
@ -286,6 +320,8 @@ class DungeonUI(DungeonState):
|
||||
KEYWORDS_DUNGEON_NAV.Calyx_Crimson,
|
||||
KEYWORDS_DUNGEON_NAV.Stagnant_Shadow,
|
||||
KEYWORDS_DUNGEON_NAV.Cavern_of_Corrosion,
|
||||
KEYWORDS_DUNGEON_NAV.Forgotten_Hall,
|
||||
KEYWORDS_DUNGEON_NAV.Pure_Fiction,
|
||||
]:
|
||||
button = DUNGEON_NAV_LIST.keyword2button(dungeon.dungeon_nav)
|
||||
if button:
|
||||
|
@ -184,7 +184,7 @@ class ForgottenHallUI(DungeonUI, ForgottenHallTeam):
|
||||
if self.appear(FORGOTTEN_HALL_CHECK):
|
||||
logger.info('Already in forgotten hall')
|
||||
else:
|
||||
self.dungeon_tab_goto(KEYWORDS_DUNGEON_TAB.Survival_Index)
|
||||
self.dungeon_tab_goto(KEYWORDS_DUNGEON_TAB.Treasures_Lightward)
|
||||
self._dungeon_nav_goto(dungeon)
|
||||
|
||||
self.stage_choose(dungeon)
|
||||
|
Loading…
Reference in New Issue
Block a user