Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/cn/os/TEMPLATE_ExplorationContainer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/os/TEMPLATE_ExplorationContainer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/jp/os/TEMPLATE_ExplorationContainer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/tw/os/TEMPLATE_ExplorationContainer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions module/map_detection/os_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class OSGridInfo(GridInfo):
is_scanning_device = False
is_logging_tower = False
is_exploration_reward = False
is_exploration_container = False
is_fleet_mechanism = False

is_fleet = False
Expand All @@ -37,6 +38,7 @@ def encode(self):
'SD': 'is_scanning_device',
'LT': 'is_logging_tower',
'ER': 'is_exploration_reward',
'EC': 'is_exploration_container',
'FM': 'is_fleet_mechanism',
}
for key, value in dic.items():
Expand Down Expand Up @@ -93,6 +95,9 @@ def merge(self, info, mode='normal'):
if info.is_exploration_reward:
self.is_exploration_reward = True
return True
if info.is_exploration_container:
self.is_exploration_container = True
return True
if info.is_fleet_mechanism:
self.is_fleet_mechanism = True
return True
Expand Down Expand Up @@ -137,6 +142,7 @@ def wipe_out(self):
self.is_scanning_device = False
self.is_logging_tower = False
self.is_exploration_reward = False
self.is_exploration_container = False
self.is_fleet_mechanism = False

