mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Add in breeding and feeding baby mob sounds
This commit is contained in:
parent
7733e05a12
commit
f83ccdb2ed
2 changed files with 15 additions and 0 deletions
|
@ -72,6 +72,7 @@ mobs.enter_breed_state = function(self,clicker)
|
|||
end
|
||||
self.breed_lookout_timer = self.breed_lookout_timer_goal
|
||||
self.bred = true
|
||||
mobs.play_sound_specific(self,"mobs_mc_animal_eat_generic")
|
||||
return(true)
|
||||
end
|
||||
|
||||
|
@ -173,6 +174,8 @@ mobs.make_baby_grow_faster = function(self,clicker)
|
|||
clicker:set_wielded_item(stack)
|
||||
end
|
||||
|
||||
mobs.play_sound_specific(self,"mobs_mc_animal_eat_generic")
|
||||
|
||||
return(true)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -43,5 +43,17 @@ mobs.random_sound_handling = function(self,dtime)
|
|||
mobs.play_sound(self,"random")
|
||||
self.random_sound_timer = math_random(self.random_sound_timer_min,self.random_sound_timer_max)
|
||||
end
|
||||
end
|
||||
|
||||
--used for playing a non-mob internal sound at random pitches
|
||||
mobs.play_sound_specific = function(self,soundname)
|
||||
local pitch = (100 + math_random(-15,15) + math_random()) / 100
|
||||
local distance = self.sounds.distance or 16
|
||||
|
||||
minetest.sound_play(soundname, {
|
||||
object = self.object,
|
||||
gain = 1.0,
|
||||
max_hear_distance = distance,
|
||||
pitch = pitch,
|
||||
}, true)
|
||||
end
|
Loading…
Reference in a new issue