1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 00:28:20 +08:00

Add: Handle campaign ball

- Fix: Handle doing map detection on in_stage image
This commit is contained in:
LmeSzinc
2020-09-18 21:09:26 +08:00
parent a189076da8
commit c56ef3568c
3 changed files with 55 additions and 6 deletions

View File

@@ -1,15 +1,15 @@
import numpy as np
from module.exception import MapDetectionError, CampaignEnd
from module.handler.assets import IN_MAP, IN_STAGE
from module.handler.info_handler import InfoHandler
from module.handler.assets import IN_MAP
from module.logger import logger
from module.map.map_base import CampaignMap, location2node, location_ensure
from module.map.map_operation import MapOperation
from module.map_detection.grid import Grid
from module.map_detection.view import View
class Camera(InfoHandler):
class Camera(MapOperation):
view: View
map: CampaignMap
camera = (0, 0)
@@ -94,7 +94,7 @@ class Camera(InfoHandler):
logger.info('Perspective error cause by info bar. Waiting.')
self.handle_info_bar()
return self.update(camera=camera)
elif self.appear(IN_STAGE, offset=(5, 5)):
elif self.is_in_stage():
logger.warning('Image is in stage')
raise CampaignEnd('Image is in stage')
elif not self.appear(IN_MAP):

View File

@@ -10,10 +10,9 @@ from module.map.camera import Camera
from module.map.map_base import SelectedGrids
from module.map.map_base import location2node, location_ensure
from module.map.utils import match_movable
from module.map.map_operation import MapOperation
class Fleet(Camera, MapOperation, AmbushHandler):
class Fleet(Camera, AmbushHandler):
fleet_1_location = ()
fleet_2_location = ()
fleet_current_index = 1