mirror of
http://repo.or.cz/minetest_pyramids/tsm_pyramids.git
synced 2024-12-22 15:30:19 +01:00
Call on_death when mummy dies in node
This commit is contained in:
parent
049e575da1
commit
34750f407a
13
mummy.lua
13
mummy.lua
@ -211,9 +211,16 @@ MUMMY_DEF.on_step = function(self, dtime)
|
|||||||
if self.envdmg_timer >= 1 then
|
if self.envdmg_timer >= 1 then
|
||||||
self.envdmg_timer = 0
|
self.envdmg_timer = 0
|
||||||
self.object:set_hp(self.object:get_hp()-dmg)
|
self.object:set_hp(self.object:get_hp()-dmg)
|
||||||
hit(self)
|
if self.object:get_hp() <= 0 then
|
||||||
self.sound_timer = 0
|
if self.on_death then
|
||||||
minetest.sound_play(sound_hit, {pos = current_pos, max_hear_distance = 10, gain = 0.4})
|
self.on_death(self)
|
||||||
|
end
|
||||||
|
self.object:remove()
|
||||||
|
else
|
||||||
|
hit(self)
|
||||||
|
self.sound_timer = 0
|
||||||
|
minetest.sound_play(sound_hit, {pos = current_pos, max_hear_distance = 10, gain = 0.4})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self.time_passed = 0
|
self.time_passed = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user