diff --git a/mods/ENTITIES/mcl_falling_nodes/init.lua b/mods/ENTITIES/mcl_falling_nodes/init.lua index 5e1168ca9e..8fe4f17da3 100644 --- a/mods/ENTITIES/mcl_falling_nodes/init.lua +++ b/mods/ENTITIES/mcl_falling_nodes/init.lua @@ -57,7 +57,7 @@ local deal_falling_damage = function(self, dtime) mcl_death_messages.player_damage(v, msg) end end - v:set_hp(hp) + v:set_hp(hp, { type = "punch", from = "mod" }) end end end diff --git a/mods/ENVIRONMENT/lightning/init.lua b/mods/ENVIRONMENT/lightning/init.lua index bf077105d6..6ed0fafc00 100644 --- a/mods/ENVIRONMENT/lightning/init.lua +++ b/mods/ENVIRONMENT/lightning/init.lua @@ -132,7 +132,7 @@ lightning.strike = function(pos) if minetest.get_modpath("mcl_death_messages") then mcl_death_messages.player_damage(obj, S("@1 was struck by lightning.", obj:get_player_name())) end - obj:set_hp(obj:get_hp()-5) + obj:set_hp(obj:get_hp()-5, { type = "punch", from = "mod" }) -- Mobs elseif lua and lua._cmi_is_mob then -- pig → zombie pigman (no damage) @@ -164,7 +164,7 @@ lightning.strike = function(pos) -- Other mobs: Just damage else - obj:set_hp(obj:get_hp()-5, "lightning") + obj:set_hp(obj:get_hp()-5, { type = "punch", from = "mod" }) end end end diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua index 7bfef748c4..e32de13738 100644 --- a/mods/HUD/mcl_death_messages/init.lua +++ b/mods/HUD/mcl_death_messages/init.lua @@ -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() diff --git a/mods/HUD/mcl_death_messages/locale/mcl_death_messages.de.tr b/mods/HUD/mcl_death_messages/locale/mcl_death_messages.de.tr index a37f556d56..b9ef6680df 100644 --- a/mods/HUD/mcl_death_messages/locale/mcl_death_messages.de.tr +++ b/mods/HUD/mcl_death_messages/locale/mcl_death_messages.de.tr @@ -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. diff --git a/mods/HUD/mcl_death_messages/locale/template.txt b/mods/HUD/mcl_death_messages/locale/template.txt index fc83e2963c..db074f756f 100644 --- a/mods/HUD/mcl_death_messages/locale/template.txt +++ b/mods/HUD/mcl_death_messages/locale/template.txt @@ -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.= diff --git a/mods/ITEMS/mcl_nether/init.lua b/mods/ITEMS/mcl_nether/init.lua index f183fcc02f..4025d360f5 100644 --- a/mods/ITEMS/mcl_nether/init.lua +++ b/mods/ITEMS/mcl_nether/init.lua @@ -100,7 +100,7 @@ minetest.register_node("mcl_nether:magma", { if mod_death_messages then mcl_death_messages.player_damage(player, S("@1 stood too long on a magma block.", player:get_player_name())) end - player:set_hp(player:get_hp() - 1) + player:set_hp(player:get_hp() - 1, { type = "punch", from = "mod" }) end end, _mcl_blast_resistance = 2.5, diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index c3315f42cd..19e5c2d54b 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -137,7 +137,7 @@ minetest.register_globalstep(function(dtime) if dist < 1.1 or dist_feet < 1.1 then if player:get_hp() > 0 then mcl_death_messages.player_damage(player, S("@1 was prickled to death by a cactus.", name)) - player:set_hp(player:get_hp() - 1) + player:set_hp(player:get_hp() - 1, { type = "punch", from = "mod" }) end end end