Shivers: Follow on PR to cleanup options #4401

This commit is contained in:
Kory Dondzila 2024-12-27 17:38:01 -05:00 committed by GitHub
parent 3bcc86f539
commit ca1b3df45b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 34 additions and 46 deletions

View File

@ -1,7 +1,8 @@
from dataclasses import dataclass from dataclasses import dataclass
from Options import ( from Options import (
Choice, DefaultOnToggle, ItemDict, ItemSet, LocationSet, OptionGroup, PerGameCommonOptions, Range, Toggle, Choice, DefaultOnToggle, ExcludeLocations, LocalItems, NonLocalItems, OptionGroup, PerGameCommonOptions,
PriorityLocations, Range, StartHints, StartInventory, StartLocationHints, Toggle,
) )
from . import ItemType, item_table from . import ItemType, item_table
from .Constants import location_info from .Constants import location_info
@ -129,53 +130,38 @@ valid_item_keys = [name for name, data in item_table.items() if data.type != Ite
valid_location_keys = [name for name in location_info["all_locations"] if name != "Mystery Solved"] valid_location_keys = [name for name in location_info["all_locations"] if name != "Mystery Solved"]
class LocalItems(ItemSet): class ShiversLocalItems(LocalItems):
"""Forces these items to be in their native world.""" __doc__ = LocalItems.__doc__
display_name = "Local Items"
rich_text_doc = True
valid_keys = valid_item_keys valid_keys = valid_item_keys
class NonLocalItems(ItemSet): class ShiversNonLocalItems(NonLocalItems):
"""Forces these items to be outside their native world.""" __doc__ = NonLocalItems.__doc__
display_name = "Non-local Items"
rich_text_doc = True
valid_keys = valid_item_keys valid_keys = valid_item_keys
class StartInventory(ItemDict): class ShiversStartInventory(StartInventory):
"""Start with these items.""" __doc__ = StartInventory.__doc__
verify_item_name = True
display_name = "Start Inventory"
rich_text_doc = True
valid_keys = valid_item_keys valid_keys = valid_item_keys
class StartHints(ItemSet): class ShiversStartHints(StartHints):
"""Start with these item's locations prefilled into the ``!hint`` command.""" __doc__ = StartHints.__doc__
display_name = "Start Hints"
rich_text_doc = True
valid_keys = valid_item_keys valid_keys = valid_item_keys
class StartLocationHints(LocationSet): class ShiversStartLocationHints(StartLocationHints):
"""Start with these locations and their item prefilled into the ``!hint`` command.""" __doc__ = StartLocationHints.__doc__
display_name = "Start Location Hints"
rich_text_doc = True
valid_keys = valid_location_keys valid_keys = valid_location_keys
class ExcludeLocations(LocationSet): class ShiversExcludeLocations(ExcludeLocations):
"""Prevent these locations from having an important item.""" __doc__ = ExcludeLocations.__doc__
display_name = "Excluded Locations"
rich_text_doc = True
valid_keys = valid_location_keys valid_keys = valid_location_keys
class PriorityLocations(LocationSet): class ShiversPriorityLocations(PriorityLocations):
"""Prevent these locations from having an unimportant item.""" __doc__ = PriorityLocations.__doc__
display_name = "Priority Locations"
rich_text_doc = True
valid_keys = valid_location_keys valid_keys = valid_location_keys
@ -192,23 +178,25 @@ class ShiversOptions(PerGameCommonOptions):
location_pot_pieces: LocationPotPieces location_pot_pieces: LocationPotPieces
full_pots: FullPots full_pots: FullPots
puzzle_collect_behavior: PuzzleCollectBehavior puzzle_collect_behavior: PuzzleCollectBehavior
local_items: LocalItems local_items: ShiversLocalItems
non_local_items: NonLocalItems non_local_items: ShiversNonLocalItems
start_inventory: StartInventory start_inventory: ShiversStartInventory
start_hints: StartHints start_hints: ShiversStartHints
start_location_hints: StartLocationHints start_location_hints: ShiversStartLocationHints
exclude_locations: ExcludeLocations exclude_locations: ShiversExcludeLocations
priority_locations: PriorityLocations priority_locations: ShiversPriorityLocations
shivers_option_groups = [ shivers_option_groups = [
OptionGroup("Item & Location Options", [ OptionGroup(
LocalItems, "Item & Location Options", [
NonLocalItems, ShiversLocalItems,
StartInventory, ShiversNonLocalItems,
StartHints, ShiversStartInventory,
StartLocationHints, ShiversStartHints,
ExcludeLocations, ShiversStartLocationHints,
PriorityLocations ShiversExcludeLocations,
], True), ShiversPriorityLocations
], True,
),
] ]