mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 21:19:44 +01:00
Merge pull request #7004 from mwerezak/stance
Cleans up human stance code
This commit is contained in:
@@ -55,6 +55,9 @@
|
||||
if (bodytemperature < 283.222)
|
||||
tally += (283.222 - bodytemperature) / 10 * 1.75
|
||||
|
||||
if(can_stand <= 1)
|
||||
tally += 5 //hopping around on one foot is slow
|
||||
|
||||
if(mRun in mutations)
|
||||
tally = 0
|
||||
|
||||
|
||||
+14
-13
@@ -847,17 +847,18 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
lying = 0
|
||||
canmove = 1
|
||||
pixel_y = V.mob_offset_y
|
||||
else if(buckled && (!buckled.movable))
|
||||
anchored = 1
|
||||
canmove = 0
|
||||
if(istype(buckled,/obj/structure/stool/bed/chair) )
|
||||
lying = 0
|
||||
else if(buckled)
|
||||
if (!buckled.movable)
|
||||
anchored = 1
|
||||
canmove = 0
|
||||
if(istype(buckled,/obj/structure/stool/bed/chair) )
|
||||
lying = 0
|
||||
else
|
||||
lying = 1
|
||||
else
|
||||
lying = 1
|
||||
else if (buckled && (buckled.movable))
|
||||
anchored = 0
|
||||
canmove = 1
|
||||
lying = 0
|
||||
anchored = 0
|
||||
canmove = 1
|
||||
lying = 0
|
||||
else if( stat || weakened || paralysis || resting || sleeping || (status_flags & FAKEDEATH))
|
||||
lying = 1
|
||||
canmove = 0
|
||||
@@ -867,9 +868,9 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
anchored = 1
|
||||
canmove = 0
|
||||
lying = 0
|
||||
else if (!buckled)
|
||||
lying = !can_stand
|
||||
canmove = has_limbs
|
||||
else
|
||||
lying = 0
|
||||
canmove = 1
|
||||
|
||||
if(lying)
|
||||
density = 0
|
||||
|
||||
@@ -213,11 +213,10 @@
|
||||
var/universal_speak = 0 // Set to 1 to enable the mob to speak to everyone -- TLE
|
||||
var/universal_understand = 0 // Set to 1 to enable the mob to understand everyone, not necessarily speak
|
||||
|
||||
var/has_limbs = 1 //Whether this mob have any limbs he can move with
|
||||
var/can_stand = 1 //Whether this mob have ability to stand
|
||||
var/can_stand = 2 //Whether this mob have ability to stand
|
||||
|
||||
var/immune_to_ssd = 0
|
||||
|
||||
var/turf/listed_turf = null //the current turf being examined in the stat panel
|
||||
|
||||
var/list/active_genes=list()
|
||||
var/list/active_genes=list()
|
||||
|
||||
@@ -60,7 +60,6 @@
|
||||
/mob/living/carbon/human/proc/handle_organs()
|
||||
|
||||
number_wounds = 0
|
||||
var/leg_tally = 2
|
||||
var/force_process = 0
|
||||
var/damage_this_tick = getBruteLoss() + getFireLoss() + getToxLoss()
|
||||
if(damage_this_tick > last_dam)
|
||||
@@ -75,6 +74,9 @@
|
||||
for(var/datum/organ/internal/I in internal_organs)
|
||||
I.process()
|
||||
|
||||
//losing a limb stops it from processing, so this has to be done separately
|
||||
handle_stance()
|
||||
|
||||
if(!force_process && !bad_external_organs.len)
|
||||
return
|
||||
|
||||
@@ -101,23 +103,17 @@
|
||||
if (W.infection_check())
|
||||
W.germ_level += 1
|
||||
|
||||
if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
|
||||
if (!E.is_usable() || E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)))
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
/mob/living/carbon/human/proc/handle_stance()
|
||||
can_stand = 2
|
||||
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) || E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable())
|
||||
can_stand-- // let it fail even if just foot&leg
|
||||
|
||||
// standing is poor
|
||||
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
|
||||
if(species && species.flags & NO_PAIN)
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
paralysis = 10
|
||||
|
||||
//Check arms and legs for existence
|
||||
can_stand = 2 //can stand on both legs
|
||||
var/datum/organ/external/E = organs_by_name["l_foot"]
|
||||
if(E.status & ORGAN_DESTROYED)
|
||||
can_stand--
|
||||
|
||||
E = organs_by_name["r_foot"]
|
||||
if(E.status & ORGAN_DESTROYED)
|
||||
can_stand--
|
||||
if(can_stand <= 0)
|
||||
Weaken(10)
|
||||
if (!(lying || resting))
|
||||
if(species && !(species.flags & NO_PAIN))
|
||||
emote("scream")
|
||||
emote("collapse")
|
||||
Reference in New Issue
Block a user