Fix: [TW] Universe in Unison map files update

This commit is contained in:
LmeSzinc 2022-07-15 03:16:25 +08:00
parent 9958c96107
commit 76a7eb4d08

View File

@ -1,5 +1,5 @@
from module.base.timer import Timer
from module.campaign.campaign_base import CampaignBase as CampaignBase_
from module.exception import CampaignNameError
from module.logger import logger
@ -42,7 +42,7 @@ class CampaignBase(CampaignBase_):
chapter, stage = self._campaign_separate_name(name)
if chapter.isdigit():
self.ui_weigh_anchor()
self.ui_goto_campaign()
self.campaign_ensure_mode('normal')
self.campaign_ensure_chapter(index=chapter)
if mode == 'hard':
@ -66,48 +66,9 @@ class CampaignBase(CampaignBase_):
else:
logger.warning(f'Unknown campaign chapter: {name}')
def map_live_start(self):
def is_event_animation(self):
appear = self.image_color_count((286, 342, 994, 422), color=(255, 255, 255), count=10000)
if appear:
logger.info('Live start!')
return appear
def handle_in_map_with_enemy_searching(self):
if not self.is_in_map():
return False
timeout = Timer(self.MAP_ENEMY_SEARCHING_TIMEOUT_SECOND)
appeared = False
while 1:
self.device.screenshot() # Difference
if self.map_live_start():
continue
if self.is_in_map():
timeout.start()
else:
timeout.reset()
if self.handle_in_stage():
return True
if self.handle_story_skip():
self.ensure_no_story()
timeout.limit = 10
timeout.reset()
# End
if self.enemy_searching_appear():
appeared = True
else:
if appeared:
self.handle_enemy_flashing()
self.device.sleep(0.3)
logger.info('Enemy searching appeared.')
break
self.enemy_searching_color_initial()
if timeout.reached():
logger.info('Enemy searching timeout.')
break
return True