animal_sounds.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. dlxtrains_animal_sounds = {}
  2. -- The set of sounds for supported animals. Additional sounds will be added for supported animals from enabled mods.
  3. -- Some default sounds are provided in case animal mods don't have any sounds. The index is animal type. A given
  4. -- animal type can have more than one sound in the table.
  5. local animal_sounds = {
  6. ["cow"] = {},
  7. ["horse"] = {
  8. { name = "dlxtrains_animals_horse_snort-01", gain = 60, },
  9. { name = "dlxtrains_animals_horse_snort-02", gain = 60, },
  10. { name = "dlxtrains_animals_horse_snort-03", gain = 60, },
  11. { name = "dlxtrains_animals_horse_snort-04", gain = 60, },
  12. { name = "dlxtrains_animals_horse_snort-05", gain = 60, },
  13. { name = "dlxtrains_animals_horse_snort-06", gain = 50, },
  14. { name = "dlxtrains_animals_horse_whinny-01", gain = 60, },
  15. { name = "dlxtrains_animals_horse_whinny-02", gain = 60, },
  16. },
  17. ["pig"] = {},
  18. ["sheep"] = {},
  19. ["warthog"] = {},
  20. }
  21. if minetest.get_modpath("mobs_animal") then
  22. table.insert(animal_sounds["cow"], {name = "mobs_cow", gain = 40})
  23. table.insert(animal_sounds["sheep"], {name = "mobs_sheep", gain = 20})
  24. table.insert(animal_sounds["warthog"], {name = "mobs_pig", gain = 50})
  25. end
  26. --[[
  27. if minetest.get_modpath("mob_horse") then
  28. -- No sounds available from mob_horse. Built-in sounds are provided instead.
  29. end
  30. --]]
  31. if minetest.get_modpath("animalia") then
  32. table.insert(animal_sounds["cow"], {name = "animalia_cow", gain = 20, })
  33. table.insert(animal_sounds["horse"], {name = "animalia_horse_idle", gain = 50})
  34. table.insert(animal_sounds["pig"], {name = "animalia_pig", gain = 50})
  35. table.insert(animal_sounds["sheep"], {name = "animalia_sheep_idle", gain = 40})
  36. end
  37. function dlxtrains_animal_sounds.get_sounds(animal_type)
  38. return animal_sounds[animal_type]
  39. end