Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 8 additions & 0 deletions worlds/oot_soh/Enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -3868,3 +3868,11 @@ class KeyShuffleLocations(Enum):
GANONS_CASTLE = auto()
ANY_DUNGEON = auto()
OVERWORLD = auto()

class GanonsTrials(StrEnum):
FOREST_TRIAL = "Forest Trial"
FIRE_TRIAL = "Fire Trial"
WATER_TRIAL = "Water Trial"
SHADOW_TRIAL = "Shadow Trial"
SPIRIT_TRIAL = "Spirit Trial"
LIGHT_TRIAL = "Light Trial"
29 changes: 23 additions & 6 deletions worlds/oot_soh/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,27 @@ class RainbowBridgeSkullTokensRequired(Range):
range_end = 100
default = 50

# TODO This isn't a toggle in ship. It lets them choose to do a specific/random amount of trials also. There is also a toggle for preventing trials from being done until the player has the matching medallion
class SkipGanonsTrials(DefaultOnToggle):

class GanonsTrials(Choice):
"""
Sets the number of Ganon's Trials required to dispel the barrier.
Skip - No Trials are required and the barriar is already dispelled.
Set Number - Select a number of trials that will be required. It will be chosen randomly.
"""
Choose wether or not Ganon's Trials are completed from the start.
display_name = "Ganon's Trials"
option_skip = 0
option_set_number = 1
default = 0


class GanonsTrialsCount(Range):
"""
display_name = "Skip Ganon's Trials"
How Many of Ganon's Trials are required to dispel the barrier
"""
display_name = "Ganon's Trials Count"
range_start = 0
range_end = 6
default = 6


class TriforceHunt(Toggle):
Expand Down Expand Up @@ -1128,7 +1143,8 @@ class SohOptions(PerGameCommonOptions):
rainbow_bridge_dungeons_required: RainbowBridgeDungeonsRequired
rainbow_bridge_skull_tokens_required: RainbowBridgeSkullTokensRequired
rainbow_bridge_greg_modifier: RainbowBridgeGregModifier
skip_ganons_trials: SkipGanonsTrials
ganons_trials: GanonsTrials
ganons_trials_count: GanonsTrialsCount
triforce_hunt: TriforceHunt
triforce_hunt_pieces_total: TriforceHuntPiecesTotal
triforce_hunt_pieces_required_percentage: TriforceHuntPiecesRequiredPercentage
Expand Down Expand Up @@ -1242,7 +1258,8 @@ class SohOptions(PerGameCommonOptions):
RainbowBridgeDungeonsRequired,
RainbowBridgeSkullTokensRequired,
RainbowBridgeGregModifier,
SkipGanonsTrials,
GanonsTrials,
GanonsTrialsCount,
TriforceHunt,
TriforceHuntPiecesTotal,
TriforceHuntPiecesRequiredPercentage,
Expand Down
9 changes: 5 additions & 4 deletions worlds/oot_soh/Presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"lock_overworld_doors": Toggle.option_false,
"fortress_carpenters": FortressCarpenters.option_normal,
"rainbow_bridge": RainbowBridge.option_vanilla,
"skip_ganons_trials": SkipGanonsTrials.option_true,
"ganons_trials": GanonsTrials.option_set_number,
"ganons_trials_count": 6,
"shuffle_songs": ShuffleSongs.option_song_locations,
"shuffle_dungeon_rewards": ShuffleDungeonRewards.option_dungeons,
"maps_and_compasses": MapsAndCompasses.option_own_dungeon,
Expand All @@ -35,7 +36,7 @@
"zoras_fountain": ZorasFountain.option_closed_as_child,
"fortress_carpenters": FortressCarpenters.option_fast,
"rainbow_bridge": RainbowBridge.option_greg,
"skip_ganons_trials": SkipGanonsTrials.option_true,
"ganons_trials": GanonsTrials.option_skip,
"shuffle_tycoon_wallet": ShuffleTycoonWallet.option_true,
"shuffle_ocarinas": ShuffleOcarinas.option_true,
"shuffle_dungeon_rewards": ShuffleDungeonRewards.option_dungeons,
Expand Down Expand Up @@ -63,7 +64,7 @@
"zoras_fountain": ZorasFountain.option_closed_as_child,
"fortress_carpenters": FortressCarpenters.option_fast,
"rainbow_bridge": RainbowBridge.option_greg,
"skip_ganons_trials": SkipGanonsTrials.option_true,
"ganons_trials": GanonsTrials.option_skip,
"shuffle_songs": ShuffleSongs.option_dungeon_rewards,
"shuffle_skull_tokens": ShuffleTokens.option_all,
"shuffle_kokiri_sword": ShuffleKokiriSword.option_true,
Expand Down Expand Up @@ -103,7 +104,7 @@
"door_of_time": DoorOfTime.option_open,
"fortress_carpenters": FortressCarpenters.option_fast,
"rainbow_bridge": RainbowBridge.option_greg,
"skip_ganons_trials": SkipGanonsTrials.option_true,
"ganons_trials": GanonsTrials.option_skip,
"shuffle_songs": ShuffleSongs.option_dungeon_rewards,
"shuffle_skull_tokens": ShuffleTokens.option_all,
"shuffle_kokiri_sword": ShuffleKokiriSword.option_true,
Expand Down
3 changes: 2 additions & 1 deletion worlds/oot_soh/UniversalTracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def setup_options_from_slot_data(world: "SohWorld") -> None:
"rainbow_bridge_dungeons_required"]
world.options.rainbow_bridge_skull_tokens_required.value = world.passthrough[
"rainbow_bridge_skull_tokens_required"]
world.options.skip_ganons_trials.value = world.passthrough["skip_ganons_trials"]
world.options.ganons_trials.value = world.passthrough["ganons_trials"]
world.options.ganons_trials_count.value = world.passthrough.get("ganons_trials_count", 6)
world.options.triforce_hunt.value = world.passthrough["triforce_hunt"]
world.options.triforce_hunt_pieces_total.value = world.passthrough[
"triforce_hunt_pieces_total"]
Expand Down
10 changes: 9 additions & 1 deletion worlds/oot_soh/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(self, multiworld, player):
self.vanilla_progressive_skulltula_count: int = 0
self.randomized_progressive_skulltula_count: int = 0
self.pre_fill_pool = list[Items]()
self.ganons_trials = list[GanonsTrials]()

