Optimize: 优化log, 优化精英选择

- 缩短log, 尽量在GUI上显示为一行
- 只有在开荒或地图信息缺失的时候, 将未检测到星级的敌人当成精英
This commit is contained in:
LmeSzinc 2020-04-25 18:04:05 +08:00
parent 6b56215d71
commit 47cec0af36
3 changed files with 19 additions and 11 deletions

View File

@ -303,13 +303,15 @@ class Camera(InfoBarHandler):
location = location_ensure(location)
grid = np.array(location) - self.camera + self.grids.center_grid
logger.info('Convert_map_to_grid. Map: %s, Camera: %s, grids_center: %s, grid: %s' % (
location2node(location), str(self.camera), str(self.grids.center_grid), str(grid)))
logger.info('Convert_map_to_grid')
logger.info(f'Map: {location2node(location)}, '
f'Camera: {location2node(self.camera)}, '
f'Center: {location2node(self.grids.center_grid)}, '
f'grid: {location2node(grid)}')
if grid in self.grids:
return self.grids[grid]
else:
logger.warning('Convert_map_to_grid Failed. Map: %s, Camera: %s, grids_center: %s, grid: %s' % (
location2node(location), str(self.camera), str(self.grids.center_grid), str(grid)))
logger.warning('Convert_map_to_grid Failed.')
self.grids.save_error_image()
self.focus_to(location)
grid = np.array(location) - self.camera + self.grids.center_grid

View File

@ -304,15 +304,19 @@ class Map(Fleet):
if not self.config.MAP_HAS_SIREN:
return False
grids = self.map.select(may_siren=True, is_enemy=True)
grids = grids.add(self.map.select(is_siren=True))
grids = grids.add(self.map.select(is_enemy=True, enemy_scale=0))
grids = grids.delete(self.map.select(is_boss=True))
logger.info('May siren: %s' % self.map.select(may_siren=True))
logger.info('May siren and is enemy: %s' % self.map.select(may_siren=True, is_enemy=True))
grids = self.map.select(may_siren=True, is_enemy=True)
logger.info('Is siren: %s' % self.map.select(is_siren=True))
logger.info('Is 0 scale enemy: %s' % self.map.select(is_enemy=True, enemy_scale=0))
grids = grids.add(self.map.select(is_siren=True))
if self.config.POOR_MAP_DATA or not self.is_map_green:
logger.info('Is 0 scale enemy: %s' % self.map.select(is_enemy=True, enemy_scale=0))
grids = grids.add(self.map.select(is_enemy=True, enemy_scale=0))
logger.info('Delete is boss: %s' % self.map.select(is_boss=True))
grids = grids.delete(self.map.select(is_boss=True))
grids = self.select_grids(grids, **kwargs)

View File

@ -368,8 +368,10 @@ class CampaignMap:
if upper.may_carrier:
may['carrier'] += 1
logger.info('missing: %s' % missing)
logger.info('may: %s' % may)
logger.attr('enemy_missing',
', '.join([f'{k[:2].upper()}:{str(v).rjust(2)}' for k, v in missing.items() if k != 'battle']))
logger.attr('enemy_may____',
', '.join([f'{k[:2].upper()}:{str(v).rjust(2)}' for k, v in may.items()]))
return may, missing
def missing_is_none(self, battle_count, mystery_count=0, siren_count=0, carrier_count=0):