From c64f4ad5131c71ae5f52ddcfdbca5eb78391916d Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Fri, 24 Aug 2018 11:35:31 -0400 Subject: [PATCH] secure stuff --- .../kitchen_machinery/smartfridge.dm | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index fd4aa5aa340..e3ca42425db 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -226,9 +226,8 @@ if(load(O, user)) user.visible_message("[user] has added \the [O] to \the [src].", "You add \the [O] to \the [src].") - SSnanoui.update_uis(src) - + else if(istype(O, /obj/item/storage/bag)) var/obj/item/storage/bag/P = O var/plants_loaded = 0 @@ -242,7 +241,7 @@ SSnanoui.update_uis(src) - else + else if(!istype(O, /obj/item/card/emag)) to_chat(user, "\The [src] smartly refuses [O].") return 1 @@ -308,11 +307,6 @@ to_chat(user, "Some items are refused.") SSnanoui.update_uis(src) -/obj/machinery/smartfridge/secure/emag_act(mob/user) - emagged = 1 - locked = -1 - to_chat(user, "You short out the product lock on [src].") - /******************* * SmartFridge Menu ********************/ @@ -539,6 +533,16 @@ /************************ * Secure SmartFridges *************************/ +/obj/machinery/smartfridge/secure/emag_act(mob/user) + emagged = 1 + locked = -1 + to_chat(user, "You short out the product lock on [src].") + +/obj/machinery/smartfridge/secure/emp_act(severity) + if(prob(40/severity) && (!emagged) && (locked != -1)) + playsound(loc, 'sound/effects/sparks4.ogg', 60, 1) + emagged = 1 + locked = -1 /obj/machinery/smartfridge/secure/Topic(href, href_list) if(stat & (NOPOWER|BROKEN))