Skip to content

Commit

Permalink
The Witness: Local Laser Shuffle + Option Presets (ArchipelagoMW#2590)
Browse files Browse the repository at this point in the history

Co-authored-by: Exempt-Medic <[email protected]>
  • Loading branch information
2 people authored and Jouramie committed Feb 28, 2024
1 parent d872061 commit aa13ba6
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 9 deletions.
5 changes: 4 additions & 1 deletion worlds/witness/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ class ShuffleSymbols(DefaultOnToggle):
display_name = "Shuffle Symbols"


class ShuffleLasers(Toggle):
class ShuffleLasers(Choice):
"""If on, the 11 lasers are turned into items and will activate on their own upon receiving them.
Note: There is a visual bug that can occur with the Desert Laser. It does not affect gameplay - The Laser can still
be redirected as normal, for both applications of redirection."""
display_name = "Shuffle Lasers"
option_off = 0
option_local = 1
option_anywhere = 2


class ShuffleDoors(Choice):
Expand Down
34 changes: 26 additions & 8 deletions worlds/witness/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from BaseClasses import Region, Location, MultiWorld, Item, Entrance, Tutorial, CollectionState
from Options import PerGameCommonOptions, Toggle
from .presets import witness_option_presets
from .hints import get_always_hint_locations, get_always_hint_items, get_priority_hint_locations, \
get_priority_hint_items, make_hints, generate_joke_hints
from worlds.AutoWorld import World, WebWorld
Expand All @@ -31,6 +32,8 @@ class WitnessWebWorld(WebWorld):
["NewSoupVi", "Jarno"]
)]

options_presets = witness_option_presets


class WitnessWorld(World):
"""
Expand Down Expand Up @@ -102,14 +105,29 @@ def generate_early(self):

self.log_ids_to_hints = dict()

if not (self.options.shuffle_symbols or self.options.shuffle_doors or self.options.shuffle_lasers):
if self.multiworld.players == 1:
warning(f"{self.multiworld.get_player_name(self.player)}'s Witness world doesn't have any progression"
f" items. Please turn on Symbol Shuffle, Door Shuffle or Laser Shuffle if that doesn't"
f" seem right.")
else:
raise Exception(f"{self.multiworld.get_player_name(self.player)}'s Witness world doesn't have any"
f" progression items. Please turn on Symbol Shuffle, Door Shuffle or Laser Shuffle.")
interacts_with_multiworld = (
self.options.shuffle_symbols or
self.options.shuffle_doors or
self.options.shuffle_lasers == "anywhere"
)

has_progression = (
interacts_with_multiworld
or self.options.shuffle_lasers == "local"
or self.options.shuffle_boat
or self.options.early_caves == "add_to_pool"
)

if not has_progression and self.multiworld.players == 1:
warning(f"{self.multiworld.get_player_name(self.player)}'s Witness world doesn't have any progression"
f" items. Please turn on Symbol Shuffle, Door Shuffle or Laser Shuffle if that doesn't seem right.")
elif not interacts_with_multiworld and self.multiworld.players > 1:
raise Exception(f"{self.multiworld.get_player_name(self.player)}'s Witness world doesn't have enough"
f" progression items that can be placed in other players' worlds. Please turn on Symbol"
f" Shuffle, Door Shuffle or non-local Laser Shuffle.")

if self.options.shuffle_lasers == "local":
self.options.local_items.value |= self.item_name_groups["Lasers"]

def create_regions(self):
self.regio.create_regions(self, self.player_logic)
Expand Down
101 changes: 101 additions & 0 deletions worlds/witness/presets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
from typing import Any, Dict

from .options import *

witness_option_presets: Dict[str, Dict[str, Any]] = {
# Great for short syncs & scratching that "speedrun with light routing elements" itch.
"Short & Dense": {
"progression_balancing": 30,

"puzzle_randomization": PuzzleRandomization.option_sigma_normal,

"shuffle_symbols": False,
"shuffle_doors": ShuffleDoors.option_panels,
"door_groupings": DoorGroupings.option_off,
"shuffle_boat": True,
"shuffle_lasers": ShuffleLasers.option_local,

"disable_non_randomized_puzzles": True,
"shuffle_discarded_panels": False,
"shuffle_vault_boxes": False,
"shuffle_EPs": ShuffleEnvironmentalPuzzles.option_off,
"EP_difficulty": EnvironmentalPuzzlesDifficulty.option_normal,
"shuffle_postgame": False,

"victory_condition": VictoryCondition.option_mountain_box_short,
"mountain_lasers": 7,
"challenge_lasers": 11,

"early_caves": EarlyCaves.option_off,
"elevators_come_to_you": False,

"trap_percentage": TrapPercentage.default,
"puzzle_skip_amount": PuzzleSkipAmount.default,
"hint_amount": HintAmount.default,
"death_link": DeathLink.default,
},

# For relative beginners who want to move to the next step.
"Advanced, But Chill": {
"progression_balancing": 30,

"puzzle_randomization": PuzzleRandomization.option_sigma_normal,

"shuffle_symbols": True,
"shuffle_doors": ShuffleDoors.option_doors,
"door_groupings": DoorGroupings.option_regional,
"shuffle_boat": True,
"shuffle_lasers": ShuffleLasers.option_off,

"disable_non_randomized_puzzles": False,
"shuffle_discarded_panels": True,
"shuffle_vault_boxes": True,
"shuffle_EPs": ShuffleEnvironmentalPuzzles.option_obelisk_sides,
"EP_difficulty": EnvironmentalPuzzlesDifficulty.option_normal,
"shuffle_postgame": False,

"victory_condition": VictoryCondition.option_mountain_box_long,
"mountain_lasers": 6,
"challenge_lasers": 9,

"early_caves": EarlyCaves.option_off,
"elevators_come_to_you": False,

"trap_percentage": TrapPercentage.default,
"puzzle_skip_amount": 15,
"hint_amount": HintAmount.default,
"death_link": DeathLink.default,
},

# Allsanity but without the BS (no expert, no tedious EPs).
"Nice Allsanity": {
"progression_balancing": 50,

"puzzle_randomization": PuzzleRandomization.option_sigma_normal,

"shuffle_symbols": True,
"shuffle_doors": ShuffleDoors.option_mixed,
"door_groupings": DoorGroupings.option_off,
"shuffle_boat": True,
"shuffle_lasers": ShuffleLasers.option_anywhere,

"disable_non_randomized_puzzles": False,
"shuffle_discarded_panels": True,
"shuffle_vault_boxes": True,
"shuffle_EPs": ShuffleEnvironmentalPuzzles.option_individual,
"EP_difficulty": EnvironmentalPuzzlesDifficulty.option_normal,
"shuffle_postgame": False,

"victory_condition": VictoryCondition.option_challenge,
"mountain_lasers": 6,
"challenge_lasers": 9,

"early_caves": EarlyCaves.option_off,
"elevators_come_to_you": True,

"trap_percentage": TrapPercentage.default,
"puzzle_skip_amount": 15,
"hint_amount": HintAmount.default,
"death_link": DeathLink.default,
},
}

0 comments on commit aa13ba6

Please sign in to comment.