Handcuff grab-requirement reversion

As requested by Fox
This commit is contained in:
Bone White
2014-10-18 18:05:10 +01:00
parent ebe1026bda
commit 4419dc7243
2 changed files with 33 additions and 79 deletions
+33 -69
View File
@@ -14,64 +14,43 @@
origin_tech = "materials=1"
var/dispenser = 0
var/breakouttime = 1200 //Deciseconds = 120s = 2 minutes
var/cuff_sound = 'sound/weapons/handcuffs.ogg'
/obj/item/weapon/handcuffs/attack(mob/living/carbon/C as mob, mob/user as mob)
if (!istype(user, /mob/living/carbon/human))
user << "\red You don't have the dexterity to do this!"
return
if ((M_CLUMSY in usr.mutations) && prob(50))
user << "\red Uh ... how do those things work?!"
place_handcuffs(user, user)
return
if(!C.handcuffed)
if (C == user)
place_handcuffs(user, user)
/obj/item/weapon/handcuffs/attack(mob/living/carbon/C, mob/user)
if(M_CLUMSY in user.mutations && prob(50))
user << "<span class='warning'>Uh... how do those things work?!</span>"
if(!C.handcuffed)
user.drop_item()
loc = C
C.handcuffed = src
C.update_inv_handcuffed()
return
//check for an aggressive grab
for (var/obj/item/weapon/grab/G in C.grabbed_by)
if (G.loc == user && G.state >= GRAB_AGGRESSIVE)
place_handcuffs(C, user)
var/cable = 0
if(istype(src, /obj/item/weapon/handcuffs/cable))
cable = 1
if(!C.handcuffed)
C.visible_message("<span class='danger'>[user] is trying to put handcuffs on [C]!</span>", \
"<span class='danger'>[user] is trying to put handcuffs on [C]!</span>")
if(cable)
playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
else
playsound(loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
if(do_mob(user, C, 30))
if(C.handcuffed)
return
user << "\red You need to have a firm grip on [C] before you can put \the [src] on!"
user.drop_item()
loc = C
C.handcuffed = src
C.update_inv_handcuffed()
if(cable)
feedback_add_details("handcuffs","C")
else
feedback_add_details("handcuffs","H")
/obj/item/weapon/handcuffs/proc/place_handcuffs(var/mob/living/carbon/target, var/mob/user)
playsound(src.loc, cuff_sound, 30, 1, -2)
if (ishuman(target))
var/mob/living/carbon/human/H = target
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)]")
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
O.source = user
O.target = H
O.item = user.get_active_hand()
O.s_loc = user.loc
O.t_loc = H.loc
O.place = "handcuff"
H.requests += O
spawn( 0 )
feedback_add_details("handcuffs","H")
O.process()
return
if (ismonkey(target))
var/mob/living/carbon/monkey/M = target
var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( )
O.source = user
O.target = M
O.item = user.get_active_hand()
O.s_loc = user.loc
O.t_loc = M.loc
O.place = "handcuff"
M.requests += O
spawn( 0 )
O.process()
return
add_logs(user, C, "handcuffed")
var/last_chew = 0
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
@@ -105,7 +84,6 @@ var/last_chew = 0
desc = "Looks like some cables tied together. Could be used to tie something up."
icon_state = "cuff_red"
breakouttime = 300 //Deciseconds = 30s
cuff_sound = 'sound/weapons/cablecuff.ogg'
/obj/item/weapon/handcuffs/cable/red
icon_state = "cuff_red"
@@ -150,17 +128,3 @@ var/last_chew = 0
user << "<span class='notice'>You wrap the cable restraint around the top of the rod.</span>"
del(src)
/obj/item/weapon/handcuffs/cyborg
dispenser = 1
/obj/item/weapon/handcuffs/cyborg/attack(mob/living/carbon/C as mob, mob/user as mob)
if(!C.handcuffed)
var/turf/p_loc = user.loc
var/turf/p_loc_m = C.loc
playsound(src.loc, cuff_sound, 30, 1, -2)
user.visible_message("\red <B>[user] is trying to put handcuffs on [C]!</B>")
spawn(30)
if(!C) return
if(p_loc == user.loc && p_loc_m == C.loc)
C.handcuffed = new /obj/item/weapon/handcuffs(C)
C.update_inv_handcuffed()