2023-06-16 17:04:17 +00:00
|
|
|
from module.ocr.ocr import Digit, DigitCounter
|
2023-06-15 14:12:47 +00:00
|
|
|
from tasks.base.ui import UI
|
2023-06-16 17:04:17 +00:00
|
|
|
from tasks.combat.assets.assets_combat_prepare import (
|
|
|
|
OCR_TRAILBLAZE_POWER,
|
|
|
|
OCR_WAVE_COUNT,
|
|
|
|
WAVE_MINUS,
|
|
|
|
WAVE_PLUS
|
|
|
|
)
|
2023-06-15 14:12:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CombatPrepare(UI):
|
|
|
|
def combat_set_wave(self, count=6):
|
|
|
|
"""
|
|
|
|
Args:
|
|
|
|
count: 1 to 6
|
2023-06-16 17:04:17 +00:00
|
|
|
|
|
|
|
Pages:
|
|
|
|
in: COMBAT_PREPARE
|
2023-06-15 14:12:47 +00:00
|
|
|
"""
|
|
|
|
self.ui_ensure_index(
|
2023-06-16 17:04:17 +00:00
|
|
|
count, letter=Digit(OCR_WAVE_COUNT),
|
2023-06-15 14:12:47 +00:00
|
|
|
next_button=WAVE_PLUS, prev_button=WAVE_MINUS,
|
|
|
|
skip_first_screenshot=True
|
|
|
|
)
|
2023-06-16 17:04:17 +00:00
|
|
|
|
|
|
|
def combat_get_trailblaze_power(self) -> int:
|
|
|
|
"""
|
|
|
|
Pages:
|
|
|
|
in: COMBAT_PREPARE or COMBAT_REPEAT
|
|
|
|
"""
|
|
|
|
current, _, _ = DigitCounter(OCR_TRAILBLAZE_POWER).ocr_single_line(self.device.image)
|
|
|
|
self.state.TrailblazePower = current
|
|
|
|
return current
|