mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-06-01 01:46:41 +08:00
Merge branch 'master' of https://github.com/LmeSzinc/AzurLaneAutoScript
This commit is contained in:
@@ -6,7 +6,7 @@ from module.logger import logger
|
||||
MAP = CampaignMap('A1')
|
||||
MAP.shape = 'I8'
|
||||
MAP.camera_data = ['D2', 'D6', 'F2', 'F6']
|
||||
MAP.camera_data_spawn_point = ['F2', 'D2']
|
||||
MAP.camera_data_spawn_point = ['D2']
|
||||
MAP.map_data = """
|
||||
-- -- -- SP -- SP -- -- --
|
||||
-- ME ++ -- -- -- -- ME --
|
||||
@@ -63,6 +63,7 @@ class Config:
|
||||
# ===== End of generated config =====
|
||||
|
||||
MAP_SIREN_HAS_BOSS_ICON_SMALL = True
|
||||
HOMO_EDGE_HOUGHLINES_THRESHOLD = 210
|
||||
MAP_SWIPE_MULTIPLY = (1.238, 1.261)
|
||||
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.197, 1.219)
|
||||
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.162, 1.183)
|
||||
|
||||
@@ -6,14 +6,17 @@ from .a1 import Config as ConfigBase
|
||||
|
||||
MAP = CampaignMap('A3')
|
||||
MAP.shape = 'H9'
|
||||
MAP.camera_data = ['D2', 'D6', 'D7', 'E2', 'E6', 'E7']
|
||||
MAP.camera_data_spawn_point = ['D2', 'D6']
|
||||
MAP.camera_data = ['E3', 'E5', 'E7']
|
||||
MAP.camera_data_spawn_point = ['D6']
|
||||
# Big pillar at G5 covering G1:H4
|
||||
# Smoke covering fleet ammo icon and current fleet indicator if fleet is at F4
|
||||
# mark covering grids as land, since we won't go there anyway
|
||||
MAP.map_data = """
|
||||
-- -- ++ -- -- ME -- --
|
||||
-- -- ++ Me Me -- -- --
|
||||
++ ++ ++ -- -- ME -- --
|
||||
SP -- -- MS -- -- -- --
|
||||
-- -- MS -- __ Me ++ --
|
||||
-- -- ++ -- -- ME ++ ++
|
||||
-- -- ++ Me Me -- ++ ++
|
||||
++ ++ ++ -- -- ME ++ ++
|
||||
SP -- -- MS -- ++ ++ ++
|
||||
-- -- MS -- __ Me ++ ++
|
||||
SP -- -- MS -- -- MB --
|
||||
++ ++ ++ -- -- -- -- ME
|
||||
-- -- ++ -- Me -- ME --
|
||||
|
||||
@@ -61,6 +61,7 @@ class Config:
|
||||
# ===== End of generated config =====
|
||||
|
||||
MAP_SIREN_HAS_BOSS_ICON_SMALL = True
|
||||
HOMO_EDGE_HOUGHLINES_THRESHOLD = 210
|
||||
MAP_SWIPE_MULTIPLY = (1.132, 1.154)
|
||||
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.095, 1.115)
|
||||
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.063, 1.082)
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
from module.base.utils import location2node
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_base import CampaignMap, location_ensure
|
||||
from module.map.map_grids import SelectedGrids, RoadGrids
|
||||
from module.logger import logger
|
||||
from .b1 import Config as ConfigBase
|
||||
from .d3 import GridCurrentFleet
|
||||
|
||||
MAP = CampaignMap('B3')
|
||||
MAP.shape = 'I9'
|
||||
MAP.camera_data = ['D3', 'D7', 'F3', 'F7']
|
||||
MAP.camera_data_spawn_point = ['F7', 'D7']
|
||||
MAP.camera_data = ['D3', 'D5', 'D7', 'F3', 'F5', 'F7']
|
||||
MAP.camera_data_spawn_point = ['D7']
|
||||
# Big pillar at E4 covering D1:F2
|
||||
# mark covering grids as land, since we won't go there anyway
|
||||
MAP.map_data = """
|
||||
++ ++ ++ -- -- -- ++ ++ ++
|
||||
-- -- ME -- -- -- ME -- --
|
||||
-- ME -- ME -- ME -- ME --
|
||||
++ ++ ++ ++ ++ ++ ++ ++ ++
|
||||
-- -- ME ++ ++ ++ ME -- --
|
||||
-- ME -- ME ++ ME -- ME --
|
||||
-- ++ -- -- ++ -- -- ++ --
|
||||
ME ++ Me -- -- -- Me ++ ME
|
||||
-- Me -- -- MB -- -- Me --
|
||||
@@ -71,6 +75,15 @@ class Config(ConfigBase):
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
|
||||
grid_class = GridCurrentFleet
|
||||
|
||||
def in_sight(self, location, sight=None):
|
||||
# Focus E3 when insight E3, to avoid ammo icon covered by pillar
|
||||
location = location_ensure(location)
|
||||
node = location2node(location)
|
||||
if node == 'E3':
|
||||
return self.focus_to('E3')
|
||||
return super().in_sight(location, sight=sight)
|
||||
|
||||
def battle_0(self):
|
||||
if self.clear_siren():
|
||||
|
||||
@@ -6,7 +6,7 @@ from module.logger import logger
|
||||
MAP = CampaignMap('C1')
|
||||
MAP.shape = 'I8'
|
||||
MAP.camera_data = ['D2', 'D6', 'F2', 'F6']
|
||||
MAP.camera_data_spawn_point = ['F2', 'D2']
|
||||
MAP.camera_data_spawn_point = ['D2']
|
||||
MAP.map_data = """
|
||||
-- -- -- SP -- SP -- -- --
|
||||
-- ME ++ -- -- -- -- ME --
|
||||
@@ -63,6 +63,7 @@ class Config:
|
||||
# ===== End of generated config =====
|
||||
|
||||
MAP_SIREN_HAS_BOSS_ICON_SMALL = True
|
||||
HOMO_EDGE_HOUGHLINES_THRESHOLD = 210
|
||||
MAP_SWIPE_MULTIPLY = (1.238, 1.261)
|
||||
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.197, 1.219)
|
||||
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.162, 1.183)
|
||||
|
||||
@@ -6,14 +6,17 @@ from .c1 import Config as ConfigBase
|
||||
|
||||
MAP = CampaignMap('C3')
|
||||
MAP.shape = 'H9'
|
||||
MAP.camera_data = ['D2', 'D6', 'D7', 'E2', 'E6', 'E7']
|
||||
MAP.camera_data_spawn_point = ['D2', 'D6']
|
||||
MAP.camera_data = ['E3', 'E5', 'E7']
|
||||
MAP.camera_data_spawn_point = ['D6']
|
||||
# Big pillar at G5 covering G1:H4
|
||||
# Smoke covering fleet ammo icon and current fleet indicator if fleet is at F4
|
||||
# mark covering grids as land, since we won't go there anyway
|
||||
MAP.map_data = """
|
||||
-- -- ++ -- -- ME -- --
|
||||
-- -- ++ Me Me -- -- --
|
||||
++ ++ ++ -- -- ME -- --
|
||||
SP -- -- MS -- -- -- --
|
||||
-- -- MS -- __ Me ++ --
|
||||
-- -- ++ -- -- ME ++ ++
|
||||
-- -- ++ Me Me -- ++ ++
|
||||
++ ++ ++ -- -- ME ++ ++
|
||||
SP -- -- MS -- ++ ++ ++
|
||||
-- -- MS -- __ Me ++ ++
|
||||
SP -- -- MS -- -- MB --
|
||||
++ ++ ++ -- -- -- -- ME
|
||||
-- -- ++ -- Me -- ME --
|
||||
|
||||
@@ -61,6 +61,7 @@ class Config:
|
||||
# ===== End of generated config =====
|
||||
|
||||
MAP_SIREN_HAS_BOSS_ICON_SMALL = True
|
||||
HOMO_EDGE_HOUGHLINES_THRESHOLD = 210
|
||||
MAP_SWIPE_MULTIPLY = (1.132, 1.154)
|
||||
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.095, 1.115)
|
||||
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.063, 1.082)
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
from module.base.utils import color_similarity_2d, location2node
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_base import CampaignMap, location_ensure
|
||||
from module.map.map_grids import SelectedGrids, RoadGrids
|
||||
from module.logger import logger
|
||||
from module.map_detection.grid import Grid
|
||||
from module.template.assets import TEMPLATE_FLEET_CURRENT
|
||||
from .d1 import Config as ConfigBase
|
||||
|
||||
MAP = CampaignMap('D3')
|
||||
MAP.shape = 'I9'
|
||||
MAP.camera_data = ['D3', 'D7', 'F3', 'F7']
|
||||
MAP.camera_data_spawn_point = ['F7', 'D7']
|
||||
MAP.camera_data = ['D3', 'D5', 'D7', 'F3', 'F5', 'F7']
|
||||
MAP.camera_data_spawn_point = ['D7']
|
||||
# Big pillar at E4 covering D1:F2
|
||||
# mark covering grids as land, since we won't go there anyway
|
||||
MAP.map_data = """
|
||||
++ ++ ++ -- -- -- ++ ++ ++
|
||||
-- -- ME -- -- -- ME -- --
|
||||
-- ME -- ME -- ME -- ME --
|
||||
++ ++ ++ ++ ++ ++ ++ ++ ++
|
||||
-- -- ME ++ ++ ++ ME -- --
|
||||
-- ME -- ME ++ ME -- ME --
|
||||
-- ++ -- -- ++ -- -- ++ --
|
||||
ME ++ Me -- -- -- Me ++ ME
|
||||
-- Me -- -- MB -- -- Me --
|
||||
@@ -69,9 +74,33 @@ class Config(ConfigBase):
|
||||
# ===== End of generated config =====
|
||||
|
||||
|
||||
class GridCurrentFleet(Grid):
|
||||
def predict_current_fleet(self):
|
||||
# lower count threshold for D3
|
||||
count = self.relative_hsv_count(area=(-0.5, -3.5, 0.5, -2.5), h=(141 - 3, 141 + 10), shape=(50, 50))
|
||||
if count < 150:
|
||||
return False
|
||||
|
||||
image = self.relative_crop((-0.5, -3.5, 0.5, -2.5), shape=(60, 60))
|
||||
image = color_similarity_2d(image, color=(24, 255, 107))
|
||||
if not TEMPLATE_FLEET_CURRENT.match(image):
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
|
||||
grid_class = GridCurrentFleet
|
||||
|
||||
def in_sight(self, location, sight=None):
|
||||
# Focus E3 when insight E3, to avoid ammo icon covered by pillar
|
||||
location = location_ensure(location)
|
||||
node = location2node(location)
|
||||
if node == 'E3':
|
||||
return self.focus_to('E3')
|
||||
return super().in_sight(location, sight=sight)
|
||||
|
||||
def battle_0(self):
|
||||
if self.clear_siren():
|
||||
|
||||
@@ -7,11 +7,12 @@ MAP = CampaignMap('SP')
|
||||
MAP.shape = 'I10'
|
||||
MAP.camera_data = ['D6', 'D8']
|
||||
MAP.camera_data_spawn_point = ['D6']
|
||||
# Big pillar at E4, block D4 F4 to block the upper part of map
|
||||
MAP.map_data = """
|
||||
-- -- -- ++ ++ ++ -- -- --
|
||||
-- ++ -- -- -- -- -- ++ --
|
||||
-- -- -- -- -- -- -- -- --
|
||||
++ ++ ++ -- ++ -- ++ ++ ++
|
||||
++ ++ ++ ++ ++ ++ ++ ++ ++
|
||||
-- -- ME SP -- SP ME -- --
|
||||
-- -- -- -- __ -- -- -- --
|
||||
-- -- ME -- MS -- ME -- --
|
||||
@@ -76,6 +77,9 @@ class Config:
|
||||
|
||||
MAP_IS_ONE_TIME_STAGE = True
|
||||
MAP_SIREN_HAS_BOSS_ICON_SMALL = True
|
||||
HOMO_STORAGE = ((8, 6), [(137.405, 104.804), (1046.044, 104.804), (-12.171, 652.093), (1166.717, 652.093)])
|
||||
HOMO_EDGE_HOUGHLINES_THRESHOLD = 210
|
||||
MAP_ENSURE_EDGE_INSIGHT_CORNER = 'bottom'
|
||||
MAP_SWIPE_MULTIPLY = (1.071, 1.091)
|
||||
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.036, 1.055)
|
||||
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.006, 1.024)
|
||||
|
||||
Reference in New Issue
Block a user