Quicker wear out on damage

For compensation, healing will undo more HP upgrade pack wear.
This commit is contained in:
SmallJoker 2024-12-01 10:51:18 +01:00
parent 3aec15fbb8
commit 217a651495

@ -55,17 +55,17 @@ minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack,
return return
end end
-- Undo some of the wear when eating instead of dying -- 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) end)
minetest.register_on_player_hpchange(function(player, hp_change, reason) minetest.register_on_player_hpchange(function(player, hp_change, reason)
if hp_change >= 0 then if hp_change >= 0 then
return hp_change return hp_change
end end
if reason == "drown" then if reason.type == "drown" then
upgrade_packs.add_wear(player, "breath", 400) upgrade_packs.add_wear(player, "breath", hp_change * -2000)
else else
upgrade_packs.add_wear(player, "health", hp_change * -25) upgrade_packs.add_wear(player, "health", hp_change * -200)
end end
return hp_change return hp_change