diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm index 5aa21e78ce6..5d5e68d2dff 100644 --- a/code/game/objects/structures/bedsheet_bin.dm +++ b/code/game/objects/structures/bedsheet_bin.dm @@ -21,6 +21,7 @@ LINEN BINS var/list/dream_messages = list("white") var/list/nightmare_messages = list("black") + var/comfort = 0.5 diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index d58888d6e24..37a30557347 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -7,6 +7,7 @@ icon_state = "nest" var/health = 100 var/image/nest_overlay + comfort = 0 /obj/structure/stool/bed/nest/New() nest_overlay = image('icons/mob/alien.dmi', "nestoverlay", layer=MOB_LAYER - 0.2) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index b76cd70d57b..96fd7811e75 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -7,6 +7,7 @@ buildstackamount = 1 buckle_offset = 0 var/propelled = 0 // Check for fire-extinguisher-driven chairs + comfort = 0 /obj/structure/stool/bed/chair/New() ..() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 21f087eeeee..a2de971a6e1 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -354,6 +354,22 @@ if(..()) handle_dreams() adjustStaminaLoss(-10) + var/comfort = 1 + if(istype(buckled, /obj/structure/stool/bed)) + var/obj/structure/stool/bed/bed = buckled + comfort+= bed.comfort + for(var/obj/item/weapon/bedsheet/bedsheet in range(loc,0)) + if(bedsheet.loc != loc) //bedsheets in your backpack/neck don't give you comfort + continue + comfort+= bedsheet.comfort + break //Only count the first bedsheet + if(drunk) + comfort += 1 //Aren't naps SO much better when drunk? + AdjustDrunk(1-0.0015*comfort) //reduce drunkenness ~6% per two seconds, when on floor. + if(prob(3)) + if(comfort>1)//You don't heal if you're just sleeping on the floor without a blanket. + adjustBruteLoss(-1*comfort) + adjustFireLoss(-1*comfort) if(prob(10) && health && hal_screwyhud != SCREWYHUD_CRIT) emote("snore") // Keep SSD people asleep