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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user