More text; adding 'reason' by API for testing
parent
c92963f752
commit
dbbb69ad75
32
init.lua
32
init.lua
|
@ -32,6 +32,9 @@ if not (LANG and (LANG ~= "")) then LANG = "en" end
|
||||||
-- A table of quips for death messages. The first item in each sub table is the
|
-- A table of quips for death messages. The first item in each sub table is the
|
||||||
-- default message used when RANDOM_MESSAGES is disabled.
|
-- default message used when RANDOM_MESSAGES is disabled.
|
||||||
local messages = {}
|
local messages = {}
|
||||||
|
local swas = { en = " was ", de = " war " }
|
||||||
|
local sby = { en = " by ", de = " von " }
|
||||||
|
local swith = {en = " with ", de = " mit " }
|
||||||
|
|
||||||
-- Default messages
|
-- Default messages
|
||||||
-- Toxic death messages
|
-- Toxic death messages
|
||||||
|
@ -181,11 +184,9 @@ messages.player = {en = {
|
||||||
" with the quickness.",
|
" with the quickness.",
|
||||||
" while texting."
|
" while texting."
|
||||||
},de={
|
},de={
|
||||||
" betrog beim Tic-Tac-Toe.",
|
" weil er nervte.",
|
||||||
" redete schlecht über seine Mutter.",
|
" denn er brachte den Müll nicht raus.",
|
||||||
" nervte.",
|
" für das ungeputzte Bad."
|
||||||
" brachte den Müll nicht raus.",
|
|
||||||
" putzte nicht das Bad."
|
|
||||||
}}
|
}}
|
||||||
|
|
||||||
-- MOB After Messages
|
-- MOB After Messages
|
||||||
|
@ -203,8 +204,8 @@ messages.mobs = {en = {
|
||||||
" for talking smack about Oerkkii's mother.",
|
" for talking smack about Oerkkii's mother.",
|
||||||
" and grimmaced wryly."
|
" and grimmaced wryly."
|
||||||
},de={
|
},de={
|
||||||
" ist das Mittagessen.",
|
" und ist das Mittagessen.",
|
||||||
" war im Weg."
|
" weil er im Weg war."
|
||||||
}}
|
}}
|
||||||
|
|
||||||
function get_message(mtype)
|
function get_message(mtype)
|
||||||
|
@ -219,7 +220,8 @@ end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player)
|
minetest.register_on_dieplayer(function(player,reason)
|
||||||
|
if reason == nil then
|
||||||
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]
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
|
@ -289,7 +291,9 @@ minetest.register_on_dieplayer(function(player)
|
||||||
--minetest.pos_to_string(pos) .. string.char(0x1b).."(c@#aaaaaa)".." Come and get them!")
|
--minetest.pos_to_string(pos) .. string.char(0x1b).."(c@#aaaaaa)".." Come and get them!")
|
||||||
--player:setpos(death)
|
--player:setpos(death)
|
||||||
--minetest.sound_play("pacmine_death", { gain = 0.35}) NOPE!!!
|
--minetest.sound_play("pacmine_death", { gain = 0.35}) NOPE!!!
|
||||||
|
else
|
||||||
|
minetest.chat_send_all(string.char(0x1b)..player:get_player_name().." "..reason)
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
--bigfoot code
|
--bigfoot code
|
||||||
|
@ -315,11 +319,11 @@ minetest.register_on_punchplayer(function(player, hitter)
|
||||||
if holding then
|
if holding then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#00CED1)"..player:get_player_name()..
|
string.char(0x1b).."(c@#00CED1)"..player:get_player_name()..
|
||||||
string.char(0x1b).."(c@#ff0000)".." was"..
|
string.char(0x1b).."(c@#ff0000)"..swas[LANG]..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("pvp")..
|
string.char(0x1b).."(c@#ff0000)"..get_message("pvp")..
|
||||||
string.char(0x1b).."(c@#ff0000)".." by "..
|
string.char(0x1b).."(c@#ff0000)"..sby[LANG]..
|
||||||
string.char(0x1b).."(c@#00CED1)"..hitter:get_player_name()..
|
string.char(0x1b).."(c@#00CED1)"..hitter:get_player_name()..
|
||||||
string.char(0x1b).."(c@#ffffff)".." with "..
|
string.char(0x1b).."(c@#ffffff)"..swith[LANG]..
|
||||||
string.char(0x1b).."(c@#FF8C00)"..weap..
|
string.char(0x1b).."(c@#FF8C00)"..weap..
|
||||||
string.char(0x1b).."(c@#00bbff)"..get_message("player")) --TODO: make custom mob death messages
|
string.char(0x1b).."(c@#00bbff)"..get_message("player")) --TODO: make custom mob death messages
|
||||||
|
|
||||||
|
@ -333,9 +337,9 @@ minetest.register_on_punchplayer(function(player, hitter)
|
||||||
elseif hitter:get_player_name() == "" and player:get_hp() == 0 then
|
elseif hitter:get_player_name() == "" and player:get_hp() == 0 then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#00CED1)"..player:get_player_name()..
|
string.char(0x1b).."(c@#00CED1)"..player:get_player_name()..
|
||||||
string.char(0x1b).."(c@#ff0000)".." was"..
|
string.char(0x1b).."(c@#ff0000)"..swas[LANG]..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("pvp")..
|
string.char(0x1b).."(c@#ff0000)"..get_message("pvp")..
|
||||||
string.char(0x1b).."(c@#ff0000)".." by "..
|
string.char(0x1b).."(c@#ff0000)"..sby[LANG]..
|
||||||
string.char(0x1b).."(c@#FF8C00)"..hitter:get_luaentity().name.. --too many mobs add to crash
|
string.char(0x1b).."(c@#FF8C00)"..hitter:get_luaentity().name.. --too many mobs add to crash
|
||||||
string.char(0x1b).."(c@#00bbff)"..get_message("mobs")) --TODO: make custom mob death messages
|
string.char(0x1b).."(c@#00bbff)"..get_message("mobs")) --TODO: make custom mob death messages
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue