HK: allow webgen

This commit is contained in:
Fabian Dill 2022-04-02 20:49:27 +02:00 committed by Hussein Farran
parent ed1c11267c
commit 97d0c51db1
2 changed files with 9 additions and 4 deletions

View File

@ -18,7 +18,7 @@ class Disabled(Toggle):
locations = {"option_" + start: i for i, start in enumerate(starts)}
# This way the dynamic start names are picked up by the MetaClass Choice belongs to
StartLocation = type("StartLocation", (Choice,), {"auto_display_name": False, **locations})
StartLocation = type("StartLocation", (Choice,), {"__module__": __name__, "auto_display_name": False, **locations})
del (locations)
default_on = {
@ -43,7 +43,7 @@ disabled = {
hollow_knight_randomize_options: typing.Dict[str, type(Option)] = {}
for option_name, option_data in pool_options.items():
extra_data = {"items": option_data[0], "locations": option_data[1]}
extra_data = {"__module__": __name__, "items": option_data[0], "locations": option_data[1]}
if option_name in disabled:
extra_data["__doc__"] = "Disabled Option. Not implemented."
option = type(option_name, (Disabled,), extra_data)
@ -51,7 +51,8 @@ for option_name, option_data in pool_options.items():
option = type(option_name, (DefaultOnToggle,), extra_data)
else:
option = type(option_name, (Toggle,), extra_data)
hollow_knight_randomize_options[option_name] = option
globals()[option.__name__] = option
hollow_knight_randomize_options[option.__name__] = option
hollow_knight_logic_options: typing.Dict[str, type(Option)] = {

View File

@ -77,6 +77,11 @@ white_palace_locations = {
class HKWorld(World):
"""Beneath the fading town of Dirtmouth sleeps a vast, ancient kingdom. Many are drawn beneath the surface,
searching for riches, or glory, or answers to old secrets.
As the enigmatic Knight, youll traverse the depths, unravel its mysteries and conquer its evils.
""" # from https://www.hollowknight.com
game: str = "Hollow Knight"
options = hollow_knight_options
@ -84,7 +89,6 @@ class HKWorld(World):
location_name_to_id = {location_name: location_id for location_id, location_name in
enumerate(locations, start=0x1000000)}
hidden = True
ranges: typing.Dict[str, typing.Tuple[int, int]]
shops = {"Egg_Shop": "egg", "Grubfather": "grub", "Seer": "essence", "Salubra_(Requires_Charms)": "charm"}
charm_costs: typing.List[int]