mirror of
https://github.com/sui-feng-cb/AzurLaneAutoScript1.git
synced 2026-07-13 19:05:16 +08:00
Merge branch 'master' of https://github.com/LmeSzinc/AzurLaneAutoScript
This commit is contained in:
@@ -4,7 +4,7 @@ from scipy import signal
|
||||
from module.base.button import Button
|
||||
from module.base.timer import Timer
|
||||
from module.base.utils import *
|
||||
from module.exception import RequestHumanTakeover
|
||||
from module.exception import HardNotSatisfied
|
||||
from module.handler.assets import AUTO_SEARCH_SET_MOB, AUTO_SEARCH_SET_BOSS, \
|
||||
AUTO_SEARCH_SET_ALL, AUTO_SEARCH_SET_STANDBY, \
|
||||
AUTO_SEARCH_SET_SUB_AUTO, AUTO_SEARCH_SET_SUB_STANDBY
|
||||
@@ -122,13 +122,12 @@ class FleetOperator:
|
||||
# logger.attr('Light_orange_line', lines)
|
||||
return lines > 0
|
||||
|
||||
# Remove this function, centralized validation and unified error raising
|
||||
# def raise_hard_not_satisfied(self):
|
||||
# if self.is_hard_satisfied() is False:
|
||||
# stage = self.main.config.Campaign_Name
|
||||
# logger.critical(f'Stage "{stage}" is a hard mode, '
|
||||
# f'please prepare your fleet "{str(self)}" in game before running Alas')
|
||||
# raise RequestHumanTakeover('Hard not satisfied', str(self))
|
||||
def raise_hard_not_satisfied(self):
|
||||
if self.is_hard_satisfied() is False:
|
||||
stage = self.main.config.Campaign_Name
|
||||
logger.critical(f'Stage "{stage}" is a hard mode, '
|
||||
f'please prepare your fleet "{str(self)}" in game before running Alas')
|
||||
raise HardNotSatisfied
|
||||
|
||||
def clear(self, skip_first_screenshot=True):
|
||||
"""
|
||||
@@ -347,11 +346,10 @@ class FleetPreparation(InfoHandler):
|
||||
h1, h2, h3 = fleet_1.is_hard_satisfied(), fleet_2.is_hard_satisfied(), submarine.is_hard_satisfied()
|
||||
logger.info(f'Hard satisfied: Fleet_1: {h1}, Fleet_2: {h2}, Submarine: {h3}')
|
||||
if self.config.SERVER in ['cn', 'en', 'jp']:
|
||||
unsatisfied = []
|
||||
if self.config.Fleet_Fleet1 and h1 is False:
|
||||
unsatisfied.append(str(fleet_1))
|
||||
if self.config.Fleet_Fleet2 and h2 is False:
|
||||
unsatisfied.append(str(fleet_2))
|
||||
if self.config.Fleet_Fleet1:
|
||||
fleet_1.raise_hard_not_satisfied()
|
||||
if self.config.Fleet_Fleet2:
|
||||
fleet_2.raise_hard_not_satisfied()
|
||||
if self.config.Submarine_Fleet and h3 is False:
|
||||
auto_recommend = self.config.Submarine_AutoRecommend
|
||||
logger.attr('Submarine AutoRecommend', auto_recommend)
|
||||
@@ -361,13 +359,7 @@ class FleetPreparation(InfoHandler):
|
||||
self.device.screenshot()
|
||||
h3 = submarine.is_hard_satisfied()
|
||||
logger.info(f'Hard satisfied: Fleet_1: {h1}, Fleet_2: {h2}, Submarine: {h3}')
|
||||
if h3 is False:
|
||||
unsatisfied.append(str(submarine))
|
||||
if unsatisfied:
|
||||
stage = self.config.Campaign_Name
|
||||
logger.critical(f'Stage "{stage}" is a hard mode, '
|
||||
f'please prepare your fleet(s): {", ".join(unsatisfied)} in game before running Alas')
|
||||
raise RequestHumanTakeover('Hard not satisfied', *unsatisfied)
|
||||
submarine.raise_hard_not_satisfied()
|
||||
|
||||
# Skip fleet preparation in hard mode
|
||||
self.map_is_hard_mode = h1 or h2 or h3
|
||||
|
||||
Reference in New Issue
Block a user