def cross_dungeon(world, player):
    fix_big_key_doors_with_ugly_smalls(world, player)
    overworld_prep(world, player)
    (entrances_map, potentials, connections) = determine_entrance_list(world, player)
    connections_tuple = (entrances_map, potentials, connections)
    all_sectors = []
    for key in dungeon_regions.keys():
        all_sectors.extend(convert_to_sectors(dungeon_regions[key], world, player))
    dungeon_builders = create_dungeon_builders(all_sectors, world, player)
    for builder in dungeon_builders.values():
        builder.entrance_list = list(entrances_map[builder.name])
        dungeon_obj = world.get_dungeon(builder.name, player)
        for sector in builder.sectors:
            for region in sector.regions:
                region.dungeon = dungeon_obj
                for loc in region.locations:
                    if (loc.name in key_only_locations):
                        key_name = (dungeon_keys[builder.name] if (loc.name != 'Hyrule Castle - Big Key Drop') else dungeon_bigs[builder.name])
                        loc.forced_item = loc.item = ItemFactory(key_name, player)
    recombinant_builders = {}
    handle_split_dungeons(dungeon_builders, recombinant_builders, entrances_map)
    main_dungeon_generation(dungeon_builders, recombinant_builders, connections_tuple, world, player)
    paths = determine_required_paths(world, player)
    check_required_paths(paths, world, player)
    hc = world.get_dungeon('Hyrule Castle', player)
    del hc.dungeon_items[0]
    hc.dungeon_items.append(ItemFactory('Compass (Escape)', player))
    at = world.get_dungeon('Agahnims Tower', player)
    at.dungeon_items.append(ItemFactory('Compass (Agahnims Tower)', player))
    gt = world.get_dungeon('Ganons Tower', player)
    del gt.dungeon_items[0]
    assign_cross_keys(dungeon_builders, world, player)
    all_dungeon_items = [y for x in world.dungeons if (x.player == player) for y in x.all_items]
    target_items = (34 if world.retro[player] else 63)
    d_items = (target_items - len(all_dungeon_items))
    if (d_items > 0):
        if (d_items >= 1):
            world.get_dungeon('Hyrule Castle', player).dungeon_items.append(ItemFactory('Map (Escape)', player))
        if (d_items >= 2):
            world.get_dungeon('Ganons Tower', player).dungeon_items.append(ItemFactory('Map (Ganons Tower)', player))
        if (d_items > 2):
            world.pool_adjustment[player] = (d_items - 2)
    elif (d_items < 0):
        world.pool_adjustment[player] = d_items
    smooth_door_pairs(world, player)
    gt = world.get_dungeon('Ganons Tower', player)
    for (name, builder) in dungeon_builders.items():
        reassign_boss('GT Ice Armos', 'bottom', builder, gt, world, player)
        reassign_boss('GT Lanmolas 2', 'middle', builder, gt, world, player)
        reassign_boss('GT Moldorm', 'top', builder, gt, world, player)
    if world.hints[player]:
        refine_hints(dungeon_builders)
def cross_dungeon(world, player):
    fix_big_key_doors_with_ugly_smalls(world, player)
    overworld_prep(world, player)
    (entrances_map, potentials, connections) = determine_entrance_list(world, player)
    connections_tuple = (entrances_map, potentials, connections)
    all_sectors = []
    for key in dungeon_regions.keys():
        all_sectors.extend(convert_to_sectors(dungeon_regions[key], world, player))
    dungeon_builders = create_dungeon_builders(all_sectors, world, player)
    for builder in dungeon_builders.values():
        builder.entrance_list = list(entrances_map[builder.name])
        dungeon_obj = world.get_dungeon(builder.name, player)
        for sector in builder.sectors:
            for region in sector.regions:
                region.dungeon = dungeon_obj
                for loc in region.locations:
                    if (loc.name in key_only_locations):
                        key_name = (dungeon_keys[builder.name] if (loc.name != 'Hyrule Castle - Big Key Drop') else dungeon_bigs[builder.name])
                        loc.forced_item = loc.item = ItemFactory(key_name, player)
    recombinant_builders = {}
    handle_split_dungeons(dungeon_builders, recombinant_builders, entrances_map)
    main_dungeon_generation(dungeon_builders, recombinant_builders, connections_tuple, world, player)
    paths = determine_required_paths(world, player)
    check_required_paths(paths, world, player)
    hc = world.get_dungeon('Hyrule Castle', player)
    del hc.dungeon_items[0]
    hc.dungeon_items.append(ItemFactory('Compass (Escape)', player))
    at = world.get_dungeon('Agahnims Tower', player)
    at.dungeon_items.append(ItemFactory('Compass (Agahnims Tower)', player))
    gt = world.get_dungeon('Ganons Tower', player)
    del gt.dungeon_items[0]
    assign_cross_keys(dungeon_builders, world, player)
    all_dungeon_items = [y for x in world.dungeons if (x.player == player) for y in x.all_items]
    target_items = (34 if world.retro[player] else 63)
    d_items = (target_items - len(all_dungeon_items))
    if (d_items > 0):
        if (d_items >= 1):
            world.get_dungeon('Hyrule Castle', player).dungeon_items.append(ItemFactory('Map (Escape)', player))
        if (d_items >= 2):
            world.get_dungeon('Ganons Tower', player).dungeon_items.append(ItemFactory('Map (Ganons Tower)', player))
        if (d_items > 2):
            world.pool_adjustment[player] = (d_items - 2)
    elif (d_items < 0):
        world.pool_adjustment[player] = d_items
    smooth_door_pairs(world, player)
    gt = world.get_dungeon('Ganons Tower', player)
    for (name, builder) in dungeon_builders.items():
        reassign_boss('GT Ice Armos', 'bottom', builder, gt, world, player)
        reassign_boss('GT Lanmolas 2', 'middle', builder, gt, world, player)
        reassign_boss('GT Moldorm', 'top', builder, gt, world, player)
    if world.hints[player]:
        refine_hints(dungeon_builders)