diff --git a/Main.py b/Main.py index 2f62bf79..f15c085e 100644 --- a/Main.py +++ b/Main.py @@ -289,7 +289,7 @@ def main(args, seed=None): location.item.code, False) precollected_hints[location.player].add(hint) precollected_hints[location.item.player].add(hint) - elif location.item.name in args.start_hints[location.item.player]: + elif location.item.name in world.start_hints[location.item.player]: hint = NetUtils.Hint(location.item.player, location.player, location.address, location.item.code, False, er_hint_data.get(location.player, {}).get(location.address, "")) diff --git a/Options.py b/Options.py index c2824197..fdb1b8a6 100644 --- a/Options.py +++ b/Options.py @@ -29,7 +29,9 @@ class AssembleOptions(type): def validate(self, *args, **kwargs): func(self, *args, **kwargs) self.value = self.schema.validate(self.value) + return validate + attrs["__init__"] = validate_decorator(attrs["__init__"]) return super(AssembleOptions, mcs).__new__(mcs, name, bases, attrs) @@ -241,9 +243,10 @@ class OptionNameSet(Option): class OptionDict(Option): default = {} supports_weighting = False + value: typing.Dict[str, typing.Any] def __init__(self, value: typing.Dict[str, typing.Any]): - self.value: typing.Dict[str, typing.Any] = value + self.value = value @classmethod def from_any(cls, data: typing.Dict[str, typing.Any]) -> OptionDict: @@ -255,8 +258,11 @@ class OptionDict(Option): def get_option_name(self, value): return ", ".join(f"{key}: {value}" for key, value in self.value.items()) + def __contains__(self, item): + return item in self.value -class OptionList(Option, list): + +class OptionList(Option): default = [] supports_weighting = False value: list @@ -278,8 +284,11 @@ class OptionList(Option, list): def get_option_name(self, value): return ", ".join(self.value) + def __contains__(self, item): + return item in self.value -class OptionSet(Option, set): + +class OptionSet(Option): default = frozenset() supports_weighting = False value: set @@ -303,6 +312,9 @@ class OptionSet(Option, set): def get_option_name(self, value): return ", ".join(self.value) + def __contains__(self, item): + return item in self.value + local_objective = Toggle # local triforce pieces, local dungeon prizes etc. diff --git a/worlds/alttp/EntranceRandomizer.py b/worlds/alttp/EntranceRandomizer.py index 74c1dee5..c5053335 100644 --- a/worlds/alttp/EntranceRandomizer.py +++ b/worlds/alttp/EntranceRandomizer.py @@ -4,12 +4,15 @@ import copy import textwrap import shlex +"""Legacy module, undergoing dismantling.""" + class ArgumentDefaultsHelpFormatter(argparse.RawTextHelpFormatter): def _get_help_string(self, action): return textwrap.dedent(action.help) + def parse_arguments(argv, no_defaults=False): def defval(value): return value if not no_defaults else None @@ -241,7 +244,6 @@ def parse_arguments(argv, no_defaults=False): parser.add_argument('--game', default="A Link to the Past") parser.add_argument('--race', default=defval(False), action='store_true') parser.add_argument('--outputname') - parser.add_argument('--start_hints') if multiargs.multi: for player in range(1, multiargs.multi + 1): parser.add_argument(f'--p{player}', default=defval(''), help=argparse.SUPPRESS) @@ -277,7 +279,7 @@ def parse_arguments(argv, no_defaults=False): 'sprite', "triforce_pieces_available", "triforce_pieces_required", "shop_shuffle", - "required_medallions", "start_hints", + "required_medallions", "plando_items", "plando_texts", "plando_connections", "er_seeds", 'dungeon_counters', 'shuffle_prizes', 'sprite_pool', 'dark_room_logic',