From aa080eb455ef6ad06cd396cd90b1e2d3fd63acaa Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Sat, 21 Dec 2019 13:33:07 +0100 Subject: [PATCH] Include unreachable items in the spoiler log --- BaseClasses.py | 4 ++++ Main.py | 1 + 2 files changed, 5 insertions(+) diff --git a/BaseClasses.py b/BaseClasses.py index 217ac5d8..1401b5ab 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -959,6 +959,7 @@ class Spoiler(object): self.entrances = OrderedDict() self.medallions = {} self.playthrough = {} + self.unreachables = [] self.locations = {} self.paths = {} 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\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()])) + 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') path_listings = [] diff --git a/Main.py b/Main.py index 03b17a40..5e609ed8 100644 --- a/Main.py +++ b/Main.py @@ -371,6 +371,7 @@ def create_playthrough(world): 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.') else: + old_world.spoiler.unreachables = sphere_candidates.copy() 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