1
0
Fork 0

Add in breeding and feeding baby mob sounds

This commit is contained in:
jordan4ibanez 2021-04-25 01:22:43 -04:00
parent 7733e05a12
commit f83ccdb2ed
2 changed files with 15 additions and 0 deletions

View File

@ -72,6 +72,7 @@ mobs.enter_breed_state = function(self,clicker)
end end
self.breed_lookout_timer = self.breed_lookout_timer_goal self.breed_lookout_timer = self.breed_lookout_timer_goal
self.bred = true self.bred = true
mobs.play_sound_specific(self,"mobs_mc_animal_eat_generic")
return(true) return(true)
end end
@ -173,6 +174,8 @@ mobs.make_baby_grow_faster = function(self,clicker)
clicker:set_wielded_item(stack) clicker:set_wielded_item(stack)
end end
mobs.play_sound_specific(self,"mobs_mc_animal_eat_generic")
return(true) return(true)
end end
end end

View File

@ -43,5 +43,17 @@ mobs.random_sound_handling = function(self,dtime)
mobs.play_sound(self,"random") mobs.play_sound(self,"random")
self.random_sound_timer = math_random(self.random_sound_timer_min,self.random_sound_timer_max) self.random_sound_timer = math_random(self.random_sound_timer_min,self.random_sound_timer_max)
end 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 end