1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 18:20:36 +01:00

Translate death_messages

- Solves #265
This commit is contained in:
LeMagnesium 2015-09-05 14:28:47 +02:00
parent 592ac4fa12
commit 4e99399cdb

View File

@ -21,73 +21,80 @@ local sounds = {
-- Lava death messages -- Lava death messages
messages.lava = { messages.lava = {
" pensait que la lave etait cool.", "%s thought lava was cool. / %s pensait que la lave etait cool.",
" s'est sentit oblige de toucher la lave.", "%s felt an urgent need to touch lava. / %s s'est sentit oblige de toucher la lave.",
" est tombe dans la lave.", "%s fell in lava. / %s est tombe dans la lave.",
" est mort(e) dans de la lave.", "%s died in lava. / %s est mort(e) dans de la lave.",
" ne savait pas que la lave etait vraiment chaude.", "%s didn't know lava was very hot. / %s ne savait pas que la lave etait vraiment chaude.",
" a detruit l'anneau de Sauron." "%s destroyed Sauron's ring. / %s a detruit l'anneau de Sauron."
} }
-- Drowning death messages -- Drowning death messages
messages.water = { messages.water = {
" a manque d'air.", "%s lacked oxygen. / %s a manque d'air.",
" a essaye d'usurper l'identite d'une ancre.", "%s tried to impersonate an anchor. / %s a essaye d'usurper l'identite d'une ancre.",
" a oublie qu'il n'etait pas un poisson.", "%s forgot they were not a fish. / %s a oublie qu'il n'etait pas un poisson.",
" a oublier qu'il lui fallait respirer sous l'eau.", "%s forgot they needed to breath underwater. / %s a oublier qu'il lui fallait respirer sous l'eau.",
" n'est pas bon en natation.", "%s isn't good at swimming. / %s n'est pas bon en natation.",
" a cherche le secret de la licorne.", "%s looked for the secret of the Unicorn. / %s a cherche le secret de la licorne.",
" a oublie son scaphandre." "%s forgot their scaphander. / %s a oublie son scaphandre."
} }
-- Burning death messages -- Burning death messages
messages.fire = { messages.fire = {
" a eut un peu trop chaud.", "%s was a bit too hot. / %s a eut un peu trop chaud.",
" a ete trop pres du feu.", "%s was too close to the fire. / %s a ete trop pres du feu.",
" vient de se faire rotir.", "%s just got roasted. / %s vient de se faire rotir.",
" a ete carbonise.", "%s got burnt. / %s a ete carbonise.",
" s'est prit pour la torche.", "%s thought they were the human torch. / %s s'est prit pour la torche.",
" a allume le feu." "%s started a fire. / %s a allume le feu."
} }
-- Acid death messages -- Acid death messages
messages.acid = { messages.acid = {
" a desormais des parties en moins.", "%s has now parts of them missing. / %s a desormais des parties en moins.",
" a decouvert que l'acide c'est fun.", "%s discovered that acid is fun. / %s a decouvert que l'acide c'est fun.",
" a mis sa tete la ou elle a fondu.", "%s put their head where it melted. / %s a mis sa tete la ou elle a fondu.",
" a decouvert que son corps dans l'acide, c'est comme du sucre dans de l'eau.", "%s dicovered that their body in acid, it's like sugar in water. / %s a decouvert que son corps dans l'acide, c'est comme du sucre dans de l'eau.",
" a cru qu'il se baignait dans du jus de pomme.", "%s thought they were swimming in apple juice. / %s a cru qu'il se baignait dans du jus de pomme.",
" a donne son corps pour faire une infusion.", "%s gave their body to make an infusion / %s a donne son corps pour faire une infusion.",
" a bu la mauvaise tasse.", "%s drowned in the wrong liquid. / %s a bu la mauvaise tasse.",
" a voulu tester la solubilite de son corps dans l'acide." "%s tried to test their body's solubility in acid. / %s a voulu tester la solubilite de son corps dans l'acide."
} }
-- Quicksands death messages -- Quicksands death messages
messages.sand = { messages.sand = {
" a appris que le sable etait moins fluide que l'eau.", "%s leanrt that sand is less fluid than water. / %s a appris que le sable etait moins fluide que l'eau.",
" a rejoint les momies.", "%s joined the mummies. / %s a rejoint les momies.",
" s'est fait(e) ensevelir.", "%s got themselves buried. / %s s'est fait(e) ensevelir.",
" a choisi la voie de la fossilisation." "%s chose to become a fossil. / %s a choisi la voie de la fossilisation."
} }
-- Other death messages -- Other death messages
messages.other = { messages.other = {
" a fait quelque chose qui lui a ete fatale.", "%s did something fatal to them. / %s a fait quelque chose qui lui a ete fatale.",
" est mort(e).", "%s is dead. / %s est mort(e).",
" n'est plus de ce monde.", "%s left this world. / %s n'est plus de ce monde.",
" a rejoint le paradis des mineurs.", "%s reached miner's heaven. / %s a rejoint le paradis des mineurs.",
" a perdu la vie.", "%s lost their life. / %s a perdu la vie.",
" a vu la lumière." "%s saw the light. / %s a vu la lumière."
} }
-- Whacking death messages -- Whacking death messages
messages.whacking = { messages.whacking = {
"%s got whacked by %s", "%s got whacked by %s / %s s'est pris une raclee de la part de %s",
"%s's grave was dug by %s", "%s's grave was dug by %s / La tombe de %s a ete creusee par %s",
-- Need to fill -- Need to fill
} }
local function broadcast_death(msg)
minetest.chat_send_all(msg)
if irc then
irc:say(msg)
end
end
local function sound_play_all(dead) local function sound_play_all(dead)
for _, p in ipairs(minetest.get_connected_players()) do for _, p in ipairs(minetest.get_connected_players()) do
local player_name = p:get_player_name() local player_name = p:get_player_name()
@ -100,15 +107,17 @@ end
minetest.register_on_punchplayer(function(player, hitter, time, minetest.register_on_punchplayer(function(player, hitter, time,
tool_caps, dir, damage) tool_caps, dir, damage)
if player:get_hp() - damage <= 0 and hitter:is_player() and not whacked[player:get_player_name()] then if player:get_hp() - damage <= 0 and hitter:is_player() and not whacked[player:get_player_name()] then
death_message = string.format(messages.whacking[math.random(1,#messages.whacking)], player:get_player_name(), hitter:get_player_name()) death_message = string.format(messages.whacking[math.random(1,#messages.whacking)], player:get_player_name(), hitter:get_player_name(), player:get_player_name(), hitter:get_player_name())
if minetest.get_modpath("irc") ~= nil then broadcast_death(death_message)
irc:say(death_message)
end
minetest.chat_send_all(death_message)
whacked[player:get_player_name()] = true whacked[player:get_player_name()] = true
end end
end) end)
minetest.register_on_leaveplayer(function(player)
whacked[player:get_player_name()] = nil
end)
minetest.register_on_respawnplayer(function(player) minetest.register_on_respawnplayer(function(player)
whacked[player:get_player_name()] = nil whacked[player:get_player_name()] = nil
end) end)
@ -123,56 +132,58 @@ if RANDOM_MESSAGES == true then
local death_message = "" local death_message = ""
if whacked[player_name] then return end if not whacked[player_name] then
-- Death by lava -- Death by lava
if node.groups.lava ~= nil then if node.groups.lava ~= nil then
death_message = player_name .. messages.lava[math.random(1,#messages.lava)] death_message = messages.lava[math.random(1,#messages.lava)]
-- Death by acid -- Death by acid
elseif node.groups.acid ~= nil then elseif node.groups.acid ~= nil then
death_message = player_name .. messages.acid[math.random(1,#messages.acid)] death_message = messages.acid[math.random(1,#messages.acid)]
-- Death by drowning -- Death by drowning
elseif player:get_breath() == 0 and node.groups.water then elseif player:get_breath() == 0 and node.groups.water then
death_message = player_name .. messages.water[math.random(1,#messages.water)] death_message = messages.water[math.random(1,#messages.water)]
-- Death by fire -- Death by fire
elseif node.name == "fire:basic_flame" then elseif node.name == "fire:basic_flame" then
death_message = player_name .. messages.fire[math.random(1,#messages.fire)] death_message = messages.fire[math.random(1,#messages.fire)]
-- Death in quicksand -- Death in quicksand
elseif player:get_breath() == 0 and node.name == "default:sand_source" or node.name == "default:sand_flowing" then elseif player:get_breath() == 0 and node.name == "default:sand_source" or node.name == "default:sand_flowing" then
death_message = player_name .. messages.sand[math.random(1,#messages.sand)] death_message = messages.sand[math.random(1,#messages.sand)]
-- Death by something else -- Death by something else
else else
death_message = player_name .. messages.other[math.random(1,#messages.other)] death_message = messages.other[math.random(1,#messages.other)]
end end
-- Actually tell something -- Actually tell something
minetest.chat_send_all(death_message) death_message = string.format(death_message, player_name, player_name)
if minetest.get_modpath("irc") ~= nil then broadcast_death(death_message)
irc:say(death_message)
end end
minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")}) minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")})
sound_play_all(player:get_player_name()) sound_play_all(player:get_player_name())
end) end)
else else
-- Should we keep that part?
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] 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 if not whacked[player_name] then
if node.groups.lava ~= nil then -- Death by lava
minetest.chat_send_all(player_name .. " melted into a ball of fire") if node.groups.lava ~= nil then
-- Death by drowning minetest.chat_send_all(player_name .. " melted into a ball of fire")
elseif player:get_breath() == 0 then -- Death by drowning
minetest.chat_send_all(player_name .. " ran out of air.") elseif player:get_breath() == 0 then
-- Death by fire minetest.chat_send_all(player_name .. " ran out of air.")
elseif node.name == "fire:basic_flame" then -- Death by fire
minetest.chat_send_all(player_name .. " burned to a crisp.") elseif node.name == "fire:basic_flame" then
-- Death by something else minetest.chat_send_all(player_name .. " burned to a crisp.")
else -- Death by something else
minetest.chat_send_all(player_name .. " died.") else
minetest.chat_send_all(player_name .. " died.")
end
end end
minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")}) minetest.sound_play(sounds[math.random(1,#sounds)],{to_player=player:get_player_name(),gain=soundset.get_gain(player:get_player_name(),"other")})
sound_play_all(player:get_player_name()) sound_play_all(player:get_player_name())