diff --git a/assets/share/dungeon/ui_rogue/DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE.png b/assets/share/dungeon/ui_rogue/DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE.png new file mode 100644 index 000000000..977d2e3cc Binary files /dev/null and b/assets/share/dungeon/ui_rogue/DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE.png differ diff --git a/tasks/dungeon/assets/assets_dungeon_ui_rogue.py b/tasks/dungeon/assets/assets_dungeon_ui_rogue.py index 67deaf095..abf1ebbdf 100644 --- a/tasks/dungeon/assets/assets_dungeon_ui_rogue.py +++ b/tasks/dungeon/assets/assets_dungeon_ui_rogue.py @@ -13,6 +13,16 @@ DIVERGENT_UNIVERSE_LOADED = ButtonWrapper( button=(893, 608, 911, 628), ), ) +DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE = ButtonWrapper( + name='DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE', + share=Button( + file='./assets/share/dungeon/ui_rogue/DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE.png', + area=(437, 316, 1169, 378), + search=(417, 296, 1189, 398), + color=(197, 105, 95), + button=(437, 316, 1169, 378), + ), +) LAST_TELEPORT = ButtonWrapper( name='LAST_TELEPORT', share=Button( diff --git a/tasks/ornament/combat.py b/tasks/ornament/combat.py index d35a3b838..ee8693697 100644 --- a/tasks/ornament/combat.py +++ b/tasks/ornament/combat.py @@ -23,6 +23,23 @@ class OrnamentCombat(DungeonEvent, Combat, RouteLoader): # Different position to OCR return super().get_double_event_remain_at_combat(button) + def _dungeon_wait_until_dungeon_list_loaded(self, skip_first_screenshot=True): + # Check save file before entering + result = super()._dungeon_wait_until_dungeon_list_loaded(skip_first_screenshot) + + if self.image_color_count( + DIVERGENT_UNIVERSE_SAVE_UNAVAILABLE, + color=(195, 89, 79), threshold=221, count=1000, + ): + logger.error( + 'Divergent Universe save unavailable, ' + 'please clear Divergent Universe once before running Ornament Extraction' + ) + self.config.task_delay(server_update=True) + self.config.task_stop() + + return result + def oe_leave(self, skip_first_screenshot=True): self.interval_clear([COMBAT_PREPARE, MAP_EXIT]) logger.hr('OE leave')