[MIRROR] Stops hot oil from frying certain objects (#2167)

* Stops hot oil from frying certain objects (#55253)

* oilproof some things

* fry tools again

* Stops hot oil from frying certain objects

Co-authored-by: prodirus <44090982+prodirus@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-12-13 13:45:16 +00:00
committed by GitHub
co-authored by prodirus
parent 59ddcc911c
commit 2366e7d65f
2 changed files with 19 additions and 14 deletions
@@ -2,6 +2,14 @@
#define DEEPFRYER_COOKTIME 60
#define DEEPFRYER_BURNTIME 120
GLOBAL_LIST_INIT(oilfry_blacklisted_items, typecacheof(list(
/obj/item/reagent_containers/glass,
/obj/item/reagent_containers/syringe,
/obj/item/reagent_containers/food/condiment,
/obj/item/storage,
/obj/item/small_delivery,
/obj/item/his_grace)))
/obj/machinery/deepfryer
name = "deep fryer"
desc = "Deep fried <i>everything</i>."
@@ -18,20 +26,14 @@
var/fry_speed = 1 //How quickly we fry food
var/frying_fried //If the object has been fried; used for messages
var/frying_burnt //If the object has been burnt
var/static/list/deepfry_blacklisted_items = typecacheof(list(
/obj/item/screwdriver,
/obj/item/crowbar,
/obj/item/wrench,
/obj/item/wirecutters,
/obj/item/multitool,
/obj/item/weldingtool,
/obj/item/reagent_containers/glass,
/obj/item/reagent_containers/syringe,
/obj/item/reagent_containers/food/condiment,
/obj/item/storage,
/obj/item/small_delivery,
/obj/item/his_grace))
var/datum/looping_sound/deep_fryer/fry_loop
var/static/list/deepfry_blacklisted_items = typecacheof(list(
/obj/item/screwdriver,
/obj/item/crowbar,
/obj/item/wrench,
/obj/item/wirecutters,
/obj/item/multitool,
/obj/item/weldingtool))
/obj/machinery/deepfryer/Initialize()
. = ..()
@@ -76,7 +78,7 @@
else if(default_deconstruction_screwdriver(user, "fryer_off", "fryer_off" ,I)) //where's the open maint panel icon?!
return
else
if(is_type_in_typecache(I, deepfry_blacklisted_items) || HAS_TRAIT(I, TRAIT_NODROP) || (I.item_flags & (ABSTRACT | DROPDEL)))
if(is_type_in_typecache(I, deepfry_blacklisted_items) || is_type_in_typecache(I, GLOB.oilfry_blacklisted_items) || HAS_TRAIT(I, TRAIT_NODROP) || (I.item_flags & (ABSTRACT | DROPDEL)))
return ..()
else if(!frying && user.transferItemToLoc(I, src))
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
@@ -134,6 +134,9 @@
return
if(!isitem(exposed_obj) || istype(exposed_obj, /obj/item/food/deepfryholder))
return
if(is_type_in_typecache(exposed_obj, GLOB.oilfry_blacklisted_items) || (exposed_obj.resistance_flags & INDESTRUCTIBLE))
exposed_obj.loc.visible_message("<span class='notice'>The hot oil has no effect on [exposed_obj]!</span>")
return
exposed_obj.loc.visible_message("<span class='warning'>[exposed_obj] rapidly fries as it's splashed with hot oil! Somehow.</span>")
var/obj/item/food/deepfryholder/fry_target = new(exposed_obj.drop_location(), exposed_obj)
fry_target.fry(volume)