Adds emp effect to detectives revolver (#18507)

* Adds emp effect to detectives revolver

* Update code/modules/projectiles/guns/energy/special.dm

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>

Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2022-07-24 12:51:08 -04:00
committed by GitHub
parent 6ab9a133ba
commit cfabb34b49
2 changed files with 24 additions and 5 deletions
@@ -792,6 +792,12 @@
. = ..()
. += "<span class='notice'>Ctrl-click to clear active tracked target or clear linked pinpointer.</span>"
/obj/item/gun/energy/detective/emp_act(severity)
. = ..()
unlink()
atom_say("EMP detected. Pinpointer and tracker system reset.")
/obj/item/gun/energy/detective/CtrlClick(mob/user)
. = ..()
if(!isliving(loc)) //don't do this next bit if this gun is on the floor
@@ -804,15 +810,21 @@
if(linked_pinpointer_UID)
if(alert("Do you want to clear the linked pinpointer?", "Pinpointer reset", "Yes", "No") == "Yes")
to_chat(user, "<span class='notice'>[src] is ready to be linked to a new pinpointer.</span>")
var/obj/item/pinpointer/crew/C = locateUID(linked_pinpointer_UID)
C.linked_gun_UID = null
if(C.mode == MODE_DET)
C.stop_tracking()
linked_pinpointer_UID = null
unlink()
/obj/item/gun/energy/detective/proc/link_pinpointer(pinpointer_UID)
linked_pinpointer_UID = pinpointer_UID
/obj/item/gun/energy/detective/proc/unlink()
var/obj/item/pinpointer/crew/C = locateUID(linked_pinpointer_UID)
if(!C)
return
C.linked_gun_UID = null
if(C.mode == MODE_DET)
C.stop_tracking()
linked_pinpointer_UID = null
tracking_target_UID = null
/obj/item/gun/energy/detective/multitool_act(mob/living/user, obj/item/I)
. = TRUE
user.visible_message("<span class='notice'>[user] starts [overcharged ? "restoring" : "removing"] the safety limits on [src].</span>", "<span class='notice'>You start [overcharged ? "restoring" : "removing"] the safety limits on [src]</span>")