apworld_manifest = orjson.loads(pkgutil.get_data(
__name__, "archipelago.json").decode("utf-8"))
Expand Down Expand Up @@ -202,6 +203,11 @@ def generate_early(self) -> None:
"gerudo_training_ground_key_ring"]
self.options.ganons_castle_key_ring.value = self.passthrough["ganons_castle_key_ring"]

if self.options.ganons_trials == "set_number":
self.ganons_trials = [str(trial) for trial in GanonsTrials]
self.random.shuffle(self.ganons_trials)
self.ganons_trials = self.ganons_trials[:self.options.ganons_trials_count.value]

def create_regions(self) -> None:
create_regions_and_locations(self)
place_locked_items(self)
Expand Down Expand Up @@ -364,7 +370,9 @@ def fill_slot_data(self) -> dict[str, Any]:
"rainbow_bridge_dungeon_rewards_required": self.options.rainbow_bridge_dungeon_rewards_required.value,
"rainbow_bridge_dungeons_required": self.options.rainbow_bridge_dungeons_required.value,
"rainbow_bridge_skull_tokens_required": self.options.rainbow_bridge_skull_tokens_required.value,
"skip_ganons_trials": self.options.skip_ganons_trials.value,
"ganons_trials": self.options.ganons_trials.value,
"ganons_trials_count": self.options.ganons_trials_count.value,
"required_trials": self.ganons_trials,
"triforce_hunt": self.options.triforce_hunt.value,
"triforce_hunt_pieces_total": self.options.triforce_hunt_pieces_total.value,
"triforce_hunt_pieces_required": self.triforce_pieces_required,
Expand Down
19 changes: 12 additions & 7 deletions worlds/oot_soh/location_access/dungeons/ganons_castle.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ class LocalEvents(StrEnum):
GANONS_CASTLE_LIGHT_TRIAL_CLEARED = "Ganon's Castle Light Trial Cleared"


trial_mapping: dict[GanonsTrials: LocalEvents] = {
GanonsTrials.FOREST_TRIAL: LocalEvents.GANONS_CASTLE_FOREST_TRIAL_CLEARED,
GanonsTrials.FIRE_TRIAL: LocalEvents.GANONS_CASTLE_FIRE_TRIAL_CLEARED,
GanonsTrials.WATER_TRIAL: LocalEvents.GANONS_CASTLE_WATER_TRIAL_CLEARED,
GanonsTrials.SHADOW_TRIAL: LocalEvents.GANONS_CASTLE_SHADOW_TRIAL_CLEARED,
GanonsTrials.SPIRIT_TRIAL: LocalEvents.GANONS_CASTLE_SPIRIT_TRIAL_CLEARED,
GanonsTrials.LIGHT_TRIAL: LocalEvents.GANONS_CASTLE_LIGHT_TRIAL_CLEARED
}


def set_region_rules(world: "SohWorld") -> None:
# Ganon's Castle Entryway
# Connections
Expand Down Expand Up @@ -281,13 +291,8 @@ def set_region_rules(world: "SohWorld") -> None:
# Connections
connect_regions(Regions.GANONS_TOWER_ENTRYWAY, world, [
(Regions.GANONS_CASTLE_LOBBY, lambda bundle: True),
(Regions.GANONS_TOWER_FLOOR_1, lambda bundle: (((has_item(LocalEvents.GANONS_CASTLE_FOREST_TRIAL_CLEARED, bundle)) and
(has_item(LocalEvents.GANONS_CASTLE_FIRE_TRIAL_CLEARED, bundle)) and
(has_item(LocalEvents.GANONS_CASTLE_WATER_TRIAL_CLEARED, bundle)) and
(has_item(LocalEvents.GANONS_CASTLE_SHADOW_TRIAL_CLEARED, bundle)) and
(has_item(LocalEvents.GANONS_CASTLE_SPIRIT_TRIAL_CLEARED, bundle)) and
(has_item(LocalEvents.GANONS_CASTLE_LIGHT_TRIAL_CLEARED, bundle))) or
bool(world.options.skip_ganons_trials)))
(Regions.GANONS_TOWER_FLOOR_1, lambda bundle: world.options.ganons_trials == "skip"
or bundle[0].has_all([str(trial_mapping[trial]) for trial in world.ganons_trials], world.player))
])

# Ganon's Tower Floor 1
Expand Down
2 changes: 1 addition & 1 deletion worlds/oot_soh/test/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class TestAccessGBK(SohTestBase):
This was made to test for this issue https://github.com/aMannus/Archipelago/issues/241
"""
# fill in the options here, formatted like "shuffle_childs_wallet": False,
options = {"starting_age": 1, "skip_ganons_trials": True, "rainbow_bridge_greg_modifier": "reward",
options = {"starting_age": 1, "ganons_trials": "skip", "rainbow_bridge_greg_modifier": "reward",
"rainbow_bridge": "greg", "ganons_castle_boss_key_greg_modifier": "wildcard"}
# options not set here will be set to default
world: SohWorld
Expand Down