Add /armor command.

This commit is contained in:
Duane 2016-06-20 21:31:49 -05:00
parent 50ce118087
commit 3d57691431
2 changed files with 20 additions and 0 deletions

19
chat.lua Normal file
View file

@ -0,0 +1,19 @@
minetest.register_chatcommand("armor", {
params = "",
description = "Display your armor values",
privs = {},
func = function(name, param)
local player = minetest.get_player_by_name(name)
local armor = player:get_armor_groups()
if armor then
minetest.chat_send_player(name, "Armor:")
for group, value in pairs(armor) do
minetest.chat_send_player(name, " "..group.." "..value)
end
if fun_caves.armor_expire and fun_caves.armor_expire[name] then
local min = math.floor((fun_caves.armor_expire[name] - minetest.get_us_time()) / 60000000)
minetest.chat_send_player(name, "Your elixir will expire in "..min..' minutes.')
end
end
end,
})

View file

@ -71,6 +71,7 @@ dofile(fun_caves.path .. "/fungal_tree.lua")
dofile(fun_caves.path .. "/armor.lua") dofile(fun_caves.path .. "/armor.lua")
dofile(fun_caves.path .. "/wallhammer.lua") dofile(fun_caves.path .. "/wallhammer.lua")
dofile(fun_caves.path .. "/mapgen.lua") dofile(fun_caves.path .. "/mapgen.lua")
dofile(fun_caves.path .. "/chat.lua")
if mobs and mobs.mod == "redo" then if mobs and mobs.mod == "redo" then
dofile(fun_caves.path .. "/mobs.lua") dofile(fun_caves.path .. "/mobs.lua")