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 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 .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"]
class LocalItems(ItemSet):
"""Forces these items to be in their native world."""
display_name = "Local Items"
rich_text_doc = True
class ShiversLocalItems(LocalItems):
__doc__ = LocalItems.__doc__
valid_keys = valid_item_keys
class NonLocalItems(ItemSet):
"""Forces these items to be outside their native world."""
display_name = "Non-local Items"
rich_text_doc = True
class ShiversNonLocalItems(NonLocalItems):
__doc__ = NonLocalItems.__doc__
valid_keys = valid_item_keys
class StartInventory(ItemDict):
"""Start with these items."""
verify_item_name = True
display_name = "Start Inventory"
rich_text_doc = True
class ShiversStartInventory(StartInventory):
__doc__ = StartInventory.__doc__
valid_keys = valid_item_keys
class StartHints(ItemSet):
"""Start with these item's locations prefilled into the ``!hint`` command."""
display_name = "Start Hints"
rich_text_doc = True
class ShiversStartHints(StartHints):
__doc__ = StartHints.__doc__
valid_keys = valid_item_keys
class StartLocationHints(LocationSet):
"""Start with these locations and their item prefilled into the ``!hint`` command."""
display_name = "Start Location Hints"
rich_text_doc = True
class ShiversStartLocationHints(StartLocationHints):
__doc__ = StartLocationHints.__doc__
valid_keys = valid_location_keys
class ExcludeLocations(LocationSet):
"""Prevent these locations from having an important item."""
display_name = "Excluded Locations"
rich_text_doc = True
class ShiversExcludeLocations(ExcludeLocations):
__doc__ = ExcludeLocations.__doc__
valid_keys = valid_location_keys
class PriorityLocations(LocationSet):
"""Prevent these locations from having an unimportant item."""
display_name = "Priority Locations"
rich_text_doc = True
class ShiversPriorityLocations(PriorityLocations):
__doc__ = PriorityLocations.__doc__
valid_keys = valid_location_keys
@ -192,23 +178,25 @@ class ShiversOptions(PerGameCommonOptions):
location_pot_pieces: LocationPotPieces
full_pots: FullPots
puzzle_collect_behavior: PuzzleCollectBehavior
local_items: LocalItems
non_local_items: NonLocalItems
start_inventory: StartInventory
start_hints: StartHints
start_location_hints: StartLocationHints
exclude_locations: ExcludeLocations
priority_locations: PriorityLocations
local_items: ShiversLocalItems
non_local_items: ShiversNonLocalItems
start_inventory: ShiversStartInventory
start_hints: ShiversStartHints
start_location_hints: ShiversStartLocationHints
exclude_locations: ShiversExcludeLocations
priority_locations: ShiversPriorityLocations
shivers_option_groups = [
OptionGroup("Item & Location Options", [
LocalItems,
NonLocalItems,
StartInventory,
StartHints,
StartLocationHints,
ExcludeLocations,
PriorityLocations
], True),
OptionGroup(
"Item & Location Options", [
ShiversLocalItems,
ShiversNonLocalItems,
ShiversStartInventory,
ShiversStartHints,
ShiversStartLocationHints,
ShiversExcludeLocations,
ShiversPriorityLocations
], True,
),
]