Skip to content

Commit

Permalink
Fix you will no longer be able to feed without any limit with the for…
Browse files Browse the repository at this point in the history
…k. (#4174)

# About the pull request
fixes: #3378
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
fix: you will no longer be able to feed without any limit with the fork.
/:cl:

---------

Co-authored-by: Julien <[email protected]>
  • Loading branch information
Huffie56 and Julien authored Aug 22, 2023
1 parent 6126b50 commit aa60301
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 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
4 changes: 4 additions & 0 deletions code/game/objects/items/tools/kitchen_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
return ..()

if (reagents.total_volume > 0)
var/fullness = M.nutrition + (M.reagents.get_reagent_amount("nutriment") * 25)
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)
reagents.trans_to_ingest(M, reagents.total_volume)
if(M == user)
Expand Down

0 comments on commit aa60301

Please sign in to comment.