All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
from mower.utils import config
|
|
from mower.utils.graph import SceneGraphSolver
|
|
from mower.utils.recognize import Scene
|
|
|
|
from .sss_navi import SSSNaviSolver
|
|
from .utils import is_full
|
|
|
|
|
|
class SSSOpeSolver(SceneGraphSolver):
|
|
solver_name = "保全代理"
|
|
|
|
def run(self) -> bool:
|
|
self.success = False # 是否刷满
|
|
self.check = False # 是否可代理层数小于设置要求
|
|
super().run()
|
|
return self.success
|
|
|
|
def transition(self):
|
|
if (scene := self.scene()) == Scene.SSS_START:
|
|
if self.find("sss/ope/prts") and not self.check:
|
|
self.ctap("sss/ope/prts", 3)
|
|
return
|
|
elif self.find("sss/ope/elimi_agency_on") and self.check:
|
|
self.ctap("sss/ope/elimi_agency_on", 3)
|
|
return
|
|
self.ctap((1555, 966), 3)
|
|
|
|
elif scene in [Scene.SSS_EC, Scene.SSS_EC_EX] and self.check:
|
|
return True
|
|
elif scene == Scene.SSS_ELIMI_AGENCY:
|
|
if is_full():
|
|
self.success = True
|
|
return True
|
|
if (
|
|
config.recog.num.number_int(
|
|
"riic_base",
|
|
((1750, 50), (1850, 150)),
|
|
50,
|
|
120,
|
|
target_range=range(1, 7),
|
|
)
|
|
< config.conf.sss.ope_limit_stage
|
|
):
|
|
self.scene_graph_step(Scene.SSS_START)
|
|
self.check = True
|
|
return
|
|
self.tap("sss/ope/use")
|
|
else:
|
|
SSSNaviSolver().run()
|