Merge remote-tracking branch 'origin/DoorDev' into DoorDev
This commit is contained in:
@@ -136,39 +136,20 @@ def vanilla_key_logic(world, player):
|
|||||||
world.dungeon_layouts[player][builder.name] = builder
|
world.dungeon_layouts[player][builder.name] = builder
|
||||||
|
|
||||||
overworld_prep(world, player)
|
overworld_prep(world, player)
|
||||||
entrances_map, potentials, connections = determine_entrance_list(world, player)
|
for builder in builders:
|
||||||
|
origin_list = find_accessible_entrances(world, player, default_dungeon_entrances[builder.name])
|
||||||
enabled_entrances = {}
|
start_regions = convert_regions(origin_list, world, player)
|
||||||
sector_queue = deque(builders)
|
doors = convert_key_doors(default_small_key_doors[builder.name], world, player)
|
||||||
last_key, loops = None, 0
|
key_layout = build_key_layout(builder, start_regions, doors, world, player)
|
||||||
while len(sector_queue) > 0:
|
valid = validate_key_layout(key_layout, world, player)
|
||||||
builder = sector_queue.popleft()
|
if not valid:
|
||||||
|
logging.getLogger('').warning('Vanilla key layout not valid %s', builder.name)
|
||||||
split_dungeon = builder.name.startswith('Desert Palace') or builder.name.startswith('Skull Woods')
|
builder.key_door_proposal = doors
|
||||||
origin_list = list(entrances_map[builder.name])
|
if player not in world.key_logic.keys():
|
||||||
find_enabled_origins(builder.sectors, enabled_entrances, origin_list, entrances_map, builder.name)
|
world.key_logic[player] = {}
|
||||||
if len(origin_list) <= 0 or not pre_validate(builder, origin_list, split_dungeon, world, player):
|
analyze_dungeon(key_layout, world, player)
|
||||||
if last_key == builder.name or loops > 1000:
|
world.key_logic[player][builder.name] = key_layout.key_logic
|
||||||
origin_name = world.get_region(origin_list[0], player).entrances[0].parent_region.name if len(origin_list) > 0 else 'no origin'
|
log_key_logic(builder.name, key_layout.key_logic)
|
||||||
raise Exception('Infinite loop detected for "%s" located at %s' % (builder.name, origin_name))
|
|
||||||
sector_queue.append(builder)
|
|
||||||
last_key = builder.name
|
|
||||||
loops += 1
|
|
||||||
else:
|
|
||||||
find_new_entrances(builder.master_sector, entrances_map, connections, potentials, enabled_entrances, world, player)
|
|
||||||
start_regions = convert_regions(origin_list, world, player)
|
|
||||||
doors = convert_key_doors(default_small_key_doors[builder.name], world, player)
|
|
||||||
key_layout = build_key_layout(builder, start_regions, doors, world, player)
|
|
||||||
valid = validate_key_layout(key_layout, world, player)
|
|
||||||
if not valid:
|
|
||||||
logging.getLogger('').warning('Vanilla key layout not valid %s', builder.name)
|
|
||||||
builder.key_door_proposal = doors
|
|
||||||
if player not in world.key_logic.keys():
|
|
||||||
world.key_logic[player] = {}
|
|
||||||
analyze_dungeon(key_layout, world, player)
|
|
||||||
world.key_logic[player][builder.name] = key_layout.key_logic
|
|
||||||
log_key_logic(builder.name, key_layout.key_logic)
|
|
||||||
last_key = None
|
|
||||||
if world.shuffle[player] == 'vanilla' and world.accessibility[player] == 'items' and not world.retro[player]:
|
if world.shuffle[player] == 'vanilla' and world.accessibility[player] == 'items' and not world.retro[player]:
|
||||||
validate_vanilla_key_logic(world, player)
|
validate_vanilla_key_logic(world, player)
|
||||||
|
|
||||||
@@ -391,8 +372,7 @@ def main_dungeon_generation(dungeon_builders, recombinant_builders, connections_
|
|||||||
combine_layouts(recombinant_builders, dungeon_builders, entrances_map)
|
combine_layouts(recombinant_builders, dungeon_builders, entrances_map)
|
||||||
world.dungeon_layouts[player] = {}
|
world.dungeon_layouts[player] = {}
|
||||||
for builder in dungeon_builders.values():
|
for builder in dungeon_builders.values():
|
||||||
find_enabled_origins([builder.master_sector], enabled_entrances, builder.layout_starts, entrances_map, builder.name)
|
builder.entrance_list = builder.layout_starts = builder.path_entrances = find_accessible_entrances(world, player, builder.all_entrances)
|
||||||
builder.path_entrances = entrances_map[builder.name]
|
|
||||||
world.dungeon_layouts[player] = dungeon_builders
|
world.dungeon_layouts[player] = dungeon_builders
|
||||||
|
|
||||||
|
|
||||||
@@ -545,8 +525,7 @@ def cross_dungeon(world, player):
|
|||||||
reassign_boss('GT Lanmolas 2', 'middle', builder, gt, world, player)
|
reassign_boss('GT Lanmolas 2', 'middle', builder, gt, world, player)
|
||||||
reassign_boss('GT Moldorm', 'top', builder, gt, world, player)
|
reassign_boss('GT Moldorm', 'top', builder, gt, world, player)
|
||||||
|
|
||||||
if world.hints[player]:
|
refine_hints(dungeon_builders)
|
||||||
refine_hints(dungeon_builders)
|
|
||||||
|
|
||||||
|
|
||||||
def assign_cross_keys(dungeon_builders, world, player):
|
def assign_cross_keys(dungeon_builders, world, player):
|
||||||
@@ -1165,6 +1144,33 @@ def find_inaccessible_regions(world, player):
|
|||||||
logger.debug('%s', r)
|
logger.debug('%s', r)
|
||||||
|
|
||||||
|
|
||||||
|
def find_accessible_entrances(world, player, entrances):
|
||||||
|
if world.mode[player] != 'inverted':
|
||||||
|
start_regions = ['Links House', 'Sanctuary']
|
||||||
|
else:
|
||||||
|
start_regions = ['Inverted Links House', 'Inverted Dark Sanctuary']
|
||||||
|
regs = convert_regions(start_regions, world, player)
|
||||||
|
visited_regions = set()
|
||||||
|
visited_entrances = []
|
||||||
|
queue = deque(regs)
|
||||||
|
while len(queue) > 0:
|
||||||
|
next_region = queue.popleft()
|
||||||
|
visited_regions.add(next_region)
|
||||||
|
if world.mode[player] == 'inverted' and next_region.name == 'Tower Agahnim 1':
|
||||||
|
connect = world.get_region('Hyrule Castle Ledge', player)
|
||||||
|
if connect not in queue and connect not in visited_regions:
|
||||||
|
queue.append(connect)
|
||||||
|
for ext in next_region.exits:
|
||||||
|
connect = ext.connected_region
|
||||||
|
if connect is None or ext.door and ext.door.blocked:
|
||||||
|
continue
|
||||||
|
if connect.name in entrances:
|
||||||
|
visited_entrances.append(connect.name)
|
||||||
|
elif connect and connect not in queue and connect not in visited_regions:
|
||||||
|
queue.append(connect)
|
||||||
|
return visited_entrances
|
||||||
|
|
||||||
|
|
||||||
def valid_inaccessible_region(r):
|
def valid_inaccessible_region(r):
|
||||||
return r.type is not RegionType.Cave or (len(r.exits) > 0 and r.name not in ['Links House', 'Chris Houlihan Room'])
|
return r.type is not RegionType.Cave or (len(r.exits) > 0 and r.name not in ['Links House', 'Chris Houlihan Room'])
|
||||||
|
|
||||||
|
|||||||
@@ -390,9 +390,9 @@ dungeon_hints = {
|
|||||||
'Tower of Hera': 'in Tower of Hera',
|
'Tower of Hera': 'in Tower of Hera',
|
||||||
'Agahnims Tower': 'in Castle Tower',
|
'Agahnims Tower': 'in Castle Tower',
|
||||||
'Palace of Darkness': 'in Palace of Darkness',
|
'Palace of Darkness': 'in Palace of Darkness',
|
||||||
'Swamp Palace': 'in Swamp Palace)',
|
'Swamp Palace': 'in Swamp Palace',
|
||||||
'Skull Woods': 'in Skull Woods',
|
'Skull Woods': 'in Skull Woods',
|
||||||
'Thieves Town': 'in Thieves\' Town)',
|
'Thieves Town': 'in Thieves\' Town',
|
||||||
'Ice Palace': 'in Ice Palace',
|
'Ice Palace': 'in Ice Palace',
|
||||||
'Misery Mire': 'in Misery Mire',
|
'Misery Mire': 'in Misery Mire',
|
||||||
'Turtle Rock': 'in Turtle Rock',
|
'Turtle Rock': 'in Turtle Rock',
|
||||||
|
|||||||
2
Rom.py
2
Rom.py
@@ -2358,12 +2358,12 @@ HintLocations = ['telepathic_tile_eastern_palace',
|
|||||||
InconvenientLocations = ['Spike Cave',
|
InconvenientLocations = ['Spike Cave',
|
||||||
'Sahasrahla',
|
'Sahasrahla',
|
||||||
'Purple Chest',
|
'Purple Chest',
|
||||||
'Tower of Hera - Big Key Chest',
|
|
||||||
'Magic Bat']
|
'Magic Bat']
|
||||||
|
|
||||||
InconvenientDungeonLocations = ['Swamp Left',
|
InconvenientDungeonLocations = ['Swamp Left',
|
||||||
'Mire Left',
|
'Mire Left',
|
||||||
'Eastern Palace - Big Key Chest',
|
'Eastern Palace - Big Key Chest',
|
||||||
|
'Tower of Hera - Big Key Chest',
|
||||||
'Thieves\' Town - Big Chest',
|
'Thieves\' Town - Big Chest',
|
||||||
'Ice Palace - Big Chest',
|
'Ice Palace - Big Chest',
|
||||||
'Ganons Tower - Big Chest']
|
'Ganons Tower - Big Chest']
|
||||||
|
|||||||
Reference in New Issue
Block a user