From 81cf1508e0c15d9ccafbbbbd352ce1e449c25f8f Mon Sep 17 00:00:00 2001 From: alwaysintreble Date: Mon, 15 Aug 2022 16:46:59 -0500 Subject: [PATCH] Core: Refactor Autoworld.options to Autoworld.option_definitions (#906) * refactor `world.options` -> `world.option_definitions` * rename world api reference * missed some self.options --- BaseClasses.py | 6 +++--- Generate.py | 4 ++-- WebHostLib/options.py | 2 +- docs/world api.md | 8 ++++---- test/dungeons/TestDungeon.py | 2 +- test/general/__init__.py | 2 +- test/inverted/TestInverted.py | 2 +- test/inverted/TestInvertedBombRules.py | 2 +- test/inverted_minor_glitches/TestInvertedMinor.py | 2 +- test/inverted_owg/TestInvertedOWG.py | 2 +- test/minor_glitches/TestMinor.py | 2 +- test/owg/TestVanillaOWG.py | 2 +- test/vanilla/TestVanilla.py | 2 +- worlds/AutoWorld.py | 2 +- worlds/alttp/__init__.py | 2 +- worlds/checksfinder/__init__.py | 2 +- worlds/dark_souls_3/__init__.py | 2 +- worlds/dkc3/__init__.py | 2 +- worlds/factorio/__init__.py | 2 +- worlds/ff1/__init__.py | 2 +- worlds/hk/__init__.py | 4 ++-- worlds/meritous/__init__.py | 2 +- worlds/minecraft/__init__.py | 2 +- worlds/oot/__init__.py | 2 +- worlds/oribf/__init__.py | 2 +- worlds/raft/__init__.py | 2 +- worlds/rogue_legacy/__init__.py | 2 +- worlds/ror2/__init__.py | 2 +- worlds/sa2b/__init__.py | 2 +- worlds/sc2wol/__init__.py | 2 +- worlds/sm/__init__.py | 4 ++-- worlds/sm64ex/__init__.py | 2 +- worlds/smz3/__init__.py | 2 +- worlds/soe/__init__.py | 6 +++--- worlds/spire/__init__.py | 2 +- worlds/subnautica/__init__.py | 2 +- worlds/timespinner/__init__.py | 2 +- worlds/v6/__init__.py | 2 +- worlds/witness/__init__.py | 2 +- 39 files changed, 49 insertions(+), 49 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index aa37a097a685..cea1d48e6f07 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -166,7 +166,7 @@ def add_group(self, name: str, game: str, players: Set[int] = frozenset()) -> Tu self.player_types[new_id] = NetUtils.SlotType.group self._region_cache[new_id] = {} world_type = AutoWorld.AutoWorldRegister.world_types[game] - for option_key, option in world_type.options.items(): + for option_key, option in world_type.option_definitions.items(): getattr(self, option_key)[new_id] = option(option.default) for option_key, option in Options.common_options.items(): getattr(self, option_key)[new_id] = option(option.default) @@ -204,7 +204,7 @@ def set_options(self, args): for player in self.player_ids: self.custom_data[player] = {} world_type = AutoWorld.AutoWorldRegister.world_types[self.game[player]] - for option_key in world_type.options: + for option_key in world_type.option_definitions: setattr(self, option_key, getattr(args, option_key, {})) self.worlds[player] = world_type(self, player) @@ -1388,7 +1388,7 @@ def write_option(option_key: str, option_obj: type(Options.Option)): outfile.write('Game: %s\n' % self.world.game[player]) for f_option, option in Options.per_game_common_options.items(): write_option(f_option, option) - options = self.world.worlds[player].options + options = self.world.worlds[player].option_definitions if options: for f_option, option in options.items(): write_option(f_option, option) diff --git a/Generate.py b/Generate.py index 70a8eaf66753..1cad83634513 100644 --- a/Generate.py +++ b/Generate.py @@ -396,7 +396,7 @@ def roll_meta_option(option_key, game: str, category_dict: Dict) -> Any: return get_choice(option_key, category_dict) if game in AutoWorldRegister.world_types: game_world = AutoWorldRegister.world_types[game] - options = ChainMap(game_world.options, Options.per_game_common_options) + options = ChainMap(game_world.option_definitions, Options.per_game_common_options) if option_key in options: if options[option_key].supports_weighting: return get_choice(option_key, category_dict) @@ -557,7 +557,7 @@ def roll_settings(weights: dict, plando_options: PlandoSettings = PlandoSettings setattr(ret, option_key, option.from_any(get_choice(option_key, weights, option.default))) if ret.game in AutoWorldRegister.world_types: - for option_key, option in world_type.options.items(): + for option_key, option in world_type.option_definitions.items(): handle_option(ret, game_weights, option_key, option) for option_key, option in Options.per_game_common_options.items(): # skip setting this option if already set from common_options, defaulting to root option diff --git a/WebHostLib/options.py b/WebHostLib/options.py index ccd1b27b3c48..3c481be62b7c 100644 --- a/WebHostLib/options.py +++ b/WebHostLib/options.py @@ -60,7 +60,7 @@ def default_converter(default_value): for game_name, world in AutoWorldRegister.world_types.items(): - all_options = {**Options.per_game_common_options, **world.options} + all_options = {**Options.per_game_common_options, **world.option_definitions} res = Template(open(os.path.join("WebHostLib", "templates", "options.yaml")).read()).render( options=all_options, __version__=__version__, game=game_name, yaml_dump=yaml.dump, diff --git a/docs/world api.md b/docs/world api.md index 4fa81f4aab27..ffc0749e8c6f 100644 --- a/docs/world api.md +++ b/docs/world api.md @@ -86,7 +86,7 @@ inside a World object. Players provide customized settings for their World in the form of yamls. Those are accessible through `self.world.[self.player]`. A dict -of valid options has to be provided in `self.options`. Options are automatically +of valid options has to be provided in `self.option_definitions`. Options are automatically added to the `World` object for easy access. ### World Options @@ -252,7 +252,7 @@ to describe it and a `display_name` property for display on the website and in spoiler logs. The actual name as used in the yaml is defined in a `dict[str, Option]`, that is -assigned to the world under `self.options`. +assigned to the world under `self.option_definitions`. Common option types are `Toggle`, `DefaultOnToggle`, `Choice`, `Range`. For more see `Options.py` in AP's base directory. @@ -328,7 +328,7 @@ from .Options import mygame_options # import the options dict class MyGameWorld(World): #... - options = mygame_options # assign the options dict to the world + option_definitions = mygame_options # assign the options dict to the world #... ``` @@ -365,7 +365,7 @@ class MyGameLocation(Location): # or from Locations import MyGameLocation class MyGameWorld(World): """Insert description of the world/game here.""" game: str = "My Game" # name of the game/world - options = mygame_options # options the player can set + option_definitions = mygame_options # options the player can set topology_present: bool = True # show path to required location checks in spoiler remote_items: bool = False # True if all items come from the server remote_start_inventory: bool = False # True if start inventory comes from the server diff --git a/test/dungeons/TestDungeon.py b/test/dungeons/TestDungeon.py index c44c090f6ffe..0568e799f259 100644 --- a/test/dungeons/TestDungeon.py +++ b/test/dungeons/TestDungeon.py @@ -16,7 +16,7 @@ class TestDungeon(unittest.TestCase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/general/__init__.py b/test/general/__init__.py index 8b966c0e34cd..479f4af520f0 100644 --- a/test/general/__init__.py +++ b/test/general/__init__.py @@ -12,7 +12,7 @@ def setup_default_world(world_type) -> MultiWorld: world.player_name = {1: "Tester"} world.set_seed() args = Namespace() - for name, option in world_type.options.items(): + for name, option in world_type.option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) world.set_options(args) world.set_default_common_options() diff --git a/test/inverted/TestInverted.py b/test/inverted/TestInverted.py index 586eb57907fd..0c96f0b26dbd 100644 --- a/test/inverted/TestInverted.py +++ b/test/inverted/TestInverted.py @@ -16,7 +16,7 @@ class TestInverted(TestBase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/inverted/TestInvertedBombRules.py b/test/inverted/TestInvertedBombRules.py index cca252e3e12b..f6afa9d0dc16 100644 --- a/test/inverted/TestInvertedBombRules.py +++ b/test/inverted/TestInvertedBombRules.py @@ -17,7 +17,7 @@ def setUp(self): self.world = MultiWorld(1) self.world.mode[1] = "inverted" args = Namespace - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/inverted_minor_glitches/TestInvertedMinor.py b/test/inverted_minor_glitches/TestInvertedMinor.py index d737f21a07a5..42e7c942d682 100644 --- a/test/inverted_minor_glitches/TestInvertedMinor.py +++ b/test/inverted_minor_glitches/TestInvertedMinor.py @@ -17,7 +17,7 @@ class TestInvertedMinor(TestBase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/inverted_owg/TestInvertedOWG.py b/test/inverted_owg/TestInvertedOWG.py index 7192fcb08b26..064dd9e08395 100644 --- a/test/inverted_owg/TestInvertedOWG.py +++ b/test/inverted_owg/TestInvertedOWG.py @@ -18,7 +18,7 @@ class TestInvertedOWG(TestBase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/minor_glitches/TestMinor.py b/test/minor_glitches/TestMinor.py index db77ee919c86..81c09cfb2789 100644 --- a/test/minor_glitches/TestMinor.py +++ b/test/minor_glitches/TestMinor.py @@ -17,7 +17,7 @@ class TestMinor(TestBase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/owg/TestVanillaOWG.py b/test/owg/TestVanillaOWG.py index 68b10732bb44..e5489117a71f 100644 --- a/test/owg/TestVanillaOWG.py +++ b/test/owg/TestVanillaOWG.py @@ -18,7 +18,7 @@ class TestVanillaOWG(TestBase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/test/vanilla/TestVanilla.py b/test/vanilla/TestVanilla.py index 4ffddc0747ff..e5ee73406aac 100644 --- a/test/vanilla/TestVanilla.py +++ b/test/vanilla/TestVanilla.py @@ -16,7 +16,7 @@ class TestVanilla(TestBase): def setUp(self): self.world = MultiWorld(1) args = Namespace() - for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].options.items(): + for name, option in AutoWorld.AutoWorldRegister.world_types["A Link to the Past"].option_definitions.items(): setattr(args, name, {1: option.from_any(option.default)}) self.world.set_options(args) self.world.set_default_common_options() diff --git a/worlds/AutoWorld.py b/worlds/AutoWorld.py index 5cc7d625905f..462108bb8f06 100644 --- a/worlds/AutoWorld.py +++ b/worlds/AutoWorld.py @@ -111,7 +111,7 @@ class World(metaclass=AutoWorldRegister): """A World object encompasses a game's Items, Locations, Rules and additional data or functionality required. A Game should have its own subclass of World in which it defines the required data structures.""" - options: Dict[str, Option[Any]] = {} # link your Options mapping + option_definitions: Dict[str, Option[Any]] = {} # link your Options mapping game: str # name the game topology_present: bool = False # indicate if world type has any meaningful layout/pathing diff --git a/worlds/alttp/__init__.py b/worlds/alttp/__init__.py index 8f39b606e47d..b43cfc29f453 100644 --- a/worlds/alttp/__init__.py +++ b/worlds/alttp/__init__.py @@ -110,7 +110,7 @@ class ALTTPWorld(World): Ganon! """ game: str = "A Link to the Past" - options = alttp_options + option_definitions = alttp_options topology_present = True item_name_groups = item_name_groups hint_blacklist = {"Triforce"} diff --git a/worlds/checksfinder/__init__.py b/worlds/checksfinder/__init__.py index d4a6f2aef34d..ec9091c3d2f0 100644 --- a/worlds/checksfinder/__init__.py +++ b/worlds/checksfinder/__init__.py @@ -27,7 +27,7 @@ class ChecksFinderWorld(World): with the mines! You win when you get all your items and beat the board! """ game: str = "ChecksFinder" - options = checksfinder_options + option_definitions = checksfinder_options topology_present = True web = ChecksFinderWeb() diff --git a/worlds/dark_souls_3/__init__.py b/worlds/dark_souls_3/__init__.py index 7245499e284c..1ded4203c55b 100644 --- a/worlds/dark_souls_3/__init__.py +++ b/worlds/dark_souls_3/__init__.py @@ -46,7 +46,7 @@ class DarkSouls3World(World): """ game: str = "Dark Souls III" - options = dark_souls_options + option_definitions = dark_souls_options topology_present: bool = True remote_items: bool = False remote_start_inventory: bool = False diff --git a/worlds/dkc3/__init__.py b/worlds/dkc3/__init__.py index 423693470dc6..f5b01ff723a6 100644 --- a/worlds/dkc3/__init__.py +++ b/worlds/dkc3/__init__.py @@ -38,7 +38,7 @@ class DKC3World(World): mystery of why Donkey Kong and Diddy disappeared while on vacation. """ game: str = "Donkey Kong Country 3" - options = dkc3_options + option_definitions = dkc3_options topology_present = False data_version = 1 #hint_blacklist = {LocationName.rocket_rush_flag} diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index 9dc1febcbaf2..26e761d4d376 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -193,7 +193,7 @@ def collect_item(self, state, item, remove=False): return super(Factorio, self).collect_item(state, item, remove) - options = factorio_options + option_definitions = factorio_options @classmethod def stage_write_spoiler(cls, world, spoiler_handle): diff --git a/worlds/ff1/__init__.py b/worlds/ff1/__init__.py index d5a8dd30aa81..0d731ace4beb 100644 --- a/worlds/ff1/__init__.py +++ b/worlds/ff1/__init__.py @@ -27,7 +27,7 @@ class FF1World(World): Part puzzle and part speed-run, it breathes new life into one of the most influential games ever made. """ - options = ff1_options + option_definitions = ff1_options game = "Final Fantasy" topology_present = False remote_items = True diff --git a/worlds/hk/__init__.py b/worlds/hk/__init__.py index 6869e14b67b5..1667ab81f79a 100644 --- a/worlds/hk/__init__.py +++ b/worlds/hk/__init__.py @@ -142,7 +142,7 @@ class HKWorld(World): As the enigmatic Knight, you’ll traverse the depths, unravel its mysteries and conquer its evils. """ # from https://www.hollowknight.com game: str = "Hollow Knight" - options = hollow_knight_options + option_definitions = hollow_knight_options web = HKWeb() @@ -435,7 +435,7 @@ def fill_slot_data(self): slot_data = {} options = slot_data["options"] = {} - for option_name in self.options: + for option_name in self.option_definitions: option = getattr(self.world, option_name)[self.player] try: optionvalue = int(option.value) diff --git a/worlds/meritous/__init__.py b/worlds/meritous/__init__.py index 3a98bfe562f6..d0d076da40fa 100644 --- a/worlds/meritous/__init__.py +++ b/worlds/meritous/__init__.py @@ -49,7 +49,7 @@ class MeritousWorld(World): # NOTE: Remember to change this before this game goes live required_client_version = (0, 2, 4) - options = meritous_options + option_definitions = meritous_options def __init__(self, world: MultiWorld, player: int): super(MeritousWorld, self).__init__(world, player) diff --git a/worlds/minecraft/__init__.py b/worlds/minecraft/__init__.py index e5dbe0b0cded..6e7addb2d063 100644 --- a/worlds/minecraft/__init__.py +++ b/worlds/minecraft/__init__.py @@ -58,7 +58,7 @@ class MinecraftWorld(World): victory! """ game: str = "Minecraft" - options = minecraft_options + option_definitions = minecraft_options topology_present = True web = MinecraftWebWorld() diff --git a/worlds/oot/__init__.py b/worlds/oot/__init__.py index b640578c16ee..fb90b04e777a 100644 --- a/worlds/oot/__init__.py +++ b/worlds/oot/__init__.py @@ -95,7 +95,7 @@ class OOTWorld(World): to rescue the Seven Sages, and then confront Ganondorf to save Hyrule! """ game: str = "Ocarina of Time" - options: dict = oot_options + option_definitions: dict = oot_options topology_present: bool = True item_name_to_id = {item_name: oot_data_to_ap_id(data, False) for item_name, data in item_table.items() if data[2] is not None} diff --git a/worlds/oribf/__init__.py b/worlds/oribf/__init__.py index 33f8d4b07e39..05d237659ca0 100644 --- a/worlds/oribf/__init__.py +++ b/worlds/oribf/__init__.py @@ -17,7 +17,7 @@ class OriBlindForest(World): item_name_to_id = item_table location_name_to_id = lookup_name_to_id - options = options + option_definitions = options hidden = True diff --git a/worlds/raft/__init__.py b/worlds/raft/__init__.py index cf4b7975e517..da4b58f24f52 100644 --- a/worlds/raft/__init__.py +++ b/worlds/raft/__init__.py @@ -37,7 +37,7 @@ class RaftWorld(World): lastItemId = max(filter(lambda val: val is not None, item_name_to_id.values())) location_name_to_id = locations_lookup_name_to_id - options = raft_options + option_definitions = raft_options data_version = 2 required_client_version = (0, 3, 4) diff --git a/worlds/rogue_legacy/__init__.py b/worlds/rogue_legacy/__init__.py index af8fa9a79131..ba58e133c16c 100644 --- a/worlds/rogue_legacy/__init__.py +++ b/worlds/rogue_legacy/__init__.py @@ -30,7 +30,7 @@ class LegacyWorld(World): But that's OK, because no one is perfect, and you don't have to be to succeed. """ game: str = "Rogue Legacy" - options = legacy_options + option_definitions = legacy_options topology_present = False data_version = 3 required_client_version = (0, 2, 3) diff --git a/worlds/ror2/__init__.py b/worlds/ror2/__init__.py index 1a7060786fa0..b1f3aa93071c 100644 --- a/worlds/ror2/__init__.py +++ b/worlds/ror2/__init__.py @@ -28,7 +28,7 @@ class RiskOfRainWorld(World): first crash landing. """ game: str = "Risk of Rain 2" - options = ror2_options + option_definitions = ror2_options topology_present = False item_name_to_id = item_table diff --git a/worlds/sa2b/__init__.py b/worlds/sa2b/__init__.py index ffff2a93ea49..84a38f221cfc 100644 --- a/worlds/sa2b/__init__.py +++ b/worlds/sa2b/__init__.py @@ -49,7 +49,7 @@ class SA2BWorld(World): Sonic Adventure 2 Battle is an action platforming game. Play as Sonic, Tails, Knuckles, Shadow, Rogue, and Eggman across 31 stages and prevent the destruction of the earth. """ game: str = "Sonic Adventure 2 Battle" - options = sa2b_options + option_definitions = sa2b_options topology_present = False data_version = 2 diff --git a/worlds/sc2wol/__init__.py b/worlds/sc2wol/__init__.py index 5d48c9c0f471..33522569d5b6 100644 --- a/worlds/sc2wol/__init__.py +++ b/worlds/sc2wol/__init__.py @@ -37,7 +37,7 @@ class SC2WoLWorld(World): item_name_to_id = {name: data.code for name, data in item_table.items()} location_name_to_id = {location.name: location.code for location in get_locations(None, None)} - options = sc2wol_options + option_definitions = sc2wol_options item_name_groups = item_name_groups locked_locations: typing.List[str] diff --git a/worlds/sm/__init__.py b/worlds/sm/__init__.py index 8954e2b5f7b3..5da1c40f7551 100644 --- a/worlds/sm/__init__.py +++ b/worlds/sm/__init__.py @@ -79,7 +79,7 @@ class SMWorld(World): game: str = "Super Metroid" topology_present = True data_version = 1 - options = sm_options + option_definitions = sm_options item_names: Set[str] = frozenset(items_lookup_name_to_id) location_names: Set[str] = frozenset(locations_lookup_name_to_id) item_name_to_id = items_lookup_name_to_id @@ -567,7 +567,7 @@ def modify_multidata(self, multidata: dict): def fill_slot_data(self): slot_data = {} if not self.world.is_race: - for option_name in self.options: + for option_name in self.option_definitions: option = getattr(self.world, option_name)[self.player] slot_data[option_name] = option.value diff --git a/worlds/sm64ex/__init__.py b/worlds/sm64ex/__init__.py index d40c60a163cc..e0f911fbd968 100644 --- a/worlds/sm64ex/__init__.py +++ b/worlds/sm64ex/__init__.py @@ -39,7 +39,7 @@ class SM64World(World): area_connections: typing.Dict[int, int] - options = sm64_options + option_definitions = sm64_options def generate_early(self): self.topology_present = self.world.AreaRandomizer[self.player].value diff --git a/worlds/smz3/__init__.py b/worlds/smz3/__init__.py index 2849567d3363..732a8b55486f 100644 --- a/worlds/smz3/__init__.py +++ b/worlds/smz3/__init__.py @@ -62,7 +62,7 @@ class SMZ3World(World): game: str = "SMZ3" topology_present = False data_version = 2 - options = smz3_options + option_definitions = smz3_options item_names: Set[str] = frozenset(TotalSMZ3Item.lookup_name_to_id) location_names: Set[str] item_name_to_id = TotalSMZ3Item.lookup_name_to_id diff --git a/worlds/soe/__init__.py b/worlds/soe/__init__.py index d708d6d7d3a3..f86fc48e930d 100644 --- a/worlds/soe/__init__.py +++ b/worlds/soe/__init__.py @@ -151,7 +151,7 @@ class SoEWorld(World): space station where the final boss must be defeated. """ game: str = "Secret of Evermore" - options = soe_options + option_definitions = soe_options topology_present = False remote_items = False data_version = 3 @@ -162,7 +162,7 @@ class SoEWorld(World): location_name_to_id, location_id_to_raw = _get_location_mapping() item_name_groups = _get_item_grouping() - trap_types = [name[12:] for name in options if name.startswith('trap_chance_')] + trap_types = [name[12:] for name in option_definitions if name.startswith('trap_chance_')] evermizer_seed: int connect_name: str @@ -339,7 +339,7 @@ def generate_output(self, output_directory: str): placement_file = out_base + '.txt' patch_file = out_base + '.apsoe' flags = 'l' # spoiler log - for option_name in self.options: + for option_name in self.option_definitions: option = getattr(self.world, option_name)[self.player] if hasattr(option, 'to_flag'): flags += option.to_flag() diff --git a/worlds/spire/__init__.py b/worlds/spire/__init__.py index 4d2917aab9c7..476afad8d9b4 100644 --- a/worlds/spire/__init__.py +++ b/worlds/spire/__init__.py @@ -27,7 +27,7 @@ class SpireWorld(World): immense power, and Slay the Spire! """ - options = spire_options + option_definitions = spire_options game = "Slay the Spire" topology_present = False data_version = 1 diff --git a/worlds/subnautica/__init__.py b/worlds/subnautica/__init__.py index 27e75eabadc3..6fa064d53a12 100644 --- a/worlds/subnautica/__init__.py +++ b/worlds/subnautica/__init__.py @@ -39,7 +39,7 @@ class SubnauticaWorld(World): item_name_to_id = {data["name"]: item_id for item_id, data in Items.item_table.items()} location_name_to_id = all_locations - options = Options.options + option_definitions = Options.options data_version = 5 required_client_version = (0, 3, 4) diff --git a/worlds/timespinner/__init__.py b/worlds/timespinner/__init__.py index d789e9ddef55..c8b94a276396 100644 --- a/worlds/timespinner/__init__.py +++ b/worlds/timespinner/__init__.py @@ -40,7 +40,7 @@ class TimespinnerWorld(World): Travel back in time to change fate itself. Join timekeeper Lunais on her quest for revenge against the empire that killed her family. """ - options = timespinner_options + option_definitions = timespinner_options game = "Timespinner" topology_present = True remote_items = False diff --git a/worlds/v6/__init__.py b/worlds/v6/__init__.py index 4959ddca1bd2..38690e5a00db 100644 --- a/worlds/v6/__init__.py +++ b/worlds/v6/__init__.py @@ -41,7 +41,7 @@ class V6World(World): music_map: typing.Dict[int,int] - options = v6_options + option_definitions = v6_options def create_regions(self): create_regions(self.world,self.player) diff --git a/worlds/witness/__init__.py b/worlds/witness/__init__.py index da6683b51ca9..19c9b97240f0 100644 --- a/worlds/witness/__init__.py +++ b/worlds/witness/__init__.py @@ -41,7 +41,7 @@ class WitnessWorld(World): static_locat = StaticWitnessLocations() static_items = StaticWitnessItems() web = WitnessWebWorld() - options = the_witness_options + option_definitions = the_witness_options item_name_to_id = { name: data.code for name, data in static_items.ALL_ITEM_TABLE.items()