Cyborg modules now automatically turn off when deactivated (#41326)

* Cyborg modules turn off when deactivated

* gives mining borgs built in mining scanners
This commit is contained in:
ShizCalev
2018-11-13 01:53:14 -05:00
committed by Emmett Gaines
parent 841314f580
commit 2088a9ce90
10 changed files with 62 additions and 15 deletions
+6 -10
View File
@@ -29,8 +29,11 @@
return ..()
/obj/item/pinpointer/attack_self(mob/living/user)
active = !active
toggle_on()
user.visible_message("<span class='notice'>[user] [active ? "" : "de"]activates [user.p_their()] pinpointer.</span>", "<span class='notice'>You [active ? "" : "de"]activate your pinpointer.</span>")
/obj/item/pinpointer/proc/toggle_on()
active = !active
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
if(active)
START_PROCESSING(SSfastprocess, src)
@@ -94,12 +97,8 @@
/obj/item/pinpointer/crew/attack_self(mob/living/user)
if(active)
active = FALSE
toggle_on()
user.visible_message("<span class='notice'>[user] deactivates [user.p_their()] pinpointer.</span>", "<span class='notice'>You deactivate your pinpointer.</span>")
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
target = null //Restarting the pinpointer forces a target reset
STOP_PROCESSING(SSfastprocess, src)
update_icon()
return
var/list/name_counts = list()
@@ -130,11 +129,8 @@
return
target = names[A]
active = TRUE
toggle_on()
user.visible_message("<span class='notice'>[user] activates [user.p_their()] pinpointer.</span>", "<span class='notice'>You activate your pinpointer.</span>")
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
START_PROCESSING(SSfastprocess, src)
update_icon()
/obj/item/pinpointer/crew/scan_for_target()
if(target)