a bunch of new notes. randomly. based on situations.
parent
a74fd33fff
commit
11d3a1c1ee
84
init.lua
84
init.lua
|
@ -1,14 +1,76 @@
|
|||
careLetters = true
|
||||
-- [ most messages are from https://github.com/FozLand/chat_next ] --
|
||||
|
||||
DEATH_MSG = "Oh no! %s died too young :("
|
||||
REVIVE_MSG = "Like a Phoenix %s rises from the ashes."
|
||||
local messages = {}
|
||||
|
||||
minetest.register_on_dieplayer( function(player)
|
||||
minetest.chat_send_all(string.format(DEATH_MSG, player:get_player_name()))
|
||||
end
|
||||
)
|
||||
-- Lava death messages
|
||||
messages.lava = {
|
||||
'%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 = {
|
||||
'%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 = {
|
||||
'%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 = {
|
||||
'%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 = {
|
||||
'%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!'
|
||||
}
|
||||
|
||||
core.register_on_dieplayer(function(player)
|
||||
local player_name = player:get_player_name()
|
||||
local node = core.registered_nodes[core.get_node(player:getpos()).name]
|
||||
if core.is_singleplayer() then
|
||||
player_name = 'You'
|
||||
end
|
||||
-- Death by lava
|
||||
if node.groups.lava ~= nil then
|
||||
core.chat_send_all(string.format(messages.lava[math.random(1,#messages.lava)], player:get_player_name()))
|
||||
-- Death by drowning
|
||||
elseif player:get_breath() == 0 then
|
||||
core.chat_send_all(string.format(messages.water[math.random(1,#messages.water)], player:get_player_name()))
|
||||
-- Death by fire
|
||||
elseif node.name == 'fire:basic_flame' then
|
||||
core.chat_send_all(string.format(messages.fire[math.random(1,#messages.fire)], player:get_player_name()))
|
||||
-- Death by something else
|
||||
else
|
||||
core.chat_send_all(string.format(messages.other[math.random(1,#messages.other)], player:get_player_name()))
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_respawnplayer( function(player)
|
||||
local player_name = player:get_player_name()
|
||||
core.chat_send_all(string.format(messages.respawn[math.random(1,#messages.respawn)], player:get_player_name()))
|
||||
end)
|
||||
|
||||
minetest.register_on_respawnplayer( function(player)
|
||||
minetest.chat_send_all(string.format(REVIVE_MSG, player:get_player_name()))
|
||||
end
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue