mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 12:08:55 +01:00
Uses the new trait system on some chems (#34893)
* Uses the new trait system on some chems
This commit is contained in:
committed by
vuonojenmustaturska
parent
add799e571
commit
d679d7bee1
@@ -68,32 +68,35 @@
|
||||
return S.duration - world.time
|
||||
return 0
|
||||
|
||||
/mob/living/proc/Sleeping(amount, updating = TRUE) //Can't go below remaining duration
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration = max(world.time + amount, S.duration)
|
||||
else if(amount > 0)
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/SetSleeping(amount, updating = TRUE) //Sets remaining duration
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(amount <= 0)
|
||||
/mob/living/proc/Sleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Can't go below remaining duration
|
||||
if((!has_trait(TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
qdel(S)
|
||||
else if(S)
|
||||
S.duration = world.time + amount
|
||||
else
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
S.duration = max(world.time + amount, S.duration)
|
||||
else if(amount > 0)
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/AdjustSleeping(amount, updating = TRUE) //Adds to remaining duration
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration += amount
|
||||
else if(amount > 0)
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
/mob/living/proc/SetSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Sets remaining duration
|
||||
if((!has_trait(TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(amount <= 0)
|
||||
if(S)
|
||||
qdel(S)
|
||||
else if(S)
|
||||
S.duration = world.time + amount
|
||||
else
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/mob/living/proc/AdjustSleeping(amount, updating = TRUE, ignore_sleepimmune = FALSE) //Adds to remaining duration
|
||||
if((!has_trait(TRAIT_SLEEPIMMUNE)) || ignore_sleepimmune)
|
||||
var/datum/status_effect/incapacitating/sleeping/S = IsSleeping()
|
||||
if(S)
|
||||
S.duration += amount
|
||||
else if(amount > 0)
|
||||
S = apply_status_effect(STATUS_EFFECT_SLEEPING, amount, updating)
|
||||
return S
|
||||
|
||||
/////////////////////////////////// RESTING ////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user