From 91505ab6dd5fd86738cfbe68674ce22b9b7dbd63 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 12 Oct 2021 00:53:43 +0200 Subject: [PATCH] Deal hunger damage at 0 satiation, not 1 --- mods/hbhunger/README.md | 4 ++-- mods/hbhunger/init.lua | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/hbhunger/README.md b/mods/hbhunger/README.md index 794cfcb..f4e2cef 100644 --- a/mods/hbhunger/README.md +++ b/mods/hbhunger/README.md @@ -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!) diff --git a/mods/hbhunger/init.lua b/mods/hbhunger/init.lua index 35265dd..dbbad3f 100644 --- a/mods/hbhunger/init.lua +++ b/mods/hbhunger/init.lua @@ -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)