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
This commit is contained in:
FloFluoro
2022-08-05 20:34:23 +01:00
committed by GitHub
parent b839e02639
commit 956f41e2b9
2 changed files with 34 additions and 5 deletions
@@ -41,15 +41,24 @@
/obj/machinery/cooker/proc/checkValid(obj/item/check, mob/user)
if(on)
to_chat(user, "<span class='notice'>[src] is still active!</span>")
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, "<span class ='notice'>You can only process food!</span>")
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, "<span class='notice'>The disk is more useful raw than [thiscooktype].</span>")
return FALSE
var/obj/item/disk/nuclear/datdisk = locate() in check
if(datdisk)
to_chat(user, "<span class='notice'>You get the feeling that something very important is inside this. Something that shouldn't be [thiscooktype].</span>")
return FALSE
if(check.flags & (ABSTRACT | DROPDEL | NODROP)) //you will not deep fry the armblade
return FALSE
return TRUE
to_chat(user, "<span class='notice'>You can only process food!</span>")
return FALSE
/obj/machinery/cooker/proc/setIcon(obj/item/copyme, obj/item/copyto)
copyto.color = foodcolor
@@ -119,6 +128,14 @@
to_chat(user, "<span class='warning'>That is already [thiscooktype], it would do nothing!</span>")
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
@@ -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)
. += "<span class='warning'>The heating element is smoking slightly.</span>"
/obj/machinery/cooker/deepfryer/emag_act()
if(!emagged)
to_chat(usr, "<span class='warning'>You short out the fryer's safeties, allowing non-food objects to be placed in the oil.</span>")
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)