From e2fb3a562d63d07bb4030b46af030e75b680ba6c Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 9 Dec 2019 10:11:15 +0100 Subject: [PATCH] Add some arrow-related death messages --- mods/HUD/mcl_death_messages/init.lua | 27 ++++++++++++++++--- .../locale/mcl_death_messages.de.tr | 6 ++++- .../mcl_death_messages/locale/template.txt | 4 +++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua index 7a55f499e..b212e36db 100644 --- a/mods/HUD/mcl_death_messages/init.lua +++ b/mods/HUD/mcl_death_messages/init.lua @@ -7,11 +7,23 @@ mcl_death_messages = {} local msgs = { ["arrow"] = { N("@1 was fatally hit by an arrow."), - N("@1 has been killed with an arrow."), + N("@1 has been killed by an arrow."), }, ["arrow_name"] = { N("@1 was shot by an arrow from @2."), }, + ["arrow_skeleton"] = { + N("@1 was shot by an arrow from a skeleton."), + }, + ["arrow_stray"] = { + N("@1 was shot by an arrow from a stray."), + }, + ["arrow_illusioner"] = { + N("@1 was shot by an arrow from an illusioner."), + }, + ["arrow_mob"] = { + N("@1 was shot by an arrow."), + }, ["drown"] = { N("@1 forgot to breathe."), N("@1 drowned."), @@ -186,15 +198,22 @@ minetest.register_on_dieplayer(function(player, reason) if hitter:get_luaentity()._shooter then shooter = hitter:get_luaentity()._shooter end + local s_ent = shooter:get_luaentity() if shooter == nil then msg = dmsg("arrow", name) elseif shooter:is_player() then msg = dmsg("arrow_name", name, shooter:get_player_name()) - elseif shooter:get_luaentity()._cmi_is_mob then - if shooter:get_luaentity().nametag ~= "" then + elseif s_ent._cmi_is_mob then + if s_ent.nametag ~= "" then msg = dmsg("arrow_name", name, shooter:get_player_name()) + elseif s_ent.name == "mobs_mc:skeleton" then + msg = dmsg("arrow_skeleton", name) + elseif s_ent.name == "mobs_mc:stray" then + msg = dmsg("arrow_stray", name) + elseif s_ent.name == "mobs_mc:illusioner" then + msg = dmsg("arrow_illusioner", name) else - msg = dmsg("arrow", name) + msg = dmsg("arrow_mob", name) end else msg = dmsg("arrow", 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 cc1438056..a37f556d5 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 @@ -1,7 +1,11 @@ # textdomain: mcl_death_messages @1 was fatally hit by an arrow.=@1 wurde tödlich von einem Pfeil getroffen. -@1 has been killed with an arrow.=@1 wurde mit einem Pfeil getötet. +@1 has been killed by an arrow.=@1 wurde von einem Pfeil getötet. @1 was shot by an arrow from @2.=@1 wurde mit einem Pfeil von @2 abgeschossen. +@1 was shot by an arrow from a skeleton.=@1 wurde von einem Skelett mit Pfeil und Bogen abgeschossen. +@1 was shot by an arrow from a stray.=@1 wurde von einem Eiswanderer mit Pfeil und Bogen abgeschossen. +@1 was shot by an arrow from an illusioner.=@1 wurde von einem Illusionisten mit Pfeil und Bogen abgeschossen. +@1 was shot by an arrow.=@1 wurde mit einem Pfeil abgeschossen. @1 forgot to breathe.=@1 vergaß, zu atmen. @1 drowned.=@1 ertrank. @1 ran out of oxygen.=@1 ging die Luft aus. diff --git a/mods/HUD/mcl_death_messages/locale/template.txt b/mods/HUD/mcl_death_messages/locale/template.txt index 95b2375b1..fc83e2963 100644 --- a/mods/HUD/mcl_death_messages/locale/template.txt +++ b/mods/HUD/mcl_death_messages/locale/template.txt @@ -2,6 +2,10 @@ @1 was fatally hit by an arrow.= @1 has been killed with an arrow.= @1 was shot by an arrow from @2.= +@1 was shot by an arrow from a skeleton.= +@1 was shot by an arrow from a stray.= +@1 was shot by an arrow from an illusioner.= +@1 was shot by an arrow.= @1 forgot to breathe.= @1 drowned.= @1 ran out of oxygen.=