mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-11 01:51:51 +00:00
Brings over update_stat
This commit is contained in:
8
code/modules/mob/living/carbon/brain/update_status.dm
Normal file
8
code/modules/mob/living/carbon/brain/update_status.dm
Normal file
@@ -0,0 +1,8 @@
|
||||
/mob/living/carbon/brain/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
// if(health <= min_health)
|
||||
if(health <= config.health_threshold_dead)
|
||||
if(stat != DEAD)
|
||||
death()
|
||||
// Put brain(organ) damaging code here
|
||||
17
code/modules/mob/living/carbon/update_status.dm
Normal file
17
code/modules/mob/living/carbon/update_status.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/mob/living/carbon/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(stat != DEAD)
|
||||
// if(health <= min_health)
|
||||
if(health <= config.health_threshold_dead)
|
||||
death()
|
||||
return
|
||||
// if(paralysis || sleeping || getOxyLoss() > low_oxy_ko || (status_flags & FAKEDEATH) || health <= crit_health)
|
||||
if(paralysis || sleeping || getOxyLoss() > 40 || (status_flags & FAKEDEATH) || health <= config.health_threshold_crit)
|
||||
if(stat == CONSCIOUS)
|
||||
KnockOut()
|
||||
else
|
||||
if(stat == UNCONSCIOUS)
|
||||
// updating=FALSE because `WakeUp` will handle canmove up for us
|
||||
StopResting(updating=FALSE)
|
||||
WakeUp()
|
||||
@@ -310,14 +310,6 @@
|
||||
C.reagents.clear_reagents()
|
||||
C.reagents.addiction_list.Cut()
|
||||
|
||||
/mob/living/proc/update_revive() // handles revival through other means than cloning or adminbus (defib, IPC repair)
|
||||
stat = CONSCIOUS
|
||||
dead_mob_list -= src
|
||||
living_mob_list |= src
|
||||
mob_list |= src
|
||||
SetEarDeaf(0)
|
||||
timeofdeath = null
|
||||
|
||||
/mob/living/proc/rejuvenate()
|
||||
var/mob/living/carbon/human/human_mob = null //Get this declared for use later.
|
||||
|
||||
|
||||
10
code/modules/mob/living/silicon/ai/update_status.dm
Normal file
10
code/modules/mob/living/silicon/ai/update_status.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
/mob/living/silicon/ai/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(stat != DEAD)
|
||||
if(health <= config.health_threshold_dead)
|
||||
death()
|
||||
return
|
||||
else if(stat == UNCONSCIOUS)
|
||||
WakeUp()
|
||||
//diag_hud_set_status()
|
||||
3
code/modules/mob/living/silicon/pai/update_status.dm
Normal file
3
code/modules/mob/living/silicon/pai/update_status.dm
Normal file
@@ -0,0 +1,3 @@
|
||||
/mob/living/silicon/pai/update_stat()
|
||||
if(health <= 0)
|
||||
death(gibbed = 0)
|
||||
10
code/modules/mob/living/silicon/robot/drone/update_status.dm
Normal file
10
code/modules/mob/living/silicon/robot/drone/update_status.dm
Normal file
@@ -0,0 +1,10 @@
|
||||
//Easiest to check this here, then check again in the robot proc.
|
||||
//Standard robots use config for crit, which is somewhat excessive for these guys.
|
||||
//Drones killed by damage will gib.
|
||||
/mob/living/silicon/robot/drone/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(health <= -35 && stat != DEAD)
|
||||
gib()
|
||||
return
|
||||
return ..()
|
||||
@@ -2,3 +2,20 @@
|
||||
/mob/living/silicon/robot/incapacitated()
|
||||
if(stat || lockcharge || weakened || stunned || paralysis || !is_component_functioning("actuator"))
|
||||
return 1
|
||||
|
||||
/mob/living/silicon/robot/update_stat()
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
if(stat != DEAD)
|
||||
if(health <= -maxHealth) //die only once
|
||||
death()
|
||||
return
|
||||
if(!is_component_functioning("actuator") || paralysis || sleeping || stunned || weakened || getOxyLoss() > maxHealth * 0.5)
|
||||
if(stat == CONSCIOUS)
|
||||
KnockOut()
|
||||
else
|
||||
if(stat == UNCONSCIOUS)
|
||||
WakeUp()
|
||||
// diag_hud_set_status()
|
||||
// diag_hud_set_health()
|
||||
// update_health_hud()
|
||||
|
||||
50
code/modules/mob/living/stat_states.dm
Normal file
50
code/modules/mob/living/stat_states.dm
Normal file
@@ -0,0 +1,50 @@
|
||||
// There, now `stat` is a proper state-machine
|
||||
|
||||
/mob/living/proc/KnockOut(updating = 1)
|
||||
if(stat == DEAD)
|
||||
log_runtime(EXCEPTION("KnockOut called on a dead mob."), src)
|
||||
return 0
|
||||
else if(stat == UNCONSCIOUS)
|
||||
return 0
|
||||
add_logs(src, null, "fallen unconscious at [atom_loc_line(get_turf(src))]", admin=0)
|
||||
stat = UNCONSCIOUS
|
||||
if(updating)
|
||||
// update_blind_effects()
|
||||
update_canmove()
|
||||
return 1
|
||||
|
||||
/mob/living/proc/WakeUp(updating = 1)
|
||||
if(stat == DEAD)
|
||||
log_runtime(EXCEPTION("WakeUp called on a dead mob."), src)
|
||||
return 0
|
||||
else if(stat == CONSCIOUS)
|
||||
return 0
|
||||
add_logs(src, null, "woken up at [atom_loc_line(get_turf(src))]", admin=0)
|
||||
stat = CONSCIOUS
|
||||
if(updating)
|
||||
// update_blind_effects()
|
||||
update_canmove()
|
||||
return 1
|
||||
|
||||
/mob/living/proc/can_be_revived()
|
||||
. = TRUE
|
||||
// if(health <= min_health)
|
||||
if(health <= config.health_threshold_dead)
|
||||
return FALSE
|
||||
|
||||
// death() is used to make a mob die
|
||||
|
||||
// handles revival through other means than cloning or adminbus (defib, IPC repair)
|
||||
/mob/living/proc/update_revive()
|
||||
if(stat != DEAD)
|
||||
return
|
||||
if(!can_be_revived())
|
||||
return
|
||||
add_logs(src, null, "came back to life at [atom_loc_line(get_turf(src))]", admin=0)
|
||||
stat = CONSCIOUS
|
||||
dead_mob_list -= src
|
||||
living_mob_list += src
|
||||
timeofdeath = null
|
||||
update_canmove()
|
||||
// update_blind_effects()
|
||||
updatehealth()
|
||||
Reference in New Issue
Block a user