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 = {}
-- Lava death messages
messages.lava = {
'# Illuna: %s thought lava was cool.',
'# Illuna: %s melted into a ball of fire.',
'# Illuna: %s couldn\'t resist that warm glow of lava.',
'# Illuna: %s dug straight down.',
'# Illuna: %s didn\'t know lava was hot.'
'%s thought lava was cool.',
'%s melted into a ball of fire.',
'%s couldn\'t resist that warm glow of lava.',
'%s dug straight down.',
'%s didn\'t know lava was hot.'
}
-- Drowning death messages
messages.water = {
'# Illuna: %s ran out of air.',
'# Illuna: %s failed at swimming lessons.',
'# Illuna: %s tried to impersonate an anchor.',
'# Illuna: %s forgot he wasn\'t a fish.',
'# Illuna: %s blew one too many bubbles.'
'%s ran out of air.',
'%s failed at swimming lessons.',
'%s tried to impersonate an anchor.',
'%s forgot he wasn\'t a fish.',
'%s blew one too many bubbles.'
}
-- Burning death messages
messages.fire = {
'# Illuna: %s burned to a crisp.',
'# Illuna: %s got a little too warm.',
'# Illuna: %s got too close to the camp fire.',
'# Illuna: %s just got roasted, hotdog style.',
'# Illuna: %s was set aflame. More light that way.'
'%s burned to a crisp.',
'%s got a little too warm.',
'%s got too close to the camp fire.',
'%s just got roasted, hotdog style.',
'%s was set aflame. More light that way.'
}
-- Other death messages
messages.other = {
'# Illuna: %s did something fatal.',
'# Illuna: %s died.',
'# Illuna: %s gave up on life.',
'# Illuna: %s is somewhat dead now.',
'# Illuna: %s is very dead now.',
'# Illuna: Oh snap! %s died too young. :-(',
'# Illuna: Oh no, %s has gone from us. :-('
'%s did something fatal.',
'%s died.',
'%s gave up on life.',
'%s is somewhat dead now.',
'%s is very dead now.',
'Oh snap! %s died too young. :-(',
'Oh no, %s has gone from us. :-('
}
-- Respawn messages
messages.respawn = {
'# Illuna: %s comes back alive. How is that possible?',
'# Illuna: %s comes back alive...maybe as a zombie? Other players should be careful now.',
'# Illuna: Like a Phoenix %s rises from the ashes!',
'# Illuna: My goodness, %s is back!',
'# Illuna: %s died of something fatal'
'%s comes back alive. How is that possible?',
'%s comes back alive...maybe as a zombie? Other players should be careful now.',
'Like a Phoenix %s rises from the ashes!',
'My goodness, %s is back!',
'%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)
local player_name = player:get_player_name()
local node = core.registered_nodes[core.get_node(player:getpos()).name]
......@@ -57,35 +61,35 @@ core.register_on_dieplayer(function(player)
end
-- Death by lava
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
irc:say(string.format('*** %s died.', player:get_player_name()))
irc:say(string.format('*** %s died.', player_name))
end
-- Death by drowning
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
irc:say(string.format('*** %s died.', player:get_player_name()))
irc:say(string.format('*** %s died.', player_name))
end
-- Death by fire
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
irc:say(string.format('*** %s died.', player:get_player_name()))
irc:say(string.format('*** %s died.', player_name))
end
-- Death by something 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
irc:say(string.format('*** %s died.', player:get_player_name()))
irc:say(string.format('*** %s died.', player_name))
end
end
end)
minetest.register_on_respawnplayer( function(player)
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
irc:say(string.format('*** %s returns.', player:get_player_name()))
irc:say(string.format('*** %s returns.', player_name))
end
end)