diff --git a/code/__DEFINES/damage_organs.dm b/code/__DEFINES/damage_organs.dm index 37909593305..9e481ca1ff6 100644 --- a/code/__DEFINES/damage_organs.dm +++ b/code/__DEFINES/damage_organs.dm @@ -57,12 +57,20 @@ #define ORGAN_DAMAGE_STATES ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED|ORGAN_ARTERY_CUT // Limb behaviour defines. -#define ORGAN_CAN_AMPUTATE (1<<0) //Can this organ be amputated? -#define ORGAN_CAN_BREAK (1<<1) //Can this organ break? -#define ORGAN_CAN_GRASP (1<<2) //Can this organ grasp things? -#define ORGAN_CAN_STAND (1<<3) //Can this organ allow you to stand? -#define ORGAN_CAN_MAIM (1<<4) //Can this organ be maimed? -#define ORGAN_HAS_TENDON (1<<5) //Does this organ have tendons? +///Can this organ be amputated? +#define ORGAN_CAN_AMPUTATE BITFLAG(0) +///Can this organ break? +#define ORGAN_CAN_BREAK BITFLAG(1) +///Can this organ grasp things? +#define ORGAN_CAN_GRASP BITFLAG(2) +///Can this organ allow you to stand? +#define ORGAN_CAN_STAND BITFLAG(3) +///Can this organ be maimed? +#define ORGAN_CAN_MAIM BITFLAG(4) +///Does this organ have tendons? +#define ORGAN_HAS_TENDON BITFLAG(5) +/// Does this organ heal from overkill? +#define ORGAN_HEALS_OVERKILL BITFLAG(6) #define TENDON_BRUISED (1<<0) #define TENDON_CUT (1<<1) diff --git a/code/game/machinery/body_scanner.dm b/code/game/machinery/body_scanner.dm index 8207fc84a39..8f6b97806f7 100644 --- a/code/game/machinery/body_scanner.dm +++ b/code/game/machinery/body_scanner.dm @@ -538,9 +538,9 @@ for(var/obj/item/organ/external/O in H.organs) var/list/data = list() data["name"] = capitalize_first_letters(O.name) - var/burn_damage = get_severity(O.burn_dam, TRUE) + var/burn_damage = get_severity(O.burn_dam, (O.limb_flags & ORGAN_HEALS_OVERKILL), TRUE) data["burn_damage"] = burn_damage - var/brute_damage = get_severity(O.brute_dam, TRUE) + var/brute_damage = get_severity(O.brute_dam, (O.limb_flags & ORGAN_HEALS_OVERKILL), TRUE) data["brute_damage"] = brute_damage var/list/wounds = list() @@ -613,6 +613,7 @@ data["wounds"] = capitalize(english_list(wounds, "None")) data["infection"] = capitalize(english_list(infection, "None")) + data["amputation"] = O.CheckNeedsAmputation() organs += list(data) return organs diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 15b9d486f43..0cda69be0a9 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -46,7 +46,7 @@ BREATH ANALYZER add_fingerprint(user) /// Calculates severity based on the ratios defined external limbs. -/proc/get_wound_severity(damage_ratio, uppercase = FALSE) +/proc/get_wound_severity(damage_ratio, can_heal_overkill, uppercase = FALSE) var/degree = "none" switch(damage_ratio) @@ -60,14 +60,14 @@ BREATH ANALYZER degree = "severe" if (76 to 99) degree = "extreme" - if (99 to INFINITY) - degree = "irreparable" + if (100 to INFINITY) + degree = can_heal_overkill ? "critical" : "irreparable" if(uppercase) degree = capitalize(degree) return degree -/proc/get_severity(amount, uppercase = FALSE) +/proc/get_severity(amount, can_heal_overkill, uppercase = FALSE) var/output = "none" switch(amount) @@ -84,7 +84,7 @@ BREATH ANALYZER if (76 to 99) output = "extreme" if (100 to INFINITY) - output = "irreparable" + output = can_heal_overkill ? "critical" : "irreparable" if(uppercase) output = capitalize(output) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 673b5cb010b..2d1bd0ff9fa 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -306,6 +306,12 @@ for(var/obj/item/organ/external/temp in organs) if(temp) + if(temp.CheckNeedsAmputation()) + var/damage_descriptor = "mangled" + if(!(temp.burn_ratio < 100)) + damage_descriptor = "charred" + wound_flavor_text["[temp.name]"] = SPAN_DANGER("[get_pronoun("He")] [get_pronoun("has")] \a [temp.name] that is [damage_descriptor] beyond recognition.\n") + continue//If it's this bad, we don't care about the rest of the wounds. The limb is gone. var/body_part = temp.body_part if(temp.body_part & HEAD) body_part &= ~HEAD diff --git a/code/modules/organs/internal/_internal.dm b/code/modules/organs/internal/_internal.dm index 33a27977066..2ef8e5edc48 100644 --- a/code/modules/organs/internal/_internal.dm +++ b/code/modules/organs/internal/_internal.dm @@ -75,7 +75,7 @@ /obj/item/organ/internal/proc/get_scarring_results() var/scar_level = get_scarring_level() if(scar_level > 0.01) - . += "[get_wound_severity(get_scarring_level())] scarring" + . += "[get_wound_severity(get_scarring_level(), FALSE, FALSE)] scarring" /obj/item/organ/internal/is_usable() if(robotize_type) diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index b7810e999f4..47e5894c0c9 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -268,6 +268,17 @@ /obj/item/organ/external/proc/invalidate_marking_cache() cached_markings = null +///If the organ requires amputation, returns TRUE. Otherwise, returns FALSE +/obj/item/organ/external/proc/CheckNeedsAmputation() + var/extreme_damage = FALSE + if(!(brute_ratio < 100)) + extreme_damage = TRUE + if(!(burn_ratio < 100)) + extreme_damage = TRUE + if(extreme_damage && !(limb_flags & ORGAN_HEALS_OVERKILL)) + return TRUE // Limb took too much damage, nothing left to heal + return FALSE + /obj/item/organ/external/attack_self(var/mob/user) if(!length(contents)) return ..() diff --git a/code/modules/organs/subtypes/diona.dm b/code/modules/organs/subtypes/diona.dm index 896f49a88ab..f75ffb49395 100644 --- a/code/modules/organs/subtypes/diona.dm +++ b/code/modules/organs/subtypes/diona.dm @@ -40,7 +40,7 @@ body_part = UPPER_TORSO vital = TRUE parent_organ = null - limb_flags = 0 + limb_flags = ORGAN_HEALS_OVERKILL dislocated = -1 joint = "structural ligament" amputation_point = "branch" diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index 3af2fc0474c..242123f7532 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -16,7 +16,7 @@ artery_name = "internal thoracic artery" dislocated = -1 gendered_icon = 1 - limb_flags = ORGAN_CAN_BREAK + limb_flags = ORGAN_CAN_BREAK | ORGAN_HEALS_OVERKILL parent_organ = null encased = "ribcage" augment_limit = 3 @@ -240,6 +240,7 @@ gendered_icon = 1 encased = "skull" augment_limit = 3 + limb_flags = ORGAN_CAN_AMPUTATE | ORGAN_CAN_BREAK | ORGAN_CAN_MAIM | ORGAN_HEALS_OVERKILL var/can_intake_reagents = 1 /obj/item/organ/external/head/body_part_class() diff --git a/code/modules/organs/wounds/wound.dm b/code/modules/organs/wounds/wound.dm index 4bdfc89cbc0..879d05e4e74 100644 --- a/code/modules/organs/wounds/wound.dm +++ b/code/modules/organs/wounds/wound.dm @@ -177,11 +177,10 @@ /datum/wound/proc/heal_damage(amount) if(LAZYLEN(embedded_objects)) return amount // heal nothing - if(parent_organ) - if (damage_type == INJURY_TYPE_BURN && !(parent_organ.burn_ratio < 100)) - return amount // We don't want to heal wounds on irreparable organs - else if(!(parent_organ.brute_ratio < 100)) - return amount + if (parent_organ \ + && ((damage_type == INJURY_TYPE_BURN && !(parent_organ.burn_ratio < 100 || (parent_organ.limb_flags & ORGAN_HEALS_OVERKILL)))\ + || !(parent_organ.brute_ratio < 100 || (parent_organ.limb_flags & ORGAN_HEALS_OVERKILL)))) + return amount // We don't want to heal wounds on irreparable organs var/healed_damage = min(src.damage, amount) amount -= healed_damage diff --git a/html/changelogs/GeneralCamo - Wound Stuff.yml b/html/changelogs/GeneralCamo - Wound Stuff.yml new file mode 100644 index 00000000000..514ab79fb42 --- /dev/null +++ b/html/changelogs/GeneralCamo - Wound Stuff.yml @@ -0,0 +1,60 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: GeneralCamo + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Clarified that severely damaged limbs are irreparable and must be amputated." + - balance: "The torso and head (except for dionaea) can be healed even when 'overkilled'." + - rscadd: "The body scanner will now show if a limb must be amputated." diff --git a/tgui/packages/tgui/interfaces/BodyScanner.tsx b/tgui/packages/tgui/interfaces/BodyScanner.tsx index 97a72e04999..13e2690c46a 100644 --- a/tgui/packages/tgui/interfaces/BodyScanner.tsx +++ b/tgui/packages/tgui/interfaces/BodyScanner.tsx @@ -66,6 +66,7 @@ type Organ = { brute_damage: string; wounds: string; infection: string; + amputation: BooleanLike; }; type InternalOrgan = { @@ -430,7 +431,13 @@ export const ExternalOrganWindow = (props, context) => { {organ.burn_damage}