diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 0b7850bba1f..24bcb7a8c2c 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -29,7 +29,7 @@ if(ishuman(C)) var/mob/living/carbon/human/H = C - if(!(H.get_organ("l_hand") || H.get_organ("r_hand"))) + if(!H.has_left_hand() || !H.has_right_hand()) to_chat(user, "How do you suggest handcuffing someone with no hands?") return diff --git a/code/game/objects/items/weapons/legcuffs.dm b/code/game/objects/items/weapons/legcuffs.dm index cbb8c3d4ed2..27cae75ac6c 100644 --- a/code/game/objects/items/weapons/legcuffs.dm +++ b/code/game/objects/items/weapons/legcuffs.dm @@ -127,7 +127,7 @@ H.apply_damage(trap_damage, BRUTE,"chest") else H.apply_damage(trap_damage, BRUTE,(pick("l_leg", "r_leg"))) - if(!H.legcuffed) //beartrap can't cuff you leg if there's already a beartrap or legcuffs. + if(!H.legcuffed && H.get_num_legs() >= 2) //beartrap can't cuff you leg if there's already a beartrap or legcuffs. H.legcuffed = src forceMove(H) H.update_inv_legcuffed() diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm index 8e148d75eb5..9c8624df444 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm @@ -39,9 +39,7 @@ if(ishuman(buckled_mob)) var/mob/living/carbon/human/driver = user - var/obj/item/organ/external/l_hand = driver.get_organ("l_hand") - var/obj/item/organ/external/r_hand = driver.get_organ("r_hand") - if(!l_hand && !r_hand) + if(!driver.has_left_hand() && !driver.has_right_hand()) return 0 // No hands to drive your chair? Tough luck! for(var/organ_name in list("l_hand","r_hand","l_arm","r_arm")) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index a2235b3811c..4cfede1fdee 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1827,7 +1827,10 @@ ..() /mob/living/carbon/human/canBeHandcuffed() - return 1 + if(get_num_arms() >= 2) + return 1 + else + return 0 /mob/living/carbon/human/InCritical() return (health <= config.health_threshold_crit && stat == UNCONSCIOUS) diff --git a/code/modules/surgery/organs/helpers.dm b/code/modules/surgery/organs/helpers.dm index 61ed78d0e3b..10ec8ee0dcc 100644 --- a/code/modules/surgery/organs/helpers.dm +++ b/code/modules/surgery/organs/helpers.dm @@ -44,3 +44,79 @@ for(var/obj/item/organ/external/O in bodyparts) if(limb_name == O.limb_name) return O + + +/mob/proc/has_left_hand() + return TRUE + +/mob/living/carbon/human/has_left_hand() + if(has_organ("l_hand")) + return TRUE + return FALSE + + +/mob/proc/has_right_hand() + return TRUE + +/mob/living/carbon/human/has_right_hand() + if(has_organ("r_hand")) + return TRUE + return FALSE + + +//Limb numbers +/mob/proc/get_num_arms() + return 2 + +/mob/living/carbon/human/get_num_arms() + . = 0 + for(var/X in bodyparts) + var/obj/item/organ/external/affecting = X + if(affecting.body_part == ARM_RIGHT) + .++ + if(affecting.body_part == ARM_LEFT) + .++ + +//sometimes we want to ignore that we don't have the required amount of arms. +/mob/proc/get_arm_ignore() + return 0 + + +/mob/proc/get_num_legs() + return 2 + +/mob/living/carbon/human/get_num_legs() + . = 0 + for(var/X in bodyparts) + var/obj/item/organ/external/affecting = X + if(affecting.body_part == LEG_RIGHT) + .++ + if(affecting.body_part == LEG_LEFT) + .++ + +//sometimes we want to ignore that we don't have the required amount of legs. +/mob/proc/get_leg_ignore() + return FALSE + + +/mob/living/carbon/human/get_leg_ignore() + + if(flying == 1) + return TRUE + + var/obj/item/weapon/tank/jetpack/J + if(istype(back,/obj/item/weapon/tank/jetpack)) + J = back + if(J.on == 1) + return TRUE + return FALSE + +/mob/living/proc/get_missing_limbs() + return list() + +/mob/living/carbon/human/get_missing_limbs() + var/list/full = list("head", "chest", "r_arm", "l_arm", "r_leg", "l_leg") + for(var/zone in full) + if(has_organ(zone)) + full -= zone + return full \ No newline at end of file