From 55eba5c54b0332b3f9a66a3ab6fc91c267d1901d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 4 Aug 2017 19:49:03 +0200 Subject: [PATCH] Cause more exhaustion when sprint-jumping --- mods/PLAYER/mcl_hunger/init.lua | 2 +- mods/PLAYER/mcl_playerplus/init.lua | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 1e9a3c14f1..8b59064306 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -14,7 +14,7 @@ mcl_hunger.HUD_TICK = 0.1 -- Exhaustion increase mcl_hunger.EXHAUST_DIG = 5 -- after digging node mcl_hunger.EXHAUST_JUMP = 50 -- jump -mcl_hunger.EXHAUST_SPRINT_JUMP = 200 -- TODO: jump while sprinting +mcl_hunger.EXHAUST_SPRINT_JUMP = 200 -- jump while sprinting mcl_hunger.EXHAUST_ATTACK = 100 -- hit an enemy mcl_hunger.EXHAUST_SWIM = 10 -- player movement in water mcl_hunger.EXHAUST_SPRINT = 100 -- sprint (per node) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 97a3ec9e57..fc67e64a23 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -49,7 +49,11 @@ minetest.register_globalstep(function(dtime) and minetest.get_item_group(node_stand, "disable_jump") == 0 and minetest.get_item_group(node_stand_below, "disable_jump") == 0 then -- Cause exhaustion for jumping - mcl_hunger.exhaust(name, mcl_hunger.EXHAUST_JUMP) + if mcl_sprint.is_sprinting(name) then + mcl_hunger.exhaust(name, mcl_hunger.EXHAUST_SPRINT_JUMP) + else + mcl_hunger.exhaust(name, mcl_hunger.EXHAUST_JUMP) + end -- Reset cooldown timer mcl_playerplus_internal[name].jump_cooldown = 0.45