[HK] Further updates for White Palace logic, (#662)

This commit is contained in:
Daniel Grace 2022-06-25 11:15:03 -07:00 committed by GitHub
parent 17ba73b0b8
commit 8788ee1aa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 33 deletions

View File

@ -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"))