mirror of
https://github.com/sui-feng-cb/AzurLaneAutoScript1.git
synced 2026-07-07 05:17:58 +08:00
Refactor: separate submarine_mode for clearer semantics
This commit is contained in:
@@ -348,11 +348,12 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
|
||||
return False
|
||||
|
||||
def combat_execute(self, auto='combat_auto', submarine='do_not_use', drop=None):
|
||||
def combat_execute(self, auto='combat_auto', submarine='do_not_use', is_boss=False, drop=None):
|
||||
"""
|
||||
Args:
|
||||
auto (str): ['combat_auto', 'combat_manual', 'stand_still_in_the_middle', 'hide_in_bottom_left']
|
||||
submarine (str): ['do_not_use', 'hunt_only', 'every_combat']
|
||||
submarine (str): do_not_use, boss_only, every_combat
|
||||
is_boss (bool): True on BOSS battle
|
||||
drop (DropImage):
|
||||
"""
|
||||
logger.info('Combat execute')
|
||||
@@ -379,7 +380,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
if auto != 'combat_auto' and self.auto_mode_checked and self.is_combat_executing():
|
||||
if self.handle_combat_weapon_release():
|
||||
continue
|
||||
if self.handle_submarine_call(submarine):
|
||||
if self.handle_submarine_call(call_mode=submarine, is_boss=is_boss):
|
||||
continue
|
||||
# bunch of popup handlers
|
||||
if self.handle_popup_confirm('COMBAT_EXECUTE'):
|
||||
@@ -629,7 +630,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
if self.handle_in_map_with_enemy_searching(drop=drop):
|
||||
break
|
||||
|
||||
def combat(self, balance_hp=None, emotion_reduce=None, auto_mode=None, submarine_mode=None,
|
||||
def combat(self, balance_hp=None, emotion_reduce=None, auto_mode=None, submarine_mode=None, is_boss=False,
|
||||
save_get_items=None, expected_end=None, fleet_index=1):
|
||||
"""
|
||||
Execute a combat.
|
||||
@@ -639,7 +640,8 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
balance_hp (bool):
|
||||
emotion_reduce (bool):
|
||||
auto_mode (str): combat_auto, combat_manual, stand_still_in_the_middle, hide_in_bottom_left
|
||||
submarine_mode (str): do_not_use, hunt_only, every_combat
|
||||
submarine_mode (str): do_not_use, boss_only, every_combat
|
||||
is_boss (bool): True on BOSS battle
|
||||
save_get_items (bool, DropImage):
|
||||
expected_end (str, callable):
|
||||
fleet_index (int): 1 or 2
|
||||
@@ -651,7 +653,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
if submarine_mode is None:
|
||||
submarine_mode = 'do_not_use'
|
||||
if self.config.Submarine_Fleet:
|
||||
submarine_mode = self.config.Submarine_Mode
|
||||
submarine_mode = self.config.Submarine_CallMode
|
||||
self.battle_status_click_interval = 7 if save_get_items else 0
|
||||
|
||||
# if not hasattr(self, 'emotion'):
|
||||
@@ -667,7 +669,7 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
self.combat_preparation(
|
||||
balance_hp=balance_hp, emotion_reduce=emotion_reduce, auto=auto_mode, fleet_index=fleet_index)
|
||||
self.combat_execute(
|
||||
auto=auto_mode, submarine=submarine_mode, drop=drop)
|
||||
auto=auto_mode, submarine=submarine_mode, drop=drop, is_boss=is_boss)
|
||||
self.combat_status(
|
||||
drop=drop, expected_end=expected_end)
|
||||
# self.handle_map_after_combat_story()
|
||||
|
||||
Reference in New Issue
Block a user