Merge pull request #9407 from phil235/StaminaFix

Fixes stamina damage
This commit is contained in:
Remie Richards
2015-05-09 06:03:26 +01:00
3 changed files with 16 additions and 17 deletions
+4 -1
View File
@@ -61,4 +61,7 @@
handle_hud_icons_health()
return 1
return 1
/mob/living/carbon/alien/CheckStamina()
return
+12 -1
View File
@@ -274,13 +274,24 @@
if(sleeping)
stat = UNCONSCIOUS
CheckStamina()
return 1
/mob/living/carbon/proc/CheckStamina()
if(staminaloss)
var/total_health = (health - staminaloss)
if(total_health <= config.health_threshold_crit && !stat)
src << "<span class='notice'>You're too exhausted to keep going...</span>"
Weaken(5)
setStaminaLoss(health - 2)
return
setStaminaLoss(max((staminaloss - 2), 0))
//this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc..
/mob/living/carbon/handle_status_effects()
..()
CheckStamina()
if(sleeping)
handle_dreams()
adjustStaminaLoss(-10)
-15
View File
@@ -313,12 +313,10 @@ Sorry Giacom. Please don't be mad :(
/mob/living/proc/adjustStaminaLoss(var/amount)
if(status_flags & GODMODE) return 0
staminaloss = min(max(staminaloss + amount, 0),(maxHealth*2))
handle_regular_status_updates() //we update our health right away.
/mob/living/proc/setStaminaLoss(var/amount)
if(status_flags & GODMODE) return 0
staminaloss = amount
handle_regular_status_updates() //we update our health right away.
/mob/living/proc/getMaxHealth()
return maxHealth
@@ -660,19 +658,6 @@ Sorry Giacom. Please don't be mad :(
/mob/living/proc/get_visible_name()
return name
/mob/living/proc/CheckStamina()
if(staminaloss)
var/total_health = (health - staminaloss)
if(total_health <= config.health_threshold_crit && !stat)
Exhaust()
setStaminaLoss(health - 2)
return
setStaminaLoss(max((staminaloss - 2), 0))
/mob/living/proc/Exhaust()
src << "<span class='notice'>You're too exhausted to keep going...</span>"
Weaken(5)
/mob/living/update_gravity(has_gravity)
if(!ticker)
return