Skip to content

Commit

Permalink
wor
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Feb 10, 2024
1 parent ab81a85 commit 3dffd7b
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion code/game/objects/items/legcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,70 @@
throwforce = 0
w_class = SIZE_MEDIUM

var/breakouttime = 15 SECONDS
var/breakouttime = 1 MINUTES
/// how many deciseconds it takes to cuff someone
var/cuff_delay = 4 SECONDS
/// If can be applied to people manually
var/manual = TRUE

/obj/item/legcuffs/attack(mob/living/carbon/C, mob/user)
if(!istype(C) || !manual)
return ..()
if (!istype(user, /mob/living/carbon/human))
to_chat(user, SPAN_DANGER("You don't have the dexterity to do this!"))
return
if(!C.legcuffed)
apply_legcuffs(C, user)

/obj/item/legcuffs/proc/apply_legcuffs(mob/living/carbon/target, mob/user)
playsound(src.loc, 'sound/weapons/handcuffs.ogg', 25, 1, 4)

if(user.action_busy)
return FALSE

if (ishuman(target))
var/mob/living/carbon/human/H = target

if (!H.has_limb_for_slot(WEAR_LEGCUFFS))
to_chat(user, SPAN_DANGER("\The [H] needs two ankles before you can cuff them together!"))
return FALSE

H.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been legcuffed (attempt) by [key_name(user)]</font>")
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Attempted to legcuff [key_name(H)]</font>")
msg_admin_attack("[key_name(user)] attempted to legcuff [key_name(H)] in [get_area(src)] ([src.loc.x],[src.loc.y],[src.loc.z]).", src.loc.x, src.loc.y, src.loc.z)

user.visible_message(SPAN_NOTICE("[user] tries to put [src] on [H]."))
if(do_after(user, cuff_delay, INTERRUPT_MOVED, BUSY_ICON_HOSTILE, H, INTERRUPT_MOVED, BUSY_ICON_GENERIC))
if(src == user.get_active_hand() && !H.legcuffed && Adjacent(user))
if(iscarbon(H))
if(istype(H.buckled, /obj/structure/bed/roller))
to_chat(user, SPAN_DANGER("You cannot legcuff someone who is buckled onto a roller bed."))
return FALSE
if(H.has_limb_for_slot(WEAR_LEGCUFFS))
user.drop_inv_item_on_ground(src)
H.equip_to_slot_if_possible(src, WEAR_LEGCUFFS, 1, 0, 1, 1)
user.count_niche_stat(STATISTICS_NICHE_HANDCUFF)

else if (ismonkey(target))
user.visible_message(SPAN_NOTICE("[user] tries to put [src] on [target]."))
if(do_after(user, 30, INTERRUPT_MOVED, BUSY_ICON_HOSTILE, target, INTERRUPT_MOVED, BUSY_ICON_GENERIC))
if(src == user.get_active_hand() && !target.legcuffed && Adjacent(user))
user.drop_inv_item_on_ground(src)
target.equip_to_slot_if_possible(src, WEAR_LEGCUFFS, 1, 0, 1, 1)
return TRUE

/obj/item/legcuffs/beartrap
name = "bear trap"
throw_speed = SPEED_FAST
throw_range = 1
icon_state = "beartrap0"
desc = "A trap used to catch bears and other legged creatures."
breakouttime = 20 SECONDS
var/armed = FALSE
manual = FALSE

/obj/item/legcuffs/beartrap/apply_legcuffs(mob/living/carbon/target, mob/user)
return FALSE

/obj/item/legcuffs/beartrap/attack_self(mob/user as mob)
..()
Expand Down

0 comments on commit 3dffd7b

Please sign in to comment.