Fixes Telepad Double Attack (#12557)

This commit is contained in:
variableundefined
2019-10-12 19:38:02 -04:00
committed by GitHub
+24 -16
View File
@@ -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, "<span class = 'caution'> The [src] can now be moved.</span>")
else if(!anchored)
anchored = 1
anchored = TRUE
to_chat(user, "<span class = 'caution'> The [src] is now secured.</span>")
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, "<span class = 'caution'> You unscrew the telepad's tracking beacon.</span>")
stage = 1
else if(stage == 1)
playsound(src, W.usesound, 50, 1)
playsound(src, I.usesound, 50, 1)
to_chat(user, "<span class = 'caution'> You screw in the telepad's tracking beacon.</span>")
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, "<span class = 'caution'> You disassemble the telepad.</span>")
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