mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-23 09:01:45 +00:00
Fix: 修复夜幕下的归途SP2的BOSS刷新点错误
- 修复brute_clear_boss找不到BOSS时卡住的问题
This commit is contained in:
parent
e35c193671
commit
acf73f5c17
@ -16,8 +16,25 @@ MAP.camera_data = ['D2', 'E2']
|
|||||||
class Config:
|
class Config:
|
||||||
SUBMARINE = 0
|
SUBMARINE = 0
|
||||||
POOR_MAP_DATA = True
|
POOR_MAP_DATA = True
|
||||||
INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40
|
|
||||||
EDGE_LINES_HOUGHLINES_THRESHOLD = 40
|
INTERNAL_LINES_HOUGHLINES_THRESHOLD = 30
|
||||||
|
EDGE_LINES_HOUGHLINES_THRESHOLD = 30
|
||||||
|
MID_DIFF_RANGE_H = (140 - 3, 140 + 3)
|
||||||
|
MID_DIFF_RANGE_V = (143 - 3, 143 + 3)
|
||||||
|
|
||||||
|
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||||
|
'height': (150, 255 - 24),
|
||||||
|
'width': (0.5, 20),
|
||||||
|
'prominence': 10,
|
||||||
|
'distance': 35,
|
||||||
|
'wlen': 100,
|
||||||
|
}
|
||||||
|
EDGE_LINES_FIND_PEAKS_PARAMETERS = {
|
||||||
|
'height': (255 - 24, 255),
|
||||||
|
'prominence': 10,
|
||||||
|
'distance': 50,
|
||||||
|
'wlen': 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class Campaign(CampaignBase):
|
class Campaign(CampaignBase):
|
||||||
|
@ -10,7 +10,7 @@ MAP.map_data = '''
|
|||||||
-- -- ++ ++ -- ME -- ++ ++ ME --
|
-- -- ++ ++ -- ME -- ++ ++ ME --
|
||||||
ME ME ++ ++ ME -- ME -- ME -- ME
|
ME ME ++ ++ ME -- ME -- ME -- ME
|
||||||
ME -- MB -- MB -- -- -- -- -- --
|
ME -- MB -- MB -- -- -- -- -- --
|
||||||
++ -- MB -- MB __ ME ++ ++ ME ++
|
++ -- MB MB -- __ ME ++ ++ ME ++
|
||||||
SP -- ME -- ME -- -- ++ ME -- ME
|
SP -- ME -- ME -- -- ++ ME -- ME
|
||||||
SP SP ++ ++ ++ ME -- -- -- -- ME
|
SP SP ++ ++ ++ ME -- -- -- -- ME
|
||||||
'''
|
'''
|
||||||
|
@ -35,6 +35,11 @@ class Campaign(CampaignBase):
|
|||||||
MAP = MAP
|
MAP = MAP
|
||||||
|
|
||||||
def battle_0(self):
|
def battle_0(self):
|
||||||
|
if self.clear_enemy(scale=(2,)):
|
||||||
|
return True
|
||||||
|
if self.clear_enemy(scale=(1,)):
|
||||||
|
return True
|
||||||
|
|
||||||
return self.battle_default()
|
return self.battle_default()
|
||||||
|
|
||||||
def battle_5(self):
|
def battle_5(self):
|
||||||
|
@ -240,9 +240,7 @@ class Map(Fleet):
|
|||||||
self.clear_chosen_enemy(grids[0])
|
self.clear_chosen_enemy(grids[0])
|
||||||
|
|
||||||
logger.warning('BOSS not detected, trying all boss spawn point.')
|
logger.warning('BOSS not detected, trying all boss spawn point.')
|
||||||
self.clear_potential_boss()
|
return self.clear_potential_boss()
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def clear_potential_boss(self):
|
def clear_potential_boss(self):
|
||||||
"""
|
"""
|
||||||
@ -250,13 +248,19 @@ class Map(Fleet):
|
|||||||
"""
|
"""
|
||||||
grids = self.map.select(may_boss=True, is_accessible=True)
|
grids = self.map.select(may_boss=True, is_accessible=True)
|
||||||
logger.info('May boss: %s' % self.map.select(may_boss=True))
|
logger.info('May boss: %s' % self.map.select(may_boss=True))
|
||||||
|
battle_count = self.battle_count
|
||||||
|
|
||||||
for grid in grids:
|
for grid in grids:
|
||||||
logger.hr('Clear BOSS')
|
logger.hr('Clear potential BOSS')
|
||||||
grids = grids.sort(cost=True, weight=True)
|
grids = grids.sort(cost=True, weight=True)
|
||||||
logger.info('Grid: %s' % str(grid))
|
logger.info('Grid: %s' % str(grid))
|
||||||
self.clear_chosen_enemy(grid)
|
self.clear_chosen_enemy(grid)
|
||||||
logger.info('Boss guessing incorrect.')
|
if self.battle_count >= battle_count:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
logger.info('Boss guessing incorrect.')
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def brute_clear_boss(self):
|
def brute_clear_boss(self):
|
||||||
"""
|
"""
|
||||||
@ -278,8 +282,8 @@ class Map(Fleet):
|
|||||||
else:
|
else:
|
||||||
return self.fleet_boss.clear_boss()
|
return self.fleet_boss.clear_boss()
|
||||||
else:
|
else:
|
||||||
logger.warning('No boss found.')
|
logger.warning('BOSS not detected, trying all boss spawn point.')
|
||||||
return False
|
return self.clear_potential_boss()
|
||||||
|
|
||||||
def brute_fleet_meet(self):
|
def brute_fleet_meet(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user