1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 09:48:20 +08:00
This commit is contained in:
2024-12-29 12:15:01 +08:00
32 changed files with 604 additions and 136 deletions

View File

@@ -239,7 +239,9 @@ class AutoSearchCombat(MapOperation, Combat, CampaignStatus):
# End
if self.is_in_auto_search_menu() or self._handle_auto_search_menu_missing():
raise CampaignEnd
if self.is_combat_executing():
pause = self.is_combat_executing()
if pause:
logger.attr('BattleUI', pause)
break
logger.info('Auto Search combat execute')

View File

@@ -83,17 +83,24 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
"""
self.device.stuck_record_add(PAUSE)
if self.config.SERVER in ['cn', 'en']:
if PAUSE.match_luma(self.device.image, offset=(20, 20)):
if PAUSE.match_luma(self.device.image, offset=(10, 10)):
return PAUSE
else:
color = get_color(self.device.image, PAUSE.area)
if color_similar(color, PAUSE.color) or color_similar(color, (238, 244, 248)):
if np.max(self.image_crop(PAUSE_DOUBLE_CHECK, copy=False)) < 153:
return PAUSE
if PAUSE_New.match_luma(self.device.image, offset=(20, 20)):
if PAUSE_New.match_template_color(self.device.image, offset=(10, 10)):
return PAUSE_New
if PAUSE_Iridescent_Fantasy.match_luma(self.device.image, offset=(20, 20)):
if PAUSE_Iridescent_Fantasy.match_luma(self.device.image, offset=(10, 10)):
return PAUSE_Iridescent_Fantasy
if PAUSE_Christmas.match_luma(self.device.image, offset=(10, 10)):
return PAUSE_Christmas
# PAUSE_New, PAUSE_Cyber, PAUSE_Neon look similar, check colors
if PAUSE_Neon.match_template_color(self.device.image, offset=(10, 10)):
return PAUSE_Neon
if PAUSE_Cyber.match_template_color(self.device.image, offset=(10, 10)):
return PAUSE_Cyber
return False
def handle_combat_quit(self, offset=(20, 20), interval=3):
@@ -112,6 +119,12 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
self.device.click(QUIT_Iridescent_Fantasy)
timer.reset()
return True
# Battle UI PAUSE_Neon uses QUIT_New
# Battle UI PAUSE_Cyber uses QUIT_New
if QUIT_Christmas.match_luma(self.device.image, offset=offset):
self.device.click(QUIT_Christmas)
timer.reset()
return True
return False
def ensure_combat_oil_loaded(self):
@@ -170,7 +183,9 @@ class Combat(Level, HPBalancer, Retirement, SubmarineCall, CombatAuto, CombatMan
interval_set = True
# End
if self.is_combat_executing():
pause = self.is_combat_executing()
if pause:
logger.attr('BattleUI', pause)
if emotion_reduce:
self.emotion.reduce(fleet_index)
break