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
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
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
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