调整突袭模式导航顺序
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful

This commit is contained in:
Elaina 2024-12-16 00:12:36 +08:00
parent 28b72a002e
commit 1278099578
3 changed files with 17 additions and 17 deletions

View file

@ -446,20 +446,20 @@ class NavigationSolver(SceneGraphSolver):
- 活动关卡开放时返回True活动结束后返回False
- 剿灭没满时返回True刷满后返回False
"""
self.switch_to_ex = False
if name.endswith("#"):
name = name[:-1]
self.switch_to_ex = True
if LastStageNavigation().run(name, mode):
if LastStageNavigation().run(name, mode, self.switch_to_ex):
# 剿灭导航,LastStageNavigation.run一定返回False
return True
if (
name in ActivityNavigation.location["normal"]
or name in ActivityNavigation.location["ex"]
):
ActivityNavigation().run(name, mode)
ActivityNavigation().run(name, mode, self.switch_to_ex)
return True
self.switch_to_ex = False
if name.endswith("#"):
name = name[:-1]
self.switch_to_ex = True
self.success = False
self.act = None

View file

@ -63,12 +63,14 @@ class ActivityNavigation(SceneGraphSolver):
names[name] = generate_name(name, font_size, pad_right=10)
self.names = names
def run(self, name: str, mode: Literal["auto", "copy"] = "auto") -> None:
def run(
self,
name: str,
mode: Literal["auto", "copy"] = "auto",
switch_to_ex: bool = False,
) -> None:
logger.info("导航至活动关卡")
self.switch_to_ex = False # 是否切换到突袭模式
if name.endswith("#"):
name = name[:-1]
self.switch_to_ex = True
self.switch_to_ex = switch_to_ex # 是否切换到突袭模式
self.difficulty = "ex" if "-EX-" in name else "normal"
self.name = name
self.mode = mode

View file

@ -12,12 +12,10 @@ from .utils import last_letters
class LastStageNavigation(SceneGraphSolver):
def run(self, name: str, mode: Literal["auto", "copy"] = "auto"):
self.switch_to_ex = False
if name.endswith("#"):
name = name[:-1]
self.switch_to_ex = True
def run(
self, name: str, mode: Literal["auto", "copy"] = "auto", switch_to_ex=False
) -> bool:
self.switch_to_ex = switch_to_ex
self.name = name
self.mode = mode
self.success = True