From 166ada3ec809317f41f1700df6882ab88553ec7f Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Thu, 18 Apr 2024 22:14:21 -0400 Subject: [PATCH] [MIRROR] Fix handcuffing (#2073) * Fix handcuffing (#82760) Changed this to an early return but then didn't invert the condition :cl: Melbert fix: You can handcuff people with 2 arms and you can no longer handcuff people with 0 arms /:cl: * Fix handcuffing --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- code/game/objects/items/handcuffs.dm | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm index 8db6b3556a0..4392b699d1a 100644 --- a/code/game/objects/items/handcuffs.dm +++ b/code/game/objects/items/handcuffs.dm @@ -74,7 +74,16 @@ if(!istype(C)) return +<<<<<<< HEAD if(SEND_SIGNAL(C, COMSIG_CARBON_CUFF_ATTEMPTED, user) & COMSIG_CARBON_CUFF_PREVENT) +======= + attempt_to_cuff(target_mob, user) + +/// Handles all of the checks and application in a typical situation where someone attacks a carbon victim with the handcuff item. +/obj/item/restraints/handcuffs/proc/attempt_to_cuff(mob/living/carbon/victim, mob/living/user) + if(SEND_SIGNAL(victim, COMSIG_CARBON_CUFF_ATTEMPTED, user) & COMSIG_CARBON_CUFF_PREVENT) + victim.balloon_alert(user, "can't be handcuffed!") +>>>>>>> e640bd79f2f ([MIRROR] Fix handcuffing (#2073)) return if(iscarbon(user) && (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))) //Clumsy people have a 50% chance to handcuff themselves instead of their target. @@ -82,6 +91,28 @@ apply_cuffs(user,user) return +<<<<<<< HEAD +======= + if(!isnull(victim.handcuffed)) + victim.balloon_alert(user, "already handcuffed!") + return + + if(!victim.canBeHandcuffed()) + victim.balloon_alert(user, "can't be handcuffed!") + return + + victim.visible_message( + span_danger("[user] is trying to put [src] on [victim]!"), + span_userdanger("[user] is trying to put [src] on you!"), + ) + + if(victim.is_blind()) + to_chat(victim, span_userdanger("As you feel someone grab your wrists, [src] start digging into your skin!")) + + playsound(loc, cuffsound, 30, TRUE, -2) + log_combat(user, victim, "attempted to handcuff") + +>>>>>>> e640bd79f2f ([MIRROR] Fix handcuffing (#2073)) if(HAS_TRAIT(user, TRAIT_FAST_CUFFING)) handcuff_time_mod = 0.75 else