Exemple #1
0
def calculate_pool_results(layout_configuration: BaseConfiguration,
                           resource_database: ResourceDatabase,
                           base_patches: GamePatches = None,
                           rng: Random = None,
                           rng_required: bool = False
                           ) -> PoolResults:
    """
    Creates a PoolResults with all starting items and pickups in fixed locations, as well as a list of
    pickups we should shuffle.
    :param layout_configuration:
    :param resource_database:
    :return:
    """
    base_results = PoolResults([], {}, {})

    # Adding major items to the pool
    _extend_pool_results(base_results, add_major_items(resource_database,
                                                       layout_configuration.major_items_configuration,
                                                       layout_configuration.ammo_configuration))

    # Adding ammo to the pool
    base_results.pickups.extend(add_ammo(resource_database,
                                         layout_configuration.ammo_configuration))
    try:
        layout_configuration.game.generator.item_pool_creator(
            base_results, layout_configuration, resource_database, base_patches, rng,
        )
    except MissingRng as e:
        if rng_required:
            raise e

    return base_results
Exemple #2
0
def calculate_pool_results(
    layout_configuration: BaseConfiguration,
    resource_database: ResourceDatabase,
) -> PoolResults:
    """
    Creates a PoolResults with all starting items and pickups in fixed locations, as well as a list of
    pickups we should shuffle.
    :param layout_configuration:
    :param resource_database:
    :return:
    """
    base_results = PoolResults([], {}, {})

    # Adding major items to the pool
    _extend_pool_results(
        base_results,
        add_major_items(resource_database,
                        layout_configuration.major_items_configuration,
                        layout_configuration.ammo_configuration))

    # Adding ammo to the pool
    base_results.pickups.extend(
        add_ammo(
            resource_database, layout_configuration.ammo_configuration,
            layout_configuration.major_items_configuration.
            calculate_provided_ammo()))

    _GAME_SPECIFIC[layout_configuration.game](base_results,
                                              layout_configuration,
                                              resource_database)

    return base_results
Exemple #3
0
def calculate_pool_results(
    layout_configuration: EchoesConfiguration,
    resource_database: ResourceDatabase,
) -> PoolResults:
    """
    Creates a PoolResults with all starting items and pickups in fixed locations, as well as a list of
    pickups we should shuffle.
    :param layout_configuration:
    :param resource_database:
    :return:
    """
    base_results = PoolResults([], {}, {})

    # Adding major items to the pool
    _extend_pool_results(
        base_results,
        add_major_items(resource_database,
                        layout_configuration.major_items_configuration,
                        layout_configuration.ammo_configuration))

    # Adding ammo to the pool
    base_results.pickups.extend(
        add_ammo(
            resource_database, layout_configuration.ammo_configuration,
            layout_configuration.major_items_configuration.
            calculate_provided_ammo()))

    if layout_configuration.game == RandovaniaGame.PRIME2:
        # Adding Dark Temple Keys to pool
        _extend_pool_results(base_results,
                             add_dark_temple_keys(resource_database))

        # Adding Sky Temple Keys to pool
        _extend_pool_results(
            base_results,
            add_sky_temple_key_distribution_logic(
                resource_database, layout_configuration.sky_temple_keys))

    elif layout_configuration.game == RandovaniaGame.PRIME3:
        # Adding Energy Cells to pool
        _extend_pool_results(base_results, add_energy_cells(resource_database))

    elif layout_configuration.game == RandovaniaGame.PRIME1:
        _extend_pool_results(base_results, add_artifacts(resource_database))

    return base_results
Exemple #4
0
def calculate_pool_results(
    layout_configuration: LayoutConfiguration,
    resource_database: ResourceDatabase,
) -> PoolResults:
    """
    Creates a PoolResults with all starting items and pickups in fixed locations, as well as a list of
    pickups we should shuffle.
    :param layout_configuration:
    :param resource_database:
    :return:
    """
    base_results = ([], {}, {})

    # Adding major items to the pool
    _extend_pool_results(
        base_results,
        add_major_items(resource_database,
                        layout_configuration.major_items_configuration,
                        layout_configuration.ammo_configuration))

    # Adding ammo to the pool
    base_results[0].extend(
        add_ammo(
            resource_database, layout_configuration.ammo_configuration,
            layout_configuration.major_items_configuration.
            calculate_provided_ammo()))

    # Adding Dark Temple Keys to pool
    _extend_pool_results(base_results, add_dark_temple_keys(resource_database))

    # Adding Sky Temple Keys to pool
    _extend_pool_results(
        base_results,
        add_sky_temple_key_distribution_logic(
            resource_database, layout_configuration.sky_temple_keys))

    return base_results