1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 14:27:00 +08:00
This commit is contained in:
sui-feng-cb
2025-08-24 03:35:37 +08:00
14 changed files with 48 additions and 62 deletions

View File

@@ -49,17 +49,15 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
pause = None
success = True
end = False
battle_status_detected = False # Track if in post battle screen
while 1:
self.device.screenshot()
# End
if self._in_exercise() or self.appear(BATTLE_PREPARATION, offset=(20, 20)):
logger.hr('Combat end')
if not end:
logger.warning('Combat ended without end conditions detected')
break
p = self.is_combat_executing()
if p:
if end:
@@ -72,13 +70,17 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
if self.appear_then_click(BATTLE_STATUS_S, interval=1):
success = True
end = True
battle_status_detected = True
continue
if self.appear_then_click(BATTLE_STATUS_D, interval=1):
success = True
end = True
battle_status_detected = True
logger.info("Exercise LOST")
continue
if self.appear_then_click(GET_ITEMS_1, interval=1):
# Only handle GET_ITEMS_1 after battle status
if battle_status_detected and self.appear_then_click(GET_ITEMS_1, offset=(30, 30), interval=1):
continue
if self.appear(EXP_INFO_S, interval=1):
self.device.click(CLICK_SAFE_AREA)
@@ -92,7 +94,6 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
end = True
logger.info("Exercise LOST")
continue
# Quit
if self.handle_combat_quit():
pause_interval.reset()
@@ -114,7 +115,6 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
if show_hp_timer.reached():
show_hp_timer.reset()
self._show_hp()
# bunch of popup handlers
if self.handle_popup_confirm('EXERCISE_COMBAT_EXECUTE'):
continue
@@ -126,7 +126,6 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
continue
if self.handle_mission_popup_ack():
continue
return success
def _choose_opponent(self, index, skip_first_screenshot=True):