Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medical scans will now show heartbroken status #6833

Merged
merged 4 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/datums/mob_hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ GLOBAL_LIST_INIT_TYPED(huds, /datum/mob_hud, list(
holder3.icon_state = "huddead"
holder2_set = 1
else
if(heart && (heart.organ_status >= ORGAN_BROKEN && check_tod())) // broken heart icon
if(heart && (heart.organ_status >= ORGAN_BROKEN && check_tod() && is_revivable(ignore_heart = TRUE))) // broken heart icon
Drulikar marked this conversation as resolved.
Show resolved Hide resolved
holder.icon_state = "huddeadheart"
if(!holder2_set)
holder2.icon_state = "huddeadheart"
Expand Down Expand Up @@ -784,7 +784,7 @@ GLOBAL_DATUM(hud_icon_hudfocus, /image)
// Vampire Execute HUD
/mob/living/carbon/human/proc/update_execute_hud()
var/image/execute_holder = hud_list[XENO_EXECUTE]

execute_holder.icon_state = "hudblank"
execute_holder.overlays.Cut()

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/devices/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@
if(ghost && (!check_client || ghost.client) && (!check_can_reenter || ghost.can_reenter_corpse))
return ghost

/mob/living/carbon/human/proc/is_revivable()
/mob/living/carbon/human/proc/is_revivable(ignore_heart = FALSE)
if(isnull(internal_organs_by_name) || isnull(internal_organs_by_name["heart"]))
return FALSE
var/datum/internal_organ/heart/heart = internal_organs_by_name["heart"]
var/obj/limb/head = get_limb("head")

if(chestburst || !head || head.status & LIMB_DESTROYED || !heart || heart.organ_status >= ORGAN_BROKEN || !has_brain() || status_flags & PERMANENTLY_DEAD)
if(chestburst || !head || head.status & LIMB_DESTROYED || !ignore_heart && (!heart || heart.organ_status >= ORGAN_BROKEN) || !has_brain() || status_flags & PERMANENTLY_DEAD)
return FALSE
return TRUE

Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -943,9 +943,10 @@

..()

/// Returns whether this person has a broken heart but is otherwise revivable
/mob/living/carbon/human/proc/is_heart_broken()
VileBeggar marked this conversation as resolved.
Show resolved Hide resolved
var/datum/internal_organ/heart/heart = internal_organs_by_name["heart"]
return heart && heart.organ_status >= ORGAN_BROKEN && check_tod()
return heart && heart.organ_status >= ORGAN_BROKEN && check_tod() && is_revivable(ignore_heart = TRUE)

/mob/living/carbon/human/proc/is_lung_ruptured()
var/datum/internal_organ/lungs/L = internal_organs_by_name["lungs"]
Expand Down
Loading