tweak color add a few more mnessages
parent
599d8eb6f6
commit
81848d01fc
119
init.lua
119
init.lua
|
@ -29,9 +29,6 @@ dofile(minetest.get_modpath("death_messages").."/settings.txt")
|
||||||
|
|
||||||
-- 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 = {}
|
||||||
|
|
||||||
-- Toxic death messages
|
-- Toxic death messages
|
||||||
|
@ -119,10 +116,14 @@ messages.pvp = {
|
||||||
" deader than ded ded ded",
|
" deader than ded ded ded",
|
||||||
" CHOSEN to be the ONE",
|
" CHOSEN to be the ONE",
|
||||||
" all kinds of messed up",
|
" all kinds of messed up",
|
||||||
" smoked like a Neuport",
|
" smoked like a Newport",
|
||||||
" hurted",
|
" hurted",
|
||||||
" ballistic-ed",
|
" ballistic-ed",
|
||||||
" jostled",
|
" jostled",
|
||||||
|
" messed-da-frig-up",
|
||||||
|
" lanced",
|
||||||
|
" shot",
|
||||||
|
" knocked da heck out",
|
||||||
" pooped on"
|
" pooped on"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,6 +139,7 @@ messages.player = {
|
||||||
" for not being good at PVP.",
|
" for not being good at PVP.",
|
||||||
" because they are a n00b.",
|
" because they are a n00b.",
|
||||||
" for reasons uncertain.",
|
" for reasons uncertain.",
|
||||||
|
" for using a tablet.",
|
||||||
" with the quickness.",
|
" with the quickness.",
|
||||||
" while texting."
|
" while texting."
|
||||||
}
|
}
|
||||||
|
@ -167,8 +169,10 @@ function get_message(mtype)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
minetest.register_on_dieplayer(function(player, hitter)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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]
|
||||||
local pos = player:getpos()
|
local pos = player:getpos()
|
||||||
|
@ -179,49 +183,48 @@ minetest.register_on_dieplayer(function(player, hitter)
|
||||||
pos.z = math.floor(pos.z + 0.5)
|
pos.z = math.floor(pos.z + 0.5)
|
||||||
local param2 = minetest.dir_to_facedir(player:get_look_dir())
|
local param2 = minetest.dir_to_facedir(player:get_look_dir())
|
||||||
local player_name = player:get_player_name()
|
local player_name = player:get_player_name()
|
||||||
|
|
||||||
|
|
||||||
if minetest.is_singleplayer() then
|
if minetest.is_singleplayer() then
|
||||||
player_name = "You"
|
player_name = "You"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Death by lava
|
-- Death by lava
|
||||||
if node.name == "default:lava_source" then
|
if node.name == "default:lava_source" then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#ffffff)"..player_name ..
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("lava"))
|
string.char(0x1b).."(c@#ff0000)"..get_message("lava"))
|
||||||
if player:get_hp() == 0 then end
|
|
||||||
--player:setpos(death)
|
--player:setpos(death)
|
||||||
elseif node.name == "default:lava_flowing" then
|
elseif node.name == "default:lava_flowing" then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#ffffff)"..player_name ..
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("lava"))
|
string.char(0x1b).."(c@#ff0000)"..get_message("lava"))
|
||||||
if player:get_hp() == 0 then end
|
|
||||||
--player:setpos(death)
|
--player:setpos(death)
|
||||||
-- Death by drowning
|
-- Death by drowning
|
||||||
elseif player:get_breath() == 0 then
|
elseif player:get_breath() == 0 then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#ffffff)"..player_name ..
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("water"))
|
string.char(0x1b).."(c@#ff0000)"..get_message("water"))
|
||||||
if player:get_hp() == 0 then end
|
|
||||||
--player:setpos(death)
|
--player:setpos(death)
|
||||||
-- Death by fire
|
-- Death by fire
|
||||||
elseif node.name == "fire:basic_flame" then
|
elseif node.name == "fire:basic_flame" then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#ffffff)"..player_name ..
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("fire"))
|
string.char(0x1b).."(c@#ff0000)"..get_message("fire"))
|
||||||
if player:get_hp() == 0 then end
|
|
||||||
--player:setpos(death)
|
--player:setpos(death)
|
||||||
-- Death by Toxic water
|
-- Death by Toxic water
|
||||||
elseif node.name == "es:toxic_water_source" or node.name == "es:toxic_water_flowing" or node.name == "groups:radioactive" then
|
elseif node.name == "es:toxic_water_source" then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#ffffff)"..player_name ..
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
|
string.char(0x1b).."(c@#ff0000)"..get_message("toxic"))
|
||||||
|
--player:setpos(death)
|
||||||
|
elseif node.name == "es:toxic_water_flowing" then
|
||||||
|
minetest.chat_send_all(
|
||||||
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
|
string.char(0x1b).."(c@#ff0000)"..get_message("toxic"))
|
||||||
|
--player:setpos(death)
|
||||||
|
elseif node.name == "groups:radioactive" then
|
||||||
|
minetest.chat_send_all(
|
||||||
|
string.char(0x1b).."(c@#00CED1)"..player_name ..
|
||||||
string.char(0x1b).."(c@#ff0000)"..get_message("toxic"))
|
string.char(0x1b).."(c@#ff0000)"..get_message("toxic"))
|
||||||
minetest.after(1.5, function() return
|
|
||||||
player:setpos(death) --gamebreaker?
|
|
||||||
end)
|
|
||||||
if player:get_hp() == 0 then return end
|
|
||||||
--player:setpos(death)
|
--player:setpos(death)
|
||||||
|
|
||||||
-- Death by something else
|
-- Death by something else
|
||||||
|
@ -229,101 +232,75 @@ minetest.register_on_dieplayer(function(player, hitter)
|
||||||
--minetest.chat_send_all(
|
--minetest.chat_send_all(
|
||||||
--string.char(0x1b).."(c@#ffffff)"..player_name ..
|
--string.char(0x1b).."(c@#ffffff)"..player_name ..
|
||||||
--string.char(0x1b).."(c@#ff0000)"..get_message("other")) --toospammy
|
--string.char(0x1b).."(c@#ff0000)"..get_message("other")) --toospammy
|
||||||
--minetest.after(1.5, function() return
|
--minetest.after(0.5, function(holding)
|
||||||
--player:setpos(death) --gamebreaker?
|
--player:setpos(death) --gamebreaker?
|
||||||
--end)
|
--end)
|
||||||
--if player:get_hp() == 0 then end
|
|
||||||
--player:setpos(death)
|
|
||||||
--minetest.sound_play("pacmine_death", { gain = 0.35}) NOPE!!!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--=====================
|
|
||||||
--=====================
|
|
||||||
minetest.chat_send_all(string.char(0x1b).."(c@#000000)".."[DEATH COORDINATES] "..string.char(0x1b).."(c@#ffffff)" .. player_name .. string.char(0x1b).."(c@#000000)".." left a corpse full of diamonds here: " ..
|
|
||||||
minetest.pos_to_string(pos) .. string.char(0x1b).."(c@#aaaaaa)".." Come and get them!")
|
|
||||||
--=====================
|
|
||||||
--=====================
|
|
||||||
end)--after
|
|
||||||
|
|
||||||
|
--minetest.chat_send_all(string.char(0x1b).."(c@#000000)".."[DEATH COORDINATES] "..string.char(0x1b).."(c@#ffffff)" .. player_name .. string.char(0x1b).."(c@#000000)".." left a corpse full of diamonds here: " ..
|
||||||
|
--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!!!
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
--=====================
|
|
||||||
--=====================
|
|
||||||
--=====================
|
|
||||||
--bigfoot code
|
--bigfoot code
|
||||||
-- bigfoot547's death messages
|
-- bigfoot547's death messages
|
||||||
-- hacked by maikerumine
|
-- hacked by maikerumine
|
||||||
|
|
||||||
-- get tool/item when hitting get_name() returns item name (e.g. "default:stone")
|
-- get tool/item when hitting get_name() returns item name (e.g. "default:stone")
|
||||||
|
|
||||||
minetest.register_on_punchplayer(function(player, hitter)
|
minetest.register_on_punchplayer(function(player, hitter)
|
||||||
|
local pos = player:getpos()
|
||||||
|
local death = {x=0, y=23, z=-1.5}
|
||||||
-- local pos = player:getpos()
|
|
||||||
-- local death = {x=0, y=23, z=-1.5}
|
|
||||||
if not (player or hitter) then
|
if not (player or hitter) then
|
||||||
return false end
|
return false
|
||||||
|
end
|
||||||
if not hitter:get_player_name() == "" then
|
if not hitter:get_player_name() == "" then
|
||||||
return false end
|
return false
|
||||||
|
end
|
||||||
minetest.after(0, function(holding)
|
minetest.after(0, function(holding)
|
||||||
local hp = 1
|
if player:get_hp() == 0 and hitter:get_player_name() ~= "" and holding == hitter:get_wielded_item() ~= "" then
|
||||||
if player:get_hp() >= 0.01 and hitter:get_player_name() ~= "" and holding == hitter:get_wielded_item() ~= "" then
|
|
||||||
|
|
||||||
local holding = hitter:get_wielded_item()
|
local holding = hitter:get_wielded_item()
|
||||||
if holding:to_string() ~= "" then
|
if holding:to_string() ~= "" then
|
||||||
local weap = holding:get_name(holding:get_name())
|
local weap = holding:get_name(holding:get_name())
|
||||||
--if holding and player:get_hp() == 0 then
|
if holding then
|
||||||
minetest.chat_send_all(
|
minetest.chat_send_all(
|
||||||
string.char(0x1b).."(c@#ffffff)"..player:get_player_name()..
|
string.char(0x1b).."(c@#00CED1)"..player:get_player_name()..
|
||||||
string.char(0x1b).."(c@#ff0000)".." was"..
|
string.char(0x1b).."(c@#ff0000)".." was"..
|
||||||
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)".." by "..
|
||||||
string.char(0x1b).."(c@#ffffff)"..hitter:get_player_name()..
|
string.char(0x1b).."(c@#00CED1)"..hitter:get_player_name()..
|
||||||
string.char(0x1b).."(c@#ffffff)".." with "..
|
string.char(0x1b).."(c@#ffffff)".." with "..
|
||||||
string.char(0x1b).."(c@#00bbff)"..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
|
||||||
|
|
||||||
--end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if player=="" or hitter=="" then return end -- no killers/victims
|
if player=="" or hitter=="" then return end -- no killers/victims
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
||||||
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@#ffffff)"..player:get_player_name()..
|
string.char(0x1b).."(c@#00CED1)"..player:get_player_name()..
|
||||||
string.char(0x1b).."(c@#ff0000)".." was"..
|
string.char(0x1b).."(c@#ff0000)".." was"..
|
||||||
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)".." by "..
|
||||||
string.char(0x1b).."(c@#ffffff)"..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
|
||||||
|
|
||||||
if player=="" or hitter=="" or hitter=="*" then return end -- no mob killers/victims
|
if player=="" or hitter=="" or hitter=="*" then return end -- no mob killers/victims
|
||||||
else
|
else
|
||||||
|
|
||||||
if player:get_hp() == 0 then end
|
|
||||||
return false
|
return false
|
||||||
end --if player and and
|
|
||||||
end) --after
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--[[
|
|
||||||
while player:get_hp() == 0 and hitter:get_player_name() ~= "" and holding == hitter:get_wielded_item() ~= "" --make more specific
|
|
||||||
do
|
|
||||||
|
|
||||||
|
|
||||||
if player:get_hp() == 0 then
|
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
]] -- example dowhile
|
|
||||||
|
|
||||||
|
end)
|
||||||
|
|
||||||
end) --hitter func
|
end)
|
||||||
|
|
||||||
|
|
||||||
-----------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------
|
||||||
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...")
|
||||||
|
|
Loading…
Reference in New Issue