hudbars+hbhunger+hbarmor - permit to gain life if are in good shape
This commit is contained in:
parent
e6822f1f49
commit
02120d280e
@ -52,6 +52,8 @@ hb.settings.br_player_maximun = hb.load_setting("hudbars_br_player_maximun", "nu
|
||||
|
||||
hbarmor.autohide = (true and not hb.settings.forceload_default_hudbars)
|
||||
|
||||
hbhunger.permitgainhp = true
|
||||
|
||||
hbhunger.HUD_TICK = 0.2
|
||||
|
||||
hbhunger.HUNGER_TICK = 800 -- time in seconds after that 1 hunger point is taken
|
||||
@ -65,6 +67,7 @@ hbhunger.SAT_HEAL = 15 -- required satiation points to start healing
|
||||
|
||||
local set
|
||||
|
||||
set = minetest.settings:get_bool("hbhunger_permitgainhp") if set ~= nil then hbhunger.permitgainhp = set end
|
||||
set = minetest.settings:get_bool("hbarmor_autohide") if set ~= nil then hbarmor.autohide = set end
|
||||
set = minetest.settings:get("hbhunger_satiation_tick") if set ~= nil then hbhunger.HUNGER_TICK = tonumber(set) end
|
||||
set = minetest.settings:get("hbhunger_satiation_dig") if set ~= nil then hbhunger.HUNGER_DIG = tonumber(set) end
|
||||
|
@ -112,7 +112,13 @@ function hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound
|
||||
-- heal is not defines due way of hbhunger.register_food
|
||||
if not heal then heal = 1 end
|
||||
-- eating something not give you inmediate life, give you statiation to get recovery
|
||||
if hp < 6 and heal > 0 then hp = hp + heal end
|
||||
if hp < 6 and hp > 0 and heal > 0 then hp = hp + heal end
|
||||
-- so if you are in good shape and losing healt just give it only for one chance, NSSM specific
|
||||
if hbhunger.permitgainhp then
|
||||
local hpreca = math.random (6, 10)
|
||||
local hprecb = math.random (11, hb.settings.hp_player_maximun - 1)
|
||||
if hp < hprecb and hp > hpreca then hp = hp + 1 end
|
||||
end
|
||||
-- so do not hardcoded hp to 20 when eating
|
||||
if hp > max_hp then hp = max_hp end
|
||||
-- this will work only when valid then
|
||||
|
@ -128,6 +128,8 @@ hudbars_br_player_maximun (maximun value of braeth of player) int 20
|
||||
#armor. Otherwise, the armor bar shows “0%”.
|
||||
hbarmor_autohide (Automatically hide armor HUD bar) bool false
|
||||
|
||||
hbhunger_permitgainhp (Permit slowly to gain hp when eating food and not only using satiation) bool true
|
||||
|
||||
hbhunger_satiation_tick (Time in seconds after which 1 saturation point is taken) float 800
|
||||
|
||||
hbhunger_satiation_sprint_dig (exhaustion increased this value after digged node) float 3
|
||||
|
Loading…
x
Reference in New Issue
Block a user