def reset(self):
Expand All @@ -161,6 +167,7 @@ def predict(self):
self.is_scanning_device = self.enemy_genre == 'ScanningDevice'
self.is_logging_tower = self.enemy_genre == 'LoggingTower'
self.is_exploration_reward = self.enemy_genre == 'ExplorationReward'
self.is_exploration_container = self.enemy_genre == 'ExplorationContainer'
self.is_current_fleet = self.predict_current_fleet()
self.is_fleet = self.is_current_fleet
self.is_fleet_mechanism = self.predict_fleet_mechanism()
Expand Down Expand Up @@ -210,6 +217,7 @@ def predict_sea(self):
'ScanningDevice': TEMPLATE_ScanningDevice,
'LoggingTower': TEMPLATE_LoggingTower,
'ExplorationReward': TEMPLATE_ExplorationReward,
'ExplorationContainer': TEMPLATE_ExplorationContainer,
}
_os_template_enemy_upper = {
'ScanningDevice': TEMPLATE_ScanningDeviceUpper,
Expand Down
1 change: 1 addition & 0 deletions module/os/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
SELECT_STRONGHOLD = Button(area={'cn': (89, 251, 166, 269), 'en': (81, 252, 175, 272), 'jp': (89, 251, 167, 269), 'tw': (88, 250, 167, 270)}, color={'cn': (113, 114, 118), 'en': (81, 83, 87), 'jp': (115, 116, 119), 'tw': (103, 105, 108)}, button={'cn': (89, 251, 166, 269), 'en': (81, 252, 175, 272), 'jp': (89, 251, 167, 269), 'tw': (88, 250, 167, 270)}, file={'cn': './assets/cn/os/SELECT_STRONGHOLD.png', 'en': './assets/en/os/SELECT_STRONGHOLD.png', 'jp': './assets/jp/os/SELECT_STRONGHOLD.png', 'tw': './assets/tw/os/SELECT_STRONGHOLD.png'})
STRONGHOLD_PERCENTAGE = Button(area={'cn': (293, 125, 340, 143), 'en': (293, 125, 340, 143), 'jp': (293, 125, 340, 143), 'tw': (293, 125, 340, 143)}, color={'cn': (132, 135, 146), 'en': (132, 135, 146), 'jp': (132, 135, 146), 'tw': (132, 135, 146)}, button={'cn': (293, 125, 340, 143), 'en': (293, 125, 340, 143), 'jp': (293, 125, 340, 143), 'tw': (293, 125, 340, 143)}, file={'cn': './assets/cn/os/STRONGHOLD_PERCENTAGE.png', 'en': './assets/en/os/STRONGHOLD_PERCENTAGE.png', 'jp': './assets/jp/os/STRONGHOLD_PERCENTAGE.png', 'tw': './assets/tw/os/STRONGHOLD_PERCENTAGE.png'})
TEMPLATE_EMPTY_HP = Template(file={'cn': './assets/cn/os/TEMPLATE_EMPTY_HP.png', 'en': './assets/en/os/TEMPLATE_EMPTY_HP.png', 'jp': './assets/jp/os/TEMPLATE_EMPTY_HP.png', 'tw': './assets/tw/os/TEMPLATE_EMPTY_HP.png'})
TEMPLATE_ExplorationContainer = Template(file={'cn': './assets/cn/os/TEMPLATE_ExplorationContainer.png', 'en': './assets/en/os/TEMPLATE_ExplorationContainer.png', 'jp': './assets/jp/os/TEMPLATE_ExplorationContainer.png', 'tw': './assets/tw/os/TEMPLATE_ExplorationContainer.png'})
TEMPLATE_ExplorationReward = Template(file={'cn': './assets/cn/os/TEMPLATE_ExplorationReward.png', 'en': './assets/en/os/TEMPLATE_ExplorationReward.png', 'jp': './assets/jp/os/TEMPLATE_ExplorationReward.png', 'tw': './assets/tw/os/TEMPLATE_ExplorationReward.png'})
TEMPLATE_FleetMechanism = Template(file={'cn': './assets/cn/os/TEMPLATE_FleetMechanism.png', 'en': './assets/en/os/TEMPLATE_FleetMechanism.png', 'jp': './assets/jp/os/TEMPLATE_FleetMechanism.png', 'tw': './assets/tw/os/TEMPLATE_FleetMechanism.png'})
TEMPLATE_LoggingTower = Template(file={'cn': './assets/cn/os/TEMPLATE_LoggingTower.png', 'en': './assets/en/os/TEMPLATE_LoggingTower.png', 'jp': './assets/jp/os/TEMPLATE_LoggingTower.png', 'tw': './assets/tw/os/TEMPLATE_LoggingTower.png'})
Expand Down
16 changes: 16 additions & 0 deletions module/os/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,10 +785,26 @@ def map_rescan_current(self, drop=None):
Returns:
bool: If solved a map random event
"""
grids = self.view.select(is_exploration_container=True)
if 'is_exploration_container' not in self._solved_map_event \
and grids and grids[0].is_exploration_container:
grid = grids[0]
logger.info(f'Found exploration container on {grid}')
self.device.click(grid)
with self.config.temporary(STORY_ALLOW_SKIP=False, STORY_OPTION=1):
result = self.wait_until_walk_stable(
drop=drop, walk_out_of_step=False, confirm_timer=Timer(1.5, count=4))
if 'event' in result:
self._solved_map_event.add('is_exploration_container')
return True
else:
return False

grids = self.view.select(is_exploration_reward=True)
if 'is_exploration_reward' not in self._solved_map_event and grids and grids[0].is_exploration_reward:
grid = grids[0]
logger.info(f'Found exploration reward on {grid}')
self.device.click(grid)
result = self.wait_until_walk_stable(drop=drop, walk_out_of_step=False, confirm_timer=Timer(1.5, count=4))
if 'event' in result:
self._solved_map_event.add('is_exploration_reward')
Expand Down
7 changes: 5 additions & 2 deletions module/os/tasks/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ def end():
self.config.OpsiExplore_LastZone = zone
logger.info(f'Zone cleared: {self.name_to_zone(zone)}')
if finished_combat == 0:
logger.warning('Zone cleared but did not finish any combat')
self._os_explore_failed_zone.append(zone)
if 'is_exploration_container' in self._solved_map_event:
logger.info('Zone cleared by exploration container')
else:
logger.warning('Zone cleared but did not finish any combat')
self._os_explore_failed_zone.append(zone)
self.handle_after_auto_search()
self.config.check_task_switch()

Expand Down