Merge pull request #2673 from Anewbe/cuff_port

Kills Telecuffs
This commit is contained in:
Neerti
2016-10-24 19:28:44 -04:00
committed by GitHub

View File

@@ -35,20 +35,20 @@
return
//check for an aggressive grab (or robutts)
var/can_place
if(istype(user, /mob/living/silicon/robot))
can_place = 1
else
for (var/obj/item/weapon/grab/G in C.grabbed_by)
if (G.loc == user && G.state >= GRAB_AGGRESSIVE)
can_place = 1
break
if(can_place)
if(can_place(C, user))
place_handcuffs(C, user)
else
user << "<span class='danger'>You need to have a firm grip on [C] before you can put \the [src] on!</span>"
/obj/item/weapon/handcuffs/proc/can_place(var/mob/target, var/mob/user)
if(istype(user, /mob/living/silicon/robot))
return 1
else
for(var/obj/item/weapon/grab/G in target.grabbed_by)
if(G.loc == user && G.state >= GRAB_AGGRESSIVE)
return 1
return 0
/obj/item/weapon/handcuffs/proc/place_handcuffs(var/mob/living/carbon/target, var/mob/user)
playsound(src.loc, cuff_sound, 30, 1, -2)
@@ -69,6 +69,9 @@
if(!do_after(user,30))
return 0
if(!can_place(target, user)) //victim may have resisted out of the grab in the meantime
return 0
H.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been handcuffed (attempt) by [user.name] ([user.ckey])</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to handcuff [H.name] ([H.ckey])</font>")
msg_admin_attack("[key_name(user)] attempted to handcuff [key_name(H)]")