Shivers: Add events and fix require puzzle hints logic (#4018)

* Adds some events, renames things, fails for many players.

* Adds entrance rules for requires hints.

* Cleanup and add goal item.

* Cleanup.

* Add additional rule.

* Event and regions additions.

* Updates from merge.

* Adds collect behavior option.

* Fix missing generator location.

* Fix whitespace and optimize imports.

* Switch location order back.

* Add name replacement for storage.

* Fix test failure.

* Improve puzzle hints required.

* Add missing locations and cleanup indirect conditions.

* Fix naming.

* PR feedback.

* Missed comment.

* Cleanup imports, use strings for option equivalence, and update option description.

* Fix rule.

* Create rolling buffer goal items and remove goal items and location from default options.

* Cleanup.

* Removes dateutil.

* Fixes Subterranean World information plaque.
This commit is contained in:
Kory Dondzila
2024-12-27 15:07:55 -05:00
committed by GitHub
parent 218f28912e
commit 3bcc86f539
10 changed files with 783 additions and 461 deletions

View File

@@ -1,6 +1,11 @@
from Options import Choice, DefaultOnToggle, Toggle, PerGameCommonOptions, Range
from dataclasses import dataclass
from Options import (
Choice, DefaultOnToggle, ItemDict, ItemSet, LocationSet, OptionGroup, PerGameCommonOptions, Range, Toggle,
)
from . import ItemType, item_table
from .Constants import location_info
class IxupiCapturesNeeded(Range):
"""
@@ -11,12 +16,13 @@ class IxupiCapturesNeeded(Range):
range_end = 10
default = 10
class LobbyAccess(Choice):
"""
Chooses how keys needed to reach the lobby are placed.
- Normal: Keys are placed anywhere
- Early: Keys are placed early
- Local: Keys are placed locally
- Local: Keys are placed locally and early
"""
display_name = "Lobby Access"
option_normal = 0
@@ -24,16 +30,19 @@ class LobbyAccess(Choice):
option_local = 2
default = 1
class PuzzleHintsRequired(DefaultOnToggle):
"""
If turned on puzzle hints/solutions will be available before the corresponding puzzle is required.
For example: The Red Door puzzle will be logically required only after access to the Beth's Address Book which gives you the solution.
For example: The Red Door puzzle will be logically required only after obtaining access to Beth's Address Book
which gives you the solution.
Turning this off allows for greater randomization.
"""
display_name = "Puzzle Hints Required"
class InformationPlaques(Toggle):
"""
Adds Information Plaques as checks.
@@ -41,12 +50,14 @@ class InformationPlaques(Toggle):
"""
display_name = "Include Information Plaques"
class FrontDoorUsable(Toggle):
"""
Adds a key to unlock the front door of the museum.
"""
display_name = "Front Door Usable"
class ElevatorsStaySolved(DefaultOnToggle):
"""
Adds elevators as checks and will remain open upon solving them.
@@ -54,12 +65,15 @@ class ElevatorsStaySolved(DefaultOnToggle):
"""
display_name = "Elevators Stay Solved"
class EarlyBeth(DefaultOnToggle):
"""
Beth's body is open at the start of the game. This allows any pot piece to be placed in the slide and early checks on the second half of the final riddle.
Beth's body is open at the start of the game.
This allows any pot piece to be placed in the slide and early checks on the second half of the final riddle.
"""
display_name = "Early Beth"
class EarlyLightning(Toggle):
"""
Allows lightning to be captured at any point in the game. You will still need to capture all ten Ixupi for victory.
@@ -67,6 +81,7 @@ class EarlyLightning(Toggle):
"""
display_name = "Early Lightning"
class LocationPotPieces(Choice):
"""
Chooses where pot pieces will be located within the multiworld.
@@ -78,6 +93,8 @@ class LocationPotPieces(Choice):
option_own_world = 0
option_different_world = 1
option_any_world = 2
default = 2
class FullPots(Choice):
"""
@@ -107,6 +124,61 @@ class PuzzleCollectBehavior(Choice):
default = 1
# Need to override the default options to remove the goal items and goal locations so that they do not show on web.
valid_item_keys = [name for name, data in item_table.items() if data.type != ItemType.GOAL and data.code is not None]
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
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
valid_keys = valid_item_keys
class StartInventory(ItemDict):
"""Start with these items."""
verify_item_name = True
display_name = "Start Inventory"
rich_text_doc = True
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
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
valid_keys = valid_location_keys
class ExcludeLocations(LocationSet):
"""Prevent these locations from having an important item."""
display_name = "Excluded Locations"
rich_text_doc = True
valid_keys = valid_location_keys
class PriorityLocations(LocationSet):
"""Prevent these locations from having an unimportant item."""
display_name = "Priority Locations"
rich_text_doc = True
valid_keys = valid_location_keys
@dataclass
class ShiversOptions(PerGameCommonOptions):
ixupi_captures_needed: IxupiCapturesNeeded
@@ -120,3 +192,23 @@ 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
shivers_option_groups = [
OptionGroup("Item & Location Options", [
LocalItems,
NonLocalItems,
StartInventory,
StartHints,
StartLocationHints,
ExcludeLocations,
PriorityLocations
], True),
]