Sleeping is now improved if you have a bedsheet. Sleeping also now helps recover stamina regardless of injury level. (#46550)

This commit is contained in:
Mike Long
2019-09-18 12:11:33 -04:00
committed by moo
parent dfe8da7c5d
commit 582c7923a7
+12 -8
View File
@@ -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))