From 8829e81ef57353485def0ecf8d19982a11f1bc9c Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Sat, 5 Dec 2020 05:33:13 -0500 Subject: [PATCH] Makes EMP actually usefull on reactive armor (#15023) --- code/modules/clothing/suits/armor.dm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 36fd6a370a5..2394c27dbe8 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -260,7 +260,8 @@ /obj/item/clothing/suit/armor/reactive name = "reactive armor" desc = "Doesn't seem to do much for some reason." - var/active = 0 + var/active = FALSE + var/emp_d = FALSE icon_state = "reactiveoff" item_state = "reactiveoff" blood_overlay_type = "armor" @@ -271,6 +272,9 @@ /obj/item/clothing/suit/armor/reactive/attack_self(mob/user) active = !(active) + if(emp_d) + to_chat(user, "[src] is disabled from an electromagnetic pulse!") + return if(active) to_chat(user, "[src] is now active.") icon_state = "reactive" @@ -286,14 +290,19 @@ A.UpdateButtonIcon() /obj/item/clothing/suit/armor/reactive/emp_act(severity) - active = 0 + active = FALSE + emp_d = TRUE icon_state = "reactiveoff" item_state = "reactiveoff" if(istype(loc, /mob/living/carbon/human)) var/mob/living/carbon/human/C = loc C.update_inv_wear_suit() + addtimer(CALLBACK(src, .proc/reboot), 100 / severity) ..() +/obj/item/clothing/suit/armor/reactive/proc/reboot() + emp_d = FALSE + //When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!) /obj/item/clothing/suit/armor/reactive/teleport name = "reactive teleport armor"