From e57737ed2429458aa6fd98f9bea1b4439844218d Mon Sep 17 00:00:00 2001 From: Theos Date: Thu, 28 Dec 2023 11:47:45 -0500 Subject: [PATCH] Heating rations now provides their bonus vitamin/nutriment reagents (#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: --------- Signed-off-by: Theos Co-authored-by: Mark Suckerberg --- code/modules/food_and_drinks/food/ration.dm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/modules/food_and_drinks/food/ration.dm b/code/modules/food_and_drinks/food/ration.dm index b74db1f0ccb72..261fe707ed7f6 100644 --- a/code/modules/food_and_drinks/food/ration.dm +++ b/code/modules/food_and_drinks/food/ration.dm @@ -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 @@ -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)