diff --git a/mods/ENTITIES/mobs_mc/LICENSE-media.md b/mods/ENTITIES/mobs_mc/LICENSE-media.md index 566f230518..2ed4a437a4 100644 --- a/mods/ENTITIES/mobs_mc/LICENSE-media.md +++ b/mods/ENTITIES/mobs_mc/LICENSE-media.md @@ -121,6 +121,7 @@ Origin of those models: * [rubberduck](https://opengameart.org/users/rubberduck) * `mobs_mc_endermite_*.ogg` (CC0) * `mobs_mc_zombiepig_*.ogg` (CC0) + * `mobs_mc_enderman_teleport_*.ogg` (CC0) * Source 1: * Source 2: * [pointparkcinema](https://freesound.org/people/pointparkcinema/) diff --git a/mods/ENTITIES/mobs_mc/enderman.lua b/mods/ENTITIES/mobs_mc/enderman.lua index 89c7b47f05..3e2cd5f0e4 100644 --- a/mods/ENTITIES/mobs_mc/enderman.lua +++ b/mods/ENTITIES/mobs_mc/enderman.lua @@ -8,7 +8,6 @@ -- However, they have a reduced viewing range to make them less dangerous. -- This differs from MC, in which endermen only become hostile when provoked, -- and they are provoked by looking directly at them. --- TODO: Implement MC behaviour. -- Rootyjr ----------------------------- @@ -27,6 +26,16 @@ local S = minetest.get_translator("mobs_mc") +local telesound = function(pos, is_source) + local snd + if is_source then + snd = "mobs_mc_enderman_teleport_src" + else + snd = "mobs_mc_enderman_teleport_dst" + end + minetest.sound_play(snd, {pos=pos, max_hear_distance=16}, true) +end + --################### --################### ENDERMAN --################### @@ -181,7 +190,6 @@ end local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false mobs:register_mob("mobs_mc:enderman", { - -- TODO: Endermen should be classified as passive type = "monster", spawn_class = "passive", passive = true, @@ -214,7 +222,6 @@ mobs:register_mob("mobs_mc:enderman", { }, animation = select_enderman_animation("normal"), _taken_node = "", - -- TODO: Teleport enderman on damage, etc. do_custom = function(self, dtime) -- PARTICLE BEHAVIOUR HERE. local enderpos = self.object:get_pos() @@ -464,7 +471,9 @@ mobs:register_mob("mobs_mc:enderman", { end end if telepos then + telesound(self.object:get_pos(), false) self.object:set_pos(telepos) + telesound(telepos, true) end end end @@ -492,7 +501,10 @@ mobs:register_mob("mobs_mc:enderman", { end end if node_ok then - self.object:set_pos({x=nodepos.x, y=nodepos.y+1, z=nodepos.z}) + telesound(self.object:get_pos(), false) + local telepos = {x=nodepos.x, y=nodepos.y+1, z=nodepos.z} + self.object:set_pos(telepos) + telesound(telepos, true) break end end diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_enderman_teleport_dst.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_enderman_teleport_dst.ogg new file mode 100644 index 0000000000..1896d7d4df Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_enderman_teleport_dst.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_enderman_teleport_src.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_enderman_teleport_src.ogg new file mode 100644 index 0000000000..7b08a4884c Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_enderman_teleport_src.ogg differ