diff --git a/assets/combat/READY_AIR_RAID.png b/assets/combat/READY_AIR_RAID.png new file mode 100644 index 000000000..33c51121b Binary files /dev/null and b/assets/combat/READY_AIR_RAID.png differ diff --git a/assets/combat/READY_TORPEDO.png b/assets/combat/READY_TORPEDO.png new file mode 100644 index 000000000..99d5f326c Binary files /dev/null and b/assets/combat/READY_TORPEDO.png differ diff --git a/module/combat/assets.py b/module/combat/assets.py index 77c82002b..e5b655286 100644 --- a/module/combat/assets.py +++ b/module/combat/assets.py @@ -26,6 +26,8 @@ LOADING_BAR = Button(area=(33, 676, 1247, 680), color=(172, 205, 232), button=(3 MOVE_DOWN = Button(area=(148, 647, 155, 669), color=(21, 28, 57), button=(148, 647, 155, 669), file='./assets/combat/MOVE_DOWN.png') PAUSE = Button(area=(1236, 37, 1244, 59), color=(247, 243, 247), button=(1162, 34, 1246, 61), file='./assets/combat/PAUSE.png') PAUSE_DOUBLE_CHECK = Button(area=(1231, 35, 1236, 60), color=(96, 104, 136), button=(1231, 35, 1236, 60), file='./assets/combat/PAUSE_DOUBLE_CHECK.png') +READY_AIR_RAID = Button(area=(887, 618, 907, 628), color=(255, 255, 255), button=(887, 618, 907, 628), file='./assets/combat/READY_AIR_RAID.png') +READY_TORPEDO = Button(area=(1038, 611, 1046, 619), color=(255, 255, 255), button=(1038, 611, 1046, 619), file='./assets/combat/READY_TORPEDO.png') SUBMARINE_AVAILABLE_CHECK_1 = Button(area=(707, 660, 712, 665), color=(255, 255, 255), button=(707, 660, 712, 665), file='./assets/combat/SUBMARINE_AVAILABLE_CHECK_1.png') SUBMARINE_AVAILABLE_CHECK_2 = Button(area=(790, 631, 795, 641), color=(255, 255, 255), button=(790, 631, 795, 641), file='./assets/combat/SUBMARINE_AVAILABLE_CHECK_2.png') SUBMARINE_CALLED = Button(area=(737, 608, 750, 626), color=(132, 134, 132), button=(737, 608, 750, 626), file='./assets/combat/SUBMARINE_CALLED.png') diff --git a/module/combat/combat.py b/module/combat/combat.py index 2ab76b535..4b71f152b 100644 --- a/module/combat/combat.py +++ b/module/combat/combat.py @@ -171,10 +171,10 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba return False - def combat_execute(self, func=None, call_submarine_at_boss=False, save_get_items=False): + def combat_execute(self, auto=True, call_submarine_at_boss=False, save_get_items=False): """ Args: - func: Funtion to run when in combat. + auto (bool): call_submarine_at_boss (bool): save_get_items (bool) """ @@ -198,6 +198,9 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba continue if self.handle_combat_manual(): continue + if not auto and self.is_combat_executing(): + if self.handle_combat_weapon_release(): + continue if call_submarine_at_boss: pass else: @@ -343,7 +346,7 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba self.combat_preparation( balance_hp=balance_hp, emotion_reduce=emotion_reduce, auto=auto, fleet_index=fleet_index) self.combat_execute( - func=func, call_submarine_at_boss=call_submarine_at_boss, save_get_items=save_get_items) + auto=auto, call_submarine_at_boss=call_submarine_at_boss, save_get_items=save_get_items) self.combat_status( save_get_items=save_get_items, expected_end=expected_end) self.handle_map_after_combat_story() diff --git a/module/combat/combat_manual.py b/module/combat/combat_manual.py index 037aae658..83874f6c0 100644 --- a/module/combat/combat_manual.py +++ b/module/combat/combat_manual.py @@ -1,5 +1,5 @@ from module.base.base import ModuleBase -from module.combat.assets import MOVE_DOWN +from module.combat.assets import * class CombatManual(ModuleBase): @@ -16,6 +16,14 @@ class CombatManual(ModuleBase): self.device.long_click(MOVE_DOWN, duration=0.8) return True + def handle_combat_weapon_release(self): + if self.appear_then_click(READY_AIR_RAID, interval=5): + return True + if self.appear_then_click(READY_TORPEDO, interval=5): + return True + + return False + def handle_combat_manual(self): if self.manual_executed or not self.auto_mode_checked: return False