diff --git a/code/__DEFINES/dcs/signals/signals_object.dm b/code/__DEFINES/dcs/signals/signals_object.dm index 6a1670569ef..8f626c1d544 100644 --- a/code/__DEFINES/dcs/signals/signals_object.dm +++ b/code/__DEFINES/dcs/signals/signals_object.dm @@ -141,6 +141,8 @@ #define COMPONENT_HANDLED_GRILLING (1<<0) ///Called when an object is turned into another item through grilling ontop of a griddle #define COMSIG_GRILL_COMPLETED "item_grill_completed" +///Called when an object is meant to be grilled through a grill: (atom/fry_object, grill_time) +#define COMSIG_GRILL_FOOD "item_grill_food" //Called when an object is in an oven #define COMSIG_ITEM_BAKED "item_baked" #define COMPONENT_HANDLED_BAKING (1<<0) diff --git a/code/datums/components/food/edible.dm b/code/datums/components/food/edible.dm index 32d33253d62..0617b53744c 100644 --- a/code/datums/components/food/edible.dm +++ b/code/datums/components/food/edible.dm @@ -83,6 +83,7 @@ Behavior that's still missing from this component that original food items had t if(isitem(parent)) RegisterSignal(parent, COMSIG_ITEM_ATTACK, .proc/UseFromHand) RegisterSignal(parent, COMSIG_ITEM_FRIED, .proc/OnFried) + RegisterSignal(parent, COMSIG_GRILL_FOOD, .proc/GrillFood) RegisterSignal(parent, COMSIG_ITEM_MICROWAVE_ACT, .proc/OnMicrowaved) RegisterSignal(parent, COMSIG_ITEM_USED_AS_INGREDIENT, .proc/used_to_customize) @@ -184,6 +185,29 @@ Behavior that's still missing from this component that original food items had t qdel(our_atom) return COMSIG_FRYING_HANDLED +/datum/component/edible/proc/GrillFood(datum/source, atom/fry_object, grill_time) + SIGNAL_HANDLER + + var/atom/this_food = parent + + switch(grill_time) //no 0-20 to prevent spam + if(20 to 30) + this_food.name = "lightly-grilled [this_food.name]" + this_food.desc = "[this_food.desc] It's been lightly grilled." + if(30 to 80) + this_food.name = "grilled [this_food.name]" + this_food.desc = "[this_food.desc] It's been grilled." + foodtypes |= FRIED + if(80 to 100) + this_food.name = "heavily grilled [this_food.name]" + this_food.desc = "[this_food.desc] It's been heavily grilled." + foodtypes |= FRIED + if(100 to INFINITY) //grill marks reach max alpha + this_food.name = "Powerfully Grilled [this_food.name]" + this_food.desc = "A [this_food.name]. Reminds you of your wife, wait, no, it's prettier!" + foodtypes |= FRIED + + ///Called when food is created through processing (Usually this means it was sliced). We use this to pass the OG items reagents. /datum/component/edible/proc/OnProcessed(datum/source, atom/original_atom, list/chosen_processing_option) SIGNAL_HANDLER diff --git a/code/modules/food_and_drinks/kitchen_machinery/grill.dm b/code/modules/food_and_drinks/kitchen_machinery/grill.dm index c6accc619ee..8d1aea33dde 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/grill.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/grill.dm @@ -134,22 +134,7 @@ return ..() /obj/machinery/grill/proc/finish_grill() - switch(grill_time) //no 0-20 to prevent spam - if(20 to 30) - grilled_item.name = "lightly-grilled [grilled_item.name]" - grilled_item.desc = "[grilled_item.desc] It's been lightly grilled." - if(30 to 80) - grilled_item.name = "grilled [grilled_item.name]" - grilled_item.desc = "[grilled_item.desc] It's been grilled." - grilled_item.foodtype |= FRIED - if(80 to 100) - grilled_item.name = "heavily grilled [grilled_item.name]" - grilled_item.desc = "[grilled_item.desc] It's been heavily grilled." - grilled_item.foodtype |= FRIED - if(100 to INFINITY) //grill marks reach max alpha - grilled_item.name = "Powerfully Grilled [grilled_item.name]" - grilled_item.desc = "A [grilled_item.name]. Reminds you of your wife, wait, no, it's prettier!" - grilled_item.foodtype |= FRIED + SEND_SIGNAL(grilled_item, COMSIG_GRILL_FOOD, grilled_item, grill_time) grill_time = 0 UnregisterSignal(grilled_item, COMSIG_GRILL_COMPLETED) grill_loop.stop()