Add more death messages

This commit is contained in:
Wuzzy 2017-07-24 19:36:04 +02:00
parent 8970bd16ef
commit 95e8f80f2c
5 changed files with 9 additions and 23 deletions

View file

@ -1,3 +1,4 @@
mcl_sounds
mcl_core
mcl_hunger
mcl_death_messages

View file

@ -35,10 +35,11 @@ local on_step_add = function(self, dtime)
if hp < 0 then
hp = 0
end
v:set_hp(hp)
if v:is_player() then
mcl_death_messages.player_damage(v, string.format("%s was smashed by a falling anvil.", v:get_player_name()))
mcl_hunger.exhaust(v:get_player_name(), mcl_hunger.EXHAUST_DAMAGE)
end
v:set_hp(hp)
if hp == 0 then
kill = true
end