1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-07-06 13:09:46 +08:00

Refactor: separate submarine_mode for clearer semantics

This commit is contained in:
positnuec
2026-07-02 17:47:24 +08:00
parent d9a9b784af
commit bb8a6d6044
19 changed files with 364 additions and 239 deletions

View File

@@ -16,19 +16,21 @@ class SubmarineCall(ModuleBase):
self.submarine_call_timer.reset()
self.submarine_call_flag = False
def handle_submarine_call(self, submarine='do_not_use', call=False):
def handle_submarine_call(self, call_mode='do_not_use', is_boss=False):
"""
Args:
call_mode (str): do_not_use, boss_only, every_combat
is_boss (bool): True on BOSS battle
Returns:
str: If call.
bool: If clicked submarine call button.
"""
if self.submarine_call_flag:
return False
if call and submarine == 'boss_only':
pass
else:
if submarine in ['do_not_use', 'hunt_only', 'boss_only', 'hunt_and_boss']:
self.submarine_call_flag = True
return False
if call_mode == 'do_not_use' or (call_mode == 'boss_only' and not is_boss):
self.submarine_call_flag = True
return False
if self.submarine_call_timer.reached():
logger.info('Submarine call timer reached')
self.submarine_call_flag = True