parameters: (line, sound_id, location_ref, obj_name_prefix, filename_prefix)
return_statement: return sound_forward_ref
docstring: Generates a sound for an ability.
  
          :param line: ConverterObjectGroup that the animation object is added to.
          :type line: ConverterObjectGroup
          :param sound_id: ID of the sound in the dataset.
          :type sound_id: int
          :param location_ref: Reference of the object the sound is nested in.
          :type location_ref: str
          :param obj_name_prefix: Name prefix for the sound object.
          :type obj_name_prefix: str
          :param filename_prefix: Prefix for the animation PNG and sprite files.
          :type filename_prefix: str
docstring_summary: Generates a sound for an ability.
docstring_tokens: Generates a sound for an ability .
function: def create_sound(line, sound_id, location_ref, obj_name_prefix, filename_prefix):
          """
          Generates a sound for an ability.
  
          :param line: ConverterObjectGroup that the animation object is added to.
          :type line: ConverterObjectGroup
          :param sound_id: ID of the sound in the dataset.
          :type sound_id: int
          :param location_ref: Reference of the object the sound is nested in.
          :type location_ref: str
          :param obj_name_prefix: Name prefix for the sound object.
          :type obj_name_prefix: str
          :param filename_prefix: Prefix for the animation PNG and sprite files.
          :type filename_prefix: str
          """
          dataset = line.data
  
          sound_ref = f"{location_ref}.{obj_name_prefix}Sound"
          sound_obj_name = f"{obj_name_prefix}Sound"
          sound_raw_api_object = RawAPIObject(sound_ref, sound_obj_name,
                                              dataset.nyan_api_objects)
          sound_raw_api_object.add_raw_parent("engine.util.sound.Sound")
          sound_location = ForwardRef(line, location_ref)
          sound_raw_api_object.set_location(sound_location)
  
          # Search for the sound if it exists
          sounds_set = []
  
          genie_sound = dataset.genie_sounds[sound_id]
          file_ids = genie_sound.get_sounds(civ_id=-1)
  
          for file_id in file_ids:
              if file_id in dataset.combined_sounds:
                  sound = dataset.combined_sounds[file_id]
  
              else:
                  sound = CombinedSound(sound_id,
                                        file_id,
                                        f"{filename_prefix}sound_{str(file_id)}",
                                        dataset)
                  dataset.combined_sounds.update({file_id: sound})
  
              sound.add_reference(sound_raw_api_object)
              sounds_set.append(sound)
  
          sound_raw_api_object.add_raw_member("play_delay",
                                              0,
                                              "engine.util.sound.Sound")
          sound_raw_api_object.add_raw_member("sounds",
                                              sounds_set,
                                              "engine.util.sound.Sound")
  
          line.add_raw_api_object(sound_raw_api_object)
  
          sound_forward_ref = ForwardRef(line, sound_ref)
  
          return sound_forward_ref
function_tokens: def create_sound ( line , sound_id , location_ref , obj_name_prefix , filename_prefix ) : dataset = line . data sound_ref = f"{location_ref}.{obj_name_prefix}Sound" sound_obj_name = f"{obj_name_prefix}Sound" sound_raw_api_object = RawAPIObject ( sound_ref , sound_obj_name , dataset . nyan_api_objects ) sound_raw_api_object . add_raw_parent ( "engine.util.sound.Sound" ) sound_location = ForwardRef ( line , location_ref ) sound_raw_api_object . set_location ( sound_location ) # Search for the sound if it exists sounds_set = [ ] genie_sound = dataset . genie_sounds [ sound_id ] file_ids = genie_sound . get_sounds ( civ_id = - 1 ) for file_id in file_ids : if file_id in dataset . combined_sounds : sound = dataset . combined_sounds [ file_id ] else : sound = CombinedSound ( sound_id , file_id , f"{filename_prefix}sound_{str(file_id)}" , dataset ) dataset . combined_sounds . update ( { file_id : sound } ) sound . add_reference ( sound_raw_api_object ) sounds_set . append ( sound ) sound_raw_api_object . add_raw_member ( "play_delay" , 0 , "engine.util.sound.Sound" ) sound_raw_api_object . add_raw_member ( "sounds" , sounds_set , "engine.util.sound.Sound" ) line . add_raw_api_object ( sound_raw_api_object ) sound_forward_ref = ForwardRef ( line , sound_ref ) return sound_forward_ref