mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-27 02:27:12 +00:00
5b3dc4ec85
- 修复了删除空列时, 边缘仍然存在, 导致网格定位出错的问题 - 修复了在边缘外有错误的内部线时, 会把边缘删除的问题 - 调整了一图的边缘识别参数 - 修复了紧急委托过多时, 会触发同一按钮点击过多停止的问题 委托列表拖动方式从 拖动-点击 改为 拖拽抖动 独立出random_rectangle_vector函数 增加random_line_segments函数 - 更改: 索敌时默认使用地图权重 - 修复了收菜获取物品过多时会卡住的问题 - 写死了1-1的相机移动, 防止因为地图太小导致透视识别错误
53 lines
1.2 KiB
Python
53 lines
1.2 KiB
Python
from module.campaign.campaign_base import CampaignBase
|
|
from module.map.map_base import CampaignMap
|
|
from module.map.map_grids import SelectedGrids, RoadGrids
|
|
from module.logger import logger
|
|
from module.map.exception import CampaignEnd
|
|
|
|
|
|
MAP = CampaignMap()
|
|
MAP.shape = 'G1'
|
|
MAP.map_data = '''
|
|
SP -- -- -- -- ME MB
|
|
'''
|
|
MAP.spawn_data = [
|
|
{'battle': 0, 'enemy': 1},
|
|
{'battle': 1, 'boss': 1},
|
|
]
|
|
|
|
A1, B1, C1, D1, E1, F1, G1, \
|
|
= MAP.flatten()
|
|
|
|
|
|
class Config:
|
|
FLEET_2 = 0
|
|
SUBMARINE = 0
|
|
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
|
'height': (120, 255 - 40),
|
|
'width': (1.5, 10),
|
|
'prominence': 10,
|
|
'distance': 35,
|
|
}
|
|
EDGE_LINES_FIND_PEAKS_PARAMETERS = {
|
|
'height': (255 - 40, 255),
|
|
'prominence': 10,
|
|
'distance': 50,
|
|
'wlen': 1000
|
|
}
|
|
INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40
|
|
EDGE_LINES_HOUGHLINES_THRESHOLD = 40
|
|
|
|
|
|
class Campaign(CampaignBase):
|
|
MAP = MAP
|
|
|
|
def battle_0(self):
|
|
return self.battle_default()
|
|
|
|
def battle_1(self):
|
|
return self.clear_boss()
|
|
|
|
def handle_boss_appear_refocus(self):
|
|
self.map_swipe((-3, 0))
|
|
return super().handle_boss_appear_refocus()
|