Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Witness: Allow setting the puzzle randomization seed yourself #4196

Merged
merged 6 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion worlds/witness/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class WitnessWorld(World):

def _get_slot_data(self) -> Dict[str, Any]:
return {
"seed": self.random.randrange(0, 1000000),
"seed": self.options.puzzle_randomization_seed.value,
"victory_location": int(self.player_logic.VICTORY_LOCATION, 16),
"panelhex_to_id": self.player_locations.CHECK_PANELHEX_TO_ID,
"item_id_to_door_hexes": static_witness_items.get_item_to_door_mappings(),
Expand Down
12 changes: 12 additions & 0 deletions worlds/witness/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,16 @@ class DeathLinkAmnesty(Range):
default = 1


class PuzzleRandomizationSeed(Range):
"""
Sigma Rando, which is the basis for all puzzle randomization in this randomizer, uses a seed from 1 to 9999999 for the puzzle randomization.
This option lets you set this seed yourself.
"""
range_start = 1
range_end = 9999999
default = "random"


@dataclass
class TheWitnessOptions(PerGameCommonOptions):
puzzle_randomization: PuzzleRandomization
Expand Down Expand Up @@ -435,6 +445,7 @@ class TheWitnessOptions(PerGameCommonOptions):
laser_hints: LaserHints
death_link: DeathLink
death_link_amnesty: DeathLinkAmnesty
puzzle_randomization_seed: PuzzleRandomizationSeed
shuffle_dog: ShuffleDog


Expand Down Expand Up @@ -483,6 +494,7 @@ class TheWitnessOptions(PerGameCommonOptions):
ElevatorsComeToYou,
DeathLink,
DeathLinkAmnesty,
PuzzleRandomizationSeed,
]),
OptionGroup("Silly Options", [
ShuffleDog,
Expand Down
2 changes: 1 addition & 1 deletion worlds/witness/player_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Defines progression, junk and event items for The Witness
"""
import copy
from typing import TYPE_CHECKING, Dict, List, Set, cast
from typing import TYPE_CHECKING, Dict, List, Set

from BaseClasses import Item, ItemClassification, MultiWorld

Expand Down
Loading