Use status effects for elixirs and cold demon slow.

This commit is contained in:
Duane 2016-06-30 18:48:51 -05:00
parent b486af8627
commit e9ae30dfc9
4 changed files with 37 additions and 16 deletions

View file

@ -112,6 +112,29 @@ function fun_caves.register_status(def)
}
end
function fun_caves.set_status(player_name, status, time, param)
local player = minetest.get_player_by_name(player_name)
local def = fun_caves.registered_status[status]
if not (def and player) then
return
end
if not param then
param = {}
end
if time then
param.remove = minetest.get_gametime() + time
end
if player_name and status and fun_caves.db.status[player_name] then
fun_caves.db.status[player_name][status] = param
if def.start then
def.start(player)
end
end
end
--dofile(fun_caves.path .. "/recipe_list.lua")