mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 12:29:46 +01:00
Sleeping tweaks, at-will wakes (#21452)
Species capable of indefinite sleep can now wake up from being asleep at will by pressing "Sleep" again. IPCs will also no longer beep constantly when sleeping. This is part of a `snores` variable that can be toggled on other species too in lieu of a `snore_key` variable. Unfortunately does not make IPCs stop consuming charge when asleep. Tried it, it's one hell of a spaghetticode nightmare for a result that really doesn't matter that much. Might revisit once the IPC rework gets merged.
This commit is contained in:
@@ -398,7 +398,16 @@
|
||||
set category = "IC"
|
||||
|
||||
if(usr.sleeping)
|
||||
to_chat(usr, SPAN_WARNING("You are already asleep."))
|
||||
if(species && species.indefinite_sleep) // Species can wake up at will when sleeping.
|
||||
to_chat(usr, SPAN_NOTICE("You start to wake up."))
|
||||
if(usr.sleeping_indefinitely)
|
||||
to_chat(usr, SPAN_NOTICE("You will no longer sleep indefinitely."))
|
||||
usr.sleeping_indefinitely = FALSE // Stop any glitches from happening with overriding indefinite sleep.
|
||||
|
||||
usr.sleeping = 1 // Wake up soon.
|
||||
usr.eye_blurry = 1
|
||||
else
|
||||
to_chat(usr, SPAN_WARNING("You are already asleep."))
|
||||
return
|
||||
if(alert(src,"Are you sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes")
|
||||
willfully_sleeping = TRUE
|
||||
|
||||
@@ -796,7 +796,7 @@
|
||||
else
|
||||
AdjustSleeping(-1)
|
||||
if(prob(2) && health && !failed_last_breath && !InStasis())
|
||||
if(!paralysis)
|
||||
if(!paralysis && species.snores)
|
||||
emote(species.snore_key)
|
||||
|
||||
//CONSCIOUS
|
||||
|
||||
@@ -361,6 +361,10 @@
|
||||
* The key of the emote to play when this species is sleeping
|
||||
*/
|
||||
var/snore_key = "snore"
|
||||
/**
|
||||
* Whether or not this species snores when sleeping
|
||||
*/
|
||||
var/snores = TRUE
|
||||
/**
|
||||
* Whether this species can choose to sleep indefinitely
|
||||
*/
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
psi_deaf = TRUE
|
||||
|
||||
sleeps_upright = TRUE
|
||||
snore_key = "beep"
|
||||
snores = FALSE
|
||||
indefinite_sleep = TRUE
|
||||
|
||||
/datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H)
|
||||
|
||||
Reference in New Issue
Block a user