mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Fixes the knockout trait and simple mob sleeping (#18567)
* makes the knockout work * forgot to remove the calls here
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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]")
|
||||
|
||||
@@ -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]")
|
||||
|
||||
@@ -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(.)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user