Generalizing sleeping updates and adding it to simple mobs.

This commit is contained in:
MistakeNot4892
2023-02-24 11:04:17 +11:00
parent 90901ef3a8
commit bef699437f
5 changed files with 14 additions and 6 deletions
+1 -2
View File
@@ -1104,8 +1104,7 @@
if (mind)
//Are they SSD? If so we'll keep them asleep but work off some of that sleep var in case of stoxin or similar.
if(client || sleeping > 3)
AdjustSleeping(-1)
throw_alert("asleep", /obj/screen/alert/asleep)
handle_sleeping()
if( prob(2) && health && client )
spawn(0)
emote("snore")
+1 -1
View File
@@ -66,7 +66,7 @@
if(sleeping)
adjustHalLoss(-3)
if(mind && mind.active && client)
AdjustSleeping(-1)
handle_sleeping()
SetBlinded(TRUE)
set_stat(UNCONSCIOUS)
else if(resting)
+10 -2
View File
@@ -41,10 +41,10 @@
//Check if we're on fire
handle_fire()
if(client && !(client.prefs.ambience_freq == 0)) // Handle re-running ambience to mobs if they've remained in an area, AND have an active client assigned to them, and do not have repeating ambience disabled.
handle_ambience()
//stuff in the stomach
handle_stomach()
@@ -122,6 +122,14 @@
handle_slurring()
handle_confused()
/mob/living/proc/handle_sleeping()
if(sleeping)
AdjustSleeping(-1)
throw_alert("asleep", /obj/screen/alert/asleep)
else
clear_alert("asleep")
return sleeping
/mob/living/proc/handle_stunned()
if(stunned)
AdjustStunned(-1)
@@ -78,7 +78,7 @@
if(src.sleeping)
Paralyse(3)
AdjustSleeping(-1)
handle_sleeping()
if(src.resting)
Weaken(5)
@@ -6,6 +6,7 @@
if(stat >= DEAD)
return FALSE
handle_sleeping()
handle_stunned()
handle_weakened()
handle_paralysed()