From 217a651495ad1bdb7fc27a9fc4f67ac97fdf71d3 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 1 Dec 2024 10:51:18 +0100 Subject: [PATCH] Quicker wear out on damage For compensation, healing will undo more HP upgrade pack wear. --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 920494b..32904da 100644 --- a/init.lua +++ b/init.lua @@ -55,17 +55,17 @@ minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, return end -- Undo some of the wear when eating instead of dying - upgrade_packs.add_wear(user, "health", hp_change * -2) + upgrade_packs.add_wear(user, "health", hp_change * -100) end) minetest.register_on_player_hpchange(function(player, hp_change, reason) if hp_change >= 0 then return hp_change end - if reason == "drown" then - upgrade_packs.add_wear(player, "breath", 400) + if reason.type == "drown" then + upgrade_packs.add_wear(player, "breath", hp_change * -2000) else - upgrade_packs.add_wear(player, "health", hp_change * -25) + upgrade_packs.add_wear(player, "health", hp_change * -200) end return hp_change