mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-31 07:57:47 +01:00
Fixed up the stupid handcuff shit that's been bugging me forever.
This commit is contained in:
@@ -15,88 +15,42 @@
|
||||
var/dispenser = 0
|
||||
var/breakouttime = 1200 //Deciseconds = 120s = 2 minutes
|
||||
|
||||
/obj/item/weapon/handcuffs/attack(mob/living/carbon/C as mob, mob/user as mob)
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cyborg) && isrobot(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)
|
||||
var/turf/p_loc = user.loc
|
||||
var/turf/p_loc_m = C.loc
|
||||
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message("\red <B>[user] is trying to put handcuffs on [C]!</B>", 1)
|
||||
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()
|
||||
|
||||
else
|
||||
if ((M_CLUMSY in usr.mutations) && prob(50))
|
||||
usr << "\red Uh ... how do those things work?!"
|
||||
if (istype(C, /mob/living/carbon/human))
|
||||
if(!C.handcuffed)
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = user
|
||||
O.target = user
|
||||
O.item = user.get_active_hand()
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = user.loc
|
||||
O.place = "handcuff"
|
||||
C.requests += O
|
||||
spawn( 0 )
|
||||
O.process()
|
||||
return
|
||||
user.drop_item()
|
||||
loc = C
|
||||
C.handcuffed = src
|
||||
C.update_inv_handcuffed()
|
||||
return
|
||||
if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if (istype(C, /mob/living/carbon/human))
|
||||
if(!C.handcuffed)
|
||||
|
||||
C.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 [C.name] ([C.ckey])</font>")
|
||||
log_attack("[user.name] ([user.ckey]) Attempted to handcuff [C.name] ([C.ckey])")
|
||||
var/cable = 0
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cable))
|
||||
cable = 1
|
||||
|
||||
if(!iscarbon(user))
|
||||
C.LAssailant = null
|
||||
else
|
||||
C.LAssailant = user
|
||||
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>")
|
||||
|
||||
|
||||
var/obj/effect/equip_e/human/O = new /obj/effect/equip_e/human( )
|
||||
O.source = user
|
||||
O.target = C
|
||||
O.item = user.get_active_hand()
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = C.loc
|
||||
O.place = "handcuff"
|
||||
C.requests += O
|
||||
spawn( 0 )
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cable))
|
||||
feedback_add_details("handcuffs","C")
|
||||
playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
|
||||
else
|
||||
feedback_add_details("handcuffs","H")
|
||||
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
O.process()
|
||||
return
|
||||
if(cable)
|
||||
playsound(loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
|
||||
else
|
||||
if(!C.handcuffed)
|
||||
var/obj/effect/equip_e/monkey/O = new /obj/effect/equip_e/monkey( )
|
||||
O.source = user
|
||||
O.target = C
|
||||
O.item = user.get_active_hand()
|
||||
O.s_loc = user.loc
|
||||
O.t_loc = C.loc
|
||||
O.place = "handcuff"
|
||||
C.requests += O
|
||||
spawn( 0 )
|
||||
if(istype(src, /obj/item/weapon/handcuffs/cable))
|
||||
playsound(src.loc, 'sound/weapons/cablecuff.ogg', 30, 1, -2)
|
||||
else
|
||||
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
O.process()
|
||||
return
|
||||
return
|
||||
playsound(loc, 'sound/weapons/handcuffs.ogg', 30, 1, -2)
|
||||
|
||||
if(do_mob(user, C, 30))
|
||||
if(C.handcuffed)
|
||||
return
|
||||
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")
|
||||
|
||||
add_logs(user, C, "handcuffed")
|
||||
|
||||
var/last_chew = 0
|
||||
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
|
||||
|
||||
Reference in New Issue
Block a user