From df224e81d6b540bd8461dd2006e2ace0324e3392 Mon Sep 17 00:00:00 2001 From: Crazylemon Date: Mon, 4 Jan 2016 13:47:36 -0800 Subject: [PATCH] Simple animals will now tick down sleeping --- code/modules/mob/living/carbon/life.dm | 17 ++++++++--------- code/modules/mob/living/life.dm | 7 +++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 33af21120de..ca87e8b1e22 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -293,15 +293,6 @@ CheckStamina() - if(sleeping) - handle_dreams() - adjustStaminaLoss(-10) - sleeping = max(sleeping - 1, 0) - if(prob(10) && health && !hal_crit) - spawn(0) - emote("snore") - - var/restingpwr = 1 + 4 * resting //Dizziness @@ -373,6 +364,14 @@ else hallucination -= 2 +/mob/living/carbon/handle_sleeping() + if(..()) + adjustStaminaLoss(-10) + if(prob(10) && health && !hal_crit) + spawn(0) + emote("snore") + + //this handles hud updates. Calls update_vision() and handle_hud_icons() /mob/living/carbon/handle_regular_hud_updates() if(!client) return 0 diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 062a8e3b69e..91248c2ab14 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -110,6 +110,7 @@ handle_drugged() handle_slurring() handle_paralysed() + handle_sleeping() /mob/living/proc/handle_stunned() @@ -151,6 +152,12 @@ AdjustParalysis(-1) return paralysis +/mob/living/proc/handle_sleeping() + if(sleeping) + handle_dreams() + sleeping = max(sleeping - 1, 0) + return sleeping + /mob/living/proc/handle_disabilities()