mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-12-24 08:59:32 +01:00
Mobs now flash red when hurt.
This commit is contained in:
parent
d4facaf503
commit
58d9fb874d
1 changed files with 7 additions and 1 deletions
|
@ -453,8 +453,14 @@ local check_for_death = function(self, cause, cmi_cause)
|
||||||
self.health = self.hp_max
|
self.health = self.hp_max
|
||||||
end
|
end
|
||||||
|
|
||||||
-- play damage sound if health was reduced
|
-- play damage sound if health was reduced and make mob flash red.
|
||||||
if damaged then
|
if damaged then
|
||||||
|
self.object:set_texture_mod("^[colorize:#FF000040")
|
||||||
|
minetest.after(.2, function()
|
||||||
|
if self then
|
||||||
|
self.object:set_texture_mod("")
|
||||||
|
end
|
||||||
|
end)
|
||||||
mob_sound(self, self.sounds.damage)
|
mob_sound(self, self.sounds.damage)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue