mirror of
https://github.com/sui-feng-cb/AzurLaneAutoScript1.git
synced 2026-06-21 03:54:11 +08:00
Fix: handle low emotion combat withdraw after sinking
This commit is contained in:
@@ -355,6 +355,7 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus):
|
||||
|
||||
confirm_timer = Timer(10)
|
||||
confirm_timer.start()
|
||||
exp_confirm_timer = Timer(1, count=2)
|
||||
for _ in self.loop():
|
||||
|
||||
if self.handle_submarine_call(submarine_mode, call=force_call):
|
||||
@@ -397,6 +398,13 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus):
|
||||
self.device.click(OPTS_INFO_D)
|
||||
confirm_timer.reset()
|
||||
continue
|
||||
if self.appear(EXP_INFO_C) or self.appear(EXP_INFO_D):
|
||||
if exp_confirm_timer.reached():
|
||||
self._sinking = True
|
||||
break
|
||||
continue
|
||||
else:
|
||||
exp_confirm_timer.reset()
|
||||
if self.appear(BATTLE_STATUS_S) or self.appear(BATTLE_STATUS_A) or self.appear(BATTLE_STATUS_B) \
|
||||
or self.appear(EXP_INFO_S) or self.appear(EXP_INFO_A) or self.appear(EXP_INFO_B) \
|
||||
or self.appear(GET_MISSION) or self.is_auto_search_running():
|
||||
@@ -467,9 +475,11 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus):
|
||||
continue
|
||||
if self.handle_popup_confirm('combat_status'):
|
||||
continue
|
||||
if self.handle_exp_info():
|
||||
if self.handle_exp_info(handle_fail=True):
|
||||
exp_info = True
|
||||
continue
|
||||
if self.appear_then_click(OPTS_INFO_D, offset=(30, 30), interval=2):
|
||||
continue
|
||||
|
||||
def auto_search_combat(self, emotion_reduce=None, fleet_index=1, battle=None):
|
||||
"""
|
||||
|
||||
@@ -487,8 +487,10 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
|
||||
return False
|
||||
|
||||
def handle_exp_info(self):
|
||||
def handle_exp_info(self, handle_fail=False):
|
||||
"""
|
||||
Args:
|
||||
handle_fail (bool): if handle EXP_INFO_C and EXP_INFO_D
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
@@ -503,6 +505,13 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
|
||||
if self.appear_then_click(EXP_INFO_B):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if handle_fail:
|
||||
if self.appear_then_click(EXP_INFO_C):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_D):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
@@ -47,13 +47,7 @@ class RaidCombat(Combat):
|
||||
"""
|
||||
if self.is_combat_executing():
|
||||
return False
|
||||
if super().handle_exp_info():
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_C):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_D):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
if super().handle_exp_info(handle_fail=True):
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_CF):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
|
||||
Reference in New Issue
Block a user