From b6bcf6f99d334a196a428d96fbc44c34642d7c9c Mon Sep 17 00:00:00 2001 From: Julien Date: Fri, 18 Aug 2023 18:02:21 +0200 Subject: [PATCH] replace numbers by define like harry told me. --- code/__DEFINES/chemistry.dm | 1 + .../items/reagent_containers/food/snacks.dm | 16 ++++++++-------- code/game/objects/items/tools/kitchen_tools.dm | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/code/__DEFINES/chemistry.dm b/code/__DEFINES/chemistry.dm index 9a29754381f3..078ccbdc2d94 100644 --- a/code/__DEFINES/chemistry.dm +++ b/code/__DEFINES/chemistry.dm @@ -49,6 +49,7 @@ // Nutrition levels #define NUTRITION_MAX 550 +#define NUTRITION_HIGH 540 #define NUTRITION_NORMAL 400 #define NUTRITION_LOW 250 #define NUTRITION_VERYLOW 50 diff --git a/code/game/objects/items/reagent_containers/food/snacks.dm b/code/game/objects/items/reagent_containers/food/snacks.dm index c0e11dac8eb3..06a4d785e677 100644 --- a/code/game/objects/items/reagent_containers/food/snacks.dm +++ b/code/game/objects/items/reagent_containers/food/snacks.dm @@ -60,7 +60,7 @@ if(istype(M, /mob/living/carbon)) var/mob/living/carbon/C = M var/fullness = M.nutrition + (M.reagents.get_reagent_amount("nutriment") * 25) - if(fullness > 540 && world.time < C.overeat_cooldown) + if(fullness > NUTRITION_HIGH && world.time < C.overeat_cooldown) to_chat(user, SPAN_WARNING("[user == M ? "You" : "They"] don't feel like eating more right now.")) return if(issynth(C)) @@ -70,22 +70,22 @@ to_chat(user, SPAN_DANGER("[user == M ? "You are" : "[M] is"] unable to eat!")) return - if(fullness > 540) + if(fullness > NUTRITION_HIGH) C.overeat_cooldown = world.time + OVEREAT_TIME if(M == user)//If you're eating it yourself - if (fullness <= 50) + if (fullness <= NUTRITION_VERYLOW) to_chat(M, SPAN_WARNING("You hungrily chew out a piece of [src] and gobble it!")) - if (fullness > 50 && fullness <= 150) + if (fullness > NUTRITION_VERYLOW && fullness <= NUTRITION_LOW) to_chat(M, SPAN_NOTICE(" You hungrily begin to eat [src].")) - if (fullness > 150 && fullness <= 350) + if (fullness > NUTRITION_LOW && fullness <= NUTRITION_NORMAL) to_chat(M, SPAN_NOTICE(" You take a bite of [src].")) - if (fullness > 350 && fullness <= 540) + if (fullness > NUTRITION_NORMAL && fullness <= NUTRITION_HIGH) to_chat(M, SPAN_NOTICE(" You unwillingly chew a bit of [src].")) - if (fullness > 540) + if (fullness > NUTRITION_HIGH) to_chat(M, SPAN_WARNING("You reluctantly force more of [src] to go down your throat.")) else - if (fullness <= 540) + if (fullness <= NUTRITION_HIGH) user.affected_message(M, SPAN_HELPFUL("You start feeding [user == M ? "yourself" : "[M]"] [src]."), SPAN_HELPFUL("[user] starts feeding you [src]."), diff --git a/code/game/objects/items/tools/kitchen_tools.dm b/code/game/objects/items/tools/kitchen_tools.dm index c0bbf969ea68..bb763ada9911 100644 --- a/code/game/objects/items/tools/kitchen_tools.dm +++ b/code/game/objects/items/tools/kitchen_tools.dm @@ -46,7 +46,7 @@ if (reagents.total_volume > 0) var/fullness = M.nutrition + (M.reagents.get_reagent_amount("nutriment") * 25) - if(fullness > 540) + if(fullness > NUTRITION_HIGH) to_chat(user, SPAN_WARNING("[user == M ? "You" : "They"] don't feel like eating more right now.")) return ..() reagents.set_source_mob(user)