Generalize status effects.

This commit is contained in:
Duane 2016-06-30 17:54:33 -05:00
parent e5005dd8d6
commit b486af8627
5 changed files with 76 additions and 24 deletions

View file

@ -11,9 +11,9 @@ minetest.register_chatcommand("armor", {
minetest.chat_send_player(player_name, " "..group.." "..value)
end
if fun_caves.db.armor_expire and fun_caves.db.armor_expire[player_name] then
local armor_time = fun_caves.db.armor_expire[player_name].time
local min = math.floor((armor_time - minetest.get_gametime()) / 60)
if fun_caves.db.status[player_name].armor_elixir then
local armor_time = fun_caves.db.status[player_name].armor_elixir.remove
local min = math.floor(math.max(0, armor_time - minetest.get_gametime()) / 60)
minetest.chat_send_player(player_name, "Your armor elixir will expire in "..min..' minutes.')
end
end