From d3e148dcc6537588fc140d7f6c62bd08a80db66e Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Sun, 24 Dec 2023 17:28:34 -0800 Subject: [PATCH] Blasphemous: Use options_dataclass --- worlds/blasphemous/Options.py | 49 +++++++++++++++++----------------- worlds/blasphemous/__init__.py | 5 ++-- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/worlds/blasphemous/Options.py b/worlds/blasphemous/Options.py index 127a1dc776..d09e75337d 100644 --- a/worlds/blasphemous/Options.py +++ b/worlds/blasphemous/Options.py @@ -1,4 +1,5 @@ -from Options import Choice, Toggle, DefaultOnToggle, DeathLink, StartInventoryPool +from Options import Choice, Toggle, DefaultOnToggle, DeathLink, StartInventoryPool, PerGameCommonOptions +from dataclasses import dataclass import random @@ -163,26 +164,26 @@ class BlasphemousDeathLink(DeathLink): Note that Guilt Fragments will not appear when killed by Death Link.""" -blasphemous_options = { - "prie_dieu_warp": PrieDieuWarp, - "skip_cutscenes": SkipCutscenes, - "corpse_hints": CorpseHints, - "difficulty": Difficulty, - "penitence": Penitence, - "starting_location": StartingLocation, - "ending": Ending, - "skip_long_quests": SkipLongQuests, - "thorn_shuffle" : ThornShuffle, - "dash_shuffle": DashShuffle, - "wall_climb_shuffle": WallClimbShuffle, - "reliquary_shuffle": ReliquaryShuffle, - "boots_of_pleading": CustomItem1, - "purified_hand": CustomItem2, - "start_wheel": StartWheel, - "skill_randomizer": SkillRando, - "enemy_randomizer": EnemyRando, - "enemy_groups": EnemyGroups, - "enemy_scaling": EnemyScaling, - "death_link": BlasphemousDeathLink, - "start_inventory": StartInventoryPool -} \ No newline at end of file +@dataclass +class BlasphemousOptions(PerGameCommonOptions): + prie_dieu_warp: PrieDieuWarp + skip_cutscenes: SkipCutscenes + corpse_hints: CorpseHints + difficulty: Difficulty + penitence: Penitence + starting_location: StartingLocation + ending: Ending + skip_long_quests: SkipLongQuests + thorn_shuffle : ThornShuffle + dash_shuffle: DashShuffle + wall_climb_shuffle: WallClimbShuffle + reliquary_shuffle: ReliquaryShuffle + boots_of_pleading: CustomItem1 + purified_hand: CustomItem2 + start_wheel: StartWheel + skill_randomizer: SkillRando + enemy_randomizer: EnemyRando + enemy_groups: EnemyGroups + enemy_scaling: EnemyScaling + death_link: BlasphemousDeathLink + start_inventory: StartInventoryPool \ No newline at end of file diff --git a/worlds/blasphemous/__init__.py b/worlds/blasphemous/__init__.py index 0bbccac264..25eab02e5b 100644 --- a/worlds/blasphemous/__init__.py +++ b/worlds/blasphemous/__init__.py @@ -7,7 +7,7 @@ from .Locations import location_table from .Rooms import room_table, door_table from .Rules import rules from worlds.generic.Rules import set_rule, add_rule -from .Options import blasphemous_options +from .Options import BlasphemousOptions from .Vanilla import unrandomized_dict, junk_locations, thorn_set, skill_dict @@ -39,7 +39,8 @@ class BlasphemousWorld(World): location_name_to_game_id = {loc["name"]: loc["game_id"] for loc in location_table} item_name_groups = group_table - option_definitions = blasphemous_options + options = BlasphemousOptions + options_dataclass = BlasphemousOptions required_client_version = (0, 4, 2)