Skip to content

Commit

Permalink
Health Analyzer Rework (medial mains inquire within) (#86666)
Browse files Browse the repository at this point in the history
# Conflicts:
#	code/__DEFINES/chat.dm
#	code/__DEFINES/surgery.dm
#	code/datums/status_effects/debuffs/genetic_damage.dm
#	code/datums/wounds/_wounds.dm
#	code/datums/wounds/burns.dm
#	code/datums/wounds/cranial_fissure.dm
#	code/game/objects/items/devices/scanners/autopsy_scanner.dm
#	code/game/objects/items/devices/scanners/health_analyzer.dm
#	code/modules/antagonists/heretic/items/corrupted_organs.dm
#	code/modules/language/_language_holder.dm
#	code/modules/mob/living/basic/lavaland/legion/legion_tumour.dm
#	code/modules/mob/living/brain/brain_item.dm
#	code/modules/surgery/organs/_organ.dm
#	code/modules/surgery/organs/appendix.dm
#	code/modules/surgery/organs/internal/ears/_ears.dm
#	code/modules/surgery/organs/internal/eyes/_eyes.dm
#	code/modules/surgery/organs/internal/heart/_heart.dm
  • Loading branch information
MrMelbert authored and RimiNosha committed Nov 10, 2024
1 parent 291a4b8 commit 7348f44
Show file tree
Hide file tree
Showing 19 changed files with 464 additions and 226 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/chat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@
#define debug_world_log(msg) if (GLOB.Debug2) log_world("DEBUG: [msg]")
/// Adds a generic box around whatever message you're sending in chat. Really makes things stand out.
#define examine_block(str) ("<div class='examine_block'>" + str + "</div>")
/// Helper which creates a chat message which may have a tooltip in some contexts, but not others.
#define conditional_tooltip(normal_text, tooltip_text, condition) ((condition) ? (span_tooltip(tooltip_text, normal_text)) : (normal_text))
2 changes: 2 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(
#define BODY_ZONE_PRECISE_L_FOOT "l_foot"
#define BODY_ZONE_PRECISE_R_FOOT "r_foot"

GLOBAL_LIST_INIT(all_body_zones, list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG))

//We will round to this value in damage calculations.
#define DAMAGE_PRECISION 0.1

Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/surgery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#define ORGAN_SYNTHETIC_EMP (1<<5)
///Can't be removed using surgery
#define ORGAN_UNREMOVABLE (1<<6)
/// An organ that is ostensibly dangerous when inside a body
#define ORGAN_HAZARDOUS (1<<7)
/// Can't be seen by scanners
#define ORGAN_HIDDEN (1<<8)

// Flags for the bodypart_flags var on /obj/item/bodypart
/// Bodypart cannot be dismembered or amputated
Expand Down
8 changes: 8 additions & 0 deletions code/datums/components/irradiated.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
/datum/component/irradiated/RegisterWithParent()
RegisterSignal(parent, COMSIG_COMPONENT_CLEAN_ACT, PROC_REF(on_clean))
RegisterSignal(parent, COMSIG_GEIGER_COUNTER_SCAN, PROC_REF(on_geiger_counter_scan))
RegisterSignal(parent, COMSIG_LIVING_HEALTHSCAN, PROC_REF(on_healthscan))

/datum/component/irradiated/UnregisterFromParent()
UnregisterSignal(parent, list(
COMSIG_COMPONENT_CLEAN_ACT,
COMSIG_GEIGER_COUNTER_SCAN,
COMSIG_LIVING_HEALTHSCAN,
))

/datum/component/irradiated/Destroy(force, silent)
Expand Down Expand Up @@ -186,6 +188,12 @@

return COMSIG_GEIGER_COUNTER_SCAN_SUCCESSFUL

/datum/component/irradiated/proc/on_healthscan(datum/source, list/render_list, advanced, mob/user, mode, tochat)
SIGNAL_HANDLER

render_list += conditional_tooltip("<span class='alert ml-1'>Subject is irradiated.</span>", "Supply antiradiation or antitoxin, such as [/datum/reagent/medicine/potass_iodide::name] or [/datum/reagent/medicine/pen_acid::name].", tochat)
render_list += "<br>"

/atom/movable/screen/alert/irradiated
name = "Irradiated"
desc = "You're irradiated! Heal your toxins quick, and stand under a shower to halt the incoming damage."
Expand Down
3 changes: 2 additions & 1 deletion code/datums/quirks/_quirk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@
* Arguments:
* * Medical- If we want the long, fancy descriptions that show up in medical records, or if not, just the name
* * Category- Which types of quirks we want to print out. Defaults to everything
* * from_scan- If this call originates from a medical scanner. Currently unused.
*/
/mob/living/proc/get_quirk_string(medical, category = CAT_QUIRK_ALL) //helper string. gets a string of all the quirks the mob has
/mob/living/proc/get_quirk_string(medical, category = CAT_QUIRK_ALL, from_scan = FALSE) //helper string. gets a string of all the quirks the mob has
var/list/dat = list()
switch(category)
if(CAT_QUIRK_ALL)
Expand Down
6 changes: 3 additions & 3 deletions code/datums/status_effects/debuffs/hallucination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
))

