Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add:第8章导航 #636

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified arknights_mower/models/navigation.pkl
Binary file not shown.
39 changes: 35 additions & 4 deletions arknights_mower/solvers/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pickle

import cv2

import re
from arknights_mower import __rootdir__
from arknights_mower.utils import hot_update
from arknights_mower.utils.graph import SceneGraphSolver
Expand All @@ -25,6 +25,34 @@
"1-11": (4965, -9),
"1-12": (5436, -10),
},
8: {
"R8-1": (0, 0),
"R8-2": (471, 0),
"R8-3": (864, 0),
"R8-4": (1259, 0),
"R8-5": (1651, -4),
"R8-6": (2045, -4),
"R8-7": (2228, -124),
"R8-8": (2437, -4),
"R8-9": (2951, -4),
"R8-10": (3284, -4),
"R8-11": (3617, -4),
"M8-1": (6, 339),
"M8-2": (865, 339),
"M8-3": (1259, 339),
"M8-4": (1651, 339),
"M8-5": (2045, 339),
"M8-6": (2439, 340),
"M8-7": (2952, 340),
"M8-8": (3617, 339),
"JT8-1": (4092, 171),
"JT8-2": (4545, 171),
"JT8-3": (5022, 171),
"H8-1": (5556, -24),
"H8-2": (5759, 354),
"H8-3": (5999, -24),
"H8-4": (6192, 354),
},
12: {
"12-1": (0, 0),
"12-2": (342, 292),
Expand Down Expand Up @@ -123,7 +151,7 @@ class NavigationSolver(SceneGraphSolver):
def run(self, name: str):
logger.info("Start: 关卡导航")
self.success = False
self.act=None
self.act = None

hot_update.update()
if name in hot_update.navigation.NavigationSolver.location:
Expand All @@ -139,9 +167,12 @@ def run(self, name: str):
self.pr_prefix = pr_prefix
self.now_difficulty = None
self.change_to = None
self.patten = r"^(R|JT|H|M)(\d{1,2})$"
if name == "Annihilation":
logger.info("剿灭导航")
elif prefix.isdigit():
elif prefix.isdigit() or re.match(self.patten, prefix):
if match := re.search(self.patten, prefix):
prefix = match.group(2)
prefix = int(prefix)
self.prefix = prefix
if prefix in location and name in location[prefix]:
Expand All @@ -166,7 +197,7 @@ def run(self, name: str):
else:
logger.error(f"暂不支持{name}")
return False

super().run()
return self.success

Expand Down
1 change: 1 addition & 0 deletions arknights_mower/utils/recognize.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ def find(
"loading3": (1681, 1000),
"loading4": (828, 429),
"main_theme": (283, 945),
"main_theme_small": (321, 973),
"materiel_ico": (892, 61),
"mission_daily_on": ((685, 15), (1910, 100)),
"mission_weekly_on": ((685, 15), (1910, 100)),
Expand Down