From fe0185697e76b6669641469b2d50ae025dff2712 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Tue, 7 Apr 2015 19:50:26 -0700 Subject: [PATCH] Some dislocation fixes/adjustments. --- .../mob/living/carbon/human/human_attackhand.dm | 2 +- code/modules/mob/living/carbon/human/human_organs.dm | 10 +++++----- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/organs/organ_external.dm | 9 +++++++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 291ab0d38a..a61009b836 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -308,7 +308,7 @@ if(!target_zone) return null var/obj/item/organ/external/organ = get_organ(check_zone(target_zone)) - if(!organ || organ.is_dislocated() || organ.dislocated == -1) + if(!organ || (organ.dislocated == 2) || (organ.dislocated == -1)) return null var/dislocation_str if(prob(W.force)) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index e40b915226..a0d456af4e 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -70,12 +70,12 @@ for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot")) var/obj/item/organ/external/E = organs_by_name[limb_tag] - if(!E) - stance_damage += 2 - else if (E.status & ORGAN_DESTROYED) + if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD))) stance_damage += 2 // let it fail even if just foot&leg - else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable()) + else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || (E.status & ORGAN_MUTATED)) stance_damage += 1 + else if (E.is_dislocated()) + stance_damage += 0.5 // Canes and crutches help you stand (if the latter is ever added) // One cane mitigates a broken leg+foot, or a missing foot. @@ -102,7 +102,7 @@ if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED)) continue - if(E.is_broken()) + if(E.is_broken() || E.is_dislocated()) if(E.body_part == HAND_LEFT) if(!l_hand) continue diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 10c22f6012..568822d105 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -389,7 +389,7 @@ // Lung damage increases the minimum safe pressure. if(species.has_organ["lungs"]) var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"] - if(!L) + if(isnull(L)) safe_pressure_min = INFINITY //No lungs, how are you breathing? else if(L.is_broken()) safe_pressure_min *= 1.5 diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 09c1c539ae..54382c251b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -96,9 +96,14 @@ dislocated = 0 if(children && children.len) for(var/obj/item/organ/external/child in children) - child.undislocate() + if(child.dislocated == 1) + child.undislocate() if(owner) owner.shock_stage += 20 + for(var/obj/item/organ/external/limb in owner.organs) + if(limb.dislocated == 2) + return + owner.verbs -= /mob/living/carbon/human/proc/undislocate /obj/item/organ/external/update_health() damage = min(max_damage, (brute_dam + burn_dam)) @@ -837,7 +842,7 @@ Note that amputating the affected organ does in fact remove the infection from t return 0 /obj/item/organ/external/proc/is_usable() - return !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) + return !is_dislocated() && !(status & (ORGAN_DESTROYED|ORGAN_MUTATED|ORGAN_DEAD)) /obj/item/organ/external/proc/is_malfunctioning() return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))