|
|
|
|
@@ -2,6 +2,7 @@ import collections
|
|
|
|
|
import logging
|
|
|
|
|
from typing import Iterator, Set
|
|
|
|
|
|
|
|
|
|
from Options import ItemsAccessibility
|
|
|
|
|
from worlds.alttp import OverworldGlitchRules
|
|
|
|
|
from BaseClasses import MultiWorld, Entrance
|
|
|
|
|
from worlds.alttp.Items import ItemFactory, progression_items, item_name_groups, item_table
|
|
|
|
|
@@ -33,7 +34,7 @@ def set_rules(world):
|
|
|
|
|
else:
|
|
|
|
|
# Set access rules according to max glitches for multiworld progression.
|
|
|
|
|
# Set accessibility to none, and shuffle assuming the no logic players can always win
|
|
|
|
|
world.accessibility[player] = world.accessibility[player].from_text("minimal")
|
|
|
|
|
world.accessibility[player].value = ItemsAccessibility.option_minimal
|
|
|
|
|
world.progression_balancing[player].value = 0
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
@@ -265,14 +266,14 @@ def global_rules(world, player):
|
|
|
|
|
set_rule(world.get_entrance('Tower of Hera Big Key Door', player), lambda state: state.has('Big Key (Tower of Hera)', player))
|
|
|
|
|
set_rule(world.get_location('Tower of Hera - Big Chest', player), lambda state: state.has('Big Key (Tower of Hera)', player))
|
|
|
|
|
set_rule(world.get_location('Tower of Hera - Big Key Chest', player), lambda state: state.has_fire_source(player))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Tower of Hera - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Tower of Hera)' and item.player == player)
|
|
|
|
|
|
|
|
|
|
set_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
|
|
|
|
|
set_rule(world.get_entrance('Swamp Palace Small Key Door', player), lambda state: state._lttp_has_key('Small Key (Swamp Palace)', player))
|
|
|
|
|
set_rule(world.get_entrance('Swamp Palace (Center)', player), lambda state: state.has('Hammer', player))
|
|
|
|
|
set_rule(world.get_location('Swamp Palace - Big Chest', player), lambda state: state.has('Big Key (Swamp Palace)', player) or item_name(state, 'Swamp Palace - Big Chest', player) == ('Big Key (Swamp Palace)', player))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Swamp Palace - Big Chest', player), lambda state, item: item.name == 'Big Key (Swamp Palace)' and item.player == player)
|
|
|
|
|
set_rule(world.get_entrance('Swamp Palace (North)', player), lambda state: state.has('Hookshot', player))
|
|
|
|
|
if not world.smallkey_shuffle[player] and world.logic[player] not in ['hybridglitches', 'nologic']:
|
|
|
|
|
@@ -281,7 +282,7 @@ def global_rules(world, player):
|
|
|
|
|
set_rule(world.get_entrance('Thieves Town Big Key Door', player), lambda state: state.has('Big Key (Thieves Town)', player))
|
|
|
|
|
set_rule(world.get_entrance('Blind Fight', player), lambda state: state._lttp_has_key('Small Key (Thieves Town)', player))
|
|
|
|
|
set_rule(world.get_location('Thieves\' Town - Big Chest', player), lambda state: (state._lttp_has_key('Small Key (Thieves Town)', player) or item_name(state, 'Thieves\' Town - Big Chest', player) == ('Small Key (Thieves Town)', player)) and state.has('Hammer', player))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Thieves\' Town - Big Chest', player), lambda state, item: item.name == 'Small Key (Thieves Town)' and item.player == player and state.has('Hammer', player))
|
|
|
|
|
set_rule(world.get_location('Thieves\' Town - Attic', player), lambda state: state._lttp_has_key('Small Key (Thieves Town)', player))
|
|
|
|
|
|
|
|
|
|
@@ -290,7 +291,7 @@ def global_rules(world, player):
|
|
|
|
|
set_rule(world.get_entrance('Skull Woods First Section West Door', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 2)) # ideally would only be one key, but we may have spent thst key already on escaping the right section
|
|
|
|
|
set_rule(world.get_entrance('Skull Woods First Section (Left) Door to Exit', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 2))
|
|
|
|
|
set_rule(world.get_location('Skull Woods - Big Chest', player), lambda state: state.has('Big Key (Skull Woods)', player) or item_name(state, 'Skull Woods - Big Chest', player) == ('Big Key (Skull Woods)', player))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Skull Woods - Big Chest', player), lambda state, item: item.name == 'Big Key (Skull Woods)' and item.player == player)
|
|
|
|
|
set_rule(world.get_entrance('Skull Woods Torch Room', player), lambda state: state._lttp_has_key('Small Key (Skull Woods)', player, 3) and state.has('Fire Rod', player) and state.has_sword(player)) # sword required for curtain
|
|
|
|
|
|
|
|
|
|
@@ -344,12 +345,12 @@ def global_rules(world, player):
|
|
|
|
|
|
|
|
|
|
set_rule(world.get_entrance('Palace of Darkness Big Key Chest Staircase', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6) or (
|
|
|
|
|
item_name(state, 'Palace of Darkness - Big Key Chest', player) in [('Small Key (Palace of Darkness)', player)] and state._lttp_has_key('Small Key (Palace of Darkness)', player, 3)))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Palace of Darkness - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Palace of Darkness)' and item.player == player and state._lttp_has_key('Small Key (Palace of Darkness)', player, 5))
|
|
|
|
|
|
|
|
|
|
set_rule(world.get_entrance('Palace of Darkness Spike Statue Room Door', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6) or (
|
|
|
|
|
item_name(state, 'Palace of Darkness - Harmless Hellway', player) in [('Small Key (Palace of Darkness)', player)] and state._lttp_has_key('Small Key (Palace of Darkness)', player, 4)))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Palace of Darkness - Harmless Hellway', player), lambda state, item: item.name == 'Small Key (Palace of Darkness)' and item.player == player and state._lttp_has_key('Small Key (Palace of Darkness)', player, 5))
|
|
|
|
|
|
|
|
|
|
set_rule(world.get_entrance('Palace of Darkness Maze Door', player), lambda state: state._lttp_has_key('Small Key (Palace of Darkness)', player, 6))
|
|
|
|
|
@@ -363,7 +364,7 @@ def global_rules(world, player):
|
|
|
|
|
set_rule(world.get_entrance('Ganons Tower (Hookshot Room)', player), lambda state: state.has('Hammer', player) and (state.has('Hookshot', player) or state.has('Pegasus Boots', player)))
|
|
|
|
|
set_rule(world.get_entrance('Ganons Tower (Map Room)', player), lambda state: state._lttp_has_key('Small Key (Ganons Tower)', player, 4) or (
|
|
|
|
|
item_name(state, 'Ganons Tower - Map Chest', player) in [('Big Key (Ganons Tower)', player), ('Small Key (Ganons Tower)', player)] and state._lttp_has_key('Small Key (Ganons Tower)', player, 3)))
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Ganons Tower - Map Chest', player), lambda state, item: item.name == 'Small Key (Ganons Tower)' and item.player == player and state._lttp_has_key('Small Key (Ganons Tower)', player, 3) and state.can_reach('Ganons Tower (Hookshot Room)', 'region', player))
|
|
|
|
|
|
|
|
|
|
# It is possible to need more than 2 keys to get through this entrance if you spend keys elsewhere. We reflect this in the chest requirements.
|
|
|
|
|
@@ -938,7 +939,7 @@ def set_trock_key_rules(world, player):
|
|
|
|
|
if not can_reach_big_chest:
|
|
|
|
|
# Must not go in the Chain Chomps chest - only 2 other chests available and 3+ keys required for all other chests
|
|
|
|
|
forbid_item(world.get_location('Turtle Rock - Chain Chomps', player), 'Big Key (Turtle Rock)', player)
|
|
|
|
|
if world.accessibility[player] == 'locations' and world.goal[player] != 'icerodhunt':
|
|
|
|
|
if world.accessibility[player] == 'full' and world.goal[player] != 'icerodhunt':
|
|
|
|
|
if world.bigkey_shuffle[player] and can_reach_big_chest:
|
|
|
|
|
# Must not go in the dungeon - all 3 available chests (Chomps, Big Chest, Crystaroller) must be keys to access laser bridge, and the big key is required first
|
|
|
|
|
for location in ['Turtle Rock - Chain Chomps', 'Turtle Rock - Compass Chest',
|
|
|
|
|
@@ -952,7 +953,7 @@ def set_trock_key_rules(world, player):
|
|
|
|
|
location.event = True
|
|
|
|
|
toss_junk_item(world, player)
|
|
|
|
|
|
|
|
|
|
if world.accessibility[player] != 'locations':
|
|
|
|
|
if world.accessibility[player] != 'full':
|
|
|
|
|
set_always_allow(world.get_location('Turtle Rock - Big Key Chest', player), lambda state, item: item.name == 'Small Key (Turtle Rock)' and item.player == player
|
|
|
|
|
and state.can_reach(state.multiworld.get_region('Turtle Rock (Second Section)', player)))
|
|
|
|
|
|
|
|
|
|
|