Include unreachable items in the spoiler log

This commit is contained in:
Bonta-kun 2019-12-21 13:33:07 +01:00
parent 4a16ba74e8
commit aa080eb455
2 changed files with 5 additions and 0 deletions

View File

@ -959,6 +959,7 @@ class Spoiler(object):
self.entrances = OrderedDict() self.entrances = OrderedDict()
self.medallions = {} self.medallions = {}
self.playthrough = {} self.playthrough = {}
self.unreachables = []
self.locations = {} self.locations = {}
self.paths = {} self.paths = {}
self.metadata = {} self.metadata = {}
@ -1134,6 +1135,9 @@ class Spoiler(object):
outfile.write('\n'.join("{} [{}]\n {}".format(shop['location'], shop['type'], "\n ".join(item for item in [shop.get('item_0', None), shop.get('item_1', None), shop.get('item_2', None)] if item)) for shop in self.shops)) outfile.write('\n'.join("{} [{}]\n {}".format(shop['location'], shop['type'], "\n ".join(item for item in [shop.get('item_0', None), shop.get('item_1', None), shop.get('item_2', None)] if item)) for shop in self.shops))
outfile.write('\n\nPlaythrough:\n\n') outfile.write('\n\nPlaythrough:\n\n')
outfile.write('\n'.join(['%s: {\n%s\n}' % (sphere_nr, '\n'.join([' %s: %s' % (location, item) for (location, item) in sphere.items()])) for (sphere_nr, sphere) in self.playthrough.items()])) outfile.write('\n'.join(['%s: {\n%s\n}' % (sphere_nr, '\n'.join([' %s: %s' % (location, item) for (location, item) in sphere.items()])) for (sphere_nr, sphere) in self.playthrough.items()]))
if self.unreachables:
outfile.write('\n\nUnreachable Items:\n\n')
outfile.write('\n'.join(['%s: %s' % (unreachable.item, unreachable) for unreachable in self.unreachables]))
outfile.write('\n\nPaths:\n\n') outfile.write('\n\nPaths:\n\n')
path_listings = [] path_listings = []

View File

@ -371,6 +371,7 @@ def create_playthrough(world):
if any([world.accessibility[location.item.player] != 'none' for location in sphere_candidates]): if any([world.accessibility[location.item.player] != 'none' for location in sphere_candidates]):
raise RuntimeError('Not all progression items reachable. Something went terribly wrong here.') raise RuntimeError('Not all progression items reachable. Something went terribly wrong here.')
else: else:
old_world.spoiler.unreachables = sphere_candidates.copy()
break break
# in the second phase, we cull each sphere such that the game is still beatable, reducing each range of influence to the bare minimum required inside it # in the second phase, we cull each sphere such that the game is still beatable, reducing each range of influence to the bare minimum required inside it