Deal hunger damage at 0 satiation, not 1

master
Wuzzy 2021-10-12 00:53:43 +02:00
parent 5121268cf0
commit 91505ab6dd
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Hunger with HUD bar [`hbhunger`]
* Version: 1.1.0
Modified version for Hades Revisited.
## Using the mod
@ -14,7 +14,7 @@ This mod adds a hunger mechanic to the game. Players get a new attribute called
* A new player starts with 20 satiation points out of 30
* Actions like digging, placing and walking cause exhaustion, which lower the satiation
* Every 800 seconds you lose 1 satiation point without doing anything
* At 1 or 0 satiation you will suffer damage and die in case you don't eat something
* At 0 satiation you will suffer damage and die in case you don't eat something
* If your satiation is 16 or higher, you will slowly regenerate health points
* Eating food will increase your satiation (Duh!)

View File

@ -122,8 +122,8 @@ minetest.register_globalstep(function(dtime)
-- heal player by 1 hp if not dead and satiation is > hbhunger.SAT_HEAL
if h > hbhunger.SAT_HEAL and hp > 0 and player:get_breath() > 0 then
player:set_hp(hp+1)
-- or damage player by 1 hp if satiation is < 2
elseif h <= 1 then
-- or damage player by 1 hp if satiation is <= 0
elseif h <= 0 then
if hp-1 >= 0 then
hades_death_messages.player_damage(player, S("Starvation"))
player:set_hp(hp-1)