From c281b2c18d309f1b3c7c4f194131ebbcae76e7c1 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 20 Nov 2020 00:57:05 +0100 Subject: [PATCH] [MIRROR] Fixes grills. they went too far this time. (#1728) * damn man i just want grill and they took it away, damn them all!!! (#55024) Whoever the damn bastard is who tried to take our grills. know this: we will not bend over while you take the only thing that still makes us happy. We just want to drink energy drinks and grill some hamburgers in peace. This is your final warning, try doing this again and we will assemble a lawn mower squad outside of your house at the early hours of 6AM to make sure you cannot enjoy your sunday morning in peace. Newfood compatibility is now included by checking IS_EDIBLE() and removing the shitty foodtype that was there before * Fixes grills. they went too far this time. Co-authored-by: Qustinnus --- code/__DEFINES/food.dm | 1 - code/__DEFINES/traits.dm | 1 + .../kitchen_machinery/grill.dm | 49 +++++++++---------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/code/__DEFINES/food.dm b/code/__DEFINES/food.dm index cf993f01441..4b913507c92 100644 --- a/code/__DEFINES/food.dm +++ b/code/__DEFINES/food.dm @@ -13,7 +13,6 @@ #define PINEAPPLE (1<<12) #define BREAKFAST (1<<13) #define CLOTH (1<<14) -#define GRILLED (1<<15) #define DRINK_NICE 1 #define DRINK_GOOD 2 diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index b10b4a6b819..8eab148b203 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -233,6 +233,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NO_STORAGE_INSERT "no_storage_insert" //cannot be inserted in a storage. #define TRAIT_T_RAY_VISIBLE "t-ray-visible" // Visible on t-ray scanners if the atom/var/level == 1 #define TRAIT_NO_TELEPORT "no-teleport" //you just can't +#define TRAIT_FOOD_GRILLED "food_grilled" //quirk traits #define TRAIT_ALCOHOL_TOLERANCE "alcohol_tolerance" diff --git a/code/modules/food_and_drinks/kitchen_machinery/grill.dm b/code/modules/food_and_drinks/kitchen_machinery/grill.dm index 1b99c4e2045..8dc1678843f 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/grill.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/grill.dm @@ -43,31 +43,30 @@ if(I.resistance_flags & INDESTRUCTIBLE) to_chat(user, "You don't feel it would be wise to grill [I]...") return ..() - if(istype(I, /obj/item/reagent_containers)) - if(istype(I, /obj/item/reagent_containers/food) && !istype(I, /obj/item/reagent_containers/food/drinks)) - var/obj/item/reagent_containers/food/food_item = I - if(HAS_TRAIT(food_item, TRAIT_NODROP) || (food_item.item_flags & (ABSTRACT | DROPDEL))) - return ..() - else if(food_item.foodtype & GRILLED) - to_chat(user, "[food_item] has already been grilled!") - return - else if(grill_fuel <= 0) - to_chat(user, "There is not enough fuel!") - return - else if(!grilled_item && user.transferItemToLoc(food_item, src)) - grilled_item = food_item - grilled_item.foodtype |= GRILLED - to_chat(user, "You put the [grilled_item] on [src].") - update_icon() - grill_loop.start() - return - else - if(I.reagents.has_reagent(/datum/reagent/consumable/monkey_energy)) - grill_fuel += (20 * (I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy))) - to_chat(user, "You pour the Monkey Energy in [src].") - I.reagents.remove_reagent(/datum/reagent/consumable/monkey_energy, I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy)) - update_icon() - return + if(istype(I, /obj/item/reagent_containers/food/drinks)) + if(I.reagents.has_reagent(/datum/reagent/consumable/monkey_energy)) + grill_fuel += (20 * (I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy))) + to_chat(user, "You pour the Monkey Energy in [src].") + I.reagents.remove_reagent(/datum/reagent/consumable/monkey_energy, I.reagents.get_reagent_amount(/datum/reagent/consumable/monkey_energy)) + update_icon() + return + else if(IS_EDIBLE(I)) + if(HAS_TRAIT(I, TRAIT_NODROP) || (I.item_flags & (ABSTRACT | DROPDEL))) + return ..() + else if(HAS_TRAIT(I, TRAIT_FOOD_GRILLED)) + to_chat(user, "[I] has already been grilled!") + return + else if(grill_fuel <= 0) + to_chat(user, "There is not enough fuel!") + return + else if(!grilled_item && user.transferItemToLoc(I, src)) + grilled_item = I + ADD_TRAIT(grilled_item, TRAIT_FOOD_GRILLED, "boomers") + to_chat(user, "You put the [grilled_item] on [src].") + update_icon() + grill_loop.start() + return + ..() /obj/machinery/grill/process(delta_time)