1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 05:08:19 +08:00

Opt: Reduce swipes become clicks when game is randomly stuck (#743)

Optimise the swipe path so that it ends on land
This commit is contained in:
LmeSzinc
2021-11-17 22:25:56 +08:00
parent 8974964e90
commit 501467ed4c
7 changed files with 235 additions and 33 deletions

View File

@@ -193,6 +193,8 @@ class SelectedGrids:
Returns:
SelectedGrids:
"""
if not self:
return self
if len(args):
grids = sorted(self.grids, key=operator.attrgetter(*args))
return SelectedGrids(grids)
@@ -207,6 +209,8 @@ class SelectedGrids:
Returns:
SelectedGrids:
"""
if not self:
return self
location = np.array(self.location)
diff = np.sum(np.abs(np.array(location) - camera), axis=1)
# grids = [x for _, x in sorted(zip(diff, self.grids))]
@@ -223,6 +227,8 @@ class SelectedGrids:
Returns:
SelectedGrids:
"""
if not self:
return self
vector = np.subtract(self.location, center)
theta = np.arctan2(vector[:, 1], vector[:, 0]) / np.pi * 180
vector = np.subtract(start, center)