1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-08 19:40:21 +01:00

Lower life regen to 10s per HP

This commit is contained in:
Wouters Dorian 2015-07-19 17:37:17 +02:00
parent 07f78821fe
commit cbba955168

View File

@ -101,14 +101,14 @@ minetest.register_globalstep(function(dtime)
main_timer = main_timer + dtime
timer = timer + dtime
timer2 = timer2 + dtime
if main_timer > HUNGER_HUD_TICK or timer > 4 or timer2 > HUNGER_HUNGER_TICK then
if main_timer > HUNGER_HUD_TICK or timer > 10 or timer2 > HUNGER_HUNGER_TICK then
if main_timer > HUNGER_HUD_TICK then main_timer = 0 end
for _,player in ipairs(minetest.get_connected_players()) do
local name = player:get_player_name()
local h = tonumber(hbhunger.hunger[name])
local hp = player:get_hp()
if timer > 4 then
if timer > 10 then
-- heal player by 1 hp if not dead and satiation is > 15 (of 30)
if h > 15 and hp > 0 and player:get_breath() > 0 then
player:set_hp(hp+1)
@ -136,7 +136,7 @@ minetest.register_globalstep(function(dtime)
end
end
end
if timer > 4 then timer = 0 end
if timer > 10 then timer = 0 end
if timer2 > HUNGER_HUNGER_TICK then timer2 = 0 end
end)