Cleans up stance handling.

Now that dislocation no longer implicates !is_usable(), we can tidy up stance_damage calculation.
Also fixes stance being processed every tick except for the fourth, instead of the inverse
This commit is contained in:
HarpyEagle
2016-06-19 23:58:44 +01:00
committed by Yoshax
parent 37cf0d3fff
commit 6ecf6bc154
@@ -68,7 +68,7 @@
/mob/living/carbon/human/proc/handle_stance()
// 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)
if (!stance_damage && (lying || resting) && (life_tick % 4) != 0)
return
stance_damage = 0
@@ -80,7 +80,7 @@
var/limb_pain
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 || (E.status & (ORGAN_MUTATED|ORGAN_DEAD)) || E.is_stump()) //should just be !E.is_usable() here but dislocation screws that up.
if(!E || !E.is_usable())
stance_damage += 2 // let it fail even if just foot&leg
else if (E.is_malfunctioning())
//malfunctioning only happens intermittently so treat it as a missing limb when it procs
@@ -93,7 +93,7 @@
spark_system.start()
spawn(10)
qdel(spark_system)
else if (E.is_broken() || !E.is_usable())
else if (E.is_broken())
stance_damage += 1
else if (E.is_dislocated())
stance_damage += 0.5