mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Empty fleet check should after switching fleet mode
This commit is contained in:
parent
e01b77c6e5
commit
0b8d1a5b57
@ -67,12 +67,15 @@ class CoalitionUI(Combat):
|
|||||||
else:
|
else:
|
||||||
logger.warning(f'Unknown coalition campaign mode: {mode}')
|
logger.warning(f'Unknown coalition campaign mode: {mode}')
|
||||||
|
|
||||||
def coalition_ensure_fleet(self, event, mode):
|
def coalition_set_fleet(self, event, mode):
|
||||||
"""
|
"""
|
||||||
Args:
|
Args:
|
||||||
event (str): Event name.
|
event (str): Event name.
|
||||||
mode (str): 'single' or 'multi'
|
mode (str): 'single' or 'multi'
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
bool: If clicked
|
||||||
|
|
||||||
Pages:
|
Pages:
|
||||||
in: FLEET_PREPARATION
|
in: FLEET_PREPARATION
|
||||||
"""
|
"""
|
||||||
@ -96,12 +99,17 @@ class CoalitionUI(Combat):
|
|||||||
logger.error(f'FLEET_SWITCH is not defined in event {event}')
|
logger.error(f'FLEET_SWITCH is not defined in event {event}')
|
||||||
raise ScriptError
|
raise ScriptError
|
||||||
|
|
||||||
|
if fleet_switch.get(main=self) == mode:
|
||||||
|
return False
|
||||||
if mode == 'single':
|
if mode == 'single':
|
||||||
fleet_switch.set('single', main=self)
|
fleet_switch.set('single', main=self)
|
||||||
|
return True
|
||||||
elif mode == 'multi':
|
elif mode == 'multi':
|
||||||
fleet_switch.set('multi', main=self)
|
fleet_switch.set('multi', main=self)
|
||||||
|
return True
|
||||||
else:
|
else:
|
||||||
logger.warning(f'Unknown coalition fleet mode: {mode}')
|
logger.warning(f'Unknown coalition fleet mode: {mode}')
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def coalition_get_entrance(event, stage):
|
def coalition_get_entrance(event, stage):
|
||||||
@ -279,7 +287,7 @@ class CoalitionUI(Combat):
|
|||||||
mode (str): 'single' or 'multi'
|
mode (str): 'single' or 'multi'
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
bool: If success
|
bool: If clicked
|
||||||
"""
|
"""
|
||||||
stage = stage.lower()
|
stage = stage.lower()
|
||||||
|
|
||||||
@ -296,8 +304,20 @@ class CoalitionUI(Combat):
|
|||||||
if stage in ['easy', 'sp', 'ex']:
|
if stage in ['easy', 'sp', 'ex']:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.coalition_ensure_fleet(event, mode)
|
clicked = self.coalition_set_fleet(event, mode)
|
||||||
return True
|
|
||||||
|
if self.appear(FLEET_NOT_PREPARED, offset=(20, 20)):
|
||||||
|
logger.critical('FLEET_NOT_PREPARED')
|
||||||
|
logger.critical('Please prepare you fleets before running coalition battles')
|
||||||
|
raise RequestHumanTakeover
|
||||||
|
if self.appear(EMPTY_FLAGSHIP, offset=(20, 20)):
|
||||||
|
logger.critical('EMPTY_FLAGSHIP, Please prepare you fleets before running coalition battles')
|
||||||
|
raise RequestHumanTakeover
|
||||||
|
if self.appear(EMPTY_VANGUARD, offset=(20, 20)):
|
||||||
|
logger.critical('EMPTY_VANGUARD, Please prepare you fleets before running coalition battles')
|
||||||
|
raise RequestHumanTakeover
|
||||||
|
|
||||||
|
return clicked
|
||||||
|
|
||||||
def coalition_map_exit(self, event):
|
def coalition_map_exit(self, event):
|
||||||
"""
|
"""
|
||||||
@ -367,16 +387,6 @@ class CoalitionUI(Combat):
|
|||||||
"This stage can only be farmed once a day, "
|
"This stage can only be farmed once a day, "
|
||||||
"but it's the second time that you are entering")
|
"but it's the second time that you are entering")
|
||||||
raise RequestHumanTakeover
|
raise RequestHumanTakeover
|
||||||
if self.appear(FLEET_NOT_PREPARED, offset=(20, 20)):
|
|
||||||
logger.critical('FLEET_NOT_PREPARED')
|
|
||||||
logger.critical('Please prepare you fleets before running coalition battles')
|
|
||||||
raise RequestHumanTakeover
|
|
||||||
if self.appear(EMPTY_FLAGSHIP, offset=(20, 20)):
|
|
||||||
logger.critical('EMPTY_FLAGSHIP, Please prepare you fleets before running coalition battles')
|
|
||||||
raise RequestHumanTakeover
|
|
||||||
if self.appear(EMPTY_VANGUARD, offset=(20, 20)):
|
|
||||||
logger.critical('EMPTY_VANGUARD, Please prepare you fleets before running coalition battles')
|
|
||||||
raise RequestHumanTakeover
|
|
||||||
|
|
||||||
# End
|
# End
|
||||||
if self.appear(BATTLE_PREPARATION, offset=(20, 20)):
|
if self.appear(BATTLE_PREPARATION, offset=(20, 20)):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user