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 21845a47515..1dce8088158 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 dad8fae62f7..27aa1d6b4da 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1800,7 +1800,10 @@ ..() /mob/living/carbon/human/canBeHandcuffed() - return 1 + if(get_num_arms() >= 2) + return TRUE + else + return FALSE /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..c8e5cb8422a 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 FALSE + + +/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 diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 0d077a7999b..7e61bc866a7 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -96,35 +96,6 @@ return ..() -/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob) - switch(open) - if(0) - if(istype(W,/obj/item/weapon/scalpel)) - spread_germs_to_organ(src, user, W) - user.visible_message("[user] cuts [src] open with [W]!") - open++ - return - if(1) - if(istype(W,/obj/item/weapon/retractor)) - spread_germs_to_organ(src, user, W) - user.visible_message("[user] cracks [src] open like an egg with [W]!") - open++ - return - if(2) - if(istype(W,/obj/item/weapon/hemostat)) - spread_germs_to_organ(src, user, W) - if(contents.len) - var/obj/item/removing = pick(contents) - var/obj/item/organ/internal/O = removing - if(istype(O)) - spread_germs_to_organ(O, user, W) // This wouldn't be any cleaner than the actual surgery - user.put_in_hands(removing) - user.visible_message("[user] extracts [removing] from [src] with [W]!") - else - user.visible_message("[user] fishes around fruitlessly in [src] with [W].") - return - . = ..() - /obj/item/organ/external/update_health() damage = min(max_damage, (brute_dam + burn_dam)) @@ -552,6 +523,63 @@ Note that amputating the affected organ does in fact remove the infection from t qdel(src) // If you flashed away to ashes, YOU FLASHED AWAY TO ASHES return null +/obj/item/organ/external/proc/disembowel(spillage_zone = "chest") + if(!owner) + return + + var/mob/living/carbon/C = owner + + if(!hasorgans(C)) + return + + var/organ_spilled = FALSE + var/turf/T = get_turf(C) + C.add_splatter_floor(T) + playsound(get_turf(C), 'sound/effects/splat.ogg', 25, 1) + for(var/X in C.internal_organs) + var/obj/item/organ/O = X + var/org_zone = check_zone(O.parent_organ) + if(org_zone == spillage_zone) + O.remove(C) + O.forceMove(T) + organ_spilled = TRUE + + if(organ_spilled) + C.visible_message("[C]'s internal organs spill out onto the floor!") + return TRUE + +/obj/item/organ/external/chest/droplimb() + if(disembowel()) + return TRUE + +/obj/item/organ/external/groin/droplimb() + if(disembowel("groin")) + return TRUE + + + +/obj/item/organ/external/attackby(obj/item/I, mob/user, params) + if(I.sharp) + add_fingerprint(user) + if(!contents.len) + to_chat(user, "There is nothing left inside [src]!") + return + playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1) + user.visible_message("[user] begins to cut open [src].",\ + "You begin to cut open [src]...") + if(do_after(user, 54, target = src)) + drop_organs(user) + else + return ..() + +//empties the bodypart from its organs and other things inside it +/obj/item/organ/external/proc/drop_organs(mob/user) + var/turf/T = get_turf(src) + if(status != ORGAN_ROBOT) + playsound(T, 'sound/effects/splat.ogg', 25, 1) + for(var/obj/item/I in src) + I.forceMove(T) + /**************************************************** HELPERS ****************************************************/ diff --git a/code/modules/surgery/organs/subtypes/standard.dm b/code/modules/surgery/organs/subtypes/standard.dm index 8efff94e872..3fd8effd56a 100644 --- a/code/modules/surgery/organs/subtypes/standard.dm +++ b/code/modules/surgery/organs/subtypes/standard.dm @@ -13,7 +13,6 @@ vital = 1 amputation_point = "spine" gendered_icon = 1 - cannot_amputate = 1 parent_organ = null encased = "ribcage" var/fat = FALSE @@ -46,7 +45,6 @@ w_class = WEIGHT_CLASS_BULKY // if you know what I mean ;) body_part = LOWER_TORSO vital = 1 - cannot_amputate = TRUE parent_organ = "chest" amputation_point = "lumbar" gendered_icon = 1