Kill Landing/Warp End "Doors"

This commit is contained in:
aerinon
2019-09-19 14:44:33 -06:00
parent 6534aaecc6
commit e66908816d
4 changed files with 17 additions and 22 deletions

View File

@@ -863,7 +863,6 @@ class Door(object):
self.dest = None self.dest = None
self.parentChunk = None self.parentChunk = None
self.blocked = False # Indicates if the door is normally blocked off. (Sanc door or always closed) self.blocked = False # Indicates if the door is normally blocked off. (Sanc door or always closed)
self.landing = False # Indicates a door only for matching Holes/Warp # Todo: add to those
self.smallKey = False # There's a small key door on this side 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.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.ugly = False # Indicates that it can't be seen from the front (e.g. back of a big key door)

View File

@@ -215,10 +215,12 @@ def shuffle_dungeon(world, player, start_region_names, dungeon_region_names):
if connect_door.ugly: if connect_door.ugly:
next_ugly_region += 1 next_ugly_region += 1
new_room_ugly_region = next_ugly_region new_room_ugly_region = next_ugly_region
is_new_region = connect_region in available_regions
# Add the doors # Add the doors
for door in get_doors(world, connect_region, player): for door in get_doors(world, connect_region, player):
ugly_regions[door.name] = new_room_ugly_region ugly_regions[door.name] = new_room_ugly_region
available_doors.append(door) if is_new_region:
available_doors.append(door)
# If an ugly door is anything but the connect door, panic and die # If an ugly door is anything but the connect door, panic and die
if door != connect_door and door.ugly: if door != connect_door and door.ugly:
logger.info('Failed because of ugly door, trying again.') logger.info('Failed because of ugly door, trying again.')
@@ -226,15 +228,18 @@ def shuffle_dungeon(world, player, start_region_names, dungeon_region_names):
return return
# We've used this region and door, so don't use them again # We've used this region and door, so don't use them again
available_regions.remove(connect_region) if is_new_region:
available_doors.remove(connect_door) available_regions.remove(connect_region)
if connect_door in available_doors:
available_doors.remove(connect_door)
else: else:
# If there's no available region with a door, use an internal connection # If there's no available region with a door, use an internal connection
connect_door = find_compatible_door_in_list(ugly_regions, world, door, available_doors, player) connect_door = find_compatible_door_in_list(ugly_regions, world, door, available_doors, player)
if connect_door is not None: if connect_door is not None:
logger.info(' Adding loop via %s', connect_door.name) logger.info(' Adding loop via %s', connect_door.name)
maybe_connect_two_way(world, door, connect_door, player) maybe_connect_two_way(world, door, connect_door, player)
available_doors.remove(connect_door) if connect_door in available_doors:
available_doors.remove(connect_door)
# Check that we used everything, and retry if we failed # Check that we used everything, and retry if we failed
if len(available_regions) > 0 or len(available_doors) > 0: if len(available_regions) > 0 or len(available_doors) > 0:
logger.info('Failed to add all regions to dungeon, trying again.') logger.info('Failed to add all regions to dungeon, trying again.')
@@ -263,6 +268,8 @@ def maybe_connect_two_way(world, a, b, player):
# Finds a compatible door in regions, returns the region and door # Finds a compatible door in regions, returns the region and door
def find_compatible_door_in_regions(world, door, regions, player): def find_compatible_door_in_regions(world, door, regions, player):
if door.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]:
return door.dest, door
for region in regions: for region in regions:
for proposed_door in get_doors(world, region, player): for proposed_door in get_doors(world, region, player):
if doors_compatible(door, proposed_door): if doors_compatible(door, proposed_door):
@@ -270,6 +277,8 @@ def find_compatible_door_in_regions(world, door, regions, player):
return None, None return None, None
def find_compatible_door_in_list(ugly_regions, world, door, doors, player): def find_compatible_door_in_list(ugly_regions, world, door, doors, player):
if door.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]:
return door
for proposed_door in doors: for proposed_door in doors:
if ugly_regions[door.name] != ugly_regions[proposed_door.name]: if ugly_regions[door.name] != ugly_regions[proposed_door.name]:
continue continue
@@ -293,14 +302,12 @@ def doors_compatible(a, b):
return doors_fit_mandatory_pair(open_edges, a, b) return doors_fit_mandatory_pair(open_edges, a, b)
if a.type == DoorType.StraightStairs: if a.type == DoorType.StraightStairs:
return doors_fit_mandatory_pair(straight_staircases, a, b) return doors_fit_mandatory_pair(straight_staircases, a, b)
if a.type == DoorType.Hole:
return doors_fit_mandatory_pair(falldown_pits_as_doors, a, b)
if a.type == DoorType.Warp:
return doors_fit_mandatory_pair(dungeon_warps_as_doors, a, b)
if a.type == DoorType.Interior: if a.type == DoorType.Interior:
return doors_fit_mandatory_pair(interior_doors, a, b) return doors_fit_mandatory_pair(interior_doors, a, b)
if a.type == DoorType.Normal and (a.smallKey or b.smallKey or a.bigKey or b.bigKey): if a.type == DoorType.Normal and (a.smallKey or b.smallKey or a.bigKey or b.bigKey):
return doors_fit_mandatory_pair(key_doors, a, b) return doors_fit_mandatory_pair(key_doors, a, b)
if a.type in [DoorType.Hole, DoorType.Warp, DoorType.Logical]:
return False # these aren't compatible with anything
return a.direction == switch_dir(b.direction) return a.direction == switch_dir(b.direction)
@@ -712,15 +719,11 @@ falldown_pits = [
('Hera Boss Inner Hole', 'Hera 4F'), ('Hera Boss Inner Hole', 'Hera 4F'),
] ]
falldown_pits_as_doors = [('Eastern Courtyard Potholes', 'Eastern Fairy Landing')]
dungeon_warps = [ dungeon_warps = [
('Eastern Fairies\' Warp', 'Eastern Courtyard'), ('Eastern Fairies\' Warp', 'Eastern Courtyard'),
('Hera Fairies\' Warp', 'Hera 5F') ('Hera Fairies\' Warp', 'Hera 5F')
] ]
dungeon_warps_as_doors = [('Eastern Fairies\' Warp', 'Eastern Courtyard Warp End')]
interior_doors = [ interior_doors = [
('Hyrule Dungeon Armory Interior Key Door S', 'Hyrule Dungeon Armory Interior Key Door N'), ('Hyrule Dungeon Armory Interior Key Door S', 'Hyrule Dungeon Armory Interior Key Door N'),
('Hyrule Dungeon Map Room Key Door S', 'Hyrule Dungeon North Abyss Key Door N'), ('Hyrule Dungeon Map Room Key Door S', 'Hyrule Dungeon North Abyss Key Door N'),

View File

@@ -106,9 +106,7 @@ def create_doors(world, player):
create_dir_door(player, 'Eastern Courtyard EN', DoorType.Normal, Direction.East, 0xa9, Top, Low), create_dir_door(player, 'Eastern Courtyard EN', DoorType.Normal, Direction.East, 0xa9, Top, Low),
big_key(create_dir_door(player, 'Eastern Courtyard N', DoorType.Normal, Direction.North, 0xa9, Mid, High)), big_key(create_dir_door(player, 'Eastern Courtyard N', DoorType.Normal, Direction.North, 0xa9, Mid, High)),
create_door(player, 'Eastern Courtyard Potholes', DoorType.Hole), create_door(player, 'Eastern Courtyard Potholes', DoorType.Hole),
landing(create_door(player, 'Eastern Fairy Landing', DoorType.Hole)),
create_door(player, 'Eastern Fairies\' Warp', DoorType.Warp), create_door(player, 'Eastern Fairies\' Warp', DoorType.Warp),
landing(create_door(player, 'Eastern Courtyard Warp End', DoorType.Warp)),
create_dir_door(player, 'Eastern Map Valley WN', DoorType.Normal, Direction.West, 0xaa, Top, Low), create_dir_door(player, 'Eastern Map Valley WN', DoorType.Normal, Direction.West, 0xaa, Top, Low),
create_dir_door(player, 'Eastern Map Valley SW', DoorType.Normal, Direction.South, 0xaa, Left, High), create_dir_door(player, 'Eastern Map Valley SW', DoorType.Normal, Direction.South, 0xaa, Left, High),
create_dir_door(player, 'Eastern Dark Square NW', DoorType.Normal, Direction.North, 0xba, Left, High), create_dir_door(player, 'Eastern Dark Square NW', DoorType.Normal, Direction.North, 0xba, Left, High),
@@ -266,8 +264,3 @@ def toggle(door):
def blocked(door): def blocked(door):
door.blocked = True door.blocked = True
return door return door
def landing(door):
door.landing = True
return door

View File

@@ -319,8 +319,8 @@ def create_regions(world, player):
create_dungeon_region(player, 'Eastern Map Area', 'Eastern Palace', ['Eastern Palace - Map Chest'], ['Eastern Map Area W']), create_dungeon_region(player, 'Eastern Map Area', 'Eastern Palace', ['Eastern Palace - Map Chest'], ['Eastern Map Area W']),
create_dungeon_region(player, 'Eastern Compass Area', 'Eastern Palace', ['Eastern Palace - Compass Chest'], ['Eastern Compass Area E', 'Eastern Compass Area EN']), create_dungeon_region(player, 'Eastern Compass Area', 'Eastern Palace', ['Eastern Palace - Compass Chest'], ['Eastern Compass Area E', 'Eastern Compass Area EN']),
create_dungeon_region(player, 'Eastern Hint Tile Blocked Path', 'Eastern Palace', None, ['Eastern Compass Area SW', 'Eastern Hint Tile Push Block']), create_dungeon_region(player, 'Eastern Hint Tile Blocked Path', 'Eastern Palace', None, ['Eastern Compass Area SW', 'Eastern Hint Tile Push Block']),
create_dungeon_region(player, 'Eastern Courtyard', 'Eastern Palace', ['Eastern Palace - Big Chest'], ['Eastern Courtyard WN', 'Eastern Courtyard EN', 'Eastern Courtyard N', 'Eastern Courtyard Potholes', 'Eastern Courtyard Warp End']), create_dungeon_region(player, 'Eastern Courtyard', 'Eastern Palace', ['Eastern Palace - Big Chest'], ['Eastern Courtyard WN', 'Eastern Courtyard EN', 'Eastern Courtyard N', 'Eastern Courtyard Potholes']),
create_dungeon_region(player, 'Eastern Fairies', 'Eastern Palace', None, ['Eastern Fairies\' Warp', 'Eastern Fairy Landing']), create_dungeon_region(player, 'Eastern Fairies', 'Eastern Palace', None, ['Eastern Fairies\' Warp']),
create_dungeon_region(player, 'Eastern Map Valley', 'Eastern Palace', None, ['Eastern Map Valley WN', 'Eastern Map Valley SW']), create_dungeon_region(player, 'Eastern Map Valley', 'Eastern Palace', None, ['Eastern Map Valley WN', 'Eastern Map Valley SW']),
create_dungeon_region(player, 'Eastern Dark Square', 'Eastern Palace', ['Eastern Palace - Dark Square Pot Key'], ['Eastern Dark Square NW', 'Eastern Dark Square Key Door WN']), create_dungeon_region(player, 'Eastern Dark Square', 'Eastern Palace', ['Eastern Palace - Dark Square Pot Key'], ['Eastern Dark Square NW', 'Eastern Dark Square Key Door WN']),
create_dungeon_region(player, 'Eastern Big Key', 'Eastern Palace', ['Eastern Palace - Big Key Chest'], ['Eastern Big Key EN', 'Eastern Big Key NE']), create_dungeon_region(player, 'Eastern Big Key', 'Eastern Palace', ['Eastern Palace - Big Key Chest'], ['Eastern Big Key EN', 'Eastern Big Key NE']),