Skip to content

Commit

Permalink
Heating rations now provides their bonus vitamin/nutriment reagents (#…
Browse files Browse the repository at this point in the history
…2586)

## About The Pull Request

Ration packs now use bonus_reagents properly, prior they would set the
list when being heated and not use it


![image](https://github.com/shiptest-ss13/Shiptest/assets/24857008/1bf14f40-5140-410f-a228-e07599ae83ac)

## Why It's Good For The Game

Cooking rations now makes them better

## Changelog

:cl:
fix: heating rations increases their nutritional value as intended
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

---------

Signed-off-by: Theos <[email protected]>
Co-authored-by: Mark Suckerberg <[email protected]>
  • Loading branch information
SomeguyManperson and MarkSuckerberg authored Dec 28, 2023
1 parent da4c03d commit e57737e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion code/modules/food_and_drinks/food/ration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
desc = "standard issue ration"
filling_color = "#664330"
list_reagents = list(/datum/reagent/consumable/nutriment = 4)
bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2)
icon = 'icons/obj/food/ration.dmi'
icon_state = "ration_side"
in_container = TRUE
Expand Down Expand Up @@ -55,7 +56,16 @@
..()
else
name = "warm [initial(name)]"
bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2)
var/cooking_efficiency = 1
if(istype(Heater))
cooking_efficiency = Heater.efficiency
if(length(bonus_reagents))
for(var/r_id in bonus_reagents)
var/amount = bonus_reagents[r_id] * cooking_efficiency
if(ispath(r_id, /datum/reagent/consumable/nutriment))
reagents.add_reagent(r_id, amount, tastes)
else
reagents.add_reagent(r_id, amount)
cooked = TRUE

/obj/item/reagent_containers/food/snacks/ration/examine(mob/user)
Expand Down

0 comments on commit e57737e

Please sign in to comment.