diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index dbe506380c2..6a9bb90d841 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -436,7 +436,7 @@ datum if(15 to 25) M:drowsyness = max(M:drowsyness, 20) if(25 to INFINITY) - M.sleeping = 1 + M.sleeping += 1 M.adjustOxyLoss(-M.getOxyLoss()) M.SetWeakened(0) M.SetStunned(0) @@ -2446,7 +2446,7 @@ datum M:drowsyness = max(0,M:drowsyness-3) M:slurring = max(0, M:slurring-3) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping - 2) if (M.bodytemperature < 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature+5) M.make_jittery(1) @@ -2488,7 +2488,7 @@ datum M:drowsyness = max(0,M:drowsyness-3) M:slurring = max(0, M:slurring-3) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = min(310, M.bodytemperature-5) M.make_jittery(1) @@ -2507,7 +2507,7 @@ datum M.dizziness = max(0,M.dizziness-2) M:drowsyness = max(0,M:drowsyness-1) if(!M:sleeping_willingly) - M:sleeping = 0 + M.sleeping = max(0,M.sleeping-2) if(M:getToxLoss() && prob(20)) M:adjustToxLoss(-1) if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 @@ -2542,7 +2542,7 @@ datum M.dizziness +=5 M:drowsyness = 0 if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) if (M.bodytemperature > 310)//310 is the normal bodytemp. 310.055 M.bodytemperature = max(310, M.bodytemperature-5) M:nutrition += 1 @@ -2559,7 +2559,7 @@ datum on_mob_life(var/mob/living/M as mob) M:drowsyness = max(0,M:drowsyness-7) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-1) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) M.make_jittery(1) @@ -2779,7 +2779,7 @@ datum on_mob_life(var/mob/living/M as mob) M:drowsyness = max(0,M:drowsyness-7) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) M.make_jittery(1) @@ -3095,7 +3095,7 @@ datum M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) ..() @@ -3112,7 +3112,7 @@ datum M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) M.make_jittery(1) ..() return @@ -3128,7 +3128,7 @@ datum M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) if(!M:sleeping_willingly) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping - 2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index d7588011af1..e44e5937a06 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -741,7 +741,7 @@ In all, this is a lot like the monkey code. /N if ("help") if(!sleeping_willingly) - sleeping = 0 + sleeping = max(0,sleeping-5) resting = 0 AdjustParalysis(-3) AdjustStunned(-3) diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 1388a1314c1..6356a385efe 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -380,7 +380,7 @@ src.drowsyness-- src.eye_blurry = max(2, src.eye_blurry) if (prob(5)) - src.sleeping = 1 + src.sleeping += 1 src.Paralyse(5) confused = max(0, confused - 1) diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 252dc6349e7..3388ae322c6 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -490,7 +490,7 @@ if ("help") if(!sleeping_willingly) - sleeping = 0 + sleeping = max(0,sleeping-5) resting = 0 AdjustParalysis(-3) AdjustStunned(-3) diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm index b975d969cbe..334676870a8 100644 --- a/code/modules/mob/living/carbon/alien/larva/life.dm +++ b/code/modules/mob/living/carbon/alien/larva/life.dm @@ -303,7 +303,7 @@ drowsyness-- eye_blurry = max(2, eye_blurry) if (prob(5)) - sleeping = 1 + sleeping += 1 Paralyse(5) confused = max(0, confused - 1) diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm index 4106a1b0144..ac1fe5e7276 100644 --- a/code/modules/mob/living/carbon/brain/life.dm +++ b/code/modules/mob/living/carbon/brain/life.dm @@ -141,7 +141,7 @@ drowsyness-- eye_blurry = max(2, eye_blurry) if (prob(5)) - sleeping = 1 + sleeping += 1 Paralyse(5) confused = max(0, confused - 1) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index cb42ba9b436..12af315a253 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -228,10 +228,10 @@ if (istype(src,/mob/living/carbon/human) && src:w_uniform) var/mob/living/carbon/human/H = src H.w_uniform.add_fingerprint(M) - src.sleeping = max(0,src.sleeping-5) if(!src.sleeping_willingly) - src.sleeping = 0 - src.resting = 0 + src.sleeping = max(0,src.sleeping-5) + if(src.sleeping == 0) + src.resting = 0 AdjustParalysis(-3) AdjustStunned(-3) AdjustWeakened(-3) diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm index 0eae0dd45d8..fc6980a7891 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -164,7 +164,9 @@ if ("faint") message = "[src] faints." - src.sleeping = 1 + if(src.sleeping) + return //Can't faint while asleep + src.sleeping += 10 //Short-short nap m_type = 1 if ("cough") diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 317e9824c8e..4d4b9e923c0 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -545,7 +545,7 @@ if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit Paralyse(3) // 3 gives them one second to wake up and run away a bit! if(SA_pp > SA_sleep_min) // Enough to make us sleep as well - sleeping = max(sleeping, 4) + sleeping = max(src.sleeping+2, 10) else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20) && isbreathing) spawn(0) emote(pick("giggle", "laugh")) @@ -819,7 +819,7 @@ drowsyness-- eye_blurry = max(2, eye_blurry) if (prob(5)) - sleeping = 1 + sleeping += 1 Paralyse(5) confused = max(0, confused - 1) diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index ab616822cee..64bad12d893 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -333,7 +333,7 @@ if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit Paralyse(3) // 3 gives them one second to wake up and run away a bit! if(SA_pp > SA_sleep_min) // Enough to make us sleep as well - src.sleeping = max(src.sleeping, 2) + src.sleeping = max(src.sleeping+2, 10) else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning if(prob(20)) spawn(0) emote(pick("giggle", "laugh")) diff --git a/code/modules/mob/say.dm b/code/modules/mob/say.dm index f036910eef8..f8e9fb94320 100644 --- a/code/modules/mob/say.dm +++ b/code/modules/mob/say.dm @@ -52,6 +52,8 @@ return 0 /mob/proc/say_quote(var/text) + if(!text) + return "says, \"...\""; //not the best solution, but it will stop a large number of runtimes. The cause is somewhere in the Tcomms code var/ending = copytext(text, length(text)) if (src.disease_symptoms & DISEASE_HOARSE) return "rasps, \"[text]\""; @@ -63,7 +65,7 @@ return "gibbers, \"[text]\""; if (ending == "?") return "asks, \"[text]\""; - else if (ending == "!") + if (ending == "!") return "exclaims, \"[text]\""; return "says, \"[text]\""; diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 07343b0c6c8..4cc9c33b0a5 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -439,13 +439,13 @@ usr.pulling = null if("sleep") if(usr.sleeping && usr.sleeping_willingly) - usr.sleeping = 0 - usr.sleeping_willingly = 0 + return else if(!usr.sleeping) - usr.sleeping = 1 + usr.sleeping = 20 //Short nap usr.sleeping_willingly = 1 if("rest") - usr.resting = !usr.resting + usr.resting = !( usr.resting ) + //kavala2 if("throw") if (!usr.stat && isturf(usr.loc) && !usr.restrained()) usr:toggle_throw_mode()