From 8788ee1aa72ab919e0c1a829c6aec14d0db0907d Mon Sep 17 00:00:00 2001 From: Daniel Grace Date: Sat, 25 Jun 2022 11:15:03 -0700 Subject: [PATCH] [HK] Further updates for White Palace logic, (#662) --- worlds/hk/__init__.py | 68 ++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/worlds/hk/__init__.py b/worlds/hk/__init__.py index 3402f81a..110010e9 100644 --- a/worlds/hk/__init__.py +++ b/worlds/hk/__init__.py @@ -165,35 +165,36 @@ class HKWorld(World): exclusions.update(path_of_pain_locations) if wp <= WhitePalace.option_kingfragment: exclusions.update(white_palace_checks) - if wp == WhitePalace.option_exclude and self.world.RandomizeCharms[self.player]: - # Ensure KF location is still reachable if charms are non-randomized - exclusions.update(white_palace_transitions) - exclusions.update(white_palace_events) + if wp == WhitePalace.option_exclude: exclusions.add("King_Fragment") + if self.world.RandomizeCharms[self.player]: + # If charms are randomized, this will be junk-filled -- so transitions and events are not progression + exclusions.update(white_palace_transitions) + exclusions.update(white_palace_events) return exclusions def create_regions(self): menu_region: Region = create_region(self.world, self.player, 'Menu') self.world.regions.append(menu_region) - wp_exclusions = self.white_palace_exclusions() + # wp_exclusions = self.white_palace_exclusions() # Link regions for event_name in event_names: - if event_name in wp_exclusions: - continue + #if event_name in wp_exclusions: + # continue loc = HKLocation(self.player, event_name, None, menu_region) loc.place_locked_item(HKItem(event_name, - event_name not in wp_exclusions, + True, #event_name not in wp_exclusions, None, "Event", self.player)) menu_region.locations.append(loc) for entry_transition, exit_transition in connectors.items(): - if entry_transition in wp_exclusions: - continue + #if entry_transition in wp_exclusions: + # continue if exit_transition: # if door logic fulfilled -> award vanilla target as event loc = HKLocation(self.player, entry_transition, None, menu_region) loc.place_locked_item(HKItem(exit_transition, - exit_transition not in wp_exclusions, + True, #exit_transition not in wp_exclusions, None, "Event", self.player)) menu_region.locations.append(loc) @@ -208,29 +209,30 @@ class HKWorld(World): wp_exclusions = self.white_palace_exclusions() for option_key, option in hollow_knight_randomize_options.items(): - if getattr(self.world, option_key)[self.player]: - for item_name, location_name in zip(option.items, option.locations): - if location_name in wp_exclusions: - continue - if item_name in geo_replace: - item_name = "Geo_Rock-Default" - item = self.create_item(item_name) - # self.create_location(location_name).place_locked_item(item) - if location_name == "Start": - self.world.push_precollected(item) + randomized = getattr(self.world, option_key)[self.player] + for item_name, location_name in zip(option.items, option.locations): + vanilla = not randomized + excluded = False + if item_name in geo_replace: + item_name = "Geo_Rock-Default" + item = self.create_item(item_name) + if location_name == "Start": + self.world.push_precollected(item) + continue + + location = self.create_location(location_name) + if not vanilla and location_name in wp_exclusions: + if location_name == 'King_Fragment': + excluded = True else: - self.create_location(location_name) - pool.append(item) - # elif option_key not in logicless_options: - else: - for item_name, location_name in zip(option.items, option.locations): - if location_name in wp_exclusions and location_name != 'King_Fragment': - continue - item = self.create_item(item_name) - if location_name == "Start": - self.world.push_precollected(item) - else: - self.create_location(location_name).place_locked_item(item) + vanilla = True + if excluded: + location.progress_type = LocationProgressType.EXCLUDED + if vanilla: + location.place_locked_item(item) + else: + pool.append(item) + for i in range(self.world.EggShopSlots[self.player].value): self.create_location("Egg_Shop") pool.append(self.create_item("Geo_Rock-Default"))