Fix: 修复夜幕下的归途SP2的BOSS刷新点错误

- 修复brute_clear_boss找不到BOSS时卡住的问题
This commit is contained in:
LmeSzinc 2020-05-07 19:55:06 +08:00
parent e35c193671
commit acf73f5c17
4 changed files with 36 additions and 10 deletions

View File

@ -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):

View File

@ -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
''' '''

View File

@ -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):

View File

@ -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,14 +248,20 @@ 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)
if self.battle_count >= battle_count:
return True
else:
logger.info('Boss guessing incorrect.') logger.info('Boss guessing incorrect.')
return False
def brute_clear_boss(self): def brute_clear_boss(self):
""" """
Method to clear boss, using brute-force to find roadblocks. Method to clear boss, using brute-force to find roadblocks.
@ -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):
""" """