Skip to content

Commit

Permalink
replace numbers by define like harry told me.
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien committed Aug 18, 2023
1 parent 56db2ad commit b6bcf6f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions code/game/objects/items/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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 <b>start feeding</b> [user == M ? "yourself" : "[M]"] <b>[src]</b>."),
SPAN_HELPFUL("[user] <b>starts feeding</b> you <b>[src]</b>."),
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/tools/kitchen_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b6bcf6f

Please sign in to comment.