mirror of
https://github.com/4Evergreen4/death_messages.git
synced 2024-11-14 22:30:19 +01:00
add support for groups lava and water
This commit is contained in:
parent
80247f1069
commit
3af6d00070
16
init.lua
16
init.lua
|
@ -49,18 +49,18 @@ messages.other = {
|
||||||
if RANDOM_MESSAGES == true then
|
if RANDOM_MESSAGES == true then
|
||||||
minetest.register_on_dieplayer(function(player)
|
minetest.register_on_dieplayer(function(player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
local node = minetest.registered_nodes[minetest.get_node(player:getpos()).name]
|
||||||
if minetest.is_singleplayer() then
|
if minetest.is_singleplayer() then
|
||||||
player_name = "You"
|
player_name = "You"
|
||||||
end
|
end
|
||||||
-- Death by lava
|
-- Death by lava
|
||||||
local nodename = minetest.get_node(player:getpos()).name
|
if node.groups.lava ~= nil then
|
||||||
if nodename == "default:lava_source" or nodename == "default:lava_flowing" then
|
|
||||||
minetest.chat_send_all(player_name .. messages.lava[math.random(1,#messages.lava)] )
|
minetest.chat_send_all(player_name .. messages.lava[math.random(1,#messages.lava)] )
|
||||||
-- Death by drowning
|
-- Death by drowning
|
||||||
elseif nodename == "default:water_source" or nodename == "default:water_flowing" then
|
elseif node.groups.water ~= nil then
|
||||||
minetest.chat_send_all(player_name .. messages.water[math.random(1,#messages.water)] )
|
minetest.chat_send_all(player_name .. messages.water[math.random(1,#messages.water)] )
|
||||||
-- Death by fire
|
-- Death by fire
|
||||||
elseif nodename == "fire:basic_flame" then
|
elseif node.name == "fire:basic_flame" then
|
||||||
minetest.chat_send_all(player_name .. messages.fire[math.random(1,#messages.fire)] )
|
minetest.chat_send_all(player_name .. messages.fire[math.random(1,#messages.fire)] )
|
||||||
-- Death by something else
|
-- Death by something else
|
||||||
else
|
else
|
||||||
|
@ -72,18 +72,18 @@ if RANDOM_MESSAGES == true then
|
||||||
else
|
else
|
||||||
minetest.register_on_dieplayer(function(player)
|
minetest.register_on_dieplayer(function(player)
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
local node = minetest.registered_nodes[minetest.get_node(player:getpos()).name]
|
||||||
if minetest.is_singleplayer() then
|
if minetest.is_singleplayer() then
|
||||||
player_name = "You"
|
player_name = "You"
|
||||||
end
|
end
|
||||||
-- Death by lava
|
-- Death by lava
|
||||||
local nodename = minetest.get_node(player:getpos()).name
|
if node.groups.lava ~= nil then
|
||||||
if nodename == "default:lava_source" or nodename == "default:lava_flowing" then
|
|
||||||
minetest.chat_send_all(player_name .. " melted into a ball of fire")
|
minetest.chat_send_all(player_name .. " melted into a ball of fire")
|
||||||
-- Death by drowning
|
-- Death by drowning
|
||||||
elseif nodename == "default:water_source" or nodename == "default:water_flowing" then
|
elseif node.groups.water ~= nil then
|
||||||
minetest.chat_send_all(player_name .. " ran out of air.")
|
minetest.chat_send_all(player_name .. " ran out of air.")
|
||||||
-- Death by fire
|
-- Death by fire
|
||||||
elseif nodename == "fire:basic_flame" then
|
elseif node.name == "fire:basic_flame" then
|
||||||
minetest.chat_send_all(player_name .. " burned to a crisp.")
|
minetest.chat_send_all(player_name .. " burned to a crisp.")
|
||||||
-- Death by something else
|
-- Death by something else
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user