From 4f8c1f89c3363bd165fa5d7aa3f8aedbef1ef879 Mon Sep 17 00:00:00 2001 From: Hengyu Date: Thu, 29 Jun 2023 12:56:05 +0800 Subject: [PATCH] Add: dungeon goto forgotten hall --- .../share/base/page/FORGOTTEN_HALL_CHECK.png | Bin 0 -> 7377 bytes dev_tools/keyword_extract.py | 10 +- module/ui/draggable_list.py | 2 +- tasks/base/assets/assets_base_page.py | 10 ++ tasks/dungeon/keywords/classes.py | 4 + tasks/dungeon/keywords/dungeon.py | 136 ++++++++++++++++++ tasks/dungeon/ui.py | 15 +- 7 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 assets/share/base/page/FORGOTTEN_HALL_CHECK.png diff --git a/assets/share/base/page/FORGOTTEN_HALL_CHECK.png b/assets/share/base/page/FORGOTTEN_HALL_CHECK.png new file mode 100644 index 0000000000000000000000000000000000000000..2569ef937b172b71e28cd60c13557d84fe6182a2 GIT binary patch literal 7377 zcmeH~_cL5=*vF5S=mb%tgeZ?5Ejm$RBZP>u5gS25tW~0~E*=EYB1`m6^b(?%sA09$ zqOZRC>Z^M#@2zmy@%j zwJq!|0C-NNKKB5};TVA7KrG8w@5U90z82-^T!pKZ^hjS*s+Sd!ay?y@syb+Uvxfp;C(gfV1p2vr+^*G7Q`!i24DKt{1Dwc14E%OEDPQkSx0-zO%=udbuEXh!d7-IF<-<@B) zyVwS+P_tnAht`^GnL8yRnTH;PA<`M31OV1k)Xytfl^D$G^1`Y$28KQC%(}AMb>vpQ zyNAAN{6t6$&^{f+PMNQ)j1xI^6O_BP*cH44ri_7i=u?Q~G+Blz`H43b#w zz5@=!bJZQ}e;M@;YEi1fO!#*A9yqL4pIf&ZUS|-iakmGtNVo1UvBw#INfzfp1r&$q zwLblEvlPNP+Y2!Q^CoFxEgTw^x- z_Jv8OixdDfG6Dt5AKs+=$xz%%o$`~tv6YF?;)aGQ<-Jx#TD2R?0e8qVnd2X_7`Dn! z5LcHIv1Z&#TA;1^d0&hab}Qx^JAU;awRnC|4;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ncTcagDq6yw! z=cU@YbQ;esn7gu|%prC0yf^*bHB9mH+i)Nlc!P}$jV$m4ml!+dPCqK`zn*KS=%&6Z zpDJ&*>+E%QE4@QewcwLzkjcIV>TiDzjT~yXAufkajX>dozi_Ff>LLd+#BBHXE zD=$4gJ#X*xJl*6p-{Z-ssHmDbug$ZgO}rE-+rh$&Ar`d62yIOheAYYqOl7L(O`dBg zv6*WG+Cd4vzZ{8-Xs+@)O}`TO^q}~BJi#E8rseR!B@8TVTo9btR~Y*Q)6M^g11-VH zpeHQ_Nla9z!_J1VE4Wt)pJ5FJjq0U6T&!37f^YoslE3knz+VD?3H&ASm%v{Fe+m30 g@c)#+74~8fm>|5%5H70<|5L+b&8HfrYOg>15Bqj|e*gdg literal 0 HcmV?d00001 diff --git a/dev_tools/keyword_extract.py b/dev_tools/keyword_extract.py index 5eeea835b..a460d9ef9 100644 --- a/dev_tools/keyword_extract.py +++ b/dev_tools/keyword_extract.py @@ -1,8 +1,8 @@ import os import re import typing as t -from functools import cached_property from collections import namedtuple +from functools import cached_property from module.base.code_generator import CodeGenerator from module.config.utils import deep_get, read_file @@ -97,8 +97,8 @@ class KeywordExtract: for data in read_file(file).values(): hash_ = deep_get(data, keys='Name.Hash') _, name = self.find_keyword(hash_, lang='cn') - if '忘却之庭' in name or '遗秘' in name: - continue + # if '忘却之庭' in name: + # continue yield hash_ def find_keyword(self, keyword, lang) -> tuple[int, str]: @@ -158,8 +158,8 @@ class KeywordExtract: def generate_assignment_keywords(self): KeywordFromFile = namedtuple('KeywordFromFile', ('file', 'class_name', 'output_file')) for keyword in ( - KeywordFromFile('ExpeditionGroup.json', 'AssignmentGroup', './tasks/assignment/keywords/group.py'), - KeywordFromFile('ExpeditionData.json', 'AssignmentEntry','./tasks/assignment/keywords/entry.py') + KeywordFromFile('ExpeditionGroup.json', 'AssignmentGroup', './tasks/assignment/keywords/group.py'), + KeywordFromFile('ExpeditionData.json', 'AssignmentEntry', './tasks/assignment/keywords/entry.py') ): file = os.path.join(TextMap.DATA_FOLDER, 'ExcelOutput', keyword.file) self.load_keywords(deep_get(data, 'Name.Hash') for data in read_file(file).values()) diff --git a/module/ui/draggable_list.py b/module/ui/draggable_list.py index 50bb8dc08..4794f8f5d 100644 --- a/module/ui/draggable_list.py +++ b/module/ui/draggable_list.py @@ -164,7 +164,7 @@ class DraggableList: self.drag_page('down', main=main) # Wait for bottoming out main.wait_until_stable(self.search_button, timer=Timer( - 0, count=0), timeout=Timer(1.5, count=5)) + 0.3, count=1), timeout=Timer(1.5, count=5)) skip_first_screenshot = True return True diff --git a/tasks/base/assets/assets_base_page.py b/tasks/base/assets/assets_base_page.py index 6e71523a8..9fec22d2d 100644 --- a/tasks/base/assets/assets_base_page.py +++ b/tasks/base/assets/assets_base_page.py @@ -63,6 +63,16 @@ EVENT_CHECK = ButtonWrapper( button=(39, 19, 75, 56), ), ) +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), + ), +) GACHA_CHECK = ButtonWrapper( name='GACHA_CHECK', share=Button( diff --git a/tasks/dungeon/keywords/classes.py b/tasks/dungeon/keywords/classes.py index a31a4f81d..d91acc67f 100644 --- a/tasks/dungeon/keywords/classes.py +++ b/tasks/dungeon/keywords/classes.py @@ -42,6 +42,10 @@ class DungeonList(Keyword): def is_Simulated_Universe(self): return 'Simulated_Universe' in self.name + @property + def is_Forgotten_Hall(self): + return 'Forgotten_Hall' or 'Last_Vestiges' in self.name + @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 diff --git a/tasks/dungeon/keywords/dungeon.py b/tasks/dungeon/keywords/dungeon.py index bc8303ef2..83b48f683 100644 --- a/tasks/dungeon/keywords/dungeon.py +++ b/tasks/dungeon/keywords/dungeon.py @@ -259,3 +259,139 @@ Simulated_Universe_World_6 = DungeonList( en='Simulated Universe — World 6', jp='第六世界・模擬宇宙', ) +The_Last_Vestiges_of_Towering_Citadel = DungeonList( + id=33, + name='The_Last_Vestiges_of_Towering_Citadel', + cn='永屹之城遗秘', + cht='永屹之城遺秘', + en='The Last Vestiges of Towering Citadel', + jp='永屹の城の秘密', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=34, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) +Frostscar_Reverie_Forgotten_Hall = DungeonList( + id=35, + name='Frostscar_Reverie_Forgotten_Hall', + cn='霜痕旧梦•忘却之庭', + cht='霜痕舊夢•忘卻之庭', + en='Frostscar Reverie — Forgotten Hall', + jp='霜跡に旧夢・忘却の庭', +) +Everwinter_Trials_Forgotten_Hall = DungeonList( + id=36, + name='Everwinter_Trials_Forgotten_Hall', + cn='永冬试炼•忘却之庭', + cht='永冬試煉•忘卻之庭', + en='Everwinter Trials — Forgotten Hall', + jp='常冬の試練・忘却の庭', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=37, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) +Frostscar_Reverie_Forgotten_Hall = DungeonList( + id=38, + name='Frostscar_Reverie_Forgotten_Hall', + cn='霜痕旧梦•忘却之庭', + cht='霜痕舊夢•忘卻之庭', + en='Frostscar Reverie — Forgotten Hall', + jp='霜跡に旧夢・忘却の庭', +) +Everwinter_Trials_Forgotten_Hall = DungeonList( + id=39, + name='Everwinter_Trials_Forgotten_Hall', + cn='永冬试炼•忘却之庭', + cht='永冬試煉•忘卻之庭', + en='Everwinter Trials — Forgotten Hall', + jp='常冬の試練・忘却の庭', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=40, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) +Frostscar_Reverie_Forgotten_Hall = DungeonList( + id=41, + name='Frostscar_Reverie_Forgotten_Hall', + cn='霜痕旧梦•忘却之庭', + cht='霜痕舊夢•忘卻之庭', + en='Frostscar Reverie — Forgotten Hall', + jp='霜跡に旧夢・忘却の庭', +) +Everwinter_Trials_Forgotten_Hall = DungeonList( + id=42, + name='Everwinter_Trials_Forgotten_Hall', + cn='永冬试炼•忘却之庭', + cht='永冬試煉•忘卻之庭', + en='Everwinter Trials — Forgotten Hall', + jp='常冬の試練・忘却の庭', +) +ColdironTribulation = DungeonList( + id=43, + name='ColdironTribulation', + cn='寒铁砥砺•忘却之庭', + cht='寒鐵砥礪•忘卻之庭', + en='ColdironTribulation', + jp='寒鉄練磨・忘却の庭', +) +Hyperborean_Search_for_Warmth = DungeonList( + id=44, + name='Hyperborean_Search_for_Warmth', + cn='蹈冰寻火•忘却之庭', + cht='蹈冰尋火•忘卻之庭', + en='Hyperborean Search for Warmth', + jp='氷踏みて炎求む・忘却の庭', +) +Stormquell = DungeonList( + id=45, + name='Stormquell', + cn='风暴止息•忘却之庭', + cht='風暴止息•忘卻之庭', + en='Stormquell', + jp='止息せし嵐・忘却の庭', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=46, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=47, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=48, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) +Favor_of_Amber_Forgotten_Hall = DungeonList( + id=49, + name='Favor_of_Amber_Forgotten_Hall', + cn='琥珀恩赐•忘却之庭', + cht='琥珀恩賜•忘卻之庭', + en='Favor of Amber — Forgotten Hall', + jp='琥珀の賜物・忘却の庭', +) diff --git a/tasks/dungeon/ui.py b/tasks/dungeon/ui.py index 972bf4746..5ca163335 100644 --- a/tasks/dungeon/ui.py +++ b/tasks/dungeon/ui.py @@ -9,6 +9,7 @@ from module.ocr.ocr import Ocr, OcrResultButton from module.ocr.utils import split_and_pair_button_attr from module.ui.draggable_list import DraggableList from module.ui.switch import Switch +from tasks.base.assets.assets_base_page import FORGOTTEN_HALL_CHECK from tasks.base.page import page_guide from tasks.base.ui import UI from tasks.combat.assets.assets_combat_prepare import COMBAT_PREPARE @@ -174,7 +175,10 @@ class DungeonUI(UI): if dungeon not in [tp.matched_keyword for tp in DUNGEON_LIST.teleports]: # Dungeon name is insight but teleport button is not logger.info('Dungeon name is insight, swipe down a little bit to find the teleport button') - DUNGEON_LIST.drag_vector = (0.2, 0.4) + if dungeon.is_Forgotten_Hall: + DUNGEON_LIST.drag_vector = (-0.4, -0.2) # Keyword loaded is reversed + else: + DUNGEON_LIST.drag_vector = (0.2, 0.4) DUNGEON_LIST.ocr_class = OcrDungeonListLimitEntrance DUNGEON_LIST.insight_row(dungeon, main=self) DUNGEON_LIST.drag_vector = DraggableList.drag_vector @@ -192,7 +196,7 @@ class DungeonUI(UI): """ Pages: in: page_guide, Survival_Index, nav including dungeon - out: COMBAT_PREPARE + out: COMBAT_PREPARE, FORGOTTEN_HALL_CHECK """ logger.hr('Dungeon enter', level=2) skip_first_load = True @@ -203,7 +207,7 @@ class DungeonUI(UI): self.device.screenshot() # End - if self.appear(COMBAT_PREPARE): + if self.appear(COMBAT_PREPARE) or self.appear(FORGOTTEN_HALL_CHECK): logger.info('Arrive COMBAT_PREPARE') break @@ -272,6 +276,11 @@ class DungeonUI(UI): self._dungeon_insight(dungeon) self._dungeon_enter(dungeon) return True + if dungeon.is_Forgotten_Hall: + DUNGEON_NAV_LIST.select_row(KEYWORDS_DUNGEON_NAV.Forgotten_Hall, main=self) + self._dungeon_insight(dungeon) + self._dungeon_enter(dungeon) + return True logger.error(f'Goto dungeon {dungeon} is not supported') return False