Add: 增加中路站桩时放空袭和鱼雷

This commit is contained in:
LmeSzinc 2020-05-22 22:33:18 +08:00
parent 8ec5099b58
commit 4503793e47
5 changed files with 17 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -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') 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 = 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') 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_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_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') SUBMARINE_CALLED = Button(area=(737, 608, 750, 626), color=(132, 134, 132), button=(737, 608, 750, 626), file='./assets/combat/SUBMARINE_CALLED.png')

View File

@ -171,10 +171,10 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba
return False 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: Args:
func: Funtion to run when in combat. auto (bool):
call_submarine_at_boss (bool): call_submarine_at_boss (bool):
save_get_items (bool) save_get_items (bool)
""" """
@ -198,6 +198,9 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba
continue continue
if self.handle_combat_manual(): if self.handle_combat_manual():
continue continue
if not auto and self.is_combat_executing():
if self.handle_combat_weapon_release():
continue
if call_submarine_at_boss: if call_submarine_at_boss:
pass pass
else: else:
@ -343,7 +346,7 @@ class Combat(HPBalancer, EnemySearchingHandler, Retirement, SubmarineCall, Comba
self.combat_preparation( self.combat_preparation(
balance_hp=balance_hp, emotion_reduce=emotion_reduce, auto=auto, fleet_index=fleet_index) balance_hp=balance_hp, emotion_reduce=emotion_reduce, auto=auto, fleet_index=fleet_index)
self.combat_execute( 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( self.combat_status(
save_get_items=save_get_items, expected_end=expected_end) save_get_items=save_get_items, expected_end=expected_end)
self.handle_map_after_combat_story() self.handle_map_after_combat_story()

View File

@ -1,5 +1,5 @@
from module.base.base import ModuleBase from module.base.base import ModuleBase
from module.combat.assets import MOVE_DOWN from module.combat.assets import *
class CombatManual(ModuleBase): class CombatManual(ModuleBase):
@ -16,6 +16,14 @@ class CombatManual(ModuleBase):
self.device.long_click(MOVE_DOWN, duration=0.8) self.device.long_click(MOVE_DOWN, duration=0.8)
return True 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): def handle_combat_manual(self):
if self.manual_executed or not self.auto_mode_checked: if self.manual_executed or not self.auto_mode_checked:
return False return False