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

View File

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

View File

@ -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)
'random' played randomly from time to time.
also played for overfeeding animal.
'eat' played when mob eats something
'war_cry' what you hear when mob starts to attack player. (currently disabled)
'attack' what you hear when being attacked.
'shoot_attack' sound played when mob shoots.

View File

@ -236,6 +236,9 @@ Origin of those models:
* [kbnevel](https://freesound.org/people/kbnevel/)
* `mobs_mc_magma_cube_attack.ogg` (CC0)
* 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.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,6 +28,7 @@ mobs:register_mob("mobs_mc:parrot", {
random = "mobs_mc_parrot_random",
damage = {name="mobs_mc_parrot_hurt", gain=0.3},
death = {name="mobs_mc_parrot_death", gain=0.6},
eat = "mobs_mc_animal_eat_generic",
distance = 16,
},
drops = {
@ -67,6 +68,7 @@ mobs:register_mob("mobs_mc:parrot", {
local item = clicker:get_wielded_item()
-- Kill parrot if fed with cookie
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
-- Doomed to die
self._doomed = true

View File

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

View File

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

View File

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

View File

@ -39,6 +39,7 @@ local wolf = {
war_cry = "mobs_mc_wolf_growl",
damage = {name = "mobs_mc_wolf_hurt", gain=0.6},
death = {name = "mobs_mc_wolf_death", gain=0.6},
sounds = "mobs_mc_animal_eat_generic",
distance = 16,
},
pathfinding = 1,
@ -71,7 +72,7 @@ local wolf = {
ent = dog:get_luaentity()
ent.owner = clicker:get_player_name()
-- 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()
end
end