Add animal eat sound

This commit is contained in:
Wuzzy 2020-12-05 23:37:12 +01:00
parent da7214bafa
commit b70e58ab05
14 changed files with 27 additions and 2 deletions

@ -4357,6 +4357,8 @@ function mobs:feed_tame(self, clicker, feed_count, breed, tame)
clicker:set_wielded_item(item) clicker:set_wielded_item(item)
end end
mob_sound(self, "eat", nil, true)
-- increase health -- increase health
self.health = self.health + 4 self.health = self.health + 4

@ -145,6 +145,7 @@ functions needed for the mob to work properly which contains the following:
'base_pitch' base pitch to use adult mobs, default is 1.0 (MCL2 extension) 'base_pitch' base pitch to use adult mobs, default is 1.0 (MCL2 extension)
'random' played randomly from time to time. 'random' played randomly from time to time.
also played for overfeeding animal. also played for overfeeding animal.
'eat' played when mob eats something
'war_cry' what you hear when mob starts to attack player. (currently disabled) 'war_cry' what you hear when mob starts to attack player. (currently disabled)
'attack' what you hear when being attacked. 'attack' what you hear when being attacked.
'shoot_attack' sound played when mob shoots. 'shoot_attack' sound played when mob shoots.

@ -236,6 +236,9 @@ Origin of those models:
* [kbnevel](https://freesound.org/people/kbnevel/) * [kbnevel](https://freesound.org/people/kbnevel/)
* `mobs_mc_magma_cube_attack.ogg` (CC0) * `mobs_mc_magma_cube_attack.ogg` (CC0)
* Derived from: <https://freesound.org/people/kbnevel/sounds/119863/> * Derived from: <https://freesound.org/people/kbnevel/sounds/119863/>
* [InspectorJ](https://freesound.org/people/InspectorJ/sounds/429591/)
* `mobs_mc_animal_eat_generic.ogg` (CC BY 3.0)
* Source: <https://freesound.org/people/InspectorJ/>
Note: Many of these sounds have been more or less modified to fit the game. Note: Many of these sounds have been more or less modified to fit the game.

@ -42,12 +42,14 @@ mobs:register_mob("mobs_mc:chicken", {
random = "mobs_mc_chicken_buck", random = "mobs_mc_chicken_buck",
damage = "mobs_mc_chicken_hurt", damage = "mobs_mc_chicken_hurt",
death = "mobs_mc_chicken_hurt", death = "mobs_mc_chicken_hurt",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
sounds_child = { sounds_child = {
random = "mobs_mc_chicken_child", random = "mobs_mc_chicken_child",
damage = "mobs_mc_chicken_child", damage = "mobs_mc_chicken_child",
death = "mobs_mc_chicken_child", death = "mobs_mc_chicken_child",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
animation = { animation = {

@ -32,6 +32,7 @@ local cow_def = {
random = "mobs_mc_cow", random = "mobs_mc_cow",
damage = "mobs_mc_cow_hurt", damage = "mobs_mc_cow_hurt",
death = "mobs_mc_cow_hurt", death = "mobs_mc_cow_hurt",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
animation = { animation = {

@ -106,6 +106,7 @@ local horse = {
-- TODO: Separate damage sound -- TODO: Separate damage sound
damage = "mobs_mc_horse_death", damage = "mobs_mc_horse_death",
death = "mobs_mc_horse_death", death = "mobs_mc_horse_death",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
fear_height = 4, fear_height = 4,
@ -361,6 +362,7 @@ skeleton_horse.sounds = {
random = "mobs_mc_skeleton_random", random = "mobs_mc_skeleton_random",
death = "mobs_mc_skeleton_death", death = "mobs_mc_skeleton_death",
damage = "mobs_mc_skeleton_hurt", damage = "mobs_mc_skeleton_hurt",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
} }
skeleton_horse.harmed_by_heal = true skeleton_horse.harmed_by_heal = true
@ -380,6 +382,7 @@ zombie_horse.sounds = {
random = "mobs_mc_zombie_growl", random = "mobs_mc_zombie_growl",
death = "mobs_mc_zombie_death", death = "mobs_mc_zombie_death",
damage = "mobs_mc_zombie_hurt", damage = "mobs_mc_zombie_hurt",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
} }
zombie_horse.harmed_by_heal = true zombie_horse.harmed_by_heal = true
@ -398,6 +401,7 @@ donkey.sounds = {
random = "mobs_mc_donkey_random", random = "mobs_mc_donkey_random",
damage = "mobs_mc_donkey_hurt", damage = "mobs_mc_donkey_hurt",
death = "mobs_mc_donkey_death", death = "mobs_mc_donkey_death",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
} }
donkey.visual_size = { x=horse.visual_size.x*d, y=horse.visual_size.y*d } donkey.visual_size = { x=horse.visual_size.x*d, y=horse.visual_size.y*d }

@ -57,6 +57,7 @@ mobs:register_mob("mobs_mc:llama", {
fear_height = 4, fear_height = 4,
sounds = { sounds = {
random = "mobs_mc_llama", random = "mobs_mc_llama",
eat = "mobs_mc_animal_eat_generic",
-- TODO: Death and damage sounds -- TODO: Death and damage sounds
distance = 16, distance = 16,
}, },

@ -49,6 +49,7 @@ local ocelot = {
sounds = { sounds = {
damage = "mobs_mc_ocelot_hurt", damage = "mobs_mc_ocelot_hurt",
death = "mobs_mc_ocelot_hurt", death = "mobs_mc_ocelot_hurt",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
animation = { animation = {
@ -113,6 +114,7 @@ cat.sounds = {
random = "mobs_mc_cat_idle", random = "mobs_mc_cat_idle",
damage = "mobs_mc_cat_hiss", damage = "mobs_mc_cat_hiss",
death = "mobs_mc_ocelot_hurt", death = "mobs_mc_ocelot_hurt",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
} }
cat.on_rightclick = function(self, clicker) cat.on_rightclick = function(self, clicker)

@ -28,6 +28,7 @@ mobs:register_mob("mobs_mc:parrot", {
random = "mobs_mc_parrot_random", random = "mobs_mc_parrot_random",
damage = {name="mobs_mc_parrot_hurt", gain=0.3}, damage = {name="mobs_mc_parrot_hurt", gain=0.3},
death = {name="mobs_mc_parrot_death", gain=0.6}, death = {name="mobs_mc_parrot_death", gain=0.6},
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
drops = { drops = {
@ -67,6 +68,7 @@ mobs:register_mob("mobs_mc:parrot", {
local item = clicker:get_wielded_item() local item = clicker:get_wielded_item()
-- Kill parrot if fed with cookie -- Kill parrot if fed with cookie
if item:get_name() == mobs_mc.items.cookie then if item:get_name() == mobs_mc.items.cookie then
minetest.sound_play("mobs_mc_animal_eat_generic", {object = self.object, max_hear_distance=16}, true)
self.health = 0 self.health = 0
-- Doomed to die -- Doomed to die
self._doomed = true self._doomed = true

@ -32,6 +32,7 @@ mobs:register_mob("mobs_mc:pig", {
random = "mobs_pig", random = "mobs_pig",
death = "mobs_pig_angry", death = "mobs_pig_angry",
damage = "mobs_pig", damage = "mobs_pig",
eat = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
animation = { animation = {

@ -23,7 +23,11 @@ local rabbit = {
{"mobs_mc_rabbit_black.png"}, {"mobs_mc_rabbit_black.png"},
}, },
visual_size = {x=1.5, y=1.5}, visual_size = {x=1.5, y=1.5},
sounds = {
-- TODO: sounds: random, damage, death -- TODO: sounds: random, damage, death
eat = "mobs_mc_animal_eat_generic",
distance = 16,
},
makes_footstep_sound = false, makes_footstep_sound = false,
walk_velocity = 1, walk_velocity = 1,
run_velocity = 3.7, run_velocity = 3.7,

@ -73,6 +73,7 @@ mobs:register_mob("mobs_mc:sheep", {
random = "mobs_sheep", random = "mobs_sheep",
death = "mobs_sheep", death = "mobs_sheep",
damage = "mobs_sheep", damage = "mobs_sheep",
sounds = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
animation = { animation = {

@ -39,6 +39,7 @@ local wolf = {
war_cry = "mobs_mc_wolf_growl", war_cry = "mobs_mc_wolf_growl",
damage = {name = "mobs_mc_wolf_hurt", gain=0.6}, damage = {name = "mobs_mc_wolf_hurt", gain=0.6},
death = {name = "mobs_mc_wolf_death", gain=0.6}, death = {name = "mobs_mc_wolf_death", gain=0.6},
sounds = "mobs_mc_animal_eat_generic",
distance = 16, distance = 16,
}, },
pathfinding = 1, pathfinding = 1,
@ -71,7 +72,7 @@ local wolf = {
ent = dog:get_luaentity() ent = dog:get_luaentity()
ent.owner = clicker:get_player_name() ent.owner = clicker:get_player_name()
-- cornfirm taming -- cornfirm taming
minetest.sound_play("mobs_mc_wolf_bark", {object=self.object, max_hear_distance=16}) minetest.sound_play("mobs_mc_wolf_bark", {object=self.object, max_hear_distance=16}, true)
self.object:remove() self.object:remove()
end end
end end