From 4e18f24f3bcdfaa77a6f86091613fe8ae4bbfcc7 Mon Sep 17 00:00:00 2001 From: espeon65536 Date: Sat, 11 Sep 2021 10:18:03 -0500 Subject: [PATCH] Add glitchless condition to ganon's castle junk fill --- worlds/oot/__init__.py | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/worlds/oot/__init__.py b/worlds/oot/__init__.py index 6aaf38bf..fad62f50 100644 --- a/worlds/oot/__init__.py +++ b/worlds/oot/__init__.py @@ -654,26 +654,28 @@ class OOTWorld(World): self.world.itempool.remove(item_to_place) # Exclude locations in Ganon's Castle proportional to the number of items required to make the bridge - if self.bridge == 'medallions': - ganon_junk_fill = self.bridge_medallions / 9 - elif self.bridge == 'stones': - ganon_junk_fill = self.bridge_stones / 9 - elif self.bridge == 'dungeons': - ganon_junk_fill = self.bridge_rewards / 9 - elif self.bridge == 'vanilla': - ganon_junk_fill = 2 / 9 - elif self.bridge == 'tokens': - ganon_junk_fill = self.bridge_tokens / 100 - elif self.bridge == 'open': - ganon_junk_fill = 0 - else: - raise Exception("Unexpected bridge setting") + # Check for dungeon ER later + if self.logic_rules == 'glitchless': + if self.bridge == 'medallions': + ganon_junk_fill = self.bridge_medallions / 9 + elif self.bridge == 'stones': + ganon_junk_fill = self.bridge_stones / 9 + elif self.bridge == 'dungeons': + ganon_junk_fill = self.bridge_rewards / 9 + elif self.bridge == 'vanilla': + ganon_junk_fill = 2 / 9 + elif self.bridge == 'tokens': + ganon_junk_fill = self.bridge_tokens / 100 + elif self.bridge == 'open': + ganon_junk_fill = 0 + else: + raise Exception("Unexpected bridge setting") - gc = next(filter(lambda dungeon: dungeon.name == 'Ganons Castle', self.dungeons)) - locations = [loc.name for region in gc.regions for loc in region.locations if loc.item is None] - junk_fill_locations = self.world.random.sample(locations, round(len(locations) * ganon_junk_fill)) - print(junk_fill_locations) - exclusion_rules(self.world, self.player, junk_fill_locations) + gc = next(filter(lambda dungeon: dungeon.name == 'Ganons Castle', self.dungeons)) + locations = [loc.name for region in gc.regions for loc in region.locations if loc.item is None] + junk_fill_locations = self.world.random.sample(locations, round(len(locations) * ganon_junk_fill)) + print(junk_fill_locations) + exclusion_rules(self.world, self.player, junk_fill_locations) # Locations which are not sendable must be converted to events # This includes all locations for which show_in_spoiler is false, and shuffled shop items.