Fix: Failed to enter boss room due to wrong is_question prediction

This commit is contained in:
LmeSzinc 2024-06-07 09:56:35 +08:00
parent ab27a00125
commit e4653741dd
2 changed files with 12 additions and 1 deletions

View File

@ -530,7 +530,11 @@ class OSFleet(OSCamera, Combat, Fleet, OSAsh):
if is_normal:
self.relative_goto(has_fleet_step=True, near_by=True, is_exclamation=True)
else:
self.relative_goto(has_fleet_step=True, near_by=True, is_question=True)
if self.radar.select(is_exclamation=True).count:
logger.warning('Trying to enter month boss hard mode but is_exclamation exists')
self.relative_goto(has_fleet_step=True, near_by=True, is_exclamation=True)
else:
self.relative_goto(has_fleet_step=True, near_by=True, is_question=True)
def question_goto(self, has_fleet_step=False):
logger.hr('Question goto')

View File

@ -205,6 +205,13 @@ class Radar:
grid.image = image
grid.reset()
grid.predict()
# Fixup is_question near is_port
for port in self.select(is_port=True):
for grid in self.select(is_question=True):
if np.sum(np.abs(np.subtract(port.location, grid.location))) == 1:
logger.warning(f'Wrong radar prediction is_question {grid.location} {grid.encode()} '
f'near {port.location} {port.encode()}')
grid.is_question = False
def select(self, **kwargs):
"""