From fa863c6a3bace774c9c400b97c22d7b70a1e93ae Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Mon, 20 Apr 2015 10:23:06 +0100 Subject: [PATCH] Fixed DM attack sound and added explode sound --- api.lua | 8 ++++---- dungeonmaster.lua | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api.lua b/api.lua index 93d5a81..c197926 100644 --- a/api.lua +++ b/api.lua @@ -644,7 +644,7 @@ lifetimer = def.lifetimer or 600, if self.timer > 3 then local pos = vector.round(self.object:getpos()) do_tnt_physics(pos, 3, self) -- hurt player/mobs in blast area - minetest.sound_play("tnt_explode", {pos = pos, gain = 1.0, max_hear_distance = 16,}) + minetest.sound_play(self.sounds.explode, {pos = pos, gain = 1.0, max_hear_distance = 16,}) if minetest.find_node_near(pos, 1, {"group:water"}) or minetest.is_protected(pos, "") then self.object:remove() @@ -652,7 +652,7 @@ lifetimer = def.lifetimer or 600, return end self.object:remove() - mobs:explosion(pos, 2, 1, 1) + mobs:explosion(pos, 2, 1, 1, "tnt_explode") end end -- Modif MFF "attack type kamicaze" des creepers /FIN @@ -998,7 +998,7 @@ function effect(pos, amount, texture) end -- explosion -function mobs:explosion(pos, radius, fire, smoke) +function mobs:explosion(pos, radius, fire, smoke, sound) -- node hit, bursts into flame (cannot blast through obsidian or protection redo mod items) if not fire then fire = 0 end if not smoke then smoke = 0 end @@ -1014,7 +1014,7 @@ function mobs:explosion(pos, radius, fire, smoke) local c_obsidian = minetest.get_content_id("default:obsidian") local c_brick = minetest.get_content_id("default:obsidianbrick") local c_chest = minetest.get_content_id("default:chest_locked") - +if sound and sound ~= "" then minetest.sound_play(sound, {pos = pos, gain = 1.0, max_hear_distance = 16}) end for z = -radius, radius do for y = -radius, radius do local vi = a:index(pos.x + (-radius), pos.y + y, pos.z + z) diff --git a/dungeonmaster.lua b/dungeonmaster.lua index 1dacb33..c274dac 100644 --- a/dungeonmaster.lua +++ b/dungeonmaster.lua @@ -24,6 +24,7 @@ mobs:register_mob("mobs:dungeon_master", { makes_footstep_sound = true, sounds = { random = "mobs_dungeonmaster", + attack = "mobs_fireball", }, walk_velocity = 1, run_velocity = 3,