mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-23 00:52:22 +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:
|
||||
SUBMARINE = 0
|
||||
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):
|
||||
|
@ -10,7 +10,7 @@ MAP.map_data = '''
|
||||
-- -- ++ ++ -- ME -- ++ ++ ME --
|
||||
ME ME ++ ++ ME -- ME -- ME -- ME
|
||||
ME -- MB -- MB -- -- -- -- -- --
|
||||
++ -- MB -- MB __ ME ++ ++ ME ++
|
||||
++ -- MB MB -- __ ME ++ ++ ME ++
|
||||
SP -- ME -- ME -- -- ++ ME -- ME
|
||||
SP SP ++ ++ ++ ME -- -- -- -- ME
|
||||
'''
|
||||
|
@ -35,6 +35,11 @@ class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
|
||||
def battle_0(self):
|
||||
if self.clear_enemy(scale=(2,)):
|
||||
return True
|
||||
if self.clear_enemy(scale=(1,)):
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
||||
|
||||
def battle_5(self):
|
||||
|
@ -240,9 +240,7 @@ class Map(Fleet):
|
||||
self.clear_chosen_enemy(grids[0])
|
||||
|
||||
logger.warning('BOSS not detected, trying all boss spawn point.')
|
||||
self.clear_potential_boss()
|
||||
|
||||
return False
|
||||
return self.clear_potential_boss()
|
||||
|
||||
def clear_potential_boss(self):
|
||||
"""
|
||||
@ -250,13 +248,19 @@ class Map(Fleet):
|
||||
"""
|
||||
grids = self.map.select(may_boss=True, is_accessible=True)
|
||||
logger.info('May boss: %s' % self.map.select(may_boss=True))
|
||||
battle_count = self.battle_count
|
||||
|
||||
for grid in grids:
|
||||
logger.hr('Clear BOSS')
|
||||
logger.hr('Clear potential BOSS')
|
||||
grids = grids.sort(cost=True, weight=True)
|
||||
logger.info('Grid: %s' % str(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):
|
||||
"""
|
||||
@ -278,8 +282,8 @@ class Map(Fleet):
|
||||
else:
|
||||
return self.fleet_boss.clear_boss()
|
||||
else:
|
||||
logger.warning('No boss found.')
|
||||
return False
|
||||
logger.warning('BOSS not detected, trying all boss spawn point.')
|
||||
return self.clear_potential_boss()
|
||||
|
||||
def brute_fleet_meet(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user