diff --git a/code/modules/chemical/Chemistry-Reagents.dm b/code/modules/chemical/Chemistry-Reagents.dm index 842362c5152..061ece24211 100644 --- a/code/modules/chemical/Chemistry-Reagents.dm +++ b/code/modules/chemical/Chemistry-Reagents.dm @@ -394,7 +394,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) @@ -2223,7 +2223,7 @@ datum ..() M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - 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(5) @@ -2242,7 +2242,7 @@ datum M.dizziness = max(0,M.dizziness-2) M:drowsyness = max(0,M:drowsyness-1) M:jitteriness = max(0,M:jitteriness-3) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-1) if(M:getToxLoss() && prob(20)) M:adjustToxLoss(-1) if (M.bodytemperature < 310) //310 is the normal bodytemp. 310.055 @@ -2261,7 +2261,7 @@ datum ..() M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - 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(5) @@ -2279,7 +2279,7 @@ datum ..() M.dizziness = max(0,M.dizziness-2) M:drowsyness = max(0,M:drowsyness-1) - 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 @@ -2313,7 +2313,7 @@ datum M.druggy = max(M.druggy, 30) M.dizziness +=5 M:drowsyness = 0 - 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 @@ -2329,7 +2329,7 @@ datum on_mob_life(var/mob/living/M as mob) M:drowsyness = max(0,M:drowsyness-7) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-1) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) M.make_jittery(5) @@ -2346,7 +2346,7 @@ datum on_mob_life(var/mob/living/M as mob) M:drowsyness = max(0,M:drowsyness-7) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) M.make_jittery(5) @@ -2614,7 +2614,7 @@ datum on_mob_life(var/mob/living/M as mob) M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0 + M:sleeping = max(0,M.sleeping-2) if (M.bodytemperature > 310) M.bodytemperature = max(310, M.bodytemperature-5) ..() @@ -2630,7 +2630,7 @@ datum on_mob_life(var/mob/living/M as mob) M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0//Copy-paste from Coffee, derp + M:sleeping = max(0,M.sleeping-2)//Copy-paste from Coffee, derp M.make_jittery(5) ..() return @@ -2703,7 +2703,6 @@ datum on_mob_life(var/mob/living/M as mob) M.dizziness = max(0,M.dizziness-5) M:drowsyness = max(0,M:drowsyness-3) - M:sleeping = 0 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 b7d224dec56..62035c47bdc 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -714,7 +714,7 @@ In all, this is a lot like the monkey code. /N switch(M.a_intent) if ("help") - 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 6760429a780..3e6f48dc1bd 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 e4a5e0a16ae..eb27d1ffe6f 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -468,7 +468,7 @@ switch(M.a_intent) if ("help") - 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 5f381f75e35..054208e2f08 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 ef7a98d2976..1169c8e6176 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 1bf229c96cb..657ca1c1b57 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -201,8 +201,9 @@ 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 = 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 b8b6f25bbf5..38bcdf6d4c6 100644 --- a/code/modules/mob/living/carbon/human/emote.dm +++ b/code/modules/mob/living/carbon/human/emote.dm @@ -141,7 +141,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 ab9e69eeaef..a74d814447a 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -330,7 +330,7 @@ return null update_canmove() - if(paralysis || stunned || weakened || buckled || (changeling && changeling.changeling_fakedeath)) + if(paralysis || stunned || weakened || resting || buckled || (changeling && changeling.changeling_fakedeath)) canmove = 0 else canmove = 1 @@ -416,7 +416,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, 2) + 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")) @@ -692,7 +692,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 97506dbfbee..d12c4e6b365 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -328,7 +328,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")) @@ -406,7 +406,7 @@ src.drowsyness-- src.eye_blurry = max(2, src.eye_blurry) if (prob(5)) - src.sleeping = 1 + src.sleeping += 1 Paralyse(5) confused = max(0, confused - 1) diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 6058e70df91..08dc7eb9253 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -410,9 +410,13 @@ if("pull") usr.pulling = null if("sleep") - usr.sleeping = !( usr.sleeping ) + if(usr.sleeping) + return + else + usr.sleeping = 20 //Short nap if("rest") usr.resting = !( usr.resting ) + //kavala2 if("throw") if (!usr.stat && isturf(usr.loc) && !usr.restrained()) usr:toggle_throw_mode() diff --git a/html/changelog.html b/html/changelog.html index c560ed169ad..9aac8f2d490 100644 --- a/html/changelog.html +++ b/html/changelog.html @@ -93,6 +93,14 @@ Stuff which is in development and not yet visible to players or just code relate should be listed in the changelog upon commit tho. Thanks. --> +