mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-16 03:27:24 +08:00
Fix: Clear OS missions below monthly mission, the Arbiter (#814)
This commit is contained in:
@@ -145,7 +145,10 @@ class Button:
|
|||||||
self.ensure_template()
|
self.ensure_template()
|
||||||
|
|
||||||
if isinstance(offset, tuple):
|
if isinstance(offset, tuple):
|
||||||
offset = np.array((-offset[0], -offset[1], offset[0], offset[1]))
|
if len(offset) == 2:
|
||||||
|
offset = np.array((-offset[0], -offset[1], offset[0], offset[1]))
|
||||||
|
else:
|
||||||
|
offset = np.array(offset)
|
||||||
else:
|
else:
|
||||||
offset = np.array((-3, -offset, 3, offset))
|
offset = np.array((-3, -offset, 3, offset))
|
||||||
image = np.array(image.crop(offset + self.area))
|
image = np.array(image.crop(offset + self.area))
|
||||||
|
|||||||
@@ -102,16 +102,18 @@ class MissionHandler(GlobeOperation, ZoneManager):
|
|||||||
"""
|
"""
|
||||||
self.os_mission_enter()
|
self.os_mission_enter()
|
||||||
|
|
||||||
if not (self.appear(MISSION_CHECKOUT, offset=(20, 20)) and MISSION_CHECKOUT.match_appear_on(self.device.image)):
|
checkout_offset = (20, 20)
|
||||||
|
if self.appear(MISSION_MONTHLY_BOSS, offset=(20, 20)):
|
||||||
|
# If monthly BOSS hasn't been killed, there is always a task.
|
||||||
|
logger.info('Monthly BOSS mission found, checking missions bellow it')
|
||||||
|
checkout_offset = (-20, 100, 20, 150)
|
||||||
|
|
||||||
|
if not (self.appear(MISSION_CHECKOUT, offset=checkout_offset)
|
||||||
|
and MISSION_CHECKOUT.match_appear_on(self.device.image)):
|
||||||
# If not having enough items to claim a mission,
|
# If not having enough items to claim a mission,
|
||||||
# there will still be MISSION_CHECKOUT, but button is transparent.
|
# there will still be MISSION_CHECKOUT, but button is transparent.
|
||||||
# So here needs to use both template matching and color detection.
|
# So here needs to use both template matching and color detection.
|
||||||
self.os_mission_quit()
|
logger.info('No more OS missions')
|
||||||
return False
|
|
||||||
if self.appear(MISSION_MONTHLY_BOSS, offset=(20, 20)):
|
|
||||||
# If monthly BOSS hasn't been killed, there is always a task.
|
|
||||||
# It has a low priority to show, so its presence means that the task list is empty.
|
|
||||||
logger.info('Monthly BOSS mission found, mission list is empty')
|
|
||||||
self.os_mission_quit()
|
self.os_mission_quit()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -123,7 +125,7 @@ class MissionHandler(GlobeOperation, ZoneManager):
|
|||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
|
|
||||||
if self.appear_then_click(MISSION_CHECKOUT, offset=(20, 20), interval=2):
|
if self.appear_then_click(MISSION_CHECKOUT, offset=checkout_offset, interval=2):
|
||||||
continue
|
continue
|
||||||
if self.handle_popup_confirm('OS_MISSION_CHECKOUT'):
|
if self.handle_popup_confirm('OS_MISSION_CHECKOUT'):
|
||||||
# Popup: Submarine will retreat after exiting current zone.
|
# Popup: Submarine will retreat after exiting current zone.
|
||||||
|
|||||||
Reference in New Issue
Block a user