From 582c7923a7e9cefaaf38bd2d2ace75ace336d3de Mon Sep 17 00:00:00 2001 From: Mike Long Date: Wed, 18 Sep 2019 12:11:33 -0400 Subject: [PATCH] Sleeping is now improved if you have a bedsheet. Sleeping also now helps recover stamina regardless of injury level. (#46550) --- code/datums/status_effects/debuffs.dm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 0533fea686f..2452d68b187 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -69,17 +69,21 @@ /datum/status_effect/incapacitating/sleeping/tick() if(owner.maxHealth) var/health_ratio = owner.health / owner.maxHealth - if(health_ratio > 0.8) - var/healing = -0.2 - if((locate(/obj/structure/bed) in owner.loc)) - healing -= 0.3 - else - if((locate(/obj/structure/table) in owner.loc)) - healing -= 0.1 + var/healing = -0.2 + if((locate(/obj/structure/bed) in owner.loc)) + healing -= 0.3 + else if((locate(/obj/structure/table) in owner.loc)) + healing -= 0.1 + for(var/obj/item/bedsheet/bedsheet in range(owner.loc,0)) + if(bedsheet.loc != owner.loc) //bedsheets in your backpack/neck don't give you comfort + continue + healing -= 0.1 + break //Only count the first bedsheet + if(health_ratio > 0.8) owner.adjustBruteLoss(healing) owner.adjustFireLoss(healing) owner.adjustToxLoss(healing * 0.5, TRUE, TRUE) - owner.adjustStaminaLoss(healing) + owner.adjustStaminaLoss(healing) if(human_owner && human_owner.drunkenness) human_owner.drunkenness *= 0.997 //reduce drunkenness by 0.3% per tick, 6% per 2 seconds if(prob(20))