Deep fry ANYTHING again (#32465)

* re-adds frying ANYTHING

* Apply suggestions from code review

Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>

* Update code/modules/cooking/machines/deep_fryer.dm

Co-authored-by: Alan <alfalfascout@users.noreply.github.com>
Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>

---------

Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>
Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Co-authored-by: Alan <alfalfascout@users.noreply.github.com>
Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
This commit is contained in:
Kyani
2026-08-28 23:58:56 +00:00
committed by GitHub
co-authored by CRUNCH Alan PollardTheDragon
parent cd31dcf309
commit e2340ee513
10 changed files with 45 additions and 12 deletions
+12 -3
View File
@@ -41,6 +41,8 @@
/// Whether the container is in "mini" mode, that is, placed on a cooking machine and rendered
/// with its smaller icons
var/mini = FALSE
/// References the current surface the container is inside.
var/datum/cooking_surface/surface
/obj/item/reagent_containers/cooking/Initialize(mapload)
. = ..()
@@ -87,8 +89,14 @@
/obj/item/reagent_containers/cooking/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/autochef_remote))
return
process_item(user, used)
if(istype(used, /obj/item/disk/nuclear))
used.visible_message(SPAN_DANGER("[used] disappears as soon as it touches the scalding oil!"))
qdel(used)
return ITEM_INTERACT_COMPLETE
if(surface)
process_item(user, used, surface.frier_bypass)
else
process_item(user, used, FALSE)
return ITEM_INTERACT_COMPLETE
@@ -98,7 +106,7 @@
/// machine, such as an oven or stove. So in some cases `used` will be something
/// like a food item, and in other cases `used` will be an
/// [/obj/machinery/cooking].
/obj/item/reagent_containers/cooking/proc/process_item(mob/user, obj/used)
/obj/item/reagent_containers/cooking/proc/process_item(mob/user, obj/used, fryer_bypass = FALSE)
if(!istype(used))
return PCWJ_NO_STEPS
@@ -119,6 +127,7 @@
to_chat(user, SPAN_NOTICE("\The [src] is full. Empty its contents first."))
return PCWJ_CONTAINER_FULL
tracker.frying_exception = fryer_bypass
var/process_reaction = tracker.process_item_wrap(user, used)
react_to_process(process_reaction, user, used)
return process_reaction
@@ -145,6 +145,7 @@ RESTRICT_TYPE(/obj/machinery/cooking)
used.forceMove(src)
surface.container = used
surface.container.surface = surface
surface.prob_quality_decrease = 0
surface.RegisterSignal(used, COMSIG_PARENT_EXAMINE, TYPE_PROC_REF(/datum/cooking_surface, container_examine), override = TRUE)
if(surface.on)
@@ -16,6 +16,8 @@ RESTRICT_TYPE(/datum/cooking_surface)
var/prob_quality_decrease = 0
var/allow_temp_change = TRUE
var/allow_toggling = TRUE
/// Tracks whether one may deep fry *anything*.
var/frier_bypass = FALSE
VAR_PRIVATE/burn_callback
VAR_PRIVATE/fire_callback
VAR_PRIVATE/alarm_callback
@@ -43,7 +45,7 @@ RESTRICT_TYPE(/datum/cooking_surface)
#endif
container.set_cooker_data(src, stop_watch(cooktime) SECONDS)
var/process_result = container.process_item(user, parent)
var/process_result = container.process_item(user, parent, frier_bypass)
if(process_result == PCWJ_COMPLETE)
SEND_SIGNAL(container, COMSIG_COOK_MACHINE_STEP_COMPLETE, src)
@@ -29,9 +29,18 @@
component_parts += new /obj/item/stock_parts/capacitor(null)
RefreshParts()
/obj/machinery/cooking/deepfryer/emag_act(mob/user)
emagged = TRUE
visible_message(SPAN_WARNING("Hot oil begins to sputter and boil dangerously inside the fry pit!"), SPAN_WARNING("You hear something begin to boil and sputter angrily!"))
for(var/datum/cooking_surface/deepfryer_basin/frier in surfaces)
frier.frier_bypass = TRUE
do_sparks(5, FALSE, src)
/obj/machinery/cooking/deepfryer/examine(mob/user)
. = ..()
. += SPAN_NOTICE("<b>Ctrl-Click</b> on a basin to set its timer and toggle it on or off.")
if(emagged)
. += SPAN_WARNING("Hot oil sputters and boils angrily inside the fry basins.")
#define ICON_SPLIT_X 16
#define ICON_SPLIT_Y 16
@@ -70,6 +79,7 @@
user.put_in_hands(surface.container)
surface.UnregisterSignal(surface.container, COMSIG_PARENT_EXAMINE)
surface.container.surface = null
surface.container = null
update_appearance(UPDATE_ICON)
@@ -134,4 +144,5 @@
for(var/i in 1 to length(surfaces))
var/datum/cooking_surface/surface = surfaces[i]
surface.container = new /obj/item/reagent_containers/cooking/deep_basket(src)
surface.container.surface = surface
update_appearance()
+1
View File
@@ -206,6 +206,7 @@
for(var/i in 1 to length(surfaces))
var/datum/cooking_surface/surface = surfaces[i]
surface.container = new /obj/item/reagent_containers/cooking/grill_grate(src)
surface.container.surface = surface
stored_wood = 30
update_appearance()
@@ -81,6 +81,7 @@
for(var/i in 1 to length(surfaces))
var/datum/cooking_surface/surface = surfaces[i]
surface.container = new /obj/item/reagent_containers/cooking/icecream_bowl(src)
surface.container.surface = surface
update_appearance()
/obj/item/circuitboard/cooking/ice_cream_mixer
+1
View File
@@ -104,6 +104,7 @@
for(var/i in 1 to length(surfaces))
var/datum/cooking_surface/surface = surfaces[i]
surface.container = new /obj/item/reagent_containers/cooking/oven(src)
surface.container.surface = surface
update_appearance()
/obj/machinery/cooking/oven/loaded/upgraded/InitializeParts()
@@ -136,8 +136,10 @@
var/datum/cooking_surface/surface = surfaces[i]
if(i % 2 == 0)
surface.container = new /obj/item/reagent_containers/cooking/pot(src)
surface.container.surface = surface
else
surface.container = new /obj/item/reagent_containers/cooking/pan(src)
surface.container.surface = surface
update_appearance()
/obj/machinery/cooking/stovetop/loaded/upgraded/initialize_parts()
+2
View File
@@ -45,6 +45,8 @@
/// completion.
var/list/recipes_applied_step_data = list()
var/step_reaction_message
/// A boolean for checking for special deep frier behavior.
var/frying_exception = FALSE
/datum/cooking/recipe_tracker/New(obj/item/reagent_containers/cooking/container)
container_uid = container.UID()
+11 -8
View File
@@ -137,13 +137,14 @@
/datum/cooking/recipe_step/add_item/deep_fried_anything
/datum/cooking/recipe_step/add_item/deep_fried_anything/check_conditions_met(obj/added_item, datum/cooking/recipe_tracker/tracker)
var/obj/item/food/food_item = added_item
if(!istype(food_item))
return PCWJ_CHECK_INVALID
if(!tracker.frying_exception)
var/obj/item/food/food_item = added_item
if(!istype(food_item))
return PCWJ_CHECK_INVALID
if("deep fried" in food_item.cooktype)
tracker.step_reaction_message = "That is already deep-fried!"
return PCWJ_CHECK_INVALID
if("deep fried" in food_item.cooktype)
tracker.step_reaction_message = "That is already deep-fried!"
return PCWJ_CHECK_INVALID
// check to see if this is something that belongs to another deep fryer
// recipe with only one item
@@ -167,7 +168,6 @@
var/obj/item/reagent_containers/cooking/container = locateUID(tracker.container_uid)
if(!istype(container))
stack_trace("couldn't find container for deep fried everything recipe")
var/obj/item/food/food_item = container.contents[1]
var/obj/item/food/result = new(container)
result.icon = food_item.icon
@@ -176,7 +176,10 @@
result.name = "deep-fried [food_item.name]"
result.desc = "It has been deep-fried."
result.cooktype["deep fried"] = TRUE
food_item.reagents.trans_to(result, food_item.reagents.total_volume)
if(istype(container.contents[1], /obj/item/food)) // Just in case we're deep frying something inedible.
food_item.reagents.trans_to(result, food_item.reagents.total_volume)
else
result.reagents.add_reagent("nutriment", 5)
qdel(food_item)
/datum/cooking/recipe/jellybean_red