/// Signal proc for [COMSIG_LIVING_HEALTHSCAN]. Show we're hallucinating to (advanced) scanners.
/datum/status_effect/hallucination/proc/on_health_scan(datum/source, list/render_list, advanced, mob/user, mode)
/datum/status_effect/hallucination/proc/on_health_scan(datum/source, list/render_list, advanced, mob/user, mode, tochat)
SIGNAL_HANDLER

if(!advanced)
return

render_list += "<span class='info ml-1'>Subject is hallucinating.</span>\n"
render_list += conditional_tooltip("<span class='info ml-1'>Subject is hallucinating.</span>", "Supply antipsychotic medication.", tochat)
render_list += "<br>"

/// Signal proc for [COMSIG_CARBON_CHECKING_BODYPART],
/// checking bodyparts while hallucinating can cause them to appear more damaged than they are
Expand Down
17 changes: 14 additions & 3 deletions code/datums/wounds/_wounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
var/desc = ""
/// The basic treatment suggested by health analyzers
var/treat_text = ""
/// Even more basic treatment
var/treat_text_short = ""
/// What the limb looks like on a cursory examine
var/examine_desc = "is badly hurt"

Expand Down Expand Up @@ -648,19 +650,28 @@
return span_bold("[desc]!")
return "[desc]."

/**
* Prints the details about the wound for the wound scanner on simple mode
*/
/datum/wound/proc/get_scanner_description(mob/user)
return "Type: [name]\nSeverity: [severity_text()]\nDescription: [desc]\nRecommended Treatment: [treat_text]"
return "Type: [name]<br>\
Severity: [severity_text()]<br>\
Description: [desc]<br>\
Recommended Treatment: [treat_text]"

/**
* Returns what text describes this wound
*/
/datum/wound/proc/severity_text()
switch(severity)
if(WOUND_SEVERITY_TRIVIAL)
return "Trivial"
if(WOUND_SEVERITY_MODERATE)
return "Moderate"
if(WOUND_SEVERITY_SEVERE)
return "Severe"
return "<b>Severe</b>"
if(WOUND_SEVERITY_CRITICAL)
return "Critical"
return "<b>Critical</b>"

/// Returns TRUE if our limb is the head or chest, FALSE otherwise.
/// Essential in the sense of "we cannot live without it".
Expand Down
15 changes: 11 additions & 4 deletions code/datums/wounds/bones.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@
/datum/wound/blunt/bone/moderate
name = "Joint Dislocation"
desc = "Patient's limb has been unset from socket, causing pain and reduced motor function."
treat_text = "Recommended application of bonesetter to affected limb, though manual relocation by applying an aggressive grab to the patient and helpfully interacting with afflicted limb may suffice."
treat_text = "Apply Bonesetter to the affected limb. \
Manual relocation by via an aggressive grab and a tight hug to the affected limb may also suffice."
treat_text_short = "Apply Bonesetter, or manually relocate the limb."
examine_desc = "is awkwardly janked out of place"
occur_text = "janks violently and becomes unseated"
severity = WOUND_SEVERITY_MODERATE
Expand Down Expand Up @@ -341,7 +343,9 @@
/datum/wound/blunt/bone/severe
name = "Hairline Fracture"
desc = "Patient's bone has suffered a crack in the foundation, causing serious pain and reduced limb functionality."
treat_text = "Recommended light surgical application of bone gel, though a sling of medical gauze will prevent worsening situation."
treat_text = "Repair surgically. In the event of an emergency, an application of bone gel over the affected area will fix over time. \
A splint or sling of medical gauze can also be used to prevent the fracture from worsening."
treat_text_short = "Repair surgically, or apply bone gel. A splint or gauze sling can also be used."
examine_desc = "appears grotesquely swollen, jagged bumps hinting at chips in the bone"
occur_text = "sprays chips of bone and develops a nasty looking bruise"

Expand Down Expand Up @@ -369,8 +373,11 @@
/// Compound Fracture (Critical Blunt)
/datum/wound/blunt/bone/critical
name = "Compound Fracture"
desc = "Patient's bones have suffered multiple gruesome fractures, causing significant pain and near uselessness of limb."
treat_text = "Immediate binding of affected limb, followed by surgical intervention ASAP."
desc = "Patient's bones have suffered multiple fractures, \
couped with a break in the skin, causing significant pain and near uselessness of limb."
treat_text = "Immediately bind the affected limb with gauze or a splint. Repair surgically. \
In the event of an emergency, bone gel and surgical tape can be applied to the affected area to fix over a long period of time."
treat_text_short = "Repair surgically, or apply bone gel and surgical tape. A splint or gauze sling should also be used."
examine_desc = "is thoroughly pulped and cracked, exposing shards of bone to open air"
occur_text = "cracks apart, exposing broken bones to open air"

Expand Down
46 changes: 41 additions & 5 deletions code/datums/wounds/burns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@
victim.gain_trauma(sepsis)
strikes_to_lose_limb--

/datum/wound/burn/flesh/set_disabling(new_value)
. = ..()
if(new_value && strikes_to_lose_limb <= 0)
treat_text_short = "Amputate or augment limb immediately, or place the patient into cryogenics."
else
treat_text_short = initial(treat_text_short)

/datum/wound/burn/flesh/get_wound_description(mob/user)
if(strikes_to_lose_limb <= 0)
return span_deadsay("<B>[victim.p_their(TRUE)] [limb.plaintext_zone] has locked up completely and is non-functional.</B>")
Expand Down Expand Up @@ -170,10 +177,26 @@

return "<B>[condition.Join()]</B>"

/datum/wound/burn/flesh/severity_text(simple = FALSE)
. = ..()
. += " Burn / "
switch(infestation)
if(-INFINITY to WOUND_INFECTION_MODERATE)
. += "No"
if(WOUND_INFECTION_MODERATE to WOUND_INFECTION_SEVERE)
. += "Moderate"
if(WOUND_INFECTION_SEVERE to WOUND_INFECTION_CRITICAL)
. += "<b>Severe</b>"
if(WOUND_INFECTION_CRITICAL to WOUND_INFECTION_SEPTIC)
. += "<b>Critical</b>"
if(WOUND_INFECTION_SEPTIC to INFINITY)
. += "<b>Total</b>"
. += " Infection"

/datum/wound/burn/flesh/get_scanner_description(mob/user)
if(strikes_to_lose_limb <= 0) // Unclear if it can go below 0, best to not take the chance
var/oopsie = "Type: [name]\nSeverity: [severity_text()]"
oopsie += "<div class='ml-3'>Infection Level: [span_deadsay("The body part has suffered complete sepsis and must be removed. Amputate or augment limb immediately.")]</div>"
var/oopsie = "Type: [name]<br>Severity: [severity_text()]"
oopsie += "<div class='ml-3'>Infection Level: [span_deadsay("The body part has suffered complete sepsis and must be removed. Amputate or augment limb immediately, or place the patient in a cryotube.")]</div>"
return oopsie

. = ..()
Expand Down Expand Up @@ -251,6 +274,10 @@
// people complained about burns not healing on stasis beds, so in addition to checking if it's cured, they also get the special ability to very slowly heal on stasis beds if they have the healing effects stored
/datum/wound/burn/flesh/on_stasis(delta_time, times_fired)
. = ..()
if(strikes_to_lose_limb <= 0) // we've already hit sepsis, nothing more to do
if(DT_PROB(0.5, delta_time))
victim.visible_message(span_danger("The infection on the remnants of [victim]'s [limb.plaintext_zone] shift and bubble nauseatingly!"), span_warning("You can feel the infection on the remnants of your [limb.plaintext_zone] coursing through your veins!"), vision_distance = COMBAT_MESSAGE_RANGE)
return
if(flesh_healing > 0)
flesh_damage = max(flesh_damage - (0.1 * delta_time), 0)
if((flesh_damage <= 0) && (infestation <= 1))
Expand Down Expand Up @@ -278,7 +305,8 @@
/datum/wound/burn/flesh/moderate
name = "Second Degree Burns"
desc = "Patient is suffering considerable burns with mild skin penetration, weakening limb integrity and increased burning sensations."
treat_text = "Recommended application of topical ointment or regenerative mesh to affected region."
treat_text = "Apply topical ointment or regenerative mesh to the wound."
treat_text_short = "Apply healing aid such as regenerative mesh."
examine_desc = "is badly burned and breaking out in blisters"
occur_text = "breaks out with violent red burns"
severity = WOUND_SEVERITY_MODERATE
Expand All @@ -298,7 +326,11 @@
/datum/wound/burn/flesh/severe
name = "Third Degree Burns"
desc = "Patient is suffering extreme burns with full skin penetration, creating serious risk of infection and greatly reduced limb integrity."
treat_text = "Recommended immediate disinfection and excision of any infected skin, followed by bandaging and ointment."
treat_text = "Swiftly apply healing aids such as Synthflesh or regenerative mesh to the wound. \
Disinfect the wound and surgically debride any infected skin, and wrap in clean gauze / use ointment to prevent further infection. \
If the limb has locked up, it must be amputated, augmented or treated with cryogenics."
treat_text_short = "Apply healing aid such as regenerative mesh, Synthflesh, or cryogenics and disinfect / debride. \
Clean gauze or ointment will slow infection rate."
examine_desc = "appears seriously charred, with aggressive red splotches"
occur_text = "chars rapidly, exposing ruined tissue and spreading angry red burns"
severity = WOUND_SEVERITY_SEVERE
Expand All @@ -320,7 +352,11 @@
/datum/wound/burn/flesh/critical
name = "Catastrophic Burns"
desc = "Patient is suffering near complete loss of tissue and significantly charred muscle and bone, creating life-threatening risk of infection and negligible limb integrity."
treat_text = "Immediate surgical debriding of any infected skin, followed by potent tissue regeneration formula and bandaging."
treat_text = "Immediately apply healing aids such as Synthflesh or regenerative mesh to the wound. \
Disinfect the wound and surgically debride any infected skin, and wrap in clean gauze / use ointment to prevent further infection. \
If the limb has locked up, it must be amputated, augmented or treated with cryogenics."
treat_text_short = "Apply healing aid such as regenerative mesh, Synthflesh, or cryogenics and disinfect / debride. \
Clean gauze or ointment will slow infection rate."
examine_desc = "is a ruined mess of blanched bone, melted fat, and charred tissue"
occur_text = "vaporizes as flesh, bone, and fat melt together in a horrifying mess"
severity = WOUND_SEVERITY_CRITICAL
Expand Down
15 changes: 12 additions & 3 deletions code/datums/wounds/pierce.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@
/datum/wound/pierce/bleed/moderate
name = "Minor Skin Breakage"
desc = "Patient's skin has been broken open, causing severe bruising and minor internal bleeding in affected area."
treat_text = "Treat affected site with bandaging or exposure to extreme cold. In dire cases, brief exposure to vacuum may suffice." // space is cold in ss13, so it's like an ice pack!
treat_text = "Apply bandaging or suturing to the wound, make use of blood clotting agents, \
cauterization, or in extreme circumstances, exposure to extreme cold or vaccuum. \
Follow with food and a rest period."
treat_text_short = "Apply bandaging or suturing."
examine_desc = "has a small, circular hole, gently bleeding"
occur_text = "spurts out a thin stream of blood"
sound_effect = 'sound/effects/wounds/pierce1.ogg'
Expand Down Expand Up @@ -193,7 +196,10 @@
/datum/wound/pierce/bleed/severe
name = "Open Puncture"
desc = "Patient's internal tissue is penetrated, causing sizeable internal bleeding and reduced limb stability."
treat_text = "Repair punctures in skin by suture or cautery, extreme cold may also work."
treat_text = "Swiftly apply bandaging or suturing to the wound, make use of blood clotting agents or saline-glucose, \
cauterization, or in extreme circumstances, exposure to extreme cold or vaccuum. \
Follow with iron supplements and a rest period."
treat_text_short = "Apply bandaging, suturing, clotting agents, or cauterization."
examine_desc = "is pierced clear through, with bits of tissue obscuring the open hole"
occur_text = "looses a violent spray of blood, revealing a pierced wound"
sound_effect = 'sound/effects/wounds/pierce2.ogg'
Expand All @@ -220,7 +226,10 @@
/datum/wound/pierce/bleed/critical
name = "Ruptured Cavity"
desc = "Patient's internal tissue and circulatory system is shredded, causing significant internal bleeding and damage to internal organs."
treat_text = "Surgical repair of puncture wound, followed by supervised resanguination."
treat_text = "Immediately apply bandaging or suturing to the wound, make use of blood clotting agents or saline-glucose, \
cauterization, or in extreme circumstances, exposure to extreme cold or vaccuum. \
Follow with supervised resanguination."
treat_text_short = "Apply bandaging, suturing, clotting agents, or cauterization."
examine_desc = "is ripped clear through, barely held together by exposed bone"
occur_text = "blasts apart, sending chunks of viscera flying in all directions"
sound_effect = 'sound/effects/wounds/pierce3.ogg'
Expand Down
14 changes: 11 additions & 3 deletions code/datums/wounds/slash.dm
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@
/datum/wound/slash/flesh/moderate
name = "Rough Abrasion"
desc = "Patient's skin has been badly scraped, generating moderate blood loss."
treat_text = "Application of clean bandages or first-aid grade sutures, followed by food and rest."
treat_text = "Apply bandaging or suturing to the wound. \
Follow up with food and a rest period."
treat_text_short = "Apply bandaging or suturing."
examine_desc = "has an open cut"
occur_text = "is cut open, slowly leaking blood"
sound_effect = 'sound/effects/wounds/blood1.ogg'
Expand All @@ -329,7 +331,10 @@
/datum/wound/slash/flesh/severe
name = "Open Laceration"
desc = "Patient's skin is ripped clean open, allowing significant blood loss."
treat_text = "Speedy application of first-aid grade sutures and clean bandages, followed by vitals monitoring to ensure recovery."
treat_text = "Swiftly apply bandaging or suturing to the wound, \
or make use of blood clotting agents or cauterization. \
Follow up with iron supplements or saline-glucose and a rest period."
treat_text_short = "Apply bandaging, suturing, clotting agents, or cauterization."
examine_desc = "has a severe cut"
occur_text = "is ripped open, veins spurting blood"
sound_effect = 'sound/effects/wounds/blood2.ogg'
Expand All @@ -356,7 +361,10 @@
/datum/wound/slash/flesh/critical
name = "Weeping Avulsion"
desc = "Patient's skin is completely torn open, along with significant loss of tissue. Extreme blood loss will lead to quick death without intervention."
treat_text = "Immediate bandaging and either suturing or cauterization, followed by supervised resanguination."
treat_text = "Immediately apply bandaging or suturing to the wound, \
or make use of blood clotting agents or cauterization. \
Follow up supervised resanguination."
treat_text_short = "Apply bandaging, suturing, clotting agents, or cauterization."
examine_desc = "is carved down to the bone, spraying blood wildly"
examine_desc = "is carved down to the bone"
occur_text = "is torn open, spraying blood wildly"
Expand Down
Loading

0 comments on commit 7348f44

Please sign in to comment.