mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
[MIRROR] makes grilles grill food, not drinks/condiments [MDB IGNORE] (#12767)
* makes grilles grill food, not drinks/condiments (#65833) When food was moved to newfood (and use an edible component), drinks and condiments were left both as subtypes of a no-longer-existant food. (Even worse, one isn't even a subtype of the other). Grilles were not updated to make the edible component's foodtypes fried, instead they kept making old food (which again, is just drinks and condiments) get the grilled foodtype instead, so it likely just runtimed and didn't work at all. This most probably wasn't caught because all the vars for the edible food component were all kept the same when they were created off of old food, even the procs. Edible component is a copy paste of drinks/condiments. Less runtime errors, more grilling! * makes grilles grill food, not drinks/condiments Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
This commit is contained in:
co-authored by
John Willard
parent
56a47e4ee2
commit
5a6217c81a
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user