Bug Squashing

This commit is contained in:
Fabian Dill
2022-04-01 03:23:52 +02:00
committed by Fabian Dill
parent 70e3c47120
commit 199b778d2b
11 changed files with 2510 additions and 1220 deletions

View File

@@ -1,13 +1,25 @@
# generated by https://github.com/Berserker66/HollowKnight.RandomizerMod/blob/master/extract_data.py
# do not edit manually
from .ExtractedData import region_names, exits, connectors
def create_regions(world, player: int):
from . import create_region
from .Items import item_table
from .Locations import lookup_name_to_id
world.regions += [
create_region(world, player, 'Menu', None, ['Hollow Nest S&Q']),
create_region(world, player, 'Hollow Nest', [location for location in lookup_name_to_id] +
[item_name for item_name, item_data in item_table.items() if item_data.type == "Event"])
]
from . import create_region, HKLocation, HKItem
world.regions.append(create_region(world, player, 'Menu', None, ['Hollow Nest S&Q']))
for region in region_names:
world.regions.append(create_region(world, player, region, [],
exits.get(region, [])))
for entrance_name, exit_name in connectors.items():
if exit_name:
target_region = world.get_entrance(exit_name, player).parent_region
world.get_entrance(entrance_name, player).connect(target_region)
if not entrance_name.endswith("_R"):
# a traversable entrance puts the name of the target door "into logic".
loc = HKLocation(player, exit_name, None, target_region)
loc.place_locked_item(HKItem(exit_name,
not exit_name.startswith("White_Palace_"),
None, "Event", player))
target_region.locations.append(loc)
else:
ent = world.get_entrance(entrance_name, player)
ent.parent_region.exits.remove(ent)