コード例 #1
0
ファイル: test_trick_level.py プロジェクト: gollop/randovania
def test_set_level_for_trick_remove(echoes_resource_database):
    trick = echoes_resource_database.trick[0]
    config = TrickLevelConfiguration(False, {}, RandovaniaGame.PRIME2)

    assert config.level_for_trick(trick) == LayoutTrickLevel.DISABLED

    config = config.set_level_for_trick(trick, LayoutTrickLevel.ADVANCED)
    assert config.level_for_trick(trick) == LayoutTrickLevel.ADVANCED

    config = config.set_level_for_trick(trick, LayoutTrickLevel.DISABLED)
    assert config.level_for_trick(trick) == LayoutTrickLevel.DISABLED
コード例 #2
0
ファイル: bootstrap.py プロジェクト: ThomasJRyan/randovania
def trick_resources_for_configuration(configuration: TrickLevelConfiguration,
                                      resource_database: ResourceDatabase,
                                      ) -> CurrentResources:
    """
    :param configuration:
    :param resource_database:
    :return:
    """

    static_resources = {}

    for trick in resource_database.trick:
        if configuration.minimal_logic:
            level = LayoutTrickLevel.MINIMAL_LOGIC
        else:
            level = configuration.level_for_trick(trick)
        static_resources[trick] = level.as_number

    return static_resources
コード例 #3
0
ファイル: bootstrap.py プロジェクト: BigChilly95/randovania
def static_resources_for_layout_logic(
    configuration: TrickLevelConfiguration,
    resource_database: ResourceDatabase,
) -> CurrentResources:
    """
    :param configuration:
    :param resource_database:
    :return:
    """

    static_resources = {}

    for trick in resource_database.trick:
        static_resources[trick] = configuration.level_for_trick(
            trick).as_number

    # Room Rando
    room_rando = find_resource_info_with_long_name(resource_database.misc,
                                                   "Room Randomizer")
    static_resources[room_rando] = 0

    return static_resources
コード例 #4
0
ファイル: bootstrap.py プロジェクト: cdoggers/randovania
def static_resources_for_layout_logic(
    configuration: TrickLevelConfiguration,
    resource_database: ResourceDatabase,
) -> Tuple[int, CurrentResources]:
    """
    :param configuration:
    :param resource_database:
    :return:
    """

    all_used_tricks = TrickLevelConfiguration.all_possible_tricks()
    static_resources = {}

    for trick in resource_database.trick:
        if trick.index in all_used_tricks:
            static_resources[trick] = configuration.level_for_trick(
                trick).as_number

    # Exclude from Room Rando
    static_resources[resource_database.get_by_type_and_index(
        ResourceType.TRICK, 18)] = 5

    return configuration.global_level.as_number, static_resources