Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Illuna-Minetest/death_messages
1 result
Show changes
Commits on Source (2)
...@@ -4,51 +4,55 @@ local messages = {} ...@@ -4,51 +4,55 @@ local messages = {}
-- Lava death messages -- Lava death messages
messages.lava = { messages.lava = {
'# Illuna: %s thought lava was cool.', '%s thought lava was cool.',
'# Illuna: %s melted into a ball of fire.', '%s melted into a ball of fire.',
'# Illuna: %s couldn\'t resist that warm glow of lava.', '%s couldn\'t resist that warm glow of lava.',
'# Illuna: %s dug straight down.', '%s dug straight down.',
'# Illuna: %s didn\'t know lava was hot.' '%s didn\'t know lava was hot.'
} }
-- Drowning death messages -- Drowning death messages
messages.water = { messages.water = {
'# Illuna: %s ran out of air.', '%s ran out of air.',
'# Illuna: %s failed at swimming lessons.', '%s failed at swimming lessons.',
'# Illuna: %s tried to impersonate an anchor.', '%s tried to impersonate an anchor.',
'# Illuna: %s forgot he wasn\'t a fish.', '%s forgot he wasn\'t a fish.',
'# Illuna: %s blew one too many bubbles.' '%s blew one too many bubbles.'
} }
-- Burning death messages -- Burning death messages
messages.fire = { messages.fire = {
'# Illuna: %s burned to a crisp.', '%s burned to a crisp.',
'# Illuna: %s got a little too warm.', '%s got a little too warm.',
'# Illuna: %s got too close to the camp fire.', '%s got too close to the camp fire.',
'# Illuna: %s just got roasted, hotdog style.', '%s just got roasted, hotdog style.',
'# Illuna: %s was set aflame. More light that way.' '%s was set aflame. More light that way.'
} }
-- Other death messages -- Other death messages
messages.other = { messages.other = {
'# Illuna: %s did something fatal.', '%s did something fatal.',
'# Illuna: %s died.', '%s died.',
'# Illuna: %s gave up on life.', '%s gave up on life.',
'# Illuna: %s is somewhat dead now.', '%s is somewhat dead now.',
'# Illuna: %s is very dead now.', '%s is very dead now.',
'# Illuna: Oh snap! %s died too young. :-(', 'Oh snap! %s died too young. :-(',
'# Illuna: Oh no, %s has gone from us. :-(' 'Oh no, %s has gone from us. :-('
} }
-- Respawn messages -- Respawn messages
messages.respawn = { messages.respawn = {
'# Illuna: %s comes back alive. How is that possible?', '%s comes back alive. How is that possible?',
'# Illuna: %s comes back alive...maybe as a zombie? Other players should be careful now.', '%s comes back alive...maybe as a zombie? Other players should be careful now.',
'# Illuna: Like a Phoenix %s rises from the ashes!', 'Like a Phoenix %s rises from the ashes!',
'# Illuna: My goodness, %s is back!', 'My goodness, %s is back!',
'# Illuna: %s died of something fatal' '%s died of something fatal'
} }
local base = minetest.setting_get("color_boring")
local success = minetest.setting_get("color_success")
local failure = minetest.setting_get("color_failure")
core.register_on_dieplayer(function(player) core.register_on_dieplayer(function(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
local node = core.registered_nodes[core.get_node(player:getpos()).name] local node = core.registered_nodes[core.get_node(player:getpos()).name]
...@@ -57,35 +61,35 @@ core.register_on_dieplayer(function(player) ...@@ -57,35 +61,35 @@ core.register_on_dieplayer(function(player)
end end
-- Death by lava -- Death by lava
if node.groups.lava ~= nil then if node.groups.lava ~= nil then
core.chat_send_all(string.format(core.colorize("#F6A10A", messages.lava[math.random(1,#messages.lava)]), player:get_player_name())) core.chat_send_all(core.colorize(failure, "- ") .. string.format(core.colorize(base, messages.lava[math.random(1,#messages.lava)]), player_name))
if minetest.get_modpath("irc") then if minetest.get_modpath("irc") then
irc:say(string.format('*** %s died.', player:get_player_name())) irc:say(string.format('*** %s died.', player_name))
end end
-- Death by drowning -- Death by drowning
elseif player:get_breath() == 0 then elseif player:get_breath() == 0 then
core.chat_send_all(string.format(core.colorize("#F6A10A", messages.water[math.random(1,#messages.water)]), player:get_player_name())) core.chat_send_all(core.colorize(failure, "- ") .. string.format(core.colorize(base, messages.water[math.random(1,#messages.water)]), player_name))
if minetest.get_modpath("irc") then if minetest.get_modpath("irc") then
irc:say(string.format('*** %s died.', player:get_player_name())) irc:say(string.format('*** %s died.', player_name))
end end
-- Death by fire -- Death by fire
elseif node.name == 'fire:basic_flame' then elseif node.name == 'fire:basic_flame' then
core.chat_send_all(string.format(core.colorize("#F6A10A", messages.fire[math.random(1,#messages.fire)]), player:get_player_name())) core.chat_send_all(core.colorize(failure, "* ") .. string.format(core.colorize(base, messages.fire[math.random(1,#messages.fire)]), player_name))
if minetest.get_modpath("irc") then if minetest.get_modpath("irc") then
irc:say(string.format('*** %s died.', player:get_player_name())) irc:say(string.format('*** %s died.', player_name))
end end
-- Death by something else -- Death by something else
else else
core.chat_send_all(string.format(core.colorize("#F6A10A", messages.other[math.random(1,#messages.other)]), player:get_player_name())) core.chat_send_all(core.colorize(failure, "- ") .. string.format(core.colorize(base, messages.other[math.random(1,#messages.other)]), player_name))
if minetest.get_modpath("irc") then if minetest.get_modpath("irc") then
irc:say(string.format('*** %s died.', player:get_player_name())) irc:say(string.format('*** %s died.', player_name))
end end
end end
end) end)
minetest.register_on_respawnplayer( function(player) minetest.register_on_respawnplayer( function(player)
local player_name = player:get_player_name() local player_name = player:get_player_name()
core.chat_send_all(string.format(core.colorize("#F6A10A", messages.respawn[math.random(1,#messages.respawn)]), player:get_player_name())) core.chat_send_all(core.colorize(success, "* ") .. string.format(core.colorize(base, messages.respawn[math.random(1,#messages.respawn)]), player_name))
if minetest.get_modpath("irc") then if minetest.get_modpath("irc") then
irc:say(string.format('*** %s returns.', player:get_player_name())) irc:say(string.format('*** %s returns.', player_name))
end end
end) end)