mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-25 20:11:06 +01:00
Interpret many damage sources as punches
This commit is contained in:
parent
dcc14d1f3f
commit
988ca6ffe7
7 changed files with 15 additions and 7 deletions
|
@ -57,7 +57,7 @@ local deal_falling_damage = function(self, dtime)
|
||||||
mcl_death_messages.player_damage(v, msg)
|
mcl_death_messages.player_damage(v, msg)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
v:set_hp(hp)
|
v:set_hp(hp, { type = "punch", from = "mod" })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -132,7 +132,7 @@ lightning.strike = function(pos)
|
||||||
if minetest.get_modpath("mcl_death_messages") then
|
if minetest.get_modpath("mcl_death_messages") then
|
||||||
mcl_death_messages.player_damage(obj, S("@1 was struck by lightning.", obj:get_player_name()))
|
mcl_death_messages.player_damage(obj, S("@1 was struck by lightning.", obj:get_player_name()))
|
||||||
end
|
end
|
||||||
obj:set_hp(obj:get_hp()-5)
|
obj:set_hp(obj:get_hp()-5, { type = "punch", from = "mod" })
|
||||||
-- Mobs
|
-- Mobs
|
||||||
elseif lua and lua._cmi_is_mob then
|
elseif lua and lua._cmi_is_mob then
|
||||||
-- pig → zombie pigman (no damage)
|
-- pig → zombie pigman (no damage)
|
||||||
|
@ -164,7 +164,7 @@ lightning.strike = function(pos)
|
||||||
|
|
||||||
-- Other mobs: Just damage
|
-- Other mobs: Just damage
|
||||||
else
|
else
|
||||||
obj:set_hp(obj:get_hp()-5, "lightning")
|
obj:set_hp(obj:get_hp()-5, { type = "punch", from = "mod" })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -32,6 +32,9 @@ local msgs = {
|
||||||
["murder"] = {
|
["murder"] = {
|
||||||
N("@1 was killed by @2."),
|
N("@1 was killed by @2."),
|
||||||
},
|
},
|
||||||
|
["murder_any"] = {
|
||||||
|
N("@1 was killed."),
|
||||||
|
},
|
||||||
["mob_kill"] = {
|
["mob_kill"] = {
|
||||||
N("@1 was killed by a mob."),
|
N("@1 was killed by a mob."),
|
||||||
},
|
},
|
||||||
|
@ -127,7 +130,10 @@ minetest.register_on_dieplayer(function(player, reason)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local msg
|
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()
|
local pos = player:get_pos()
|
||||||
-- Check multiple nodes because players occupy multiple nodes
|
-- Check multiple nodes because players occupy multiple nodes
|
||||||
-- (we add one additional node because the check may fail if the player was
|
-- (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
|
local hittername, hittertype, hittersubtype, shooter
|
||||||
-- Unknown hitter
|
-- Unknown hitter
|
||||||
if hitter == nil then
|
if hitter == nil then
|
||||||
msg = dmsg("murder_any")
|
msg = dmsg("murder_any", name)
|
||||||
-- Player
|
-- Player
|
||||||
elseif hitter:is_player() then
|
elseif hitter:is_player() then
|
||||||
hittername = hitter:get_player_name()
|
hittername = hitter:get_player_name()
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
@1 drowned.=@1 ertrank.
|
@1 drowned.=@1 ertrank.
|
||||||
@1 ran out of oxygen.=@1 ging die Luft aus.
|
@1 ran out of oxygen.=@1 ging die Luft aus.
|
||||||
@1 was killed by @2.=@1 wurde von @2 getötet.
|
@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 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 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.
|
@1 was killed by a fireball from a blaze.=@1 wurde von einem Feuerball einer Lohe getötet.
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
@1 drowned.=
|
@1 drowned.=
|
||||||
@1 ran out of oxygen.=
|
@1 ran out of oxygen.=
|
||||||
@1 was killed by @2.=
|
@1 was killed by @2.=
|
||||||
|
@1 was killed.=
|
||||||
@1 was killed by a mob.=
|
@1 was killed by a mob.=
|
||||||
@1 was burned to death by a blaze's fireball.=
|
@1 was burned to death by a blaze's fireball.=
|
||||||
@1 was killed by a fireball from a blaze.=
|
@1 was killed by a fireball from a blaze.=
|
||||||
|
|
|
@ -100,7 +100,7 @@ minetest.register_node("mcl_nether:magma", {
|
||||||
if mod_death_messages then
|
if mod_death_messages then
|
||||||
mcl_death_messages.player_damage(player, S("@1 stood too long on a magma block.", player:get_player_name()))
|
mcl_death_messages.player_damage(player, S("@1 stood too long on a magma block.", player:get_player_name()))
|
||||||
end
|
end
|
||||||
player:set_hp(player:get_hp() - 1)
|
player:set_hp(player:get_hp() - 1, { type = "punch", from = "mod" })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
_mcl_blast_resistance = 2.5,
|
_mcl_blast_resistance = 2.5,
|
||||||
|
|
|
@ -137,7 +137,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
if dist < 1.1 or dist_feet < 1.1 then
|
if dist < 1.1 or dist_feet < 1.1 then
|
||||||
if player:get_hp() > 0 then
|
if player:get_hp() > 0 then
|
||||||
mcl_death_messages.player_damage(player, S("@1 was prickled to death by a cactus.", name))
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue