Fix fire charge death message

This commit is contained in:
Wuzzy 2017-07-24 19:53:03 +02:00
parent 95e8f80f2c
commit e9070ee134
2 changed files with 11 additions and 2 deletions

View file

@ -36,6 +36,9 @@ local msgs = {
"%s was burned to death by a blaze's fireball.",
"%s was killed by a fireball from a blaze.",
},
["fire_charge"] = {
"%s was hit by a fire charge.",
},
["ghast_fireball"] = {
"A ghast scared %s to death.",
"%s has been fireballed by a ghast.",
@ -63,7 +66,6 @@ mobkills = {
["mobs_mc:ocelot"] = "%s was killed by an ocelot.",
["mobs_mc:ender_dragon"] = "%s was killed by an ender dragon.",
["mobs_mc:wither"] = "%s was killed by a wither.",
["mobs_mc:blaze"] = "%s was killed by a blaze.",
["mobs_mc:enderman"] = "%s was killed by an enderman.",
["mobs_mc:endermite"] = "%s was killed by an endermite.",
["mobs_mc:ghast"] = "%s was killed by a ghast.",
@ -150,6 +152,8 @@ minetest.register_on_dieplayer(function(player)
msg = dmsg("blaze_fireball", name)
elseif last_damages[name].hittertype == "ghast_fireball" then
msg = dmsg("ghast_fireball", name)
elseif last_damages[name].hittertype == "fire_charge" then
msg = dmsg("fire_charge", name)
-- Custom death message
elseif last_damages[name].custom then
msg = last_damages[name].message
@ -196,7 +200,11 @@ minetest.register_on_punchplayer(function(player, hitter)
end
-- Blaze fireball
elseif hitter:get_luaentity().name == "mobs_mc:blaze_fireball" then
if hitter:get_luaentity()._shot_from_dispenser then
hittertype = "fire_charge"
else
hittertype = "blaze_fireball"
end
-- Ghast fireball
elseif hitter:get_luaentity().name == "mobs_monster:fireball" then
hittertype = "ghast_fireball"

View file

@ -106,6 +106,7 @@ local dispenserdef = {
local shootpos = vector.add(pos, vector.multiply(dropdir, 0.51))
local fireball = minetest.add_entity(shootpos, "mobs_mc:blaze_fireball")
local ent = fireball:get_luaentity()
ent._shot_from_dispenser = true
local v = ent.velocity or 1
fireball:setvelocity(vector.multiply(dropdir, v))
ent.switch = 1