More text; adding 'reason' by API for testing

master
A. Demant 2018-09-05 16:06:26 +02:00
parent c92963f752
commit dbbb69ad75
1 changed files with 84 additions and 80 deletions

View File

@ -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
-- default message used when RANDOM_MESSAGES is disabled.
local messages = {}
local swas = { en = " was ", de = " war " }
local sby = { en = " by ", de = " von " }
local swith = {en = " with ", de = " mit " }
-- Default messages
-- Toxic death messages
@ -181,11 +184,9 @@ messages.player = {en = {
" with the quickness.",
" while texting."
},de={
" betrog beim Tic-Tac-Toe.",
" redete schlecht über seine Mutter.",
" nervte.",
" brachte den Müll nicht raus.",
" putzte nicht das Bad."
" weil er nervte.",
" denn er brachte den Müll nicht raus.",
" für das ungeputzte Bad."
}}
-- MOB After Messages
@ -203,8 +204,8 @@ messages.mobs = {en = {
" for talking smack about Oerkkii's mother.",
" and grimmaced wryly."
},de={
" ist das Mittagessen.",
" war im Weg."
" und ist das Mittagessen.",
" weil er im Weg war."
}}
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 node = minetest.registered_nodes[minetest.get_node(player:getpos()).name]
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!")
--player:setpos(death)
--minetest.sound_play("pacmine_death", { gain = 0.35}) NOPE!!!
else
minetest.chat_send_all(string.char(0x1b)..player:get_player_name().." "..reason)
end
end)
--bigfoot code
@ -315,11 +319,11 @@ minetest.register_on_punchplayer(function(player, hitter)
if holding then
minetest.chat_send_all(
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)".." by "..
string.char(0x1b).."(c@#ff0000)"..sby[LANG]..
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@#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
minetest.chat_send_all(
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)".." 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@#00bbff)"..get_message("mobs")) --TODO: make custom mob death messages