diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 40e2c74f10..19818bd459 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -10,9 +10,7 @@ /mob/living/carbon/Life() ..() - handle_viruses() - // Increase germ_level regularly if(germ_level < GERM_LEVEL_AMBIENT && prob(30)) //if you're just standing there, you shouldn't get more germs beyond an ambient level germ_level++ @@ -393,16 +391,6 @@ return method ? ">250" : "extremely weak and fast, patient's artery feels like a thread" // output for machines^ ^^^^^^^output for people^^^^^^^^^ -/mob/living/carbon/verb/mob_sleep() - set name = "Sleep" - set category = "IC" - - if(usr.sleeping) - to_chat(usr, "You are already sleeping") - return - if(alert(src,"You sure you want to sleep for a while?","Sleep","Yes","No") == "Yes") - usr.AdjustSleeping(20) - /mob/living/carbon/Bump(atom/A) if(now_pushing) return diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index 32a7a419d1..d76222128b 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -16,14 +16,13 @@ handle_light() if(stat != DEAD) + //Breathing, if applicable handle_breathing() //Mutations and radiation handle_mutations_and_radiation() - - //Blood handle_blood() @@ -123,6 +122,8 @@ handle_confused() /mob/living/proc/handle_sleeping() + if(stat != DEAD && toggled_sleeping) + Sleeping(2) if(sleeping) AdjustSleeping(-1) throw_alert("asleep", /obj/screen/alert/asleep) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b8987a7484..f4a52d42b1 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1150,3 +1150,16 @@ /mob/living/proc/empty_stomach() return + +/mob/living + var/toggled_sleeping = FALSE + +/mob/living/verb/mob_sleep() + set name = "Sleep" + set category = "IC" + if(!toggled_sleeping && alert(src, "Are you sure you wish to go to sleep? You will snooze until using the Sleep verb again.", "Sleepy Time", "No", "Yes") == "No") + return + toggled_sleeping = !toggled_sleeping + to_chat(src, SPAN_NOTICE("You are [toggled_sleeping ? "now voluntarily sleeping. Use the Sleep verb again to wake up." : "no longer voluntarily sleeping"].")) + if(toggled_sleeping) + Sleeping(1)