Spirals for Swamp

Swamp Logic
Door definition cleanup
Stabs at Swamp events and Crystal Switches
This commit is contained in:
aerinon
2019-10-11 16:53:46 -06:00
parent d7b5a513bf
commit a0fdb25b43
13 changed files with 691 additions and 544 deletions

View File

@@ -863,21 +863,28 @@ pol_inc = {
'Neg': lambda x: x - 1,
}
@unique
class CrystalBarrier(Enum):
Null = 1 # no special requirement
Blue = 2 # blue must be down and explore state set to Blue
Orange = 3 # orange must be down and explore state set to Orange
Either = 4 # you choose to leave this room in Either state
class Door(object):
def __init__(self, player, name, type, direction, roomIndex, doorIndex, layer, toggle=False):
def __init__(self, player, name, type):
self.player = player
self.name = name
self.type = type
self.direction = direction
self.direction = None
# rom properties
self.roomIndex = roomIndex
self.roomIndex = -1
# 0,1,2 + Direction (N:0, W:3, S:6, E:9) for normal
# 0-4 for spiral offset thing
self.doorIndex = doorIndex
self.layer = layer # 0 for normal floor, 1 for the inset layer
self.toggle = toggle
self.doorIndex = -1
self.layer = -1 # 0 for normal floor, 1 for the inset layer
self.toggle = False
self.trapFlag = 0x0
self.quadrant = 2
self.shiftX = 78
@@ -893,6 +900,8 @@ class Door(object):
self.smallKey = False # There's a small key door on this side
self.bigKey = False # There's a big key door on this side
self.ugly = False # Indicates that it can't be seen from the front (e.g. back of a big key door)
self.crystal = CrystalBarrier.Null # How your crystal state changes if you use this door
self.req_event = None # if a dungeon event is required for this door - swamp palace mostly
def getAddress(self):
if self.type == DoorType.Normal:
@@ -951,6 +960,18 @@ class Door(object):
self.doorListPos = pos
return self
def event(self, event):
self.req_event = event
return self
def barrier(self, crystal):
self.crystal = crystal
return self
def c_switch(self):
self.crystal = CrystalBarrier.Either
return self
def __str__(self):
return str(self.__unicode__())

View File

@@ -4,10 +4,10 @@ import logging
import operator as op
from functools import reduce
from BaseClasses import RegionType, DoorType, Direction, Sector, pol_idx
from BaseClasses import RegionType, DoorType, Direction, Sector, CrystalBarrier, pol_idx
from Dungeons import hyrule_castle_regions, eastern_regions, desert_regions, hera_regions, tower_regions, pod_regions
from Dungeons import dungeon_regions, region_starts, split_region_starts
from Regions import key_only_locations
from Regions import key_only_locations, dungeon_events
from RoomData import DoorKind, PairedDoor
@@ -962,6 +962,7 @@ class KeyDoorState(object):
self.avail_doors = []
self.small_doors = []
self.big_doors = []
self.event_doors = []
self.opened_doors = []
self.big_key_opened = False
self.big_key_special = False
@@ -971,6 +972,8 @@ class KeyDoorState(object):
self.used_locations = 0
self.key_locations = 0
self.used_smalls = 0
self.events = set()
self.crystal = CrystalBarrier.Orange
def copy(self):
ret = KeyDoorState()
@@ -985,6 +988,8 @@ class KeyDoorState(object):
ret.key_locations = self.key_locations
ret.used_locations = self.used_locations
ret.used_smalls = self.used_smalls
ret.events = set(self.events)
ret.crystal = self.crystal
return ret
@@ -996,87 +1001,161 @@ def validate_key_layout(sector, start_regions, key_door_proposal, world, player)
state.big_key_special = world.get_region('Hyrule Dungeon Cellblock', player) in sector.regions
# Everything in a start region is in key region 0.
for region in start_regions:
state.visited_regions.add(region)
state.ttl_locations += len(region.locations)
for location in region.locations:
if location.name in key_only_locations:
state.key_locations += 1
add_doors_to_lists(region, flat_proposal, state, world, player)
return validate_key_layout_r(state, flat_proposal, world, player)
visit_region(state, region)
count_locations(state, region)
add_doors_to_lists(region, flat_proposal, state, state.crystal, world, player)
checked_states = set()
return validate_key_layout_r(state, flat_proposal, checked_states, world, player)
def validate_key_layout_r(state, flat_proposal, world, player):
def visit_region(state, region):
if state.crystal == CrystalBarrier.Either:
state.visited_regions.add((region, CrystalBarrier.Orange))
state.visited_regions.add((region, CrystalBarrier.Blue))
else:
state.visited_regions.add((region, state.crystal))
for location in region.locations:
if location.name in dungeon_events and location.name not in state.events:
state.events.add(location.name)
queue = collections.deque(state.event_doors)
while len(queue) > 0:
door, crystal = queue.pop()
if door.req_event == location.name:
state.avail_doors.append((door, crystal))
state.event_doors.remove((door, crystal))
if region.name == 'Hyrule Dungeon Cellblock' and not state.big_key_opened:
state.big_key_opened = True
state.avail_doors.extend(state.big_doors)
state.big_doors.clear()
def count_locations(state, region):
for location in region.locations:
if location.name in key_only_locations:
state.key_locations += 1
if location.name not in dungeon_events and '- Prize' not in location.name:
state.ttl_locations += 1
def is_region_visited(state, region):
if state.crystal == CrystalBarrier.Either:
return (region, CrystalBarrier.Blue) in state.visited_regions and (region, CrystalBarrier.Orange) in state.visited_regions
else:
return (region, state.crystal) in state.visited_regions
def validate_key_layout_r(state, flat_proposal, checked_states, world, player):
# improvements: remove recursion to make this iterative
# store a cache of various states of opened door to increase speed of checks - many are repetitive
while len(state.avail_doors) > 0:
door = state.avail_doors.pop()
door, crystal_state = state.avail_doors.pop()
connect_region = world.get_entrance(door.name, player).connected_region
if not door.blocked and connect_region not in state.visited_regions:
state.visited_regions.add(connect_region)
state.ttl_locations += len([x for x in connect_region.locations if '- Prize' not in x.name])
for location in connect_region.locations:
if location.name in key_only_locations:
state.key_locations += 1
if connect_region.name == 'Hyrule Dungeon Cellblock':
state.big_key_opened = True
state.avail_doors.extend(state.big_doors)
state.big_doors.clear()
add_doors_to_lists(connect_region, flat_proposal, state, world, player)
if len(state.avail_doors) == 0:
num_smalls = 0
for small in state.small_doors:
if small.dest in state.small_doors:
num_smalls += 0.5 # half now, half with the dest
else:
num_smalls += 1
num_bigs = 1 if len(state.big_doors) > 0 else 0 # all or nothing
if num_smalls == 0 and num_bigs == 0:
return True # I think that's the end
available_small_locations = min(state.ttl_locations - state.used_locations, state.key_locations - state.used_smalls)
available_big_locations = state.ttl_locations - state.used_locations if not state.big_key_special else 0
valid = True
if (num_smalls == 0 or available_small_locations == 0) and (state.big_key_opened or num_bigs == 0 or available_big_locations == 0):
return False
else:
if num_smalls > 0 and available_small_locations > 0:
for d in state.small_doors:
state_copy = state.copy()
state_copy.opened_doors.append(d)
state_copy.avail_doors.append(d)
state_copy.small_doors.remove(d)
if d.dest in flat_proposal:
state_copy.opened_doors.append(d.dest)
if d.dest in state_copy.small_doors:
state_copy.small_doors.remove(d.dest)
state_copy.avail_doors.append(d.dest)
state_copy.used_locations += 1
state_copy.used_smalls += 1
valid = validate_key_layout_r(state_copy, flat_proposal, world, player)
if not valid:
return valid
if not state.big_key_opened and available_big_locations >= num_bigs > 0:
state_copy = state.copy()
state_copy.big_key_opened = True
state_copy.used_locations += 1
state_copy.avail_doors.extend(state.big_doors)
state_copy.big_doors.clear()
valid = validate_key_layout_r(state_copy, flat_proposal, world, player)
return valid
return len(state.small_doors) == 0 and len(state.big_doors) == 0
if can_traverse(crystal_state, door) and not is_region_visited(state, connect_region):
visit_region(state, connect_region)
count_locations(state, connect_region)
if door.crystal != CrystalBarrier.Null:
crystal_state = door.crystal
add_doors_to_lists(connect_region, flat_proposal, state, crystal_state, world, player)
smalls_avail = len(state.small_doors) > 0
num_bigs = 1 if len(state.big_doors) > 0 else 0 # all or nothing
if not smalls_avail and num_bigs == 0:
return True # I think that's the end
available_small_locations = min(state.ttl_locations - state.used_locations, state.key_locations - state.used_smalls)
available_big_locations = state.ttl_locations - state.used_locations if not state.big_key_special else 0
valid = True
if (not smalls_avail or available_small_locations == 0) and (state.big_key_opened or num_bigs == 0 or available_big_locations == 0):
return False
else:
if smalls_avail and available_small_locations > 0:
for d, crystal_sd in state.small_doors:
state_copy = state.copy()
state_copy.opened_doors.append(d)
state_copy.avail_doors.append((d, crystal_sd))
state_copy.small_doors.remove((d, crystal_sd))
if d.dest in flat_proposal:
state_copy.opened_doors.append(d.dest)
if in_door_list(d.dest, state_copy.small_doors):
state_copy.small_doors[:] = [x for x in state_copy.small_doors if x[0] != d.dest]
state_copy.avail_doors.append((d.dest, crystal_sd))
state_copy.used_locations += 1
state_copy.used_smalls += 1
code = state_id(state_copy, flat_proposal)
if code not in checked_states:
valid = validate_key_layout_r(state_copy, flat_proposal, checked_states, world, player)
if valid:
checked_states.add(code)
if not valid:
return valid
if not state.big_key_opened and available_big_locations >= num_bigs > 0:
state_copy = state.copy()
state_copy.big_key_opened = True
state_copy.used_locations += 1
state_copy.avail_doors.extend(state.big_doors)
state_copy.big_doors.clear()
code = state_id(state_copy, flat_proposal)
if code not in checked_states:
valid = validate_key_layout_r(state_copy, flat_proposal, checked_states, world, player)
if valid:
checked_states.add(code)
return valid
def add_doors_to_lists(region, key_door_proposal, kd_state, world, player):
def can_traverse(crystal, door):
if door.blocked:
return False
if door.crystal not in [CrystalBarrier.Null, CrystalBarrier.Either]:
return crystal == CrystalBarrier.Either or door.crystal == crystal
return True
def add_doors_to_lists(region, key_door_proposal, state, crystal, world, player):
for door in get_doors(world, region, player):
if not door.blocked:
if door in key_door_proposal and door not in kd_state.small_doors and door not in kd_state.opened_doors:
kd_state.small_doors.append(door)
elif door.bigKey and not kd_state.big_key_opened and door not in kd_state.big_doors:
kd_state.big_doors.append(door)
elif door not in kd_state.avail_doors:
kd_state.avail_doors.append(door)
if can_traverse(crystal, door):
if door in key_door_proposal and not_in_door_list(door, state.small_doors, crystal) and door not in state.opened_doors:
append_door_to_list(door, state.small_doors, crystal)
elif door.bigKey and not state.big_key_opened and not_in_door_list(door, state.big_doors, crystal):
append_door_to_list(door, state.big_doors, crystal)
elif door.req_event is not None and door.req_event not in state.events and not_in_door_list(door, state.event_doors, crystal):
append_door_to_list(door, state.event_doors, crystal)
elif not_in_door_list(door, state.avail_doors, crystal):
append_door_to_list(door, state.avail_doors, crystal)
def in_door_list(door, door_list):
for d, crystal in door_list:
if d == door:
return True
return False
def not_in_door_list(door, door_list, crystal):
if crystal == CrystalBarrier.Either:
return (door, CrystalBarrier.Orange) not in door_list or (door, CrystalBarrier.Blue) not in door_list
else:
return (door, crystal) not in door_list
def append_door_to_list(door, door_list, crystal):
if crystal == CrystalBarrier.Either:
if (door, CrystalBarrier.Blue) not in door_list and (door, CrystalBarrier.Orange) not in door_list:
door_list.append((door, crystal))
elif (door, CrystalBarrier.Blue) not in door_list:
door_list.append((door, CrystalBarrier.Blue))
elif (door, CrystalBarrier.Orange) not in door_list:
door_list.append((door, CrystalBarrier.Orange))
else:
door_list.append((door, crystal))
def state_id(state, flat_proposal):
state_id = '1' if state.big_key_opened else '0'
for d in flat_proposal:
state_id += '1' if d in state.opened_doors else '0'
return state_id
def reassign_key_doors(current_doors, proposal, world, player):
logger = logging.getLogger('')
flat_proposal = flatten_pair_list(proposal)
queue = collections.deque(current_doors)
while len(queue) > 0:
@@ -1117,6 +1196,7 @@ def reassign_key_doors(current_doors, proposal, world, player):
change_door_to_small_key(d1, world, player)
change_door_to_small_key(d2, world, player)
world.spoiler.set_door_type(d1.name+' <-> '+d2.name, 'Key Door', player)
logger.debug('Key Door: %s', d1.name+' <-> '+d2.name)
else:
d = obj
if d.type is DoorType.Interior:
@@ -1126,6 +1206,7 @@ def reassign_key_doors(current_doors, proposal, world, player):
elif d.type is DoorType.Normal:
change_door_to_small_key(d, world, player)
world.spoiler.set_door_type(d.name, 'Key Door', player)
logger.debug('Key Door: %s', d.name)
def change_door_to_small_key(d, world, player):
@@ -1178,8 +1259,8 @@ logical_connections = [
('Swamp Barrier Ledge Hook Path', 'Swamp West Ledge'),
('Swamp Drain Left Switch', 'Swamp Drain Right'),
('Swamp Drain Right Switch', 'Swamp Drain Left'),
# ('', ''),
# ('', ''),
('Swamp Flooded Spot Ladder', 'Swamp Flooded Room'),
('Swamp Flooded Room Ladder', 'Swamp Flooded Spot'),
# ('', ''),
]
@@ -1326,7 +1407,7 @@ interior_doors = [
('Swamp Shooters EN', 'Swamp Left Elbow WN'),
('Swamp Drain WN', 'Swamp Basement Shallows EN'),
('Swamp Flooded Room WS', 'Swamp Basement Shallows ES'),
('Swamp Waterfall Room NW', 'Swamp Refill 1 SW'),
('Swamp Waterfall Room NW', 'Swamp Refill SW'),
('Swamp Waterfall Room NE', 'Swamp Behind Waterfall SE'),
('Swamp C SE', 'Swamp Waterway NE'),
('Swamp Waterway N', 'Swamp I S'),

838
Doors.py
View File

@@ -1,5 +1,5 @@
from BaseClasses import Door, DoorType, Direction
from BaseClasses import Door, DoorType, Direction, CrystalBarrier
from RoomData import PairedDoor
# constants
@@ -22,412 +22,449 @@ HTH = 0 # High to High 00
HTL = 1 # High to Low 01
LTH = 2 # Low to High 10
LTL = 3 # Low to Low 11
# Type Shortcuts
Nrml = DoorType.Normal
StrS = DoorType.StraightStairs
Hole = DoorType.Hole
Warp = DoorType.Warp
Sprl = DoorType.SpiralStairs
Lddr = DoorType.Ladder
Open = DoorType.Open
Lgcl = DoorType.Logical
Intr = DoorType.Interior
def create_doors(world, player):
world.doors += [
# hyrule castle
toggle(create_dir_door(player, 'Hyrule Castle Lobby W', DoorType.Normal, Direction.West, 0x61, Mid, High)).pos(0),
toggle(create_dir_door(player, 'Hyrule Castle Lobby E', DoorType.Normal, Direction.East, 0x61, Mid, High)).pos(2),
create_dir_door(player, 'Hyrule Castle Lobby WN', DoorType.Normal, Direction.West, 0x61, Top, High).pos(1),
create_dir_door(player, 'Hyrule Castle Lobby North Stairs', DoorType.StraightStairs, Direction.North, 0x61, Mid, High),
toggle(create_dir_door(player, 'Hyrule Castle West Lobby E', DoorType.Normal, Direction.East, 0x60, Mid, Low)).pos(1),
create_dir_door(player, 'Hyrule Castle West Lobby N', DoorType.Normal, Direction.North, 0x60, Right, Low).pos(0),
create_dir_door(player, 'Hyrule Castle West Lobby EN', DoorType.Normal, Direction.East, 0x60, Top, High).pos(3),
toggle(create_dir_door(player, 'Hyrule Castle East Lobby W', DoorType.Normal, Direction.West, 0x62, Mid, Low)).pos(0),
create_dir_door(player, 'Hyrule Castle East Lobby N', DoorType.Normal, Direction.North, 0x62, Mid, High).pos(3),
create_dir_door(player, 'Hyrule Castle East Lobby NW', DoorType.Normal, Direction.North, 0x62, Left, Low).pos(2),
create_dir_door(player, 'Hyrule Castle East Hall W', DoorType.Normal, Direction.West, 0x52, Top, Low).pos(0),
create_dir_door(player, 'Hyrule Castle East Hall S', DoorType.Normal, Direction.South, 0x52, Mid, High).pos(2),
create_dir_door(player, 'Hyrule Castle East Hall SW', DoorType.Normal, Direction.South, 0x52, Left, Low).pos(1),
create_dir_door(player, 'Hyrule Castle West Hall E', DoorType.Normal, Direction.East, 0x50, Top, Low).pos(0),
create_dir_door(player, 'Hyrule Castle West Hall S', DoorType.Normal, Direction.South, 0x50, Right, Low).pos(1),
create_dir_door(player, 'Hyrule Castle Back Hall W', DoorType.Normal, Direction.West, 0x01, Top, Low).pos(0),
create_dir_door(player, 'Hyrule Castle Back Hall E', DoorType.Normal, Direction.East, 0x01, Top, Low).pos(1),
create_spiral_stairs(player, 'Hyrule Castle Back Hall Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x01, 0, HTL, A, 0x2a, 0x00),
create_dir_door(player, 'Hyrule Castle Throne Room N', DoorType.Normal, Direction.North, 0x51, Mid, High).pos(1),
create_dir_door(player, 'Hyrule Castle Throne Room South Stairs', DoorType.StraightStairs, Direction.South, 0x51, Mid, Low),
create_door(player, 'Hyrule Castle Lobby W', Nrml).dir(Direction.West, 0x61, Mid, High).toggler().pos(0),
create_door(player, 'Hyrule Castle Lobby E', Nrml).dir(Direction.East, 0x61, Mid, High).toggler().pos(2),
create_door(player, 'Hyrule Castle Lobby WN', Nrml).dir(Direction.West, 0x61, Top, High).pos(1),
create_door(player, 'Hyrule Castle Lobby North Stairs', StrS).dir(Direction.North, 0x61, Mid, High),
create_door(player, 'Hyrule Castle West Lobby E', Nrml).dir(Direction.East, 0x60, Mid, Low).toggler().pos(1),
create_door(player, 'Hyrule Castle West Lobby N', Nrml).dir(Direction.North, 0x60, Right, Low).pos(0),
create_door(player, 'Hyrule Castle West Lobby EN', Nrml).dir(Direction.East, 0x60, Top, High).pos(3),
create_door(player, 'Hyrule Castle East Lobby W', Nrml).dir(Direction.West, 0x62, Mid, Low).toggler().pos(0),
create_door(player, 'Hyrule Castle East Lobby N', Nrml).dir(Direction.North, 0x62, Mid, High).pos(3),
create_door(player, 'Hyrule Castle East Lobby NW', Nrml).dir(Direction.North, 0x62, Left, Low).pos(2),
create_door(player, 'Hyrule Castle East Hall W', Nrml).dir(Direction.West, 0x52, Top, Low).pos(0),
create_door(player, 'Hyrule Castle East Hall S', Nrml).dir(Direction.South, 0x52, Mid, High).pos(2),
create_door(player, 'Hyrule Castle East Hall SW', Nrml).dir(Direction.South, 0x52, Left, Low).pos(1),
create_door(player, 'Hyrule Castle West Hall E', Nrml).dir(Direction.East, 0x50, Top, Low).pos(0),
create_door(player, 'Hyrule Castle West Hall S', Nrml).dir(Direction.South, 0x50, Right, Low).pos(1),
create_door(player, 'Hyrule Castle Back Hall W', Nrml).dir(Direction.West, 0x01, Top, Low).pos(0),
create_door(player, 'Hyrule Castle Back Hall E', Nrml).dir(Direction.East, 0x01, Top, Low).pos(1),
create_door(player, 'Hyrule Castle Back Hall Down Stairs', Sprl).dir(Direction.Down, 0x01, 0, HTL).ss(A, 0x2a, 0x00),
create_door(player, 'Hyrule Castle Throne Room N', Nrml).dir(Direction.North, 0x51, Mid, High).pos(1),
create_door(player, 'Hyrule Castle Throne Room South Stairs', StrS).dir(Direction.South, 0x51, Mid, Low),
# hyrule dungeon level
create_spiral_stairs(player, 'Hyrule Dungeon Map Room Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x72, 0, LTH, A, 0x4b, 0xec),
small_key(create_dir_door(player, 'Hyrule Dungeon Map Room Key Door S', DoorType.Interior, Direction.South, 0x72, Mid, High)).pos(0),
small_key(create_dir_door(player, 'Hyrule Dungeon North Abyss Key Door N', DoorType.Interior, Direction.North, 0x72, Mid, High)).pos(0),
create_dir_door(player, 'Hyrule Dungeon North Abyss South Edge', DoorType.Open, Direction.South, 0x72, None, Low),
create_dir_door(player, 'Hyrule Dungeon North Abyss Catwalk Edge', DoorType.Open, Direction.South, 0x72, None, High),
create_door(player, 'Hyrule Dungeon North Abyss Catwalk Dropdown', DoorType.Logical),
create_dir_door(player, 'Hyrule Dungeon South Abyss North Edge', DoorType.Open, Direction.North, 0x82, None, Low),
create_dir_door(player, 'Hyrule Dungeon South Abyss West Edge', DoorType.Open, Direction.West, 0x82, None, Low),
create_dir_door(player, 'Hyrule Dungeon South Abyss Catwalk North Edge', DoorType.Open, Direction.North, 0x82, None, High),
create_dir_door(player, 'Hyrule Dungeon South Abyss Catwalk West Edge', DoorType.Open, Direction.West, 0x82, None, High),
create_dir_door(player, 'Hyrule Dungeon Guardroom Catwalk Edge', DoorType.Open, Direction.East, 0x81, None, High),
create_dir_door(player, 'Hyrule Dungeon Guardroom Abyss Edge', DoorType.Open, Direction.West, 0x81, None, High),
create_dir_door(player, 'Hyrule Dungeon Guardroom N', DoorType.Normal, Direction.North, 0x81, Left, Low).pos(0),
trap(create_dir_door(player, 'Hyrule Dungeon Armory S', DoorType.Normal, Direction.South, 0x71, Left, Low), 0x2).pos(1),
small_key(create_dir_door(player, 'Hyrule Dungeon Armory Interior Key Door N', DoorType.Interior, Direction.North, 0x71, Left, High)).pos(0),
small_key(create_dir_door(player, 'Hyrule Dungeon Armory Interior Key Door S', DoorType.Interior, Direction.South, 0x71, Left, High)).pos(0),
create_spiral_stairs(player, 'Hyrule Dungeon Armory Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x71, 0, HTL, A, 0x11, 0xa8, True),
create_spiral_stairs(player, 'Hyrule Dungeon Staircase Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x70, 2, LTH, A, 0x32, 0x94, True),
create_spiral_stairs(player, 'Hyrule Dungeon Staircase Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x70, 1, HTH, A, 0x11, 0x58),
create_spiral_stairs(player, 'Hyrule Dungeon Cellblock Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x80, 0, HTH, A, 0x1a, 0x44),
create_door(player, 'Hyrule Dungeon Map Room Up Stairs', Sprl).dir(Direction.Up, 0x72, 0, LTH).ss(A, 0x4b, 0xec),
create_door(player, 'Hyrule Dungeon Map Room Key Door S', Intr).dir(Direction.South, 0x72, Mid, High).small_key().pos(0),
create_door(player, 'Hyrule Dungeon North Abyss Key Door N', Intr).dir(Direction.North, 0x72, Mid, High).small_key().pos(0),
create_door(player, 'Hyrule Dungeon North Abyss South Edge', Open).dir(Direction.South, 0x72, None, Low),
create_door(player, 'Hyrule Dungeon North Abyss Catwalk Edge', Open).dir(Direction.South, 0x72, None, High),
create_door(player, 'Hyrule Dungeon North Abyss Catwalk Dropdown', Lgcl),
create_door(player, 'Hyrule Dungeon South Abyss North Edge', Open).dir(Direction.North, 0x82, None, Low),
create_door(player, 'Hyrule Dungeon South Abyss West Edge', Open).dir(Direction.West, 0x82, None, Low),
create_door(player, 'Hyrule Dungeon South Abyss Catwalk North Edge', Open).dir(Direction.North, 0x82, None, High),
create_door(player, 'Hyrule Dungeon South Abyss Catwalk West Edge', Open).dir(Direction.West, 0x82, None, High),
create_door(player, 'Hyrule Dungeon Guardroom Catwalk Edge', Open).dir(Direction.East, 0x81, None, High),
create_door(player, 'Hyrule Dungeon Guardroom Abyss Edge', Open).dir(Direction.West, 0x81, None, High),
create_door(player, 'Hyrule Dungeon Guardroom N', Nrml).dir(Direction.North, 0x81, Left, Low).pos(0),
create_door(player, 'Hyrule Dungeon Armory S', Nrml).dir(Direction.South, 0x71, Left, Low).trap(0x2).pos(1),
create_door(player, 'Hyrule Dungeon Armory Interior Key Door N', Intr).dir(Direction.North, 0x71, Left, High).small_key().pos(0),
create_door(player, 'Hyrule Dungeon Armory Interior Key Door S', Intr).dir(Direction.South, 0x71, Left, High).small_key().pos(0),
create_door(player, 'Hyrule Dungeon Armory Down Stairs', Sprl).dir(Direction.Down, 0x71, 0, HTL).ss(A, 0x11, 0xa8, True),
create_door(player, 'Hyrule Dungeon Staircase Up Stairs', Sprl).dir(Direction.Up, 0x70, 2, LTH).ss(A, 0x32, 0x94, True),
create_door(player, 'Hyrule Dungeon Staircase Down Stairs', Sprl).dir(Direction.Down, 0x70, 1, HTH).ss(A, 0x11, 0x58),
create_door(player, 'Hyrule Dungeon Cellblock Up Stairs', Sprl).dir(Direction.Up, 0x80, 0, HTH).ss(A, 0x1a, 0x44),
# sewers
trap(blocked(create_dir_door(player, 'Sewers Behind Tapestry S', DoorType.Normal, Direction.South, 0x41, Mid, High)), 0x4).pos(0),
create_spiral_stairs(player, 'Sewers Behind Tapestry Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x41, 0, HTH, S, 0x12, 0xb0),
create_spiral_stairs(player, 'Sewers Rope Room Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x42, 0, HTH, S, 0x1b, 0x9c),
create_dir_door(player, 'Sewers Rope Room North Stairs', DoorType.StraightStairs, Direction.North, 0x42, Mid, High),
create_dir_door(player, 'Sewers Dark Cross South Stairs', DoorType.StraightStairs, Direction.South, 0x32, Mid, High),
small_key(create_dir_door(player, 'Sewers Dark Cross Key Door N', DoorType.Normal, Direction.North, 0x32, Mid, High)).pos(0),
small_key(create_dir_door(player, 'Sewers Dark Cross Key Door S', DoorType.Normal, Direction.South, 0x22, Mid, High)).pos(0),
create_dir_door(player, 'Sewers Water W', DoorType.Normal, Direction.West, 0x22, Bot, High).pos(1),
create_dir_door(player, 'Sewers Key Rat E', DoorType.Normal, Direction.East, 0x21, Bot, High).pos(1),
small_key(create_dir_door(player, 'Sewers Key Rat Key Door N', DoorType.Normal, Direction.North, 0x21, Right, High)).pos(0),
small_key(create_dir_door(player, 'Sewers Secret Room Key Door S', DoorType.Normal, Direction.South, 0x11, Right, High)).pos(2),
create_door(player, 'Sewers Secret Room Push Block', DoorType.Logical),
create_spiral_stairs(player, 'Sewers Secret Room Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x11, 0, LTH, S, 0x33, 0x6c, True),
create_spiral_stairs(player, 'Sewers Pull Switch Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x02, 0, HTL, S, 0x12, 0x80),
trap(toggle(create_dir_door(player, 'Sewers Pull Switch S', DoorType.Normal, Direction.South, 0x02, Mid, Low)), 0x4).pos(0),
create_door(player, 'Sewers Behind Tapestry S', Nrml).dir(Direction.South, 0x41, Mid, High).no_exit().trap(0x4).pos(0),
create_door(player, 'Sewers Behind Tapestry Down Stairs', Sprl).dir(Direction.Down, 0x41, 0, HTH).ss(S, 0x12, 0xb0),
create_door(player, 'Sewers Rope Room Up Stairs', Sprl).dir(Direction.Up, 0x42, 0, HTH).ss(S, 0x1b, 0x9c),
create_door(player, 'Sewers Rope Room North Stairs', StrS).dir(Direction.North, 0x42, Mid, High),
create_door(player, 'Sewers Dark Cross South Stairs', StrS).dir(Direction.South, 0x32, Mid, High),
create_door(player, 'Sewers Dark Cross Key Door N', Nrml).dir(Direction.North, 0x32, Mid, High).small_key().pos(0),
create_door(player, 'Sewers Dark Cross Key Door S', Nrml).dir(Direction.South, 0x22, Mid, High).small_key().pos(0),
create_door(player, 'Sewers Water W', Nrml).dir(Direction.West, 0x22, Bot, High).pos(1),
create_door(player, 'Sewers Key Rat E', Nrml).dir(Direction.East, 0x21, Bot, High).pos(1),
create_door(player, 'Sewers Key Rat Key Door N', Nrml).dir(Direction.North, 0x21, Right, High).small_key().pos(0),
create_door(player, 'Sewers Secret Room Key Door S', Nrml).dir(Direction.South, 0x11, Right, High).small_key().pos(2),
create_door(player, 'Sewers Secret Room Push Block', Lgcl),
create_door(player, 'Sewers Secret Room Up Stairs', Sprl).dir(Direction.Up, 0x11, 0, LTH).ss(S, 0x33, 0x6c, True),
create_door(player, 'Sewers Pull Switch Down Stairs', Sprl).dir(Direction.Down, 0x02, 0, HTL).ss(S, 0x12, 0x80),
create_door(player, 'Sewers Pull Switch S', Nrml).dir(Direction.South, 0x02, Mid, Low).trap(0x4).toggler().pos(0),
# logically one way the sanc, but should be linked - also toggle
toggle(blocked(create_dir_door(player, 'Sanctuary N', DoorType.Normal, Direction.North, 0x12, Mid, High))).pos(0),
create_door(player, 'Sanctuary N', Nrml).dir(Direction.North, 0x12, Mid, High).no_exit().toggler().pos(0),
# Eastern Palace
create_dir_door(player, 'Eastern Lobby N', DoorType.Normal, Direction.North, 0xc9, Mid, High).pos(1),
create_dir_door(player, 'Eastern Cannonball S', DoorType.Normal, Direction.South, 0xb9, Mid, High).pos(2),
create_dir_door(player, 'Eastern Cannonball N', DoorType.Normal, Direction.North, 0xb9, Mid, High).pos(1),
create_dir_door(player, 'Eastern Cannonball Ledge WN', DoorType.Normal, Direction.West, 0xb9, Top, High).pos(3),
small_key(create_dir_door(player, 'Eastern Cannonball Ledge Key Door EN', DoorType.Normal, Direction.East, 0xb9, Top, High)).pos(0),
create_dir_door(player, 'Eastern Courtyard Ledge S', DoorType.Normal, Direction.South, 0xa9, Mid, High).pos(5),
trap(create_dir_door(player, 'Eastern Courtyard Ledge W', DoorType.Normal, Direction.West, 0xa9, Mid, High), 0x4).pos(0),
trap(create_dir_door(player, 'Eastern Courtyard Ledge E', DoorType.Normal, Direction.East, 0xa9, Mid, High), 0x2).pos(1),
create_dir_door(player, 'Eastern Map Area W', DoorType.Normal, Direction.West, 0xaa, Mid, High).pos(4),
create_dir_door(player, 'Eastern Compass Area E', DoorType.Normal, Direction.East, 0xa8, Mid, High).pos(5),
create_dir_door(player, 'Eastern Compass Area EN', DoorType.Normal, Direction.East, 0xa8, Top, Low).pos(4),
ugly_door(small_key(create_dir_door(player, 'Eastern Compass Area SW', DoorType.Normal, Direction.South, 0xa8, Right, High))).pos(2),
create_door(player, 'Eastern Hint Tile Push Block', DoorType.Logical),
create_dir_door(player, 'Eastern Courtyard WN', DoorType.Normal, Direction.West, 0xa9, Top, Low).pos(3),
create_dir_door(player, 'Eastern Courtyard EN', DoorType.Normal, Direction.East, 0xa9, Top, Low).pos(4),
big_key(create_dir_door(player, 'Eastern Courtyard N', DoorType.Normal, Direction.North, 0xa9, Mid, High)).pos(2),
create_door(player, 'Eastern Courtyard Potholes', DoorType.Hole),
create_door(player, 'Eastern Fairies\' Warp', DoorType.Warp),
create_dir_door(player, 'Eastern Map Valley WN', DoorType.Normal, Direction.West, 0xaa, Top, Low).pos(1),
create_dir_door(player, 'Eastern Map Valley SW', DoorType.Normal, Direction.South, 0xaa, Left, High).pos(5),
create_dir_door(player, 'Eastern Dark Square NW', DoorType.Normal, Direction.North, 0xba, Left, High).pos(1),
small_key(create_dir_door(player, 'Eastern Dark Square Key Door WN', DoorType.Normal, Direction.West, 0xba, Top, High)).pos(0),
create_dir_door(player, 'Eastern Big Key EN', DoorType.Normal, Direction.East, 0xb8, Top, High).pos(1),
big_key(create_dir_door(player, 'Eastern Big Key NE', DoorType.Normal, Direction.North, 0xb8, Right, High)).pos(0),
ugly_door(small_key(create_dir_door(player, 'Eastern Darkness S', DoorType.Normal, Direction.South, 0x99, Mid, High))).pos(1),
create_door(player, 'Eastern Lobby N', Nrml).dir(Direction.North, 0xc9, Mid, High).pos(1),
create_door(player, 'Eastern Cannonball S', Nrml).dir(Direction.South, 0xb9, Mid, High).pos(2),
create_door(player, 'Eastern Cannonball N', Nrml).dir(Direction.North, 0xb9, Mid, High).pos(1),
create_door(player, 'Eastern Cannonball Ledge WN', Nrml).dir(Direction.West, 0xb9, Top, High).pos(3),
create_door(player, 'Eastern Cannonball Ledge Key Door EN', Nrml).dir(Direction.East, 0xb9, Top, High).small_key().pos(0),
create_door(player, 'Eastern Courtyard Ledge S', Nrml).dir(Direction.South, 0xa9, Mid, High).pos(5),
create_door(player, 'Eastern Courtyard Ledge W', Nrml).dir(Direction.West, 0xa9, Mid, High).trap(0x4).pos(0),
create_door(player, 'Eastern Courtyard Ledge E', Nrml).dir(Direction.East, 0xa9, Mid, High).trap(0x2).pos(1),
create_door(player, 'Eastern Map Area W', Nrml).dir(Direction.West, 0xaa, Mid, High).pos(4),
create_door(player, 'Eastern Compass Area E', Nrml).dir(Direction.East, 0xa8, Mid, High).pos(5),
create_door(player, 'Eastern Compass Area EN', Nrml).dir(Direction.East, 0xa8, Top, Low).pos(4),
ugly_door(create_door(player, 'Eastern Compass Area SW', Nrml).dir(Direction.South, 0xa8, Right, High)).small_key().pos(2),
create_door(player, 'Eastern Hint Tile Push Block', Lgcl),
create_door(player, 'Eastern Courtyard WN', Nrml).dir(Direction.West, 0xa9, Top, Low).pos(3),
create_door(player, 'Eastern Courtyard EN', Nrml).dir(Direction.East, 0xa9, Top, Low).pos(4),
create_door(player, 'Eastern Courtyard N', Nrml).dir(Direction.North, 0xa9, Mid, High).big_key().pos(2),
create_door(player, 'Eastern Courtyard Potholes', Hole),
create_door(player, 'Eastern Fairies\' Warp', Warp),
create_door(player, 'Eastern Map Valley WN', Nrml).dir(Direction.West, 0xaa, Top, Low).pos(1),
create_door(player, 'Eastern Map Valley SW', Nrml).dir(Direction.South, 0xaa, Left, High).pos(5),
create_door(player, 'Eastern Dark Square NW', Nrml).dir(Direction.North, 0xba, Left, High).pos(1),
create_door(player, 'Eastern Dark Square Key Door WN', Nrml).dir(Direction.West, 0xba, Top, High).small_key().pos(0),
create_door(player, 'Eastern Big Key EN', Nrml).dir(Direction.East, 0xb8, Top, High).pos(1),
create_door(player, 'Eastern Big Key NE', Nrml).dir(Direction.North, 0xb8, Right, High).big_key().pos(0),
ugly_door(create_door(player, 'Eastern Darkness S', Nrml).dir(Direction.South, 0x99, Mid, High)).small_key().pos(1),
# Up is a keydoor and down is not. Only the up stairs should be considered a key door for now.
small_key(create_spiral_stairs(player, 'Eastern Darkness Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x99, 0, HTH, Z, 0x1a, 0x6c, False, True)).pos(0),
ugly_door(create_spiral_stairs(player, 'Eastern Attic Start Down Stairs', DoorType.SpiralStairs, Direction.Down, 0xda, 0, HTH, Z, 0x11, 0x80, True, True)),
create_dir_door(player, 'Eastern Attic Start WS', DoorType.Normal, Direction.West, 0xda, Bot, High).trap(0x4).pos(0),
create_dir_door(player, 'Eastern Attic Switches ES', DoorType.Normal, Direction.East, 0xd9, Bot, High).trap(0x1).pos(2),
create_dir_door(player, 'Eastern Attic Switches WS', DoorType.Normal, Direction.West, 0xd9, Bot, High).trap(0x4).pos(0),
create_dir_door(player, 'Eastern Eyegores ES', DoorType.Normal, Direction.East, 0xd8, Bot, High).pos(2),
create_dir_door(player, 'Eastern Eyegores NE', DoorType.Normal, Direction.North, 0xd8, Right, High).trap(0x4).pos(0),
trap(blocked(create_dir_door(player, 'Eastern Boss SE', DoorType.Normal, Direction.South, 0xc8, Right, High)), 0x4).pos(0),
create_door(player, 'Eastern Darkness Up Stairs', Sprl).dir(Direction.Up, 0x99, 0, HTH).ss(Z, 0x1a, 0x6c, False, True).small_key().pos(0),
ugly_door(create_door(player, 'Eastern Attic Start Down Stairs', Sprl).dir(Direction.Down, 0xda, 0, HTH).ss(Z, 0x11, 0x80, True, True)),
create_door(player, 'Eastern Attic Start WS', Nrml).dir(Direction.West, 0xda, Bot, High).trap(0x4).pos(0),
create_door(player, 'Eastern Attic Switches ES', Nrml).dir(Direction.East, 0xd9, Bot, High).trap(0x1).pos(2),
create_door(player, 'Eastern Attic Switches WS', Nrml).dir(Direction.West, 0xd9, Bot, High).trap(0x4).pos(0),
create_door(player, 'Eastern Eyegores ES', Nrml).dir(Direction.East, 0xd8, Bot, High).pos(2),
create_door(player, 'Eastern Eyegores NE', Nrml).dir(Direction.North, 0xd8, Right, High).trap(0x4).pos(0),
create_door(player, 'Eastern Boss SE', Nrml).dir(Direction.South, 0xc8, Right, High).no_exit().trap(0x4).pos(0),
# Desert Palace
create_dir_door(player, 'Desert Main Lobby NW Edge', DoorType.Open, Direction.North, 0x84, None, High),
create_dir_door(player, 'Desert Main Lobby N Edge', DoorType.Open, Direction.North, 0x84, None, High),
create_dir_door(player, 'Desert Main Lobby NE Edge', DoorType.Open, Direction.North, 0x84, None, High),
create_dir_door(player, 'Desert Main Lobby E Edge', DoorType.Open, Direction.East, 0x84, None, High),
create_dir_door(player, 'Desert Dead End Edge', DoorType.Open, Direction.South, 0x74, None, High),
create_dir_door(player, 'Desert East Wing W Edge', DoorType.Open, Direction.West, 0x85, None, High),
create_dir_door(player, 'Desert East Wing N Edge', DoorType.Open, Direction.North, 0x85, None, High),
create_dir_door(player, 'Desert East Lobby WS', DoorType.Interior, Direction.West, 0x85, Bot, High).pos(3),
create_dir_door(player, 'Desert East Wing ES', DoorType.Interior, Direction.East, 0x85, Bot, High).pos(3),
small_key(create_dir_door(player, 'Desert East Wing Key Door EN', DoorType.Interior, Direction.East, 0x85, Top, High)).pos(1),
small_key(create_dir_door(player, 'Desert Compass Key Door WN', DoorType.Interior, Direction.West, 0x85, Top, High)).pos(1),
trap(create_dir_door(player, 'Desert Compass NW', DoorType.Normal, Direction.North, 0x85, Left, High), 0x4).pos(0),
create_dir_door(player, 'Desert Cannonball S', DoorType.Normal, Direction.South, 0x75, Left, High).pos(1),
create_dir_door(player, 'Desert Arrow Pot Corner S Edge', DoorType.Open, Direction.South, 0x75, None, High),
create_dir_door(player, 'Desert Arrow Pot Corner W Edge', DoorType.Open, Direction.West, 0x75, None, High),
create_dir_door(player, 'Desert North Hall SE Edge', DoorType.Open, Direction.South, 0x74, None, High),
create_dir_door(player, 'Desert North Hall SW Edge', DoorType.Open, Direction.South, 0x74, None, High),
create_dir_door(player, 'Desert North Hall W Edge', DoorType.Open, Direction.West, 0x74, None, High),
create_dir_door(player, 'Desert North Hall E Edge', DoorType.Open, Direction.East, 0x74, None, High),
create_dir_door(player, 'Desert North Hall NW', DoorType.Interior, Direction.North, 0x74, Left, High).pos(1),
create_dir_door(player, 'Desert Map SW', DoorType.Interior, Direction.South, 0x74, Left, High).pos(1),
create_dir_door(player, 'Desert North Hall NE', DoorType.Interior, Direction.North, 0x74, Right, High).pos(0),
create_dir_door(player, 'Desert Map SE', DoorType.Interior, Direction.South, 0x74, Right, High).pos(0),
create_dir_door(player, 'Desert Sandworm Corner S Edge', DoorType.Open, Direction.South, 0x73, None, High),
create_dir_door(player, 'Desert Sandworm Corner E Edge', DoorType.Open, Direction.East, 0x73, None, High),
create_dir_door(player, 'Desert Sandworm Corner NE', DoorType.Interior, Direction.North, 0x73, Right, High).pos(2),
create_dir_door(player, 'Desert Bonk Torch SE', DoorType.Interior, Direction.South, 0x73, Right, High).pos(2),
create_dir_door(player, 'Desert Sandworm Corner WS', DoorType.Interior, Direction.West, 0x73, Bot, High).pos(1),
create_door(player, 'Desert Main Lobby NW Edge', Open).dir(Direction.North, 0x84, None, High),
create_door(player, 'Desert Main Lobby N Edge', Open).dir(Direction.North, 0x84, None, High),
create_door(player, 'Desert Main Lobby NE Edge', Open).dir(Direction.North, 0x84, None, High),
create_door(player, 'Desert Main Lobby E Edge', Open).dir(Direction.East, 0x84, None, High),
create_door(player, 'Desert Dead End Edge', Open).dir(Direction.South, 0x74, None, High),
create_door(player, 'Desert East Wing W Edge', Open).dir(Direction.West, 0x85, None, High),
create_door(player, 'Desert East Wing N Edge', Open).dir(Direction.North, 0x85, None, High),
create_door(player, 'Desert East Lobby WS', Intr).dir(Direction.West, 0x85, Bot, High).pos(3),
create_door(player, 'Desert East Wing ES', Intr).dir(Direction.East, 0x85, Bot, High).pos(3),
create_door(player, 'Desert East Wing Key Door EN', Intr).dir(Direction.East, 0x85, Top, High).small_key().pos(1),
create_door(player, 'Desert Compass Key Door WN', Intr).dir(Direction.West, 0x85, Top, High).small_key().pos(1),
create_door(player, 'Desert Compass NW', Nrml).dir(Direction.North, 0x85, Left, High).trap(0x4).pos(0),
create_door(player, 'Desert Cannonball S', Nrml).dir(Direction.South, 0x75, Left, High).pos(1),
create_door(player, 'Desert Arrow Pot Corner S Edge', Open).dir(Direction.South, 0x75, None, High),
create_door(player, 'Desert Arrow Pot Corner W Edge', Open).dir(Direction.West, 0x75, None, High),
create_door(player, 'Desert North Hall SE Edge', Open).dir(Direction.South, 0x74, None, High),
create_door(player, 'Desert North Hall SW Edge', Open).dir(Direction.South, 0x74, None, High),
create_door(player, 'Desert North Hall W Edge', Open).dir(Direction.West, 0x74, None, High),
create_door(player, 'Desert North Hall E Edge', Open).dir(Direction.East, 0x74, None, High),
create_door(player, 'Desert North Hall NW', Intr).dir(Direction.North, 0x74, Left, High).pos(1),
create_door(player, 'Desert Map SW', Intr).dir(Direction.South, 0x74, Left, High).pos(1),
create_door(player, 'Desert North Hall NE', Intr).dir(Direction.North, 0x74, Right, High).pos(0),
create_door(player, 'Desert Map SE', Intr).dir(Direction.South, 0x74, Right, High).pos(0),
create_door(player, 'Desert Sandworm Corner S Edge', Open).dir(Direction.South, 0x73, None, High),
create_door(player, 'Desert Sandworm Corner E Edge', Open).dir(Direction.East, 0x73, None, High),
create_door(player, 'Desert Sandworm Corner NE', Intr).dir(Direction.North, 0x73, Right, High).pos(2),
create_door(player, 'Desert Bonk Torch SE', Intr).dir(Direction.South, 0x73, Right, High).pos(2),
create_door(player, 'Desert Sandworm Corner WS', Intr).dir(Direction.West, 0x73, Bot, High).pos(1),
# I don't know if I have to mark trap on interior doors yet - haven't mucked them up much
create_dir_door(player, 'Desert Circle of Pots ES', DoorType.Interior, Direction.East, 0x73, Bot, High).pos(1),
create_dir_door(player, 'Desert Circle of Pots NW', DoorType.Interior, Direction.North, 0x73, Left, High).pos(0),
create_dir_door(player, 'Desert Big Chest SW', DoorType.Interior, Direction.South, 0x73, Left, High).pos(0),
create_dir_door(player, 'Desert West Wing N Edge', DoorType.Open, Direction.North, 0x83, None, High),
create_dir_door(player, 'Desert West Wing WS', DoorType.Interior, Direction.West, 0x83, Bot, High).pos(2),
create_dir_door(player, 'Desert West Lobby ES', DoorType.Interior, Direction.East, 0x83, Bot, High).pos(2),
create_door(player, 'Desert Circle of Pots ES', Intr).dir(Direction.East, 0x73, Bot, High).pos(1),
create_door(player, 'Desert Circle of Pots NW', Intr).dir(Direction.North, 0x73, Left, High).pos(0),
create_door(player, 'Desert Big Chest SW', Intr).dir(Direction.South, 0x73, Left, High).pos(0),
create_door(player, 'Desert West Wing N Edge', Open).dir(Direction.North, 0x83, None, High),
create_door(player, 'Desert West Wing WS', Intr).dir(Direction.West, 0x83, Bot, High).pos(2),
create_door(player, 'Desert West Lobby ES', Intr).dir(Direction.East, 0x83, Bot, High).pos(2),
# Desert Back
create_dir_door(player, 'Desert Back Lobby NW', DoorType.Interior, Direction.North, 0x63, Left, High).pos(1),
create_dir_door(player, 'Desert Tiles 1 SW', DoorType.Interior, Direction.South, 0x63, Left, High).pos(1),
small_key(create_spiral_stairs(player, 'Desert Tiles 1 Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x63, 0, HTH, A, 0x1b, 0x6c, True)).pos(0),
create_spiral_stairs(player, 'Desert Bridge Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x53, 0, HTH, A, 0x0f, 0x80, True),
create_dir_door(player, 'Desert Bridge SW', DoorType.Interior, Direction.South, 0x53, Left, High).pos(0),
create_dir_door(player, 'Desert Four Statues NW', DoorType.Interior, Direction.North, 0x53, Left, High).pos(0),
create_dir_door(player, 'Desert Four Statues ES', DoorType.Interior, Direction.East, 0x53, Bot, High).pos(1),
create_dir_door(player, 'Desert Beamos Hall WS', DoorType.Interior, Direction.West, 0x53, Bot, High).pos(1),
small_key(create_dir_door(player, 'Desert Beamos Hall NE', DoorType.Normal, Direction.North, 0x53, Right, High)).pos(2),
small_key(create_dir_door(player, 'Desert Tiles 2 SE', DoorType.Normal, Direction.South, 0x43, Right, High)).pos(2),
create_dir_door(player, 'Desert Tiles 2 NE', DoorType.Interior, Direction.North, 0x43, Right, High).small_key().pos(1),
create_dir_door(player, 'Desert Wall Slide SE', DoorType.Interior, Direction.South, 0x43, Right, High).small_key().pos(1),
create_door(player, 'Desert Back Lobby NW', Intr).dir(Direction.North, 0x63, Left, High).pos(1),
create_door(player, 'Desert Tiles 1 SW', Intr).dir(Direction.South, 0x63, Left, High).pos(1),
create_door(player, 'Desert Tiles 1 Up Stairs', Sprl).dir(Direction.Up, 0x63, 0, HTH).ss(A, 0x1b, 0x6c, True).small_key().pos(0),
create_door(player, 'Desert Bridge Down Stairs', Sprl).dir(Direction.Down, 0x53, 0, HTH).ss(A, 0x0f, 0x80, True),
create_door(player, 'Desert Bridge SW', Intr).dir(Direction.South, 0x53, Left, High).pos(0),
create_door(player, 'Desert Four Statues NW', Intr).dir(Direction.North, 0x53, Left, High).pos(0),
create_door(player, 'Desert Four Statues ES', Intr).dir(Direction.East, 0x53, Bot, High).pos(1),
create_door(player, 'Desert Beamos Hall WS', Intr).dir(Direction.West, 0x53, Bot, High).pos(1),
create_door(player, 'Desert Beamos Hall NE', Nrml).dir(Direction.North, 0x53, Right, High).small_key().pos(2),
create_door(player, 'Desert Tiles 2 SE', Nrml).dir(Direction.South, 0x43, Right, High).small_key().pos(2),
create_door(player, 'Desert Tiles 2 NE', Intr).dir(Direction.North, 0x43, Right, High).small_key().pos(1),
create_door(player, 'Desert Wall Slide SE', Intr).dir(Direction.South, 0x43, Right, High).small_key().pos(1),
# todo: we need a new flag for a door that has a wall on it - you have to traverse it one particular way first
# the above is not a problem until we get to crossed mode
big_key(create_dir_door(player, 'Desert Wall Slide NW', DoorType.Normal, Direction.North, 0x43, Left, High)).pos(0),
trap(blocked(create_dir_door(player, 'Desert Boss SW', DoorType.Normal, Direction.South, 0x33, Left, High)), 0x4).pos(0),
create_door(player, 'Desert Wall Slide NW', Nrml).dir(Direction.North, 0x43, Left, High).big_key().pos(0),
create_door(player, 'Desert Boss SW', Nrml).dir(Direction.South, 0x33, Left, High).no_exit().trap(0x4).pos(0),
# Hera
create_spiral_stairs(player, 'Hera Lobby Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x77, 3, HTL, Z, 0x21, 0x90, False, True),
small_key(create_spiral_stairs(player, 'Hera Lobby Key Stairs', DoorType.SpiralStairs, Direction.Down, 0x77, 1, HTL, A, 0x12, 0x80)).pos(0),
create_spiral_stairs(player, 'Hera Lobby Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x77, 2, HTL, X, 0x2b, 0x5c, False, True),
create_spiral_stairs(player, 'Hera Basement Cage Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x87, 3, LTH, Z, 0x42, 0x7c, True, True),
create_spiral_stairs(player, 'Hera Tile Room Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x87, 1, LTH, A, 0x32, 0x6c, True, True),
create_dir_door(player, 'Hera Tile Room EN', DoorType.Interior, Direction.East, 0x87, Top, High).pos(0),
create_dir_door(player, 'Hera Tridorm WN', DoorType.Interior, Direction.West, 0x87, Top, High).pos(0),
create_dir_door(player, 'Hera Tridorm SE', DoorType.Interior, Direction.South, 0x87, Right, High).pos(1),
create_dir_door(player, 'Hera Torches NE', DoorType.Interior, Direction.North, 0x87, Right, High).pos(1),
create_spiral_stairs(player, 'Hera Beetles Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x31, 2, LTH, X, 0x3a, 0x70, True, True),
create_dir_door(player, 'Hera Beetles WS', DoorType.Interior, Direction.West, 0x31, Bot, High).pos(1),
create_door(player, 'Hera Beetles Holes', DoorType.Hole),
create_dir_door(player, 'Hera Startile Corner ES', DoorType.Interior, Direction.East, 0x31, Bot, High).pos(1),
big_key(create_dir_door(player, 'Hera Startile Corner NW', DoorType.Interior, Direction.North, 0x31, Left, High)).pos(0),
create_door(player, 'Hera Startile Corner Holes', DoorType.Hole),
create_door(player, 'Hera Lobby Down Stairs', Sprl).dir(Direction.Down, 0x77, 3, HTL).ss(Z, 0x21, 0x90, False, True),
create_door(player, 'Hera Lobby Key Stairs', Sprl).dir(Direction.Down, 0x77, 1, HTL).ss(A, 0x12, 0x80).small_key().pos(0),
create_door(player, 'Hera Lobby Up Stairs', Sprl).dir(Direction.Up, 0x77, 2, HTL).ss(X, 0x2b, 0x5c, False, True),
create_door(player, 'Hera Basement Cage Up Stairs', Sprl).dir(Direction.Up, 0x87, 3, LTH).ss(Z, 0x42, 0x7c, True, True),
create_door(player, 'Hera Tile Room Up Stairs', Sprl).dir(Direction.Up, 0x87, 1, LTH).ss(A, 0x32, 0x6c, True, True),
create_door(player, 'Hera Tile Room EN', Intr).dir(Direction.East, 0x87, Top, High).pos(0),
create_door(player, 'Hera Tridorm WN', Intr).dir(Direction.West, 0x87, Top, High).pos(0),
create_door(player, 'Hera Tridorm SE', Intr).dir(Direction.South, 0x87, Right, High).pos(1),
create_door(player, 'Hera Torches NE', Intr).dir(Direction.North, 0x87, Right, High).pos(1),
create_door(player, 'Hera Beetles Down Stairs', Sprl).dir(Direction.Down, 0x31, 2, LTH).ss(X, 0x3a, 0x70, True, True),
create_door(player, 'Hera Beetles WS', Intr).dir(Direction.West, 0x31, Bot, High).pos(1),
create_door(player, 'Hera Beetles Holes', Hole),
create_door(player, 'Hera Startile Corner ES', Intr).dir(Direction.East, 0x31, Bot, High).pos(1),
create_door(player, 'Hera Startile Corner NW', Intr).dir(Direction.North, 0x31, Left, High).big_key().pos(0),
create_door(player, 'Hera Startile Corner Holes', Hole),
# technically ugly but causes lots of failures in basic
create_dir_door(player, 'Hera Startile Wide SW', DoorType.Interior, Direction.South, 0x31, Left, High).pos(0),
create_spiral_stairs(player, 'Hera Startile Wide Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x31, 0, HTH, S, 0x6b, 0xac, False, True),
create_door(player, 'Hera Startile Wide Holes', DoorType.Hole),
create_spiral_stairs(player, 'Hera 4F Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x27, 0, HTH, S, 0x62, 0xc0),
create_spiral_stairs(player, 'Hera 4F Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x27, 1, HTH, A, 0x6b, 0x2c),
create_door(player, 'Hera 4F Holes', DoorType.Hole),
create_door(player, 'Hera Big Chest Landing Exit', DoorType.Logical),
create_door(player, 'Hera Big Chest Landing Holes', DoorType.Hole),
create_spiral_stairs(player, 'Hera 5F Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x17, 1, HTH, A, 0x62, 0x40),
create_spiral_stairs(player, 'Hera 5F Up Stairs', DoorType.SpiralStairs, Direction.Up, 0x17, 0, HTH, S, 0x6a, 0x9c),
create_door(player, 'Hera 5F Star Hole', DoorType.Hole),
create_door(player, 'Hera 5F Pothole Chain', DoorType.Hole),
create_door(player, 'Hera 5F Normal Holes', DoorType.Hole),
create_door(player, 'Hera Fairies\' Warp', DoorType.Warp),
create_spiral_stairs(player, 'Hera Boss Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x07, 0, HTH, S, 0x61, 0xb0),
create_door(player, 'Hera Boss Outer Hole', DoorType.Hole),
create_door(player, 'Hera Boss Inner Hole', DoorType.Hole),
create_door(player, 'Hera Startile Wide SW', Intr).dir(Direction.South, 0x31, Left, High).pos(0),
create_door(player, 'Hera Startile Wide Up Stairs', Sprl).dir(Direction.Up, 0x31, 0, HTH).ss(S, 0x6b, 0xac, False, True),
create_door(player, 'Hera Startile Wide Holes', Hole),
create_door(player, 'Hera 4F Down Stairs', Sprl).dir(Direction.Down, 0x27, 0, HTH).ss(S, 0x62, 0xc0),
create_door(player, 'Hera 4F Up Stairs', Sprl).dir(Direction.Up, 0x27, 1, HTH).ss(A, 0x6b, 0x2c),
create_door(player, 'Hera 4F Holes', Hole),
create_door(player, 'Hera Big Chest Landing Exit', Lgcl),
create_door(player, 'Hera Big Chest Landing Holes', Hole),
create_door(player, 'Hera 5F Down Stairs', Sprl).dir(Direction.Down, 0x17, 1, HTH).ss(A, 0x62, 0x40),
create_door(player, 'Hera 5F Up Stairs', Sprl).dir(Direction.Up, 0x17, 0, HTH).ss(S, 0x6a, 0x9c),
create_door(player, 'Hera 5F Star Hole', Hole),
create_door(player, 'Hera 5F Pothole Chain', Hole),
create_door(player, 'Hera 5F Normal Holes', Hole),
create_door(player, 'Hera Fairies\' Warp', Warp),
create_door(player, 'Hera Boss Down Stairs', Sprl).dir(Direction.Down, 0x07, 0, HTH).ss(S, 0x61, 0xb0),
create_door(player, 'Hera Boss Outer Hole', Hole),
create_door(player, 'Hera Boss Inner Hole', Hole),
# Castle Tower
create_dir_door(player, 'Tower Lobby NW', DoorType.Interior, Direction.North, 0xe0, Left, High).pos(1),
create_dir_door(player, 'Tower Gold Knights SW', DoorType.Interior, Direction.South, 0xe0, Left, High).pos(1),
create_dir_door(player, 'Tower Gold Knights EN', DoorType.Interior, Direction.East, 0xe0, Top, High).pos(0),
create_dir_door(player, 'Tower Room 03 WN', DoorType.Interior, Direction.West, 0xe0, Bot, High).pos(0),
create_spiral_stairs(player, 'Tower Room 03 Up Stairs', DoorType.SpiralStairs, Direction.Up, 0xe0, 0, HTH, S, 0x1a, 0x6c, True, True).small_key().pos(2),
create_spiral_stairs(player, 'Tower Lone Statue Down Stairs', DoorType.SpiralStairs, Direction.Down, 0xd0, 0, HTH, S, 0x11, 0x80, True, True),
create_dir_door(player, 'Tower Lone Statue WN', DoorType.Interior, Direction.West, 0xd0, Top, High).pos(1),
create_dir_door(player, 'Tower Dark Maze EN', DoorType.Interior, Direction.East, 0xd0, Top, High).pos(1),
create_dir_door(player, 'Tower Dark Maze ES', DoorType.Interior, Direction.East, 0xd0, Bot, High).small_key().pos(0),
create_dir_door(player, 'Tower Dark Chargers WS', DoorType.Interior, Direction.West, 0xd0, Bot, High).small_key().pos(0),
create_spiral_stairs(player, 'Tower Dark Chargers Up Stairs', DoorType.SpiralStairs, Direction.Up, 0xd0, 2, HTH, X, 0x1b, 0x8c, True, True),
create_spiral_stairs(player, 'Tower Dual Statues Down Stairs', DoorType.SpiralStairs, Direction.Down, 0xc0, 2, HTH, X, 0x12, 0xa0, True, True),
create_dir_door(player, 'Tower Dual Statues WS', DoorType.Interior, Direction.West, 0xc0, Bot, High).pos(1),
create_dir_door(player, 'Tower Dark Pits ES', DoorType.Interior, Direction.East, 0xc0, Bot, High).pos(1),
create_dir_door(player, 'Tower Dark Pits EN', DoorType.Interior, Direction.East, 0xc0, Top, High).pos(0),
create_dir_door(player, 'Tower Dark Archers WN', DoorType.Interior, Direction.West, 0xc0, Top, High).pos(0),
create_spiral_stairs(player, 'Tower Dark Archers Up Stairs', DoorType.SpiralStairs, Direction.Up, 0xc0, 0, HTH, S, 0x1b, 0x6c, True, True).small_key().pos(2),
create_spiral_stairs(player, 'Tower Red Spears Down Stairs', DoorType.SpiralStairs, Direction.Down, 0xb0, 0, HTH, S, 0x12, 0x80, True, True),
create_dir_door(player, 'Tower Red Spears WN', DoorType.Interior, Direction.West, 0xb0, Top, High).pos(1),
create_dir_door(player, 'Tower Red Guards EN', DoorType.Interior, Direction.East, 0xb0, Top, High).pos(1),
create_dir_door(player, 'Tower Red Guards SW', DoorType.Interior, Direction.South, 0xb0, Left, High).pos(0),
create_dir_door(player, 'Tower Circle of Pots NW', DoorType.Interior, Direction.North, 0xb0, Left, High).pos(0),
create_dir_door(player, 'Tower Circle of Pots WS', DoorType.Interior, Direction.West, 0xb0, Bot, High).small_key().pos(2),
create_dir_door(player, 'Tower Pacifist Run ES', DoorType.Interior, Direction.East, 0xb0, Bot, High).small_key().pos(2),
create_spiral_stairs(player, 'Tower Pacifist Run Up Stairs', DoorType.SpiralStairs, Direction.Up, 0xb0, 2, LTH, X, 0x33, 0x8c, True, True),
create_spiral_stairs(player, 'Tower Push Statue Down Stairs', DoorType.SpiralStairs, Direction.Down, 0x40, 0, HTL, X, 0x12, 0xa0, True, True),
create_dir_door(player, 'Tower Push Statue WS', DoorType.Interior, Direction.West, 0x40, Bot, Low).pos(0),
create_dir_door(player, 'Tower Catwalk ES', DoorType.Interior, Direction.East, 0x40, Bot, Low).pos(0),
create_dir_door(player, 'Tower Catwalk North Stairs', DoorType.StraightStairs, Direction.North, 0x40, Left, High),
create_dir_door(player, 'Tower Antechamber South Stairs', DoorType.StraightStairs, Direction.South, 0x30, Left, High),
create_dir_door(player, 'Tower Antechamber NW', DoorType.Interior, Direction.North, 0x30, Left, High).pos(1),
create_dir_door(player, 'Tower Altar SW', DoorType.Interior, Direction.South, 0x30, Left, High).pos(1),
create_dir_door(player, 'Tower Altar NW', DoorType.Normal, Direction.North, 0x30, Left, High).pos(0),
create_dir_door(player, 'Tower Agahnim 1 SW', DoorType.Normal, Direction.South, 0x20, Left, High).no_exit().trap(0x4).pos(0),
create_door(player, 'Tower Lobby NW', Intr).dir(Direction.North, 0xe0, Left, High).pos(1),
create_door(player, 'Tower Gold Knights SW', Intr).dir(Direction.South, 0xe0, Left, High).pos(1),
create_door(player, 'Tower Gold Knights EN', Intr).dir(Direction.East, 0xe0, Top, High).pos(0),
create_door(player, 'Tower Room 03 WN', Intr).dir(Direction.West, 0xe0, Bot, High).pos(0),
create_door(player, 'Tower Room 03 Up Stairs', Sprl).dir(Direction.Up, 0xe0, 0, HTH).ss(S, 0x1a, 0x6c, True, True).small_key().pos(2),
create_door(player, 'Tower Lone Statue Down Stairs', Sprl).dir(Direction.Down, 0xd0, 0, HTH).ss(S, 0x11, 0x80, True, True),
create_door(player, 'Tower Lone Statue WN', Intr).dir(Direction.West, 0xd0, Top, High).pos(1),
create_door(player, 'Tower Dark Maze EN', Intr).dir(Direction.East, 0xd0, Top, High).pos(1),
create_door(player, 'Tower Dark Maze ES', Intr).dir(Direction.East, 0xd0, Bot, High).small_key().pos(0),
create_door(player, 'Tower Dark Chargers WS', Intr).dir(Direction.West, 0xd0, Bot, High).small_key().pos(0),
create_door(player, 'Tower Dark Chargers Up Stairs', Sprl).dir(Direction.Up, 0xd0, 2, HTH).ss(X, 0x1b, 0x8c, True, True),
create_door(player, 'Tower Dual Statues Down Stairs', Sprl).dir(Direction.Down, 0xc0, 2, HTH).ss(X, 0x12, 0xa0, True, True),
create_door(player, 'Tower Dual Statues WS', Intr).dir(Direction.West, 0xc0, Bot, High).pos(1),
create_door(player, 'Tower Dark Pits ES', Intr).dir(Direction.East, 0xc0, Bot, High).pos(1),
create_door(player, 'Tower Dark Pits EN', Intr).dir(Direction.East, 0xc0, Top, High).pos(0),
create_door(player, 'Tower Dark Archers WN', Intr).dir(Direction.West, 0xc0, Top, High).pos(0),
create_door(player, 'Tower Dark Archers Up Stairs', Sprl).dir(Direction.Up, 0xc0, 0, HTH).ss(S, 0x1b, 0x6c, True, True).small_key().pos(2),
create_door(player, 'Tower Red Spears Down Stairs', Sprl).dir(Direction.Down, 0xb0, 0, HTH).ss(S, 0x12, 0x80, True, True),
create_door(player, 'Tower Red Spears WN', Intr).dir(Direction.West, 0xb0, Top, High).pos(1),
create_door(player, 'Tower Red Guards EN', Intr).dir(Direction.East, 0xb0, Top, High).pos(1),
create_door(player, 'Tower Red Guards SW', Intr).dir(Direction.South, 0xb0, Left, High).pos(0),
create_door(player, 'Tower Circle of Pots NW', Intr).dir(Direction.North, 0xb0, Left, High).pos(0),
create_door(player, 'Tower Circle of Pots WS', Intr).dir(Direction.West, 0xb0, Bot, High).small_key().pos(2),
create_door(player, 'Tower Pacifist Run ES', Intr).dir(Direction.East, 0xb0, Bot, High).small_key().pos(2),
create_door(player, 'Tower Pacifist Run Up Stairs', Sprl).dir(Direction.Up, 0xb0, 2, LTH).ss(X, 0x33, 0x8c, True, True),
create_door(player, 'Tower Push Statue Down Stairs', Sprl).dir(Direction.Down, 0x40, 0, HTL).ss(X, 0x12, 0xa0, True, True),
create_door(player, 'Tower Push Statue WS', Intr).dir(Direction.West, 0x40, Bot, Low).pos(0),
create_door(player, 'Tower Catwalk ES', Intr).dir(Direction.East, 0x40, Bot, Low).pos(0),
create_door(player, 'Tower Catwalk North Stairs', StrS).dir(Direction.North, 0x40, Left, High),
create_door(player, 'Tower Antechamber South Stairs', StrS).dir(Direction.South, 0x30, Left, High),
create_door(player, 'Tower Antechamber NW', Intr).dir(Direction.North, 0x30, Left, High).pos(1),
create_door(player, 'Tower Altar SW', Intr).dir(Direction.South, 0x30, Left, High).pos(1),
create_door(player, 'Tower Altar NW', Nrml).dir(Direction.North, 0x30, Left, High).pos(0),
create_door(player, 'Tower Agahnim 1 SW', Nrml).dir(Direction.South, 0x20, Left, High).no_exit().trap(0x4).pos(0),
#Palace of Darkness
create_door(player, 'PoD Lobby N', DoorType.Interior).dir(Direction.North, 0x4a, Mid, High).pos(2),
create_door(player, 'PoD Lobby NW', DoorType.Interior).dir(Direction.North, 0x4a, Left, High).pos(0),
create_door(player, 'PoD Lobby NE', DoorType.Interior).dir(Direction.North, 0x4a, Right, High).pos(1),
create_door(player, 'PoD Left Cage SW', DoorType.Interior).dir(Direction.North, 0x4a, Left, High).pos(0),
create_door(player, 'PoD Middle Cage S', DoorType.Interior).dir(Direction.North, 0x4a, Mid, High).pos(2),
create_door(player, 'PoD Middle Cage SE', DoorType.Interior).dir(Direction.North, 0x4a, Right, High).pos(1),
create_door(player, 'PoD Left Cage Down Stairs', DoorType.SpiralStairs).dir(Direction.Down, 0x4a, 1, HTH).ss(A, 0x12, 0x80, False, True),
create_door(player, 'PoD Middle Cage Down Stairs', DoorType.SpiralStairs).dir(Direction.Down, 0x4a, 0, HTH).ss(S, 0x12, 0x80, False, True),
create_door(player, 'PoD Middle Cage N', DoorType.Normal).dir(Direction.North, 0x4a, Mid, High).small_key().pos(2),
create_door(player, 'PoD Shooter Room Up Stairs', DoorType.SpiralStairs).dir(Direction.Up, 0x09, 1, HTH).ss(A, 0x31, 0x69, True, True),
create_door(player, 'PoD Warp Room Up Stairs', DoorType.SpiralStairs).dir(Direction.Up, 0x09, 0, HTH).ss(S, 0x30, 0x69, True, True),
create_door(player, 'PoD Warp Room Warp', DoorType.Warp),
create_door(player, 'PoD Pit Room S', DoorType.Normal).dir(Direction.South, 0x3a, Mid, High).small_key().pos(0),
create_door(player, 'PoD Pit Room NW', DoorType.Normal).dir(Direction.North, 0x3a, Left, High).pos(1),
create_door(player, 'PoD Pit Room NE', DoorType.Normal).dir(Direction.North, 0x3a, Right, High).pos(2),
create_door(player, 'PoD Pit Room Freefall', DoorType.Hole),
create_door(player, 'PoD Pit Room Bomb Hole', DoorType.Hole),
create_door(player, 'PoD Big Key Landing Hole', DoorType.Hole),
create_door(player, 'PoD Big Key Landing Down Stairs', DoorType.SpiralStairs).dir(Direction.Down, 0x3a, 0, HTH).ss(A, 0x11, 0x00),
create_door(player, 'PoD Basement Ledge Up Stairs', DoorType.SpiralStairs).dir(Direction.Up, 0x0a, 0, HTH).ss(A, 0x1a, 0xec).small_key().pos(0),
create_door(player, 'PoD Basement Ledge Drop Down', DoorType.Logical),
create_door(player, 'PoD Stalfos Basement Warp', DoorType.Warp),
create_door(player, 'PoD Arena Main SW', DoorType.Normal).dir(Direction.South, 0x2a, Left, High).pos(4),
create_door(player, 'PoD Arena Bridge SE', DoorType.Normal).dir(Direction.South, 0x2a, Right, High).pos(5),
create_door(player, 'PoD Arena Main NW', DoorType.Normal).dir(Direction.North, 0x2a, Left, High).small_key().pos(1),
create_door(player, 'PoD Arena Main NE', DoorType.Normal).dir(Direction.North, 0x2a, Right, High).no_exit().trap(0x4).pos(0),
create_door(player, 'PoD Arena Main Crystal Path', DoorType.Logical),
create_door(player, 'PoD Arena Crystals E', DoorType.Normal).dir(Direction.East, 0x2a, Mid, High).pos(3),
create_door(player, 'PoD Arena Crystal Path', DoorType.Logical),
create_door(player, 'PoD Arena Bridge Drop Down', DoorType.Logical),
create_door(player, 'PoD Arena Ledge ES', DoorType.Normal).dir(Direction.East, 0x2a, Bot, High).pos(2),
create_door(player, 'PoD Sexy Statue W', DoorType.Normal).dir(Direction.West, 0x2b, Mid, High).pos(3),
create_door(player, 'PoD Sexy Statue NW', DoorType.Normal).dir(Direction.North, 0x2b, Left, High).trap(0x1).pos(2),
create_door(player, 'PoD Map Balcony Drop Down', DoorType.Logical),
create_door(player, 'PoD Map Balcony WS', DoorType.Normal).dir(Direction.West, 0x2b, Bot, High).pos(1),
create_door(player, 'PoD Map Balcony South Stairs', DoorType.StraightStairs).dir(Direction.South, 0x2b, Left, High),
create_door(player, 'PoD Conveyor North Stairs', DoorType.StraightStairs).dir(Direction.North, 0x3b, Left, High),
create_door(player, 'PoD Conveyor SW', DoorType.Normal).dir(Direction.South, 0x3b, Left, High).pos(0),
create_door(player, 'PoD Mimics 1 NW', DoorType.Normal).dir(Direction.North, 0x4b, Left, High).trap(0x4).pos(0),
create_door(player, 'PoD Mimics 1 SW', DoorType.Interior).dir(Direction.South, 0x4b, Left, High).pos(1),
create_door(player, 'PoD Jelly Hall NW', DoorType.Interior).dir(Direction.North, 0x4b, Left, High).pos(1),
create_door(player, 'PoD Jelly Hall NE', DoorType.Interior).dir(Direction.North, 0x4b, Right, High).pos(2),
create_door(player, 'PoD Warp Hint SE', DoorType.Interior).dir(Direction.South, 0x4b, Right, High).pos(2),
create_door(player, 'PoD Warp Hint Warp', DoorType.Warp),
create_door(player, 'PoD Falling Bridge SW', DoorType.Normal).dir(Direction.South, 0x1a, Left, High).small_key().pos(3),
create_door(player, 'PoD Falling Bridge WN', DoorType.Normal).dir(Direction.West, 0x1a, Top, High).small_key().pos(1),
create_door(player, 'PoD Falling Bridge EN', DoorType.Interior).dir(Direction.East, 0x1a, Top, High).pos(4),
create_door(player, 'PoD Big Chest Balcony W', DoorType.Normal).dir(Direction.West, 0x1a, Mid, High).pos(2),
create_door(player, 'PoD Dark Maze EN', DoorType.Normal).dir(Direction.East, 0x19, Top, High).small_key().pos(1),
create_door(player, 'PoD Dark Maze E', DoorType.Normal).dir(Direction.East, 0x19, Mid, High).pos(0),
create_door(player, 'PoD Compass Room WN', DoorType.Interior).dir(Direction.West, 0x1a, Top, High).pos(4),
create_door(player, 'PoD Compass Room SE', DoorType.Interior).dir(Direction.North, 0x1a, Mid, High).small_key().pos(0),
create_door(player, 'PoD Harmless Hellway NE', DoorType.Interior).dir(Direction.North, 0x1a, Right, High).small_key().pos(0),
create_door(player, 'PoD Harmless Hellway SE', DoorType.Normal).dir(Direction.South, 0x1a, Right, High).pos(5),
create_door(player, 'PoD Compass Room W Down Stairs', DoorType.SpiralStairs).dir(Direction.Down, 0x1a, 0, HTH).ss(S, 0x12, 0x50, True, True),
create_door(player, 'PoD Compass Room E Down Stairs', DoorType.SpiralStairs).dir(Direction.Down, 0x1a, 1, HTH).ss(S, 0x11, 0xb0, True, True),
create_door(player, 'PoD Dark Basement W Up Stairs', DoorType.SpiralStairs).dir(Direction.Up, 0x6a, 0, HTH).ss(S, 0x1b, 0x3c, True),
create_door(player, 'PoD Dark Basement E Up Stairs', DoorType.SpiralStairs).dir(Direction.Up, 0x6a, 1, HTH).ss(S, 0x1b, 0x9c, True),
create_door(player, 'PoD Dark Alley NE', DoorType.Normal).dir(Direction.North, 0x6a, Right, High).big_key().pos(0),
create_door(player, 'PoD Mimics 2 SW', DoorType.Normal).dir(Direction.South, 0x1b, Left, High).pos(1),
create_door(player, 'PoD Mimics 2 NW', DoorType.Interior).dir(Direction.North, 0x1b, Left, High).pos(0),
create_door(player, 'PoD Bow Statue SW', DoorType.Interior).dir(Direction.South, 0x1b, Left, High).pos(0),
create_door(player, 'PoD Bow Statue Down Ladder', DoorType.Ladder),
create_door(player, 'PoD Dark Pegs Up Ladder', DoorType.Ladder),
create_door(player, 'PoD Dark Pegs WN', DoorType.Interior).dir(Direction.West, 0x0b, Mid, High).small_key().pos(2),
create_door(player, 'PoD Lonely Turtle SW', DoorType.Interior).dir(Direction.South, 0x0b, Mid, High).pos(0),
create_door(player, 'PoD Lonely Turtle EN', DoorType.Interior).dir(Direction.East, 0x0b, Mid, High).small_key().pos(2),
create_door(player, 'PoD Turtle Party ES', DoorType.Interior).dir(Direction.East, 0x0b, Mid, High).pos(1),
create_door(player, 'PoD Turtle Party NW', DoorType.Interior).dir(Direction.North, 0x0b, Mid, High).pos(0),
create_door(player, 'PoD Callback WS', DoorType.Interior).dir(Direction.West, 0x0b, Mid, High).pos(1),
create_door(player, 'PoD Callback Warp', DoorType.Warp),
create_door(player, 'PoD Boss SE', DoorType.Normal).dir(Direction.South, 0x5a, Right, High).no_exit().trap(0x4).pos(0),
# Palace of Darkness
create_door(player, 'PoD Lobby N', Intr).dir(Direction.North, 0x4a, Mid, High).pos(2),
create_door(player, 'PoD Lobby NW', Intr).dir(Direction.North, 0x4a, Left, High).pos(0),
create_door(player, 'PoD Lobby NE', Intr).dir(Direction.North, 0x4a, Right, High).pos(1),
create_door(player, 'PoD Left Cage SW', Intr).dir(Direction.North, 0x4a, Left, High).pos(0),
create_door(player, 'PoD Middle Cage S', Intr).dir(Direction.North, 0x4a, Mid, High).pos(2),
create_door(player, 'PoD Middle Cage SE', Intr).dir(Direction.North, 0x4a, Right, High).pos(1),
create_door(player, 'PoD Left Cage Down Stairs', Sprl).dir(Direction.Down, 0x4a, 1, HTH).ss(A, 0x12, 0x80, False, True),
create_door(player, 'PoD Middle Cage Down Stairs', Sprl).dir(Direction.Down, 0x4a, 0, HTH).ss(S, 0x12, 0x80, False, True),
create_door(player, 'PoD Middle Cage N', Nrml).dir(Direction.North, 0x4a, Mid, High).small_key().pos(2),
create_door(player, 'PoD Shooter Room Up Stairs', Sprl).dir(Direction.Up, 0x09, 1, HTH).ss(A, 0x31, 0x69, True, True),
create_door(player, 'PoD Warp Room Up Stairs', Sprl).dir(Direction.Up, 0x09, 0, HTH).ss(S, 0x30, 0x69, True, True),
create_door(player, 'PoD Warp Room Warp', Warp),
create_door(player, 'PoD Pit Room S', Nrml).dir(Direction.South, 0x3a, Mid, High).small_key().pos(0),
create_door(player, 'PoD Pit Room NW', Nrml).dir(Direction.North, 0x3a, Left, High).pos(1),
create_door(player, 'PoD Pit Room NE', Nrml).dir(Direction.North, 0x3a, Right, High).pos(2),
create_door(player, 'PoD Pit Room Freefall', Hole),
create_door(player, 'PoD Pit Room Bomb Hole', Hole),
create_door(player, 'PoD Big Key Landing Hole', Hole),
create_door(player, 'PoD Big Key Landing Down Stairs', Sprl).dir(Direction.Down, 0x3a, 0, HTH).ss(A, 0x11, 0x00),
create_door(player, 'PoD Basement Ledge Up Stairs', Sprl).dir(Direction.Up, 0x0a, 0, HTH).ss(A, 0x1a, 0xec).small_key().pos(0),
create_door(player, 'PoD Basement Ledge Drop Down', Lgcl),
create_door(player, 'PoD Stalfos Basement Warp', Warp),
create_door(player, 'PoD Arena Main SW', Nrml).dir(Direction.South, 0x2a, Left, High).pos(4),
create_door(player, 'PoD Arena Bridge SE', Nrml).dir(Direction.South, 0x2a, Right, High).pos(5),
create_door(player, 'PoD Arena Main NW', Nrml).dir(Direction.North, 0x2a, Left, High).small_key().pos(1),
create_door(player, 'PoD Arena Main NE', Nrml).dir(Direction.North, 0x2a, Right, High).no_exit().trap(0x4).pos(0),
create_door(player, 'PoD Arena Main Crystal Path', Lgcl),
create_door(player, 'PoD Arena Crystals E', Nrml).dir(Direction.East, 0x2a, Mid, High).pos(3),
create_door(player, 'PoD Arena Crystal Path', Lgcl),
create_door(player, 'PoD Arena Bridge Drop Down', Lgcl),
create_door(player, 'PoD Arena Ledge ES', Nrml).dir(Direction.East, 0x2a, Bot, High).pos(2),
create_door(player, 'PoD Sexy Statue W', Nrml).dir(Direction.West, 0x2b, Mid, High).pos(3),
create_door(player, 'PoD Sexy Statue NW', Nrml).dir(Direction.North, 0x2b, Left, High).trap(0x1).pos(2),
create_door(player, 'PoD Map Balcony Drop Down', Lgcl),
create_door(player, 'PoD Map Balcony WS', Nrml).dir(Direction.West, 0x2b, Bot, High).pos(1),
create_door(player, 'PoD Map Balcony South Stairs', StrS).dir(Direction.South, 0x2b, Left, High),
create_door(player, 'PoD Conveyor North Stairs', StrS).dir(Direction.North, 0x3b, Left, High),
create_door(player, 'PoD Conveyor SW', Nrml).dir(Direction.South, 0x3b, Left, High).pos(0),
create_door(player, 'PoD Mimics 1 NW', Nrml).dir(Direction.North, 0x4b, Left, High).trap(0x4).pos(0),
create_door(player, 'PoD Mimics 1 SW', Intr).dir(Direction.South, 0x4b, Left, High).pos(1),
create_door(player, 'PoD Jelly Hall NW', Intr).dir(Direction.North, 0x4b, Left, High).pos(1),
create_door(player, 'PoD Jelly Hall NE', Intr).dir(Direction.North, 0x4b, Right, High).pos(2),
create_door(player, 'PoD Warp Hint SE', Intr).dir(Direction.South, 0x4b, Right, High).pos(2),
create_door(player, 'PoD Warp Hint Warp', Warp),
create_door(player, 'PoD Falling Bridge SW', Nrml).dir(Direction.South, 0x1a, Left, High).small_key().pos(3),
create_door(player, 'PoD Falling Bridge WN', Nrml).dir(Direction.West, 0x1a, Top, High).small_key().pos(1),
create_door(player, 'PoD Falling Bridge EN', Intr).dir(Direction.East, 0x1a, Top, High).pos(4),
create_door(player, 'PoD Big Chest Balcony W', Nrml).dir(Direction.West, 0x1a, Mid, High).pos(2),
create_door(player, 'PoD Dark Maze EN', Nrml).dir(Direction.East, 0x19, Top, High).small_key().pos(1),
create_door(player, 'PoD Dark Maze E', Nrml).dir(Direction.East, 0x19, Mid, High).pos(0),
create_door(player, 'PoD Compass Room WN', Intr).dir(Direction.West, 0x1a, Top, High).pos(4),
create_door(player, 'PoD Compass Room SE', Intr).dir(Direction.North, 0x1a, Mid, High).small_key().pos(0),
create_door(player, 'PoD Harmless Hellway NE', Intr).dir(Direction.North, 0x1a, Right, High).small_key().pos(0),
create_door(player, 'PoD Harmless Hellway SE', Nrml).dir(Direction.South, 0x1a, Right, High).pos(5),
create_door(player, 'PoD Compass Room W Down Stairs', Sprl).dir(Direction.Down, 0x1a, 0, HTH).ss(S, 0x12, 0x50, True, True),
create_door(player, 'PoD Compass Room E Down Stairs', Sprl).dir(Direction.Down, 0x1a, 1, HTH).ss(S, 0x11, 0xb0, True, True),
create_door(player, 'PoD Dark Basement W Up Stairs', Sprl).dir(Direction.Up, 0x6a, 0, HTH).ss(S, 0x1b, 0x3c, True),
create_door(player, 'PoD Dark Basement E Up Stairs', Sprl).dir(Direction.Up, 0x6a, 1, HTH).ss(S, 0x1b, 0x9c, True),
create_door(player, 'PoD Dark Alley NE', Nrml).dir(Direction.North, 0x6a, Right, High).big_key().pos(0),
create_door(player, 'PoD Mimics 2 SW', Nrml).dir(Direction.South, 0x1b, Left, High).pos(1),
create_door(player, 'PoD Mimics 2 NW', Intr).dir(Direction.North, 0x1b, Left, High).pos(0),
create_door(player, 'PoD Bow Statue SW', Intr).dir(Direction.South, 0x1b, Left, High).pos(0),
create_door(player, 'PoD Bow Statue Down Ladder', Lddr),
create_door(player, 'PoD Dark Pegs Up Ladder', Lddr),
create_door(player, 'PoD Dark Pegs WN', Intr).dir(Direction.West, 0x0b, Mid, High).small_key().pos(2),
create_door(player, 'PoD Lonely Turtle SW', Intr).dir(Direction.South, 0x0b, Mid, High).pos(0),
create_door(player, 'PoD Lonely Turtle EN', Intr).dir(Direction.East, 0x0b, Mid, High).small_key().pos(2),
create_door(player, 'PoD Turtle Party ES', Intr).dir(Direction.East, 0x0b, Mid, High).pos(1),
create_door(player, 'PoD Turtle Party NW', Intr).dir(Direction.North, 0x0b, Mid, High).pos(0),
create_door(player, 'PoD Callback WS', Intr).dir(Direction.West, 0x0b, Mid, High).pos(1),
create_door(player, 'PoD Callback Warp', Warp),
create_door(player, 'PoD Boss SE', Nrml).dir(Direction.South, 0x5a, Right, High).no_exit().trap(0x4).pos(0),
create_door(player, 'Swamp Lobby Moat', DoorType.Logical),
create_door(player, 'Swamp Entrance Down Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Entrance Moat', DoorType.Logical),
create_door(player, 'Swamp Pot Row Up Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Pot Row WN', DoorType.Normal).dir(Direction.West, 0x38, Top, High).pos(0),
create_door(player, 'Swamp Pot Row WS', DoorType.Normal).dir(Direction.West, 0x38, Bot, High).small_key().pos(1),
create_door(player, 'Swamp Map Ledge EN', DoorType.Normal).dir(Direction.East, 0x37, Top, High).pos(1),
create_door(player, 'Swamp Trench 1 Approach ES', DoorType.Normal).dir(Direction.East, 0x37, Bot, High).small_key().pos(3),
create_door(player, 'Swamp Trench 1 Approach Dry', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Approach Key', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Approach Swim Depart', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Nexus Approach', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Nexus Key', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Nexus N', DoorType.Interior).dir(Direction.North, 0x37, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 1 Alcove S', DoorType.Interior).dir(Direction.South, 0x37, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 1 Key Ledge Dry', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Key Approach', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Key Ledge Depart', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Key Ledge NW', DoorType.Interior).dir(Direction.North, 0x37, Left, High).small_key().pos(2),
create_door(player, 'Swamp Trench 1 Departure Dry', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Departure Approach', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Departure Key', DoorType.Logical),
create_door(player, 'Swamp Trench 1 Departure WS', DoorType.Normal).dir(Direction.West, 0x37, Bot, High).pos(4),
create_door(player, 'Swamp Hammer Switch SW', DoorType.Interior).dir(Direction.South, 0x37, Left, High).small_key().pos(2),
create_door(player, 'Swamp Hammer Switch WN', DoorType.Normal).dir(Direction.West, 0x37, Top, High).pos(0),
create_door(player, 'Swamp Hub ES', DoorType.Normal).dir(Direction.East, 0x36, Bot, High).pos(4),
create_door(player, 'Swamp Hub S', DoorType.Normal).dir(Direction.South, 0x36, Mid, Low).pos(5),
create_door(player, 'Swamp Hub WS', DoorType.Normal).dir(Direction.West, 0x36, Bot, High).pos(3),
create_door(player, 'Swamp Hub WN', DoorType.Normal).dir(Direction.West, 0x36, Top, High).small_key().pos(2),
create_door(player, 'Swamp Hub Hook Path', DoorType.Logical),
create_door(player, 'Swamp Hub Dead Ledge EN', DoorType.Normal).dir(Direction.East, 0x36, Top, High).pos(0),
create_door(player, 'Swamp Hub North Ledge N', DoorType.Normal).dir(Direction.North, 0x36, Mid, High).small_key().pos(1),
create_door(player, 'Swamp Hub North Ledge Drop Down', DoorType.Logical),
create_door(player, 'Swamp Donut Top N', DoorType.Normal).dir(Direction.North, 0x46, Mid, Low).pos(0),
create_door(player, 'Swamp Donut Top SE', DoorType.Interior).dir(Direction.South, 0x46, Right, Low).pos(2),
create_door(player, 'Swamp Donut Bottom NE', DoorType.Interior).dir(Direction.North, 0x46, Right, Low).pos(2),
create_door(player, 'Swamp Donut Bottom NW', DoorType.Interior).dir(Direction.North, 0x46, Left, Low).pos(1),
create_door(player, 'Swamp Compass Donut SW', DoorType.Interior).dir(Direction.South, 0x46, Left, Low).pos(1),
create_door(player, 'Swamp Compass Donut Push Block', DoorType.Logical),
create_door(player, 'Swamp Crystal Switch EN', DoorType.Normal).dir(Direction.East, 0x35, Top, High).small_key().pos(0),
create_door(player, 'Swamp Crystal Switch SE', DoorType.Interior).dir(Direction.South, 0x35, Right, High).pos(3),
create_door(player, 'Swamp Shortcut NE', DoorType.Interior).dir(Direction.North, 0x35, Right, High).pos(3),
create_door(player, 'Swamp Shortcut Blue Barrier', DoorType.Logical),
create_door(player, 'Swamp Trench 2 Pots ES', DoorType.Normal).dir(Direction.East, 0x35, Bot, High).pos(4),
create_door(player, 'Swamp Trench 2 Pots Blue Barrier', DoorType.Logical),
create_door(player, 'Swamp Trench 2 Pots Dry', DoorType.Logical),
create_door(player, 'Swamp Trench 2 Pots Wet', DoorType.Logical),
create_door(player, 'Swamp Trench 2 Blocks Pots', DoorType.Logical),
create_door(player, 'Swamp Trench 2 Blocks N', DoorType.Interior).dir(Direction.North, 0x35, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 2 Alcove S', DoorType.Interior).dir(Direction.South, 0x35, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 2 Departure Wet', DoorType.Logical),
create_door(player, 'Swamp Trench 2 Departure WS', DoorType.Normal).dir(Direction.West, 0x35, Bot, High).pos(2),
create_door(player, 'Swamp Big Key Ledge WN', DoorType.Normal).dir(Direction.West, 0x35, Top, High).pos(1),
create_door(player, 'Swamp West Shallows ES', DoorType.Normal).dir(Direction.East, 0x34, Bot, High).pos(1),
create_door(player, 'Swamp West Shallows Push Blocks', DoorType.Logical),
create_door(player, 'Swamp West Block Path Up Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp West Ledge Drop Down', DoorType.Logical),
create_door(player, 'Swamp West Ledge Hook Path', DoorType.Logical),
create_door(player, 'Swamp Barrier Ledge Drop Down', DoorType.Logical),
create_door(player, 'Swamp Barrier Ledge - Orange', DoorType.Logical),
create_door(player, 'Swamp Barrier EN', DoorType.Normal).dir(Direction.East, 0x34, Top, High).pos(0),
create_door(player, 'Swamp Barrier - Orange', DoorType.Logical),
create_door(player, 'Swamp Barrier Ledge Hook Path', DoorType.Logical),
create_door(player, 'Swamp Attic Down Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Attic Left Pit', DoorType.Hole),
create_door(player, 'Swamp Attic Right Pit', DoorType.Hole),
create_door(player, 'Swamp Push Statue S', DoorType.Normal).dir(Direction.South, 0x26, Mid, High).small_key().pos(0),
create_door(player, 'Swamp Push Statue NW', DoorType.Interior).dir(Direction.North, 0x26, Left, High).pos(1),
create_door(player, 'Swamp Push Statue NE', DoorType.Interior).dir(Direction.North, 0x26, Right, High).pos(2),
create_door(player, 'Swamp Push Statue Down Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Shooters SW', DoorType.Interior).dir(Direction.South, 0x26, Left, High).pos(1),
create_door(player, 'Swamp Shooters EN', DoorType.Interior).dir(Direction.East, 0x26, Top, High).pos(3),
create_door(player, 'Swamp Left Elbow WN', DoorType.Interior).dir(Direction.West, 0x26, Top, High).pos(3),
create_door(player, 'Swamp Left Elbow Down Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Right Elbow SE', DoorType.Interior).dir(Direction.South, 0x26, Right, High).pos(2),
create_door(player, 'Swamp Right Elbow Down Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Drain Left Up Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Drain WN', DoorType.Interior).dir(Direction.West, 0x76, Top, Low).pos(0),
create_door(player, 'Swamp Drain Left Switch', DoorType.Logical),
create_door(player, 'Swamp Drain Right Switch', DoorType.Logical),
create_door(player, 'Swamp Drain Right Up Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Flooded Room Up Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp Flooded Room WS', DoorType.Interior).dir(Direction.West, 0x76, Bot, Low).pos(1),
create_door(player, 'Swamp Basement Shallows NW', DoorType.Normal).dir(Direction.North, 0x76, Left, Low).toggler().pos(2),
create_door(player, 'Swamp Basement Shallows EN', DoorType.Interior).dir(Direction.West, 0x76, Top, Low).pos(0),
create_door(player, 'Swamp Basement Shallows ES', DoorType.Interior).dir(Direction.East, 0x76, Bot, Low).pos(1),
create_door(player, 'Swamp Waterfall Room SW', DoorType.Normal).dir(Direction.South, 0x66, Left, Low).toggler().pos(1),
create_door(player, 'Swamp Waterfall Room NW', DoorType.Interior).dir(Direction.North, 0x66, Left, Low).pos(3),
create_door(player, 'Swamp Waterfall Room NE', DoorType.Interior).dir(Direction.North, 0x66, Right, Low).pos(0),
create_door(player, 'Swamp Refill 1 SW', DoorType.Interior).dir(Direction.South, 0x66, Left, Low).pos(3),
create_door(player, 'Swamp Behind Waterfall SE', DoorType.Interior).dir(Direction.South, 0x66, Right, Low).pos(0),
create_door(player, 'Swamp Behind Waterfall Up Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp C Down Stairs', DoorType.SpiralStairs),
create_door(player, 'Swamp C SE', DoorType.Interior).dir(Direction.South, 0x16, Right, High).pos(2),
create_door(player, 'Swamp Waterway NE', DoorType.Interior).dir(Direction.North, 0x16, Right, High).pos(2),
create_door(player, 'Swamp Waterway N', DoorType.Interior).dir(Direction.North, 0x16, Mid, High).pos(0),
create_door(player, 'Swamp Waterway NW', DoorType.Interior).dir(Direction.North, 0x16, Left, High).small_key().pos(1),
create_door(player, 'Swamp I S', DoorType.Interior).dir(Direction.South, 0x16, Mid, High).pos(0),
create_door(player, 'Swamp T SW', DoorType.Interior).dir(Direction.South, 0x16, Left, High).small_key().pos(1),
create_door(player, 'Swamp T NW', DoorType.Normal).dir(Direction.North, 0x16, Left, High).pos(3),
create_door(player, 'Swamp Boss SW', DoorType.Normal).dir(Direction.South, 0x06, Left, High).pos(0),
create_door(player, 'Swamp Lobby Moat', Lgcl),
create_door(player, 'Swamp Entrance Down Stairs', Sprl).dir(Direction.Down, 0x28, 0, HTH).ss(A, 0x11, 0x80).small_key().pos(0),
create_door(player, 'Swamp Entrance Moat', Lgcl),
create_door(player, 'Swamp Pot Row Up Stairs', Sprl).dir(Direction.Up, 0x38, 0, HTH).ss(A, 0x1a, 0x6c, True),
create_door(player, 'Swamp Pot Row WN', Nrml).dir(Direction.West, 0x38, Top, High).pos(0),
create_door(player, 'Swamp Pot Row WS', Nrml).dir(Direction.West, 0x38, Bot, High).small_key().pos(1),
create_door(player, 'Swamp Map Ledge EN', Nrml).dir(Direction.East, 0x37, Top, High).pos(1),
create_door(player, 'Swamp Trench 1 Approach ES', Nrml).dir(Direction.East, 0x37, Bot, High).small_key().pos(3),
create_door(player, 'Swamp Trench 1 Approach Dry', Lgcl),
create_door(player, 'Swamp Trench 1 Approach Key', Lgcl),
create_door(player, 'Swamp Trench 1 Approach Swim Depart', Lgcl),
create_door(player, 'Swamp Trench 1 Nexus Approach', Lgcl),
create_door(player, 'Swamp Trench 1 Nexus Key', Lgcl),
create_door(player, 'Swamp Trench 1 Nexus N', Intr).dir(Direction.North, 0x37, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 1 Alcove S', Intr).dir(Direction.South, 0x37, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 1 Key Ledge Dry', Lgcl),
create_door(player, 'Swamp Trench 1 Key Approach', Lgcl),
create_door(player, 'Swamp Trench 1 Key Ledge Depart', Lgcl),
create_door(player, 'Swamp Trench 1 Key Ledge NW', Intr).dir(Direction.North, 0x37, Left, High).small_key().pos(2),
create_door(player, 'Swamp Trench 1 Departure Dry', Lgcl),
create_door(player, 'Swamp Trench 1 Departure Approach', Lgcl),
create_door(player, 'Swamp Trench 1 Departure Key', Lgcl),
create_door(player, 'Swamp Trench 1 Departure WS', Nrml).dir(Direction.West, 0x37, Bot, High).pos(4),
create_door(player, 'Swamp Hammer Switch SW', Intr).dir(Direction.South, 0x37, Left, High).small_key().pos(2),
create_door(player, 'Swamp Hammer Switch WN', Nrml).dir(Direction.West, 0x37, Top, High).pos(0),
create_door(player, 'Swamp Hub ES', Nrml).dir(Direction.East, 0x36, Bot, High).pos(4),
create_door(player, 'Swamp Hub S', Nrml).dir(Direction.South, 0x36, Mid, Low).pos(5),
create_door(player, 'Swamp Hub WS', Nrml).dir(Direction.West, 0x36, Bot, High).pos(3),
create_door(player, 'Swamp Hub WN', Nrml).dir(Direction.West, 0x36, Top, High).small_key().pos(2),
create_door(player, 'Swamp Hub Hook Path', Lgcl),
create_door(player, 'Swamp Hub Dead Ledge EN', Nrml).dir(Direction.East, 0x36, Top, High).pos(0),
create_door(player, 'Swamp Hub North Ledge N', Nrml).dir(Direction.North, 0x36, Mid, High).small_key().pos(1),
create_door(player, 'Swamp Hub North Ledge Drop Down', Lgcl),
create_door(player, 'Swamp Donut Top N', Nrml).dir(Direction.North, 0x46, Mid, Low).pos(0),
create_door(player, 'Swamp Donut Top SE', Intr).dir(Direction.South, 0x46, Right, Low).pos(2),
create_door(player, 'Swamp Donut Bottom NE', Intr).dir(Direction.North, 0x46, Right, Low).pos(2),
create_door(player, 'Swamp Donut Bottom NW', Intr).dir(Direction.North, 0x46, Left, Low).pos(1),
create_door(player, 'Swamp Compass Donut SW', Intr).dir(Direction.South, 0x46, Left, Low).pos(1),
create_door(player, 'Swamp Compass Donut Push Block', Lgcl),
create_door(player, 'Swamp Crystal Switch EN', Nrml).dir(Direction.East, 0x35, Top, High).small_key().pos(0),
create_door(player, 'Swamp Crystal Switch SE', Intr).dir(Direction.South, 0x35, Right, High).pos(3),
create_door(player, 'Swamp Shortcut NE', Intr).dir(Direction.North, 0x35, Right, High).pos(3),
create_door(player, 'Swamp Shortcut Blue Barrier', Lgcl),
create_door(player, 'Swamp Trench 2 Pots ES', Nrml).dir(Direction.East, 0x35, Bot, High).pos(4),
create_door(player, 'Swamp Trench 2 Pots Blue Barrier', Lgcl),
create_door(player, 'Swamp Trench 2 Pots Dry', Lgcl),
create_door(player, 'Swamp Trench 2 Pots Wet', Lgcl),
create_door(player, 'Swamp Trench 2 Blocks Pots', Lgcl),
create_door(player, 'Swamp Trench 2 Blocks N', Intr).dir(Direction.North, 0x35, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 2 Alcove S', Intr).dir(Direction.South, 0x35, Mid, Low).pos(5),
create_door(player, 'Swamp Trench 2 Departure Wet', Lgcl),
create_door(player, 'Swamp Trench 2 Departure WS', Nrml).dir(Direction.West, 0x35, Bot, High).pos(2),
create_door(player, 'Swamp Big Key Ledge WN', Nrml).dir(Direction.West, 0x35, Top, High).pos(1),
create_door(player, 'Swamp West Shallows ES', Nrml).dir(Direction.East, 0x34, Bot, High).pos(1),
create_door(player, 'Swamp West Shallows Push Blocks', Lgcl),
create_door(player, 'Swamp West Block Path Up Stairs', Sprl).dir(Direction.Up, 0x34, 0, HTH).ss(Z, 0x1b, 0x6c),
create_door(player, 'Swamp West Ledge Drop Down', Lgcl),
create_door(player, 'Swamp West Ledge Hook Path', Lgcl),
create_door(player, 'Swamp Barrier Ledge Drop Down', Lgcl),
create_door(player, 'Swamp Barrier Ledge - Orange', Lgcl),
create_door(player, 'Swamp Barrier EN', Nrml).dir(Direction.East, 0x34, Top, High).pos(0),
create_door(player, 'Swamp Barrier - Orange', Lgcl),
create_door(player, 'Swamp Barrier Ledge Hook Path', Lgcl),
create_door(player, 'Swamp Attic Down Stairs', Sprl).dir(Direction.Down, 0x54, 0, HTH).ss(Z, 0x12, 0x80),
create_door(player, 'Swamp Attic Left Pit', Hole),
create_door(player, 'Swamp Attic Right Pit', Hole),
create_door(player, 'Swamp Push Statue S', Nrml).dir(Direction.South, 0x26, Mid, High).small_key().pos(0),
create_door(player, 'Swamp Push Statue NW', Intr).dir(Direction.North, 0x26, Left, High).pos(1),
create_door(player, 'Swamp Push Statue NE', Intr).dir(Direction.North, 0x26, Right, High).pos(2),
create_door(player, 'Swamp Push Statue Down Stairs', Sprl).dir(Direction.Down, 0x26, 2, HTH).ss(X, 0x12, 0xc0, False, True),
create_door(player, 'Swamp Shooters SW', Intr).dir(Direction.South, 0x26, Left, High).pos(1),
create_door(player, 'Swamp Shooters EN', Intr).dir(Direction.East, 0x26, Top, High).pos(3),
create_door(player, 'Swamp Left Elbow WN', Intr).dir(Direction.West, 0x26, Top, High).pos(3),
create_door(player, 'Swamp Left Elbow Down Stairs', Sprl).dir(Direction.Down, 0x26, 0, HTH).ss(S, 0x11, 0x40, True, True),
create_door(player, 'Swamp Right Elbow SE', Intr).dir(Direction.South, 0x26, Right, High).pos(2),
create_door(player, 'Swamp Right Elbow Down Stairs', Sprl).dir(Direction.Down, 0x26, 1, HTH).ss(S, 0x12, 0xb0, True, True),
create_door(player, 'Swamp Drain Left Up Stairs', Sprl).dir(Direction.Up, 0x76, 0, HTH).ss(S, 0x1b, 0x2c, True, True),
create_door(player, 'Swamp Drain WN', Intr).dir(Direction.West, 0x76, Top, Low).pos(0),
create_door(player, 'Swamp Drain Left Switch', Lgcl),
create_door(player, 'Swamp Drain Right Switch', Lgcl),
create_door(player, 'Swamp Drain Right Up Stairs', Sprl).dir(Direction.Up, 0x76, 1, HTH).ss(S, 0x1b, 0x9c, True, True),
create_door(player, 'Swamp Flooded Room Up Stairs', Sprl).dir(Direction.Up, 0x76, 2, HTH).ss(X, 0x1a, 0xac, True, True),
create_door(player, 'Swamp Flooded Room WS', Intr).dir(Direction.West, 0x76, Bot, Low).pos(1),
create_door(player, 'Swamp Flooded Spot Ladder', Lgcl),
create_door(player, 'Swamp Flooded Room Ladder', Lgcl),
create_door(player, 'Swamp Basement Shallows NW', Nrml).dir(Direction.North, 0x76, Left, Low).toggler().pos(2),
create_door(player, 'Swamp Basement Shallows EN', Intr).dir(Direction.West, 0x76, Top, Low).pos(0),
create_door(player, 'Swamp Basement Shallows ES', Intr).dir(Direction.East, 0x76, Bot, Low).pos(1),
create_door(player, 'Swamp Waterfall Room SW', Nrml).dir(Direction.South, 0x66, Left, Low).toggler().pos(1),
create_door(player, 'Swamp Waterfall Room NW', Intr).dir(Direction.North, 0x66, Left, Low).pos(3),
create_door(player, 'Swamp Waterfall Room NE', Intr).dir(Direction.North, 0x66, Right, Low).pos(0),
create_door(player, 'Swamp Refill SW', Intr).dir(Direction.South, 0x66, Left, Low).pos(3),
create_door(player, 'Swamp Behind Waterfall SE', Intr).dir(Direction.South, 0x66, Right, Low).pos(0),
create_door(player, 'Swamp Behind Waterfall Up Stairs', Sprl).dir(Direction.Up, 0x66, 0, HTH).ss(S, 0x1a, 0x6c, True, True),
create_door(player, 'Swamp C Down Stairs', Sprl).dir(Direction.Down, 0x16, 0, HTH).ss(S, 0x11, 0x80, True, True),
create_door(player, 'Swamp C SE', Intr).dir(Direction.South, 0x16, Right, High).pos(2),
create_door(player, 'Swamp Waterway NE', Intr).dir(Direction.North, 0x16, Right, High).pos(2),
create_door(player, 'Swamp Waterway N', Intr).dir(Direction.North, 0x16, Mid, High).pos(0),
create_door(player, 'Swamp Waterway NW', Intr).dir(Direction.North, 0x16, Left, High).small_key().pos(1),
create_door(player, 'Swamp I S', Intr).dir(Direction.South, 0x16, Mid, High).pos(0),
create_door(player, 'Swamp T SW', Intr).dir(Direction.South, 0x16, Left, High).small_key().pos(1),
create_door(player, 'Swamp T NW', Nrml).dir(Direction.North, 0x16, Left, High).pos(3),
create_door(player, 'Swamp Boss SW', Nrml).dir(Direction.South, 0x06, Left, High).pos(0),
]
create_paired_doors(world, player)
# swamp events
world.get_door('Swamp Trench 1 Approach Key', player).event('Trench 1 Switch')
world.get_door('Swamp Trench 1 Approach Swim Depart', player).event('Trench 1 Switch')
world.get_door('Swamp Trench 1 Key Approach', player).event('Trench 1 Switch')
world.get_door('Swamp Trench 1 Key Ledge Depart', player).event('Trench 1 Switch')
world.get_door('Swamp Trench 1 Departure Approach', player).event('Trench 1 Switch')
world.get_door('Swamp Trench 1 Departure Key', player).event('Trench 1 Switch')
world.get_door('Swamp Trench 2 Pots Wet', player).event('Trench 2 Switch')
world.get_door('Swamp Trench 2 Departure Wet', player).event('Trench 2 Switch')
world.get_door('Swamp Drain WN', player).event('Swamp Drain')
world.get_door('Swamp Flooded Room WS', player).event('Swamp Drain')
world.get_door('Swamp Drain Left Switch', player).event('Swamp Drain')
world.get_door('Swamp Drain Right Switch', player).event('Swamp Drain')
world.get_door('Swamp Flooded Room Ladder', player).event('Swamp Drain')
#todo - new region for flooded chests???
# world.get_door('', player).event('')
# crystal switches and barriers
world.get_door('Swamp Crystal Switch EN', player).c_switch()
world.get_door('Swamp Crystal Switch SE', player).c_switch()
world.get_door('Swamp Shortcut Blue Barrier', player).barrier(CrystalBarrier.Blue)
world.get_door('Swamp Trench 2 Pots Blue Barrier', player).barrier(CrystalBarrier.Blue)
world.get_door('Swamp Barrier Ledge - Orange', player).barrier(CrystalBarrier.Orange)
world.get_door('Swamp Barrier - Orange', player).barrier(CrystalBarrier.Orange)
def create_paired_doors(world, player):
world.paired_doors[player] = [
@@ -472,51 +509,10 @@ def create_paired_doors(world, player):
]
def create_door(player, name, type):
return Door(player, name, type, None, None, None, None)
def create_dir_door(player, name, type, direction, room, doorIndex, layer):
d = Door(player, name, type, direction, room, doorIndex, layer)
return d
def create_spiral_stairs(player, name, type, direction, room,
door_index, layer, quadrant, shift_y, shift_x, zero_hz_cam=False, zero_vt_cam=False):
d = Door(player, name, type, direction, room, door_index, layer)
d.quadrant = quadrant
d.shiftY = shift_y
d.shiftX = shift_x
d.zeroHzCam = zero_hz_cam
d.zeroVtCam = zero_vt_cam
return d
def create_door(player, name, door_type):
return Door(player, name, door_type)
def ugly_door(door):
door.ugly = True
return door
def small_key(door):
door.smallKey = True
return door
def big_key(door):
door.bigKey = True
return door
def trap(door, trapFlag):
door.trapFlag = trapFlag
return door
def toggle(door):
door.toggle = True
return door
def blocked(door):
door.blocked = True
return door

View File

@@ -216,14 +216,14 @@ pod_regions = [
swamp_regions = [
'Swamp Lobby', 'Swamp Entrance', 'Swamp Pot Row', 'Swamp Map Ledge', 'Swamp Trench 1 Approach',
'Swamp Trench 1 Nexus', 'Swamp Trench 1 Alcove', 'Swamp Trench 1 Key Ledge', 'Swamp Trench 1 Departure'
'Swamp Hammer Switch', 'Swamp Hub', 'Swamp Hub Dead Ledge', 'Swamp Hub North Ledge', 'Swamp Donut Top'
'Swamp Donut Bottom', 'Swamp Compass Donut', 'Swamp Crystal Switch', 'Swamp Shortcut', 'Swamp Trench 2 Pots'
'Swamp Trench 2 Blocks', 'Swamp Trench 2 Alcove', 'Swamp Trench 2 Departure', 'Swamp Big Key Ledge'
'Swamp West Shallows', 'Swamp West Block Path', 'Swamp West Ledge', 'Swamp Barrier Ledge', 'Swamp Barrier'
'Swamp Attic', 'Swamp Push Statue', 'Swamp Shooters', 'Swamp Left Elbow', 'Swamp Right Elbow', 'Swamp Drain Left'
'Swamp Drain Right', 'Swamp Flooded Room', 'Swamp Basement Shallows', 'Swamp Waterfall Room', 'Swamp Refill 1'
'Swamp Behind Waterfall', 'Swamp C', 'Swamp Waterway', 'Swamp I', 'Swamp T', 'Swamp Boss'
'Swamp Trench 1 Nexus', 'Swamp Trench 1 Alcove', 'Swamp Trench 1 Key Ledge', 'Swamp Trench 1 Departure',
'Swamp Hammer Switch', 'Swamp Hub', 'Swamp Hub Dead Ledge', 'Swamp Hub North Ledge', 'Swamp Donut Top',
'Swamp Donut Bottom', 'Swamp Compass Donut', 'Swamp Crystal Switch', 'Swamp Shortcut', 'Swamp Trench 2 Pots',
'Swamp Trench 2 Blocks', 'Swamp Trench 2 Alcove', 'Swamp Trench 2 Departure', 'Swamp Big Key Ledge',
'Swamp West Shallows', 'Swamp West Block Path', 'Swamp West Ledge', 'Swamp Barrier Ledge', 'Swamp Barrier',
'Swamp Attic', 'Swamp Push Statue', 'Swamp Shooters', 'Swamp Left Elbow', 'Swamp Right Elbow', 'Swamp Drain Left',
'Swamp Drain Right', 'Swamp Flooded Room', 'Swamp Flooded Spot', 'Swamp Basement Shallows', 'Swamp Waterfall Room',
'Swamp Refill', 'Swamp Behind Waterfall', 'Swamp C', 'Swamp Waterway', 'Swamp I', 'Swamp T', 'Swamp Boss'
]
dungeon_regions = {

View File

@@ -2947,10 +2947,6 @@ mandatory_connections = [('Lake Hylia Central Island Pier', 'Lake Hylia Central
('Cave 45 Mirror Spot', 'Cave 45 Ledge'),
('Graveyard Ledge Mirror Spot', 'Graveyard Ledge'),
('Swamp Palace Moat', 'Swamp Palace (First Room)'),
('Swamp Palace Small Key Door', 'Swamp Palace (Starting Area)'),
('Swamp Palace (Center)', 'Swamp Palace (Center)'),
('Swamp Palace (North)', 'Swamp Palace (North)'),
('Thieves Town Big Key Door', 'Thieves Town (Deep)'),
('Skull Woods Torch Room', 'Skull Woods Final Section (Mothula)'),
('Skull Woods First Section Bomb Jump', 'Skull Woods First Section (Top)'), # represents bomb jumping to big chest
@@ -3543,7 +3539,7 @@ default_dungeon_connections = [('Desert Palace Entrance (South)', 'Desert Main L
('Misery Mire Exit', 'Dark Desert'),
('Palace of Darkness', 'PoD Lobby'),
('Palace of Darkness Exit', 'East Dark World'),
('Swamp Palace', 'Swamp Palace (Entrance)'), # requires additional patch for flooding moat if moved
('Swamp Palace', 'Swamp Lobby'), # requires additional patch for flooding moat if moved
('Swamp Palace Exit', 'South Dark World'),
('Turtle Rock', 'Turtle Rock (Entrance)'),

View File

@@ -174,6 +174,15 @@ def generate_itempool(world, player):
world.push_item(world.get_location('Floodgate', player), ItemFactory('Open Floodgate', player), False)
world.get_location('Floodgate', player).event = True
world.get_location('Floodgate', player).locked = True
world.push_item(world.get_location('Trench 1 Switch', player), ItemFactory('Trench 1 Filled', player), False)
world.get_location('Trench 1 Switch', player).event = True
world.get_location('Trench 1 Switch', player).locked = True
world.push_item(world.get_location('Trench 2 Switch', player), ItemFactory('Trench 2 Filled', player), False)
world.get_location('Trench 2 Switch', player).event = True
world.get_location('Trench 2 Switch', player).locked = True
world.push_item(world.get_location('Swamp Drain', player), ItemFactory('Drained Swamp', player), False)
world.get_location('Swamp Drain', player).event = True
world.get_location('Swamp Drain', player).locked = True
# set up item pool
if world.custom:

View File

@@ -172,4 +172,7 @@ item_table = {'Bow': (True, False, None, 0x0B, 'You have\nchosen the\narcher cla
'Return Smith': (True, False, 'Event', None, None, None, None, None, None, None, None),
'Pick Up Purple Chest': (True, False, 'Event', None, None, None, None, None, None, None, None),
'Open Floodgate': (True, False, 'Event', None, None, None, None, None, None, None, None),
'Trench 1 Filled': (True, False, 'Event', None, None, None, None, None, None, None, None),
'Trench 2 Filled': (True, False, 'Event', None, None, None, None, None, None, None, None),
'Drained Swamp': (True, False, 'Event', None, None, None, None, None, None, None, None),
}

View File

@@ -89,7 +89,7 @@ def main(args, seed=None):
# todo: remove this later. this is for debugging
for player in range(1, world.players + 1):
all_state = world.get_all_state(keys=True)
for bossregion in ['Eastern Boss', 'Desert Boss', 'Hera Boss', 'Tower Agahnim 1', 'PoD Boss']:
for bossregion in ['Eastern Boss', 'Desert Boss', 'Hera Boss', 'Tower Agahnim 1', 'PoD Boss', 'Swamp Boss']:
if world.get_region(bossregion, player) not in all_state.reachable_regions[player]:
raise Exception(bossregion + ' missing from generation')

View File

@@ -420,14 +420,14 @@ def create_regions(world, player):
create_dungeon_region(player, 'Swamp Trench 1 Alcove', 'Swamp Palace', ['Swamp Palace - Trench 1 Pot Key'], ['Swamp Trench 1 Alcove S']),
create_dungeon_region(player, 'Swamp Trench 1 Key Ledge', 'Swamp Palace', None, ['Swamp Trench 1 Key Ledge Dry', 'Swamp Trench 1 Key Approach', 'Swamp Trench 1 Key Ledge Depart', 'Swamp Trench 1 Key Ledge NW']),
create_dungeon_region(player, 'Swamp Trench 1 Departure', 'Swamp Palace', None, ['Swamp Trench 1 Departure Dry', 'Swamp Trench 1 Departure Approach', 'Swamp Trench 1 Departure Key', 'Swamp Trench 1 Departure WS']),
create_dungeon_region(player, 'Swamp Hammer Switch', 'Swamp Palace', None, ['Swamp Hammer Switch SW', 'Swamp Hammer Switch WN']),
create_dungeon_region(player, 'Swamp Hammer Switch', 'Swamp Palace', ['Trench 1 Switch'], ['Swamp Hammer Switch SW', 'Swamp Hammer Switch WN']),
create_dungeon_region(player, 'Swamp Hub', 'Swamp Palace', ['Swamp Palace - Big Chest', 'Swamp Palace - Hookshot Pot Key'], ['Swamp Hub ES', 'Swamp Hub S', 'Swamp Hub WS', 'Swamp Hub WN', 'Swamp Hub Hook Path']),
create_dungeon_region(player, 'Swamp Hub Dead Ledge', 'Swamp Palace', None, ['Swamp Hub Dead Ledge EN']),
create_dungeon_region(player, 'Swamp Hub North Ledge', 'Swamp Palace', None, ['Swamp Hub North Ledge N', 'Swamp Hub North Ledge Drop Down']),
create_dungeon_region(player, 'Swamp Donut Top', 'Swamp Palace', None, ['Swamp Donut Top N', 'Swamp Donut Top SE']),
create_dungeon_region(player, 'Swamp Donut Bottom', 'Swamp Palace', None, ['Swamp Donut Bottom NE', 'Swamp Donut Bottom NW']),
create_dungeon_region(player, 'Swamp Compass Donut', 'Swamp Palace', ['Swamp Palace - Compass Chest'], ['Swamp Compass Donut SW', 'Swamp Compass Donut Push Block']),
create_dungeon_region(player, 'Swamp Crystal Switch', 'Swamp Palace', None, ['Swamp Crystal Switch EN', 'Swamp Crystal Switch SE']),
create_dungeon_region(player, 'Swamp Crystal Switch', 'Swamp Palace', ['Trench 2 Switch'], ['Swamp Crystal Switch EN', 'Swamp Crystal Switch SE']),
create_dungeon_region(player, 'Swamp Shortcut', 'Swamp Palace', None, ['Swamp Shortcut NE', 'Swamp Shortcut Blue Barrier']),
create_dungeon_region(player, 'Swamp Trench 2 Pots', 'Swamp Palace', None, ['Swamp Trench 2 Pots ES', 'Swamp Trench 2 Pots Blue Barrier', 'Swamp Trench 2 Pots Dry', 'Swamp Trench 2 Pots Wet']),
create_dungeon_region(player, 'Swamp Trench 2 Blocks', 'Swamp Palace', None, ['Swamp Trench 2 Blocks Pots', 'Swamp Trench 2 Blocks N']),
@@ -445,11 +445,13 @@ def create_regions(world, player):
create_dungeon_region(player, 'Swamp Left Elbow', 'Swamp Palace', None, ['Swamp Left Elbow WN', 'Swamp Left Elbow Down Stairs']),
create_dungeon_region(player, 'Swamp Right Elbow', 'Swamp Palace', None, ['Swamp Right Elbow SE', 'Swamp Right Elbow Down Stairs']),
create_dungeon_region(player, 'Swamp Drain Left', 'Swamp Palace', None, ['Swamp Drain Left Up Stairs', 'Swamp Drain WN', 'Swamp Drain Left Switch']),
create_dungeon_region(player, 'Swamp Drain Right', 'Swamp Palace', None, ['Swamp Drain Right Switch', 'Swamp Drain Right Up Stairs']),
create_dungeon_region(player, 'Swamp Flooded Room', 'Swamp Palace', ['Swamp Palace - Flooded Room - Left', 'Swamp Palace - Flooded Room - Right'], ['Swamp Flooded Room Up Stairs', 'Swamp Flooded Room WS']),
create_dungeon_region(player, 'Swamp Drain Right', 'Swamp Palace', ['Swamp Drain'], ['Swamp Drain Right Switch', 'Swamp Drain Right Up Stairs']),
# This is intentionally odd so I don't have to treat the WS door in the Flooded Room oddly (because of how it works when going backward)
create_dungeon_region(player, 'Swamp Flooded Room', 'Swamp Palace', None, ['Swamp Flooded Room Up Stairs', 'Swamp Flooded Room Ladder', 'Swamp Flooded Room WS']),
create_dungeon_region(player, 'Swamp Flooded Spot', 'Swamp Palace', ['Swamp Palace - Flooded Room - Left', 'Swamp Palace - Flooded Room - Right'], ['Swamp Flooded Spot Ladder']),
create_dungeon_region(player, 'Swamp Basement Shallows', 'Swamp Palace', None, ['Swamp Basement Shallows NW', 'Swamp Basement Shallows EN', 'Swamp Basement Shallows ES']),
create_dungeon_region(player, 'Swamp Waterfall Room', 'Swamp Palace', ['Swamp Palace - Waterfall Room'], ['Swamp Waterfall Room SW', 'Swamp Waterfall Room NW', 'Swamp Waterfall Room NE']),
create_dungeon_region(player, 'Swamp Refill 1', 'Swamp Palace', None, ['Swamp Refill 1 SW']),
create_dungeon_region(player, 'Swamp Refill', 'Swamp Palace', None, ['Swamp Refill SW']),
create_dungeon_region(player, 'Swamp Behind Waterfall', 'Swamp Palace', None, ['Swamp Behind Waterfall SE', 'Swamp Behind Waterfall Up Stairs']),
create_dungeon_region(player, 'Swamp C', 'Swamp Palace', None, ['Swamp C Down Stairs', 'Swamp C SE']),
create_dungeon_region(player, 'Swamp Waterway', 'Swamp Palace', ['Swamp Palace - Waterway Pot Key'], ['Swamp Waterway NE', 'Swamp Waterway N', 'Swamp Waterway NW']),
@@ -591,6 +593,12 @@ key_only_locations = {
'Swamp Palace - Waterway Pot Key': 'Small Key (Swamp Palace)'
}
dungeon_events = [
'Trench 1 Switch',
'Trench 2 Switch',
'Swamp Drain'
]
# todo: escape big key? - should be separate from above for dungeon key layout validation
location_table = {'Mushroom': (0x180013, False, 'in the woods'),
@@ -816,6 +824,9 @@ location_table = {'Mushroom': (0x180013, False, 'in the woods'),
'Frog': (None, False, None),
'Missing Smith': (None, False, None),
'Dark Blacksmith Ruins': (None, False, None),
'Trench 1 Switch': (None, False, None),
'Trench 2 Switch': (None, False, None),
'Swamp Drain': (None, False, None),
'Eastern Palace - Prize': ([0x1209D, 0x53EF8, 0x53EF9, 0x180052, 0x18007C, 0xC6FE], True, 'Eastern Palace'),
'Desert Palace - Prize': ([0x1209E, 0x53F1C, 0x53F1D, 0x180053, 0x180078, 0xC6FF], True, 'Desert Palace'),
'Tower of Hera - Prize': ([0x120A5, 0x53F0A, 0x53F0B, 0x18005A, 0x18007A, 0xC706], True, 'Tower of Hera'),

2
Rom.py
View File

@@ -18,7 +18,7 @@ from EntranceShuffle import door_addresses
JAP10HASH = '03a63945398191337e896e5771f77173'
RANDOMIZERBASEHASH = 'fdf74815ca2ad15186daa9de3e68cecb'
RANDOMIZERBASEHASH = 'b2e727f283c249568b4603166ea83977'
class JsonRom(object):

View File

@@ -315,21 +315,45 @@ def global_rules(world, player):
set_defeat_dungeon_boss_rule(world.get_location('Palace of Darkness - Prize', player))
generate_key_logic(region_starts['Palace of Darkness'], 'Small Key (Palace of Darkness)', world, player)
# End of door rando rules.
set_rule(world.get_entrance('Swamp Palace Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
add_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', player))
set_rule(world.get_entrance('Swamp Palace Small Key Door', player), lambda state: state.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 != 'locations':
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))
set_rule(world.get_entrance('Swamp Lobby Moat', player), lambda state: state.has('Flippers', player) and state.has('Open Floodgate', player))
set_rule(world.get_entrance('Swamp Trench 1 Approach Dry', player), lambda state: not state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Key Ledge Dry', player), lambda state: not state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Departure Dry', player), lambda state: not state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Approach Key', player), lambda state: state.has('Flippers', player) and state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Approach Swim Depart', player), lambda state: state.has('Flippers', player) and state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Key Approach', player), lambda state: state.has('Flippers', player) and state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Key Ledge Depart', player), lambda state: state.has('Flippers', player) and state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Departure Approach', player), lambda state: state.has('Flippers', player) and state.has('Trench 1 Filled', player))
set_rule(world.get_entrance('Swamp Trench 1 Departure Key', player), lambda state: state.has('Flippers', player) and state.has('Trench 1 Filled', player))
set_rule(world.get_location('Trench 1 Switch', player), lambda state: state.has('Hammer', player))
set_rule(world.get_entrance('Swamp Hub Hook Path', player), lambda state: state.has('Hookshot', player))
set_rule(world.get_location('Swamp Palace - Hookshot Pot Key', player), lambda state: state.has('Hookshot', player))
set_rule(world.get_entrance('Swamp Trench 2 Pots Dry', player), lambda state: not state.has('Trench 2 Filled', player))
set_rule(world.get_entrance('Swamp Trench 2 Pots Wet', player), lambda state: state.has('Flippers', player) and state.has('Trench 2 Filled', player))
set_rule(world.get_entrance('Swamp Trench 2 Departure Wet', player), lambda state: state.has('Flippers', player) and state.has('Trench 2 Filled', player))
set_rule(world.get_entrance('Swamp West Ledge Hook Path', player), lambda state: state.has('Hookshot', player))
set_rule(world.get_entrance('Swamp Barrier Ledge Hook Path', player), lambda state: state.has('Hookshot', player))
set_rule(world.get_entrance('Swamp Drain Left Switch', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_entrance('Swamp Drain Right Switch', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_entrance('Swamp Drain WN', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_entrance('Swamp Flooded Room WS', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_entrance('Swamp Flooded Room Ladder', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_location('Swamp Palace - Flooded Room - Left', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_location('Swamp Palace - Flooded Room - Right', player), lambda state: state.has('Drained Swamp', player))
set_rule(world.get_entrance('Swamp Waterway NW', player), lambda state: state.has('Flippers', player))
set_rule(world.get_entrance('Swamp Waterway N', player), lambda state: state.has('Flippers', player))
set_rule(world.get_entrance('Swamp Waterway NE', player), lambda state: state.has('Flippers', player))
set_rule(world.get_location('Swamp Palace - Waterway Pot Key', player), lambda state: state.has('Flippers', player))
set_rule(world.get_location('Swamp Palace - Big Chest', player), lambda state: state.has('Big Key (Swamp Palace)', player))
if world.accessibility == 'locations':
forbid_item(world.get_location('Swamp Palace - Big Chest', player), 'Big Key (Swamp Palace)', player)
set_defeat_dungeon_boss_rule(world.get_location('Swamp Palace - Boss', player))
set_defeat_dungeon_boss_rule(world.get_location('Swamp Palace - Prize', player))
for location in ['Swamp Palace - Entrance']:
forbid_item(world.get_location(location, player), 'Big Key (Swamp Palace)', player)
generate_key_logic(region_starts['Swamp Palace'], 'Small Key (Swamp Palace)', world, player)
# End of door rando rules.
add_rule(world.get_location('Sunken Treasure', player), lambda state: state.has('Open Floodgate', 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.has_key('Small Key (Thieves Town)', player))

View File

@@ -8,13 +8,12 @@ RecordStairType: {
SpiralWarp: {
lda $040c : cmp.b #$ff : beq .abort ; abort if not in dungeon
cmp #$14 : beq .check ; hera is okay
cmp #$0c : beq .check ; pod is okay
cmp #$0A : bcs .abort ; abort if not supported yet -- todo: this needs to be altered/removed as more dungeons are implemented
cmp #$0e : bcs .abort ; abort if not supported yet -- todo: this needs to be altered/removed as more dungeons are implemented
.check
lda $045e : cmp #$5e : beq .gtg ; abort if not spiral - intended room is in A!
cmp #$5f : beq .gtg
.abort
stz $045e : lda $a2 : and #$0f : rtl ; clear,run highjack code and get out
stz $045e : lda $a2 : and #$0f : rtl ; clear,run hijacked code and get out
.gtg
phb : phk : plb : phx : phy ; push stuff
@@ -90,15 +89,22 @@ LookupSpiralOffset: {
cmp #$02 : beq .quad2
cmp #$03 : beq .quad3
.quad0
inc $01 : lda $22 : cmp #$98 : bcc .done ;gt ent and hc stairwell
inc $01 : lda $a2
cmp #$0c : beq .q0diff ;gt ent
cmp #$70 : bne .done ;hc stairwell
.q0diff lda $22 : cmp #$98 : bcc .done ;gt ent and hc stairwell
inc $01 : bra .done
.quad1
lda $040c : cmp $0a : beq .q1diff : cmp $0c : bne .done
.q1diff lda $22 : cmp #$98 : bcc .done ;swamp/pod dual stairs
lda $a2
cmp #$1a : beq .q1diff ;pod compass
cmp #$26 : beq .q1diff ;swamp elbows
cmp #$6a : beq .q1diff ;pod dark basement
cmp #$76 : bne .done ;swamp drain
.q1diff lda $22 : cmp #$98 : bcc .done
inc $01 : bra .done
.quad2 ;ice room
lda #$03 : sta $01
lda $040c : cmp $12 : bne .done
.quad2
lda #$03 : sta $01 : lda $a2
cmp #$5f : bne .done ;ice u room
lda $22 : cmp #$78 : bcc .done
inc $01 : bra .done
.quad3 lda #$02 : sta $01 ; always 2

File diff suppressed because one or more lines are too long