From 956f41e2b9cc1690736df8fe35ef6d50b15943f1 Mon Sep 17 00:00:00 2001
From: FloFluoro <3611705+FloFluoro@users.noreply.github.com>
Date: Fri, 5 Aug 2022 15:34:23 -0400
Subject: [PATCH] Emagged deep fryers can deep fry non-food objects (#18672)
* Emagged deep fryers can now deep fry non-food objects
* Abstract objects can no longer be deep fried
* Readability
* Tidying spacing
* Mobs put into deep fryer are killed on impact
* Fixed deadcheck
* Fixed operators
* Readability
---
.../kitchen_machinery/cooker.dm | 27 +++++++++++++++----
.../kitchen_machinery/deep_fryer.dm | 12 +++++++++
2 files changed, 34 insertions(+), 5 deletions(-)
diff --git a/code/modules/food_and_drinks/kitchen_machinery/cooker.dm b/code/modules/food_and_drinks/kitchen_machinery/cooker.dm
index 45612e918c2..555b65540d7 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/cooker.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/cooker.dm
@@ -41,15 +41,24 @@
/obj/machinery/cooker/proc/checkValid(obj/item/check, mob/user)
if(on)
to_chat(user, "[src] is still active!")
- return 0
- if(istype(check, /obj/item/reagent_containers/food/snacks))
- return 1
+ return FALSE
if(istype(check, /obj/item/grab))
return special_attack(check, user)
if(has_specials && checkSpecials(check))
return TRUE
- to_chat(user, "You can only process food!")
- return 0
+ if(istype(check, /obj/item/reagent_containers/food/snacks) || emagged)
+ if(istype(check, /obj/item/disk/nuclear)) //(1984 voice) you will not deep fry the NAD
+ to_chat(user, "The disk is more useful raw than [thiscooktype].")
+ return FALSE
+ var/obj/item/disk/nuclear/datdisk = locate() in check
+ if(datdisk)
+ to_chat(user, "You get the feeling that something very important is inside this. Something that shouldn't be [thiscooktype].")
+ return FALSE
+ if(check.flags & (ABSTRACT | DROPDEL | NODROP)) //you will not deep fry the armblade
+ return FALSE
+ return TRUE
+ to_chat(user, "You can only process food!")
+ return FALSE
/obj/machinery/cooker/proc/setIcon(obj/item/copyme, obj/item/copyto)
copyto.color = foodcolor
@@ -119,6 +128,14 @@
to_chat(user, "That is already [thiscooktype], it would do nothing!")
return
putIn(I, user)
+ for(var/mob/living/L in I.contents) //Emagged cookers - Any mob put in will not survive the trip
+ if(L.stat != DEAD)
+ if(ispAI(L)) //Snowflake check because pAIs are weird
+ var/mob/living/silicon/pai/P = L
+ P.death(cleanWipe = TRUE)
+ else
+ L.death()
+ break
sleep(cooktime)
if(I && I.loc == src)
//New interaction to allow special foods to be made/cooked via deepfryer without removing original functionality
diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
index 681ddb591a2..3bf50dbad16 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
@@ -43,6 +43,18 @@
var/obj/item/reagent_containers/food/snacks/deepfryholder/type = new(get_turf(src))
return type
+/obj/machinery/cooker/deepfryer/examine(mob/user)
+ . = ..()
+ if(emagged)
+ . += "The heating element is smoking slightly."
+
+/obj/machinery/cooker/deepfryer/emag_act()
+ if(!emagged)
+ to_chat(usr, "You short out the fryer's safeties, allowing non-food objects to be placed in the oil.")
+ playsound(src, "sparks", 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
+ emagged = TRUE
+ return
+
/obj/machinery/cooker/deepfryer/special_attack(obj/item/grab/G, mob/user)
if(ishuman(G.affecting))
if(G.state < GRAB_AGGRESSIVE)