From b5b082ec6f59d01325bdf1d79269435839c313b2 Mon Sep 17 00:00:00 2001 From: Fox McCloud Date: Thu, 10 Oct 2019 20:54:12 -0400 Subject: [PATCH] Fixes Telepad Double Attack --- code/modules/telesci/telepad.dm | 40 ++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/code/modules/telesci/telepad.dm b/code/modules/telesci/telepad.dm index b2503326c17..8859bd89515 100644 --- a/code/modules/telesci/telepad.dm +++ b/code/modules/telesci/telepad.dm @@ -61,37 +61,45 @@ desc = "A telepad used by the Rapid Crate Sender." icon = 'icons/obj/telescience.dmi' icon_state = "pad-idle" - anchored = 1 + anchored = TRUE use_power = IDLE_POWER_USE idle_power_usage = 20 active_power_usage = 500 var/stage = 0 -/obj/machinery/telepad_cargo/attackby(obj/item/W as obj, mob/user as mob, params) - if(istype(W, /obj/item/wrench)) - playsound(src, W.usesound, 50, 1) + +/obj/machinery/telepad_cargo/attackby(obj/item/I, mob/user, params) + if(iswrench(I)) + playsound(src, I.usesound, 50, 1) if(anchored) - anchored = 0 + anchored = FALSE to_chat(user, " The [src] can now be moved.") else if(!anchored) - anchored = 1 + anchored = TRUE to_chat(user, " The [src] is now secured.") - if(istype(W, /obj/item/screwdriver)) + return + if(isscrewdriver(I)) if(stage == 0) - playsound(src, W.usesound, 50, 1) + playsound(src, I.usesound, 50, 1) to_chat(user, " You unscrew the telepad's tracking beacon.") stage = 1 else if(stage == 1) - playsound(src, W.usesound, 50, 1) + playsound(src, I.usesound, 50, 1) to_chat(user, " You screw in the telepad's tracking beacon.") stage = 0 - if(istype(W, /obj/item/weldingtool) && stage == 1) - playsound(src, W.usesound, 50, 1) + return + if(iswelder(I) && stage == 1) + playsound(src, I.usesound, 50, 1) to_chat(user, " You disassemble the telepad.") - new /obj/item/stack/sheet/metal(get_turf(src)) - new /obj/item/stack/sheet/glass(get_turf(src)) - qdel(src) - else - return ..() + deconstruct(TRUE) + return + return ..() + +/obj/machinery/atmospherics/deconstruct(disassembled = TRUE) + if(!(flags & NODECONSTRUCT)) + new /obj/item/stack/sheet/metal(loc) + new /obj/item/stack/sheet/glass(loc) + qdel(src) + ///TELEPAD CALLER/// /obj/item/telepad_beacon