From bd77e17f171766053372359ac18b9154eb4b1d8a Mon Sep 17 00:00:00 2001 From: purplefoxy27 <38367315+purplefoxy27@users.noreply.github.com> Date: Sun, 5 Nov 2023 00:16:49 -0700 Subject: [PATCH] Add weight mechanics to old fitness machines (#7154) --- code/game/objects/structures/fitness.dm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/game/objects/structures/fitness.dm b/code/game/objects/structures/fitness.dm index eb2f1e37bc..9f223e096b 100644 --- a/code/game/objects/structures/fitness.dm +++ b/code/game/objects/structures/fitness.dm @@ -14,15 +14,18 @@ if(!istype(user)) ..() return - if(user.nutrition < 20) + if(user.nutrition < 70) //CHOMPEdit Set minimum nutrition to be the same as in fitness_machines_vr.dm to_chat(user, "You need more energy to use the punching bag. Go eat something.") + else if(user.weight < 70) // CHOMPAdd Begin Add weight loss to old fitness equipment + to_chat(user, "You're too skinny to risk losing any more weight!") // CHOMPAdd End else if(user.a_intent == I_HURT) user.setClickCooldown(user.get_attack_speed()) flick("[icon_state]_hit", src) playsound(src, 'sound/effects/woodhit.ogg', 25, 1, -1) user.do_attack_animation(src) - user.nutrition = user.nutrition - 5 + user.adjust_nutrition(-10) //CHOMPEdit Set nutrition drain to be the same as in fitness_machines_vr.dm + user.weight -= 0.1 * (0.01 * user.weight_loss) // CHOMPAdd Add weight loss to old fitness equipment to_chat(user, "You [pick(hit_message)] \the [src].") /obj/structure/fitness/weightlifter @@ -45,9 +48,12 @@ if(user.loc != src.loc) to_chat(user, "You must be on the weight machine to use it.") return - if(user.nutrition < 50) + if(user.nutrition < 70) //CHOMPEdit Set minimum nutrition to be the same as in fitness_machines_vr.dm to_chat(user, "You need more energy to lift weights. Go eat something.") return + if(user.weight < 70) //CHOMPAdd Begin Add weight loss to old fitness equipment + to_chat(user, "You're too skinny to risk losing any more weight!") + return //CHOMPAdd End if(being_used) to_chat(user, "The weight machine is already in use by somebody else.") return @@ -56,9 +62,10 @@ playsound(src, 'sound/effects/weightlifter.ogg', 50, 1) user.set_dir(SOUTH) flick("[icon_state]_[weight]", src) - if(do_after(user, 20 + (weight * 10))) + if(do_after(user, 30 + (weight * 10))) //CHOMPEdit Set timer to be similar to the machines in fitness_machines_vr.dm playsound(src, 'sound/effects/weightdrop.ogg', 25, 1) user.adjust_nutrition(weight * -10) + user.weight -= 0.1 * weight * (0.01 * user.weight_loss) // CHOMPAdd Add weight loss to old fitness equipment to_chat(user, "You lift the weights [qualifiers[weight]].") being_used = 0 else