Interpret many damage sources as punches

This commit is contained in:
Wuzzy 2020-02-17 18:37:23 +01:00
parent dcc14d1f3f
commit 988ca6ffe7
7 changed files with 15 additions and 7 deletions

View file

@ -32,6 +32,9 @@ local msgs = {
["murder"] = {
N("@1 was killed by @2."),
},
["murder_any"] = {
N("@1 was killed."),
},
["mob_kill"] = {
N("@1 was killed by a mob."),
},
@ -127,7 +130,10 @@ minetest.register_on_dieplayer(function(player, reason)
return
end
local msg
if reason.type == "node_damage" then
if last_damages[name] then
-- custom message
msg = last_damages[name].message
elseif reason.type == "node_damage" then
local pos = player:get_pos()
-- Check multiple nodes because players occupy multiple nodes
-- (we add one additional node because the check may fail if the player was
@ -170,7 +176,7 @@ minetest.register_on_dieplayer(function(player, reason)
local hittername, hittertype, hittersubtype, shooter
-- Unknown hitter
if hitter == nil then
msg = dmsg("murder_any")
msg = dmsg("murder_any", name)
-- Player
elseif hitter:is_player() then
hittername = hitter:get_player_name()

View file

@ -10,6 +10,7 @@
@1 drowned.=@1 ertrank.
@1 ran out of oxygen.=@1 ging die Luft aus.
@1 was killed by @2.=@1 wurde von @2 getötet.
@1 was killed.=@1 wurde getötet.
@1 was killed by a mob.=@1 wurde von einem Mob getötet.
@1 was burned to death by a blaze's fireball.=@1 wurde von einem Feuerball einer Lohe zu Tode verbrannt.
@1 was killed by a fireball from a blaze.=@1 wurde von einem Feuerball einer Lohe getötet.

View file

@ -10,6 +10,7 @@
@1 drowned.=
@1 ran out of oxygen.=
@1 was killed by @2.=
@1 was killed.=
@1 was killed by a mob.=
@1 was burned to death by a blaze's fireball.=
@1 was killed by a fireball from a blaze.=