Merge pull request #7460 from mwerezak/stance

Fixes #7406
This commit is contained in:
PsiOmegaDelta
2014-12-14 10:08:41 +01:00
+22 -6
View File
@@ -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")
if(!(lying || resting))
if(species && !(species.flags & NO_PAIN))
emote("scream")
custom_emote(1, "collapses!")
Weaken(5) //can't emote while weakened, apparently.