mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-17 19:29:27 +08:00
Merge branch 'refs/heads/LmeSzinc/master' into dev
# Conflicts: # module/campaign/campaign_status.py # module/exercise/combat.py # module/retire/dock.py # module/retire/enhancement.py
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from module.combat.combat import *
|
||||
from module.combat.combat import PAUSE, QUIT
|
||||
from module.combat.combat import QUIT
|
||||
from module.exercise.assets import *
|
||||
from module.exercise.equipment import ExerciseEquipment
|
||||
from module.exercise.hp_daemon import HpDaemon
|
||||
@@ -47,16 +47,23 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
|
||||
logger.info('Combat execute')
|
||||
self.device.stuck_record_clear()
|
||||
self.device.click_record_clear()
|
||||
self.low_hp_confirm_timer = Timer(self.config.Exercise_LowHpConfirmWait, count=2).start()
|
||||
self.low_hp_confirm_timer = Timer(1.5, count=2).start()
|
||||
show_hp_timer = Timer(5)
|
||||
pause_interval = Timer(0.5, count=1)
|
||||
# Pause button to identify battle UI theme
|
||||
pause = None
|
||||
success = True
|
||||
end = False
|
||||
|
||||
while 1:
|
||||
self.device.screenshot()
|
||||
|
||||
if not self.is_combat_executing():
|
||||
p = self.is_combat_executing()
|
||||
if p:
|
||||
if pause is None:
|
||||
pause = p
|
||||
else:
|
||||
self.low_hp_confirm_timer.reset()
|
||||
# Finish - S or D rank
|
||||
if self.appear_then_click(BATTLE_STATUS_S, interval=1):
|
||||
success = True
|
||||
@@ -93,9 +100,10 @@ class ExerciseCombat(HpDaemon, OpponentChoose, ExerciseEquipment, Combat):
|
||||
pause_interval.reset()
|
||||
continue
|
||||
if not end:
|
||||
if self._at_low_hp(image=self.device.image):
|
||||
if p and self._at_low_hp(image=self.device.image, pause=pause):
|
||||
logger.info('Exercise quit')
|
||||
if pause_interval.reached() and self.appear_then_click(PAUSE):
|
||||
if pause_interval.reached():
|
||||
self.device.click(p)
|
||||
pause_interval.reset()
|
||||
continue
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user