From 1546d9f293a4aa0661a61865aed9667fd1076c0d Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 13 Dec 2014 18:26:06 -0500 Subject: [PATCH] Fixes #7406 --- code/modules/organs/organ.dm | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 9acf108130..e20da6ccca 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -104,10 +104,17 @@ W.germ_level += 1 /mob/living/carbon/human/proc/handle_stance() - if (lying || resting) - return // don't need to process any of this if they aren't standing anyways + // Don't need to process any of this if they aren't standing anyways + // unless their stance is damaged, and we want to check if they should stay down + if (!stance_damage && (lying || resting) && (life_tick % 4) == 0) + return stance_damage = 0 + + // Buckled to a bed/chair. Stance damage is forced to 0 since they're sitting on something solid + if (istype(buckled, /obj/structure/stool/bed)) + return + for (var/organ in list("l_leg","l_foot","r_leg","r_foot")) var/datum/organ/external/E = organs_by_name[organ] if (E.status & ORGAN_DESTROYED) @@ -115,9 +122,18 @@ else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable()) stance_damage += 1 + // Canes and crutches help you stand (if the latter is ever added) + // One cane mitigates a broken leg+foot, or a missing foot. + // Two canes are needed for a lost leg. If you are missing both legs, canes aren't gonna help you. + if (istype(l_hand, /obj/item/weapon/cane)) + stance_damage -= 2 + if (istype(l_hand, /obj/item/weapon/cane)) + stance_damage -= 2 + // standing is poor if(stance_damage >= 4 || (stance_damage >= 2 && prob(5))) - Weaken(5) - if(species && !(species.flags & NO_PAIN)) - emote("scream") - emote("collapse") \ No newline at end of file + if(!(lying || resting)) + if(species && !(species.flags & NO_PAIN)) + emote("scream") + custom_emote(1, "collapses!") + Weaken(5) //can't emote while weakened, apparently. \ No newline at end of file