Skip to content

Commit

Permalink
More detailed medical hud + dead body defibbable examine (ColonialMar…
Browse files Browse the repository at this point in the history
  • Loading branch information
LaKiller8 authored and Rohesie committed Nov 19, 2018
1 parent 63bc792 commit e49459e
Show file tree
Hide file tree
Showing 10 changed files with 133 additions and 112 deletions.
188 changes: 101 additions & 87 deletions code/controllers/settings/configuration.dm

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,20 @@ var/datum/mob_hud/huds = list(
holder2.icon_state = "hudsynth"
holder3.icon_state = "hudsynth"
else
var/datum/limb/head = get_limb("head")
var/datum/internal_organ/heart/heart = internal_organs_by_name["heart"]
var/revive_enabled = 1
if(world.time - timeofdeath > revive_grace_period || undefibbable)
revive_enabled = 0
else
if(suiciding || !head || !head.is_usable() || !heart || heart.is_broken() || !has_brain() || chestburst || (HUSK in mutations) || !mind)
revive_enabled = 0
else if(!client)
var/mob/dead/observer/G = get_ghost()
if(!istype(G))
revive_enabled = 0
var/revive_enabled = TRUE
var/stage = 1
if(!check_tod() || !is_revivable())
revive_enabled = FALSE
else if(!client)
var/mob/dead/observer/G = get_ghost()
if(!istype(G))
revive_enabled = FALSE

if(stat == DEAD && !undefibbable)
if((world.time - timeofdeath) > (config.revive_grace_period * 0.4) && (world.time - timeofdeath) < (config.revive_grace_period * 0.8))
stage = 2
else if((world.time - timeofdeath) > (config.revive_grace_period * 0.8))
stage = 3

var/holder2_set = 0
if(status_flags & XENO_HOST)
Expand All @@ -290,14 +292,14 @@ var/datum/mob_hud/huds = list(

if(stat == DEAD)
if(revive_enabled)
holder.icon_state = "huddeaddefib"
holder.icon_state = "huddeaddefib[stage]"
if(!holder2_set)
holder2.icon_state = "huddeaddefib"
holder2.icon_state = "huddeaddefib[stage]"
holder3.icon_state = "huddead"
holder2_set = 1
else
holder.icon_state = "huddead"
if(!holder2_set || world.time - timeofdeath > revive_grace_period || undefibbable)
if(!holder2_set || check_tod())
holder2.icon_state = "huddead"
holder3.icon_state = "huddead"
holder2_set = 1
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/devices/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
return (FIRELOSS)

/mob/living/carbon/human/proc/check_tod()
if(!undefibbable && world.time <= timeofdeath + revive_grace_period)
return 1
return 0
if(!undefibbable && world.time <= timeofdeath + config.revive_grace_period)
return TRUE
return FALSE

/obj/item/device/defibrillator/New()
sparks.set_up(5, 0, src)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/scanners.dm
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ REAGENT SCANNER
//Check for whether there's an appropriate ghost
if(H.client)
//Calculate revival status/time left
var/revive_timer = round((H.timeofdeath + H.revive_grace_period - world.time) * 0.1)
var/revive_timer = round((H.timeofdeath + config.revive_grace_period - world.time) * 0.1)
if(revive_timer < 60) //Almost out of time; urgency required.
death_message = "<b>CRITICAL: Brain death imminent.</b> Reduce total injury value to sub-200 and administer defibrillator to unarmoured chest <b>immediately</b>."
else if(revive_timer < 120) //Running out of time; increase urgency of message.
Expand Down
4 changes: 3 additions & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@
var/distance = get_dist(user,src)
if(istype(user, /mob/dead/observer) || user.stat == DEAD) // ghosts can see anything
distance = 1
if (stat)
if(stat)
msg += "<span class='warning'>[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.</span>\n"
if((stat == 2 || src.health < config.health_threshold_crit) && distance <= 3)
msg += "<span class='warning'>[t_He] does not appear to be breathing.</span>\n"
if(undefibbable && distance <= 1)
msg += "<span class='deadsay'>[t_He] [t_has] gone cold.</span>\n"
if(ishuman(user) && !user.stat && Adjacent(user))
user.visible_message("<b>[user]</b> checks [src]'s pulse.", "You check [src]'s pulse.", null, 4)
spawn(15)
Expand Down
1 change: 0 additions & 1 deletion code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
var/pressure_alert = 0
var/prev_gender = null // Debug for plural genders
var/temperature_alert = 0
var/revive_grace_period = 3000 //In deciseconds. Set to 5 minutes
var/undefibbable = FALSE //whether the human is dead and past the defibbrillation period.

var/holo_card_color = "" //which color type of holocard is printed on us
Expand Down
8 changes: 6 additions & 2 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,14 @@
species.handle_unique_behavior(src)

else //Dead
if(!undefibbable)
if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > revive_grace_period)) //We are dead beyond revival, or we're junk mobs spawned like the clowns on the clown shuttle
if(!undefibbable && timeofdeath && life_tick > 5 && life_tick % 2 == 0)
if(timeofdeath < 5 || !check_tod()) //We are dead beyond revival, or we're junk mobs spawned like the clowns on the clown shuttle
undefibbable = TRUE
med_hud_set_status()
else if((world.time - timeofdeath) > (config.revive_grace_period * 0.4) && (world.time - timeofdeath) < (config.revive_grace_period * 0.8))
med_hud_set_status()
else if((world.time - timeofdeath) > (config.revive_grace_period * 0.8))
med_hud_set_status()

else
handle_stasis_bag()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/Castes/Queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
if(victim.stat != DEAD) //Not dead yet.
to_chat(src, "<span class='xenowarning'>The host and child are still alive!</span>")
return
else if(istype(H) && ( world.time <= H.timeofdeath + H.revive_grace_period )) //Dead, but the host can still hatch, possibly.
else if(istype(H) && !H.check_tod()) //Dead, but the host can still hatch, possibly.
to_chat(src, "<span class='xenowarning'>The child may still hatch! Not yet!</span>")
return

Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/xenomorph/Embryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
if(affected_mob.stat == DEAD)
if(ishuman(affected_mob))
var/mob/living/carbon/human/H = affected_mob
if(world.time > H.timeofdeath + H.revive_grace_period) //Can't be defibbed.
if(H.check_tod()) //Can't be defibbed.
var/mob/living/carbon/Xenomorph/Larva/L = locate() in affected_mob
if(L)
L.chest_burst(affected_mob)
Expand Down
Binary file modified icons/mob/hud.dmi
Binary file not shown.

0 comments on commit e49459e

Please sign in to comment.