diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 722b76ea48d..a7bd33b82e2 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -539,10 +539,10 @@ . = ..() if(!.) return - ADD_TRAIT(src, TRAIT_KNOCKEDOUT, "[id]") + ADD_TRAIT(owner, TRAIT_KNOCKEDOUT, "[id]") /datum/status_effect/incapacitating/sleeping/on_remove() - REMOVE_TRAIT(src, TRAIT_KNOCKEDOUT, "[id]") + REMOVE_TRAIT(owner, TRAIT_KNOCKEDOUT, "[id]") return ..() /datum/status_effect/incapacitating/sleeping/tick() diff --git a/code/modules/mob/living/carbon/update_status.dm b/code/modules/mob/living/carbon/update_status.dm index d35bed582a2..541bce6eaf1 100644 --- a/code/modules/mob/living/carbon/update_status.dm +++ b/code/modules/mob/living/carbon/update_status.dm @@ -6,7 +6,7 @@ death() create_debug_log("died of damage, trigger reason: [reason]") return - if(IsParalyzed() || IsSleeping() || (check_death_method() && getOxyLoss() > 50) || HAS_TRAIT(src, TRAIT_FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT && check_death_method()) + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || (check_death_method() && getOxyLoss() > 50) || HAS_TRAIT(src, TRAIT_FAKEDEATH) || health <= HEALTH_THRESHOLD_CRIT && check_death_method()) if(stat == CONSCIOUS) KnockOut() create_debug_log("fell unconscious, trigger reason: [reason]") diff --git a/code/modules/mob/living/silicon/ai/update_status.dm b/code/modules/mob/living/silicon/ai/update_status.dm index 7f8d90d783c..9ed49c97c01 100644 --- a/code/modules/mob/living/silicon/ai/update_status.dm +++ b/code/modules/mob/living/silicon/ai/update_status.dm @@ -6,9 +6,10 @@ death() create_debug_log("died of damage, trigger reason: [reason]") return - else if(IsSleeping()) //Required for adminfreezing - KnockOut() - create_debug_log("fell unconscious, trigger reason: [reason]") + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) + if(stat == CONSCIOUS) + KnockOut() + create_debug_log("fell unconscious, trigger reason: [reason]") else if(stat == UNCONSCIOUS) WakeUp() create_debug_log("woke up, trigger reason: [reason]") diff --git a/code/modules/mob/living/silicon/robot/update_status.dm b/code/modules/mob/living/silicon/robot/update_status.dm index f762270a00f..f8038f07ea5 100644 --- a/code/modules/mob/living/silicon/robot/update_status.dm +++ b/code/modules/mob/living/silicon/robot/update_status.dm @@ -14,15 +14,13 @@ death() create_debug_log("died of damage, trigger reason: [reason]") return - if(!is_component_functioning("actuator") || !is_component_functioning("power cell") || HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || IsStunned() || IsWeakened() || IsSleeping() || getOxyLoss() > maxHealth * 0.5) // Borgs need to be able to sleep for adminfreeze + if(!is_component_functioning("actuator") || !is_component_functioning("power cell") || HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || IsStunned() || IsWeakened() || getOxyLoss() > maxHealth * 0.5) // Borgs need to be able to sleep for adminfreeze if(stat == CONSCIOUS) KnockOut() - update_headlamp() create_debug_log("fell unconscious, trigger reason: [reason]") else if(stat == UNCONSCIOUS) WakeUp() - update_headlamp() create_debug_log("woke up, trigger reason: [reason]") else if(health > 0) @@ -38,6 +36,15 @@ diag_hud_set_health() update_health_hud() +/mob/living/silicon/robot/KnockOut(updating = TRUE) + . = ..() + update_headlamp() + +/mob/living/silicon/robot/WakeUp(updating = TRUE) + . = ..() + update_headlamp() + + /mob/living/silicon/robot/update_revive(updating = TRUE) . = ..(updating) if(.) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 53d92214bb4..02ec6dca1d3 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -188,9 +188,11 @@ death() create_debug_log("died of damage, trigger reason: [reason]") else - if(IsSleeping() && (stat == CONSCIOUS)) - KnockOut() - else + if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) + if(stat == CONSCIOUS) + KnockOut() + create_debug_log("knocked out, trigger reason: [reason]") + else if(stat == UNCONSCIOUS) WakeUp() create_debug_log("woke up, trigger reason: [reason]") med_hud_set_status()