From 26e5630e23970db6d97b07a44eba29aa486d51c5 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Mon, 18 May 2015 06:34:31 +0300 Subject: [PATCH 1/5] Ghetto diagnostics! Grab + click with help intent to inspect the bodypart. You'll learn what injuries there are without stripping the guy. After delay, you also learn if there's a fracture here. Also surgical incisions are now visible on examine because goddamnit. --- .../mob/living/carbon/human/examine.dm | 85 +++---------------- code/modules/mob/mob_grab.dm | 16 ++++ code/modules/organs/organ_external.dm | 54 +++++++++++- 3 files changed, 82 insertions(+), 73 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index d7255571613..dad4e902446 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -274,76 +274,17 @@ wound_flavor_text["[temp.name]"] = "[t_He] has a robot [temp.name]!\n" continue else - wound_flavor_text["[temp.name]"] = "[t_He] has a robot [temp.name]. It has" - if(temp.brute_dam) switch(temp.brute_dam) - if(0 to 20) - wound_flavor_text["[temp.name]"] += " some dents" - if(21 to INFINITY) - wound_flavor_text["[temp.name]"] += pick(" a lot of dents"," severe denting") - if(temp.brute_dam && temp.burn_dam) - wound_flavor_text["[temp.name]"] += " and" - if(temp.burn_dam) switch(temp.burn_dam) - if(0 to 20) - wound_flavor_text["[temp.name]"] += " some burns" - if(21 to INFINITY) - wound_flavor_text["[temp.name]"] += pick(" a lot of burns"," severe melting") - if(wound_flavor_text["[temp.name]"]) - wound_flavor_text["[temp.name]"] += "!\n" - else if(temp.wounds.len > 0) - var/list/wound_descriptors = list() - for(var/datum/wound/W in temp.wounds) - if(W.internal && !temp.open) continue // can't see internal wounds - var/this_wound_desc = W.desc - if(W.damage_type == BURN && W.salved) this_wound_desc = "salved [this_wound_desc]" - if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]" - else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]" - if(W.germ_level > 600) this_wound_desc = "badly infected [this_wound_desc]" - else if(W.germ_level > 330) this_wound_desc = "lightly infected [this_wound_desc]" - if(this_wound_desc in wound_descriptors) - wound_descriptors[this_wound_desc] += W.amount - continue - wound_descriptors[this_wound_desc] = W.amount - if(wound_descriptors.len) - var/list/flavor_text = list() - var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\ - "huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area") - for(var/wound in wound_descriptors) - switch(wound_descriptors[wound]) - if(1) - if(!flavor_text.len) - flavor_text += "[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" - else - flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a [wound]" - if(2) - if(!flavor_text.len) - flavor_text += "[t_He] has[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" - else - flavor_text += "[prob(10) && !(wound in no_exclude) ? " what might be" : ""] a pair of [wound]s" - if(3 to 5) - if(!flavor_text.len) - flavor_text += "[t_He] has several [wound]s" - else - flavor_text += " several [wound]s" - if(6 to INFINITY) - if(!flavor_text.len) - flavor_text += "[t_He] has a bunch of [wound]s" - else - flavor_text += " a ton of [wound]\s" - var/flavor_text_string = "" - for(var/text = 1, text <= flavor_text.len, text++) - if(text == flavor_text.len && flavor_text.len > 1) - flavor_text_string += ", and" - else if(flavor_text.len > 1 && text > 1) - flavor_text_string += "," - flavor_text_string += flavor_text[text] - flavor_text_string += " on [t_his] [temp.name].
" - wound_flavor_text["[temp.name]"] = flavor_text_string - else - wound_flavor_text["[temp.name]"] = "" + wound_flavor_text["[temp.name]"] = "[t_He] has a robot [temp.name]. It has[temp.get_wounds_desc()]!\n" + else if(temp.wounds.len > 0 || temp.open) + wound_flavor_text["[temp.name]"] = "[t_He] has [temp.get_wounds_desc()] on [t_his] [temp.name].
" if(temp.status & ORGAN_BLEEDING) is_bleeding["[temp.name]"] = 1 else wound_flavor_text["[temp.name]"] = "" + if(temp.dislocated == 2) + wound_flavor_text["[temp.name]"] += "[capitalize(t_his)] [temp.joint] is dislocated!
" + if(((temp.status & ORGAN_BROKEN) && temp.brute_dam > temp.min_broken_damage) || (temp.status & ORGAN_MUTATED)) + wound_flavor_text["[temp.name]"] += "[capitalize(t_his)] [temp.name] is dented and swollen!
" //Handles the text strings being added to the actual description. //If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext. @@ -354,9 +295,9 @@ msg += wound_flavor_text["head"] else if(is_bleeding["head"]) msg += "[src] has blood running down [t_his] face!\n" - if(wound_flavor_text["chest"] && !w_uniform && !skipjumpsuit) //No need. A missing chest gibs you. - msg += wound_flavor_text["chest"] - else if(is_bleeding["chest"]) + if(wound_flavor_text["upper body"] && !w_uniform && !skipjumpsuit) //No need. A missing chest gibs you. + msg += wound_flavor_text["upper body"] + else if(is_bleeding["upper body"]) display_chest = 1 if(wound_flavor_text["left arm"] && (is_destroyed["left arm"] || (!w_uniform && !skipjumpsuit))) msg += wound_flavor_text["left arm"] @@ -374,9 +315,9 @@ msg += wound_flavor_text["right hand"] else if(is_bleeding["right hand"]) display_gloves = 1 - if(wound_flavor_text["groin"] && (is_destroyed["groin"] || (!w_uniform && !skipjumpsuit))) - msg += wound_flavor_text["groin"] - else if(is_bleeding["groin"]) + if(wound_flavor_text["lower body"] && (is_destroyed["lower body"] || (!w_uniform && !skipjumpsuit))) + msg += wound_flavor_text["lower body"] + else if(is_bleeding["lower body"]) display_chest = 1 if(wound_flavor_text["left leg"] && (is_destroyed["left leg"] || (!w_uniform && !skipjumpsuit))) msg += wound_flavor_text["left leg"] diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index d3b889198c5..8a77b5cd25e 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -297,6 +297,22 @@ assailant << "You are no longer pinning [affecting] to the ground." force_down = 0 return + var/mob/living/carbon/human/H = M + var/obj/item/organ/external/E = H.get_organ(hit_zone) + if(E && !(E.status & ORGAN_DESTROYED)) + assailant.visible_message("[assailant] starts inspecting [affecting]'s [E.name] carefully.") + if(do_after(assailant, 10) && affecting && E) + if(E.wounds.len) + assailant << "You find [E.get_wounds_desc()]" + else + assailant << "You find no visible wounds." + assailant << "Checking bones now..." + if(do_after(assailant, 15) && affecting && E) + if(E.status & ORGAN_BROKEN) + assailant << "The [E.encased ? E.encased : "bone in the [E.name]"] is fractured!" + H.custom_pain("Your [E.name] hurts where it's poked.") + else + assailant << "The [E.encased ? E.encased : "bones in the [E.name]"] seem to be fine." if(I_GRAB) if(state < GRAB_AGGRESSIVE) assailant << "You require a better grab to do this." diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 4bbb173d2a9..a539f5f421b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -175,7 +175,7 @@ var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT) // If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking - // Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can + // Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can // push them faster into paincrit though, as the additional damage is converted into shock. if(vital || (brute_dam + burn_dam + brute + burn) < max_damage || !config.limbs_can_break) if(brute) @@ -931,6 +931,58 @@ Note that amputating the affected organ does in fact remove the infection from t "\red You hear a sickening sizzle.") disfigured = 1 +/obj/item/organ/external/proc/get_wounds_desc() + . = "" + if(status & ORGAN_ROBOT) + if(brute_dam) + switch(brute_dam) + if(0 to 20) + . += " some dents" + if(21 to INFINITY) + . += pick(" a lot of dents"," severe denting") + if(brute_dam && burn_dam) + . += " and" + if(burn_dam) + switch(burn_dam) + if(0 to 20) + . += " some burns" + if(21 to INFINITY) + . += pick(" a lot of burns"," severe melting") + return + + var/list/wound_descriptors = list() + if(open > 1) + wound_descriptors["an open incision"] = 1 + else if (open) + wound_descriptors["an incision"] = 1 + for(var/datum/wound/W in wounds) + if(W.internal && !open) continue // can't see internal wounds + var/this_wound_desc = W.desc + if(W.damage_type == BURN && W.salved) this_wound_desc = "salved [this_wound_desc]" + if(W.bleeding()) this_wound_desc = "bleeding [this_wound_desc]" + else if(W.bandaged) this_wound_desc = "bandaged [this_wound_desc]" + if(W.germ_level > 600) this_wound_desc = "badly infected [this_wound_desc]" + else if(W.germ_level > 330) this_wound_desc = "lightly infected [this_wound_desc]" + if(wound_descriptors[this_wound_desc]) + wound_descriptors[this_wound_desc] += W.amount + else + wound_descriptors[this_wound_desc] = W.amount + + if(wound_descriptors.len) + var/list/flavor_text = list() + var/list/no_exclude = list("gaping wound", "big gaping wound", "massive wound", "large bruise",\ + "huge bruise", "massive bruise", "severe burn", "large burn", "deep burn", "carbonised area") + for(var/wound in wound_descriptors) + switch(wound_descriptors[wound]) + if(1) + flavor_text += "[prob(10) && !(wound in no_exclude) ? "what might be " : ""]a [wound]" + if(2) + flavor_text += "[prob(10) && !(wound in no_exclude) ? "what might be " : ""]a pair of [wound]s" + if(3 to 5) + flavor_text += "several [wound]s" + if(6 to INFINITY) + flavor_text += "a ton of [wound]\s" + return english_list(flavor_text) /**************************************************** ORGAN DEFINES ****************************************************/ From ef0f21bd1a76f70c0bc0ad303f42a1be56d8e246 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Mon, 18 May 2015 07:41:19 +0300 Subject: [PATCH 2/5] Ghetto MD part 2 Examining people with grab-exmaine move now can tell you if they have toxins in blood, or are short of breath. Stethoscopes now actually give real info about severe oxyloss/internal organs damage. --- .../clothing/under/accessories/accessory.dm | 34 ++++++++++++++----- code/modules/mob/mob_grab.dm | 18 ++++++++-- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index ce4ff8306b4..feef7d06b1a 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -91,24 +91,42 @@ if(MALE) their = "his" if(FEMALE) their = "her" - var/sound = "pulse" - var/sound_strength - + var/sound = "heartbeat" + var/sound_strength = "cannot hear" + var/heartbeat = 0 + if(M.species && M.species.has_organ["heart"]) + var/obj/item/organ/heart/heart = M.internal_organs_by_name["heart"] + if(heart && !heart.robotic) + heartbeat = 1 if(M.stat == DEAD || (M.status_flags&FAKEDEATH)) sound_strength = "cannot hear" sound = "anything" else - sound_strength = "hear a weak" switch(body_part) if("chest") - if(M.oxyloss < 50) - sound_strength = "hear a healthy" - sound = "pulse and respiration" + sound_strength = "hear" + sound = "no heartbeat" + if(heartbeat) + var/obj/item/organ/heart/heart = M.internal_organs_by_name["heart"] + if(heart.is_bruised() || M.getOxyLoss() > 50) + sound = "[pick("odd noises in","weak")] heartbeat" + else + sound = "healthy heartbeat" + + var/obj/item/organ/heart/L = M.internal_organs_by_name["lungs"] + if(!L || M.losebreath) + sound += " and no respiration" + else if(M.is_lung_ruptured() || M.getOxyLoss() > 50) + sound += " and [pick("wheezing","gurgling")] sounds" + else + sound += " and healthy respiration" if("eyes","mouth") sound_strength = "cannot hear" sound = "anything" else - sound_strength = "hear a weak" + if(heartbeat) + sound_strength = "hear a weak" + sound = "pulse" user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [their] [body_part]. You [sound_strength] [sound].") return diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 8a77b5cd25e..fb02287db6b 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -301,18 +301,30 @@ var/obj/item/organ/external/E = H.get_organ(hit_zone) if(E && !(E.status & ORGAN_DESTROYED)) assailant.visible_message("[assailant] starts inspecting [affecting]'s [E.name] carefully.") - if(do_after(assailant, 10) && affecting && E) + if(do_after(assailant, 10) && H && E) if(E.wounds.len) assailant << "You find [E.get_wounds_desc()]" else assailant << "You find no visible wounds." assailant << "Checking bones now..." - if(do_after(assailant, 15) && affecting && E) + if(do_after(assailant, 20) && H && E) if(E.status & ORGAN_BROKEN) - assailant << "The [E.encased ? E.encased : "bone in the [E.name]"] is fractured!" + assailant << "The [E.encased ? E.encased : "bone in the [E.name]"] moves slightly when you poke it!" H.custom_pain("Your [E.name] hurts where it's poked.") else assailant << "The [E.encased ? E.encased : "bones in the [E.name]"] seem to be fine." + assailant << "Checking skin now..." + if(do_after(assailant, 10) && H && E) + var/bad = 0 + if(H.getToxLoss() >= 40) + assailant << "[H] has an unhealthy skin discoloration." + bad = 1 + if(H.getOxyLoss() >= 20) + assailant << "[H]'s skin is unusaly pale." + bad = 1 + if(!bad) + assailant << "[H]'s skin is normal." + if(I_GRAB) if(state < GRAB_AGGRESSIVE) assailant << "You require a better grab to do this." From 83803fa069e96b7cabbb787b38f0a392d26f793e Mon Sep 17 00:00:00 2001 From: Chinsky Date: Mon, 18 May 2015 08:03:02 +0300 Subject: [PATCH 3/5] Changelog --- html/changelogs/Comma-PR-9337.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 html/changelogs/Comma-PR-9337.yml diff --git a/html/changelogs/Comma-PR-9337.yml b/html/changelogs/Comma-PR-9337.yml new file mode 100644 index 00000000000..cf1aac28916 --- /dev/null +++ b/html/changelogs/Comma-PR-9337.yml @@ -0,0 +1,8 @@ +author: Chinsky + +delete-after: True + +changes: + - rscadd: "Ghetto diagnosis. Grab patient, aim at bodypart you want to check, click on them with help intent. This will tell you about their wounds, fractures and other oddities (toxins/oxygen) for that bodypart." + - rscadd: "Fractures are visible on very damaged limbs. Dislocations are always visible. Surgery incisions now visible too." + - rscadd: "Stethoscopes actually make sense now. They care for heart/lungs status when reporting pulse and respiration now." \ No newline at end of file From 814d38ce66c710ffaa7881fd396205a730a61abf Mon Sep 17 00:00:00 2001 From: Chinsky Date: Mon, 18 May 2015 08:25:34 +0300 Subject: [PATCH 4/5] Adds more info to self-examine --- code/modules/mob/living/carbon/carbon.dm | 56 ++++++++++++++---------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 56d0a1718fd..a70d6914c43 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -173,7 +173,7 @@ ) for(var/obj/item/organ/external/org in H.organs) - var/status = "" + var/list/status = list() var/brutedamage = org.brute_dam var/burndamage = org.burn_dam if(halloss > 0) @@ -181,29 +181,37 @@ brutedamage += halloss if(prob(30)) burndamage += halloss + switch(brutedamage) + if(1 to 20) + status += "bruised" + if(20 to 40) + status += "wounded" + if(40 to INFINITY) + status += "mangled" - if(brutedamage > 0) - status = "bruised" - if(brutedamage > 20) - status = "bleeding" - if(brutedamage > 40) - status = "mangled" - if(brutedamage > 0 && burndamage > 0) - status += " and " - if(burndamage > 40) - status += "peeling away" + switch(burndamage) + if(1 to 10) + status += "numb" + if(10 to 40) + status += "blistered" + if(40 to INFINITY) + status += "peeling away" - else if(burndamage > 10) - status += "blistered" - else if(burndamage > 0) - status += "numb" if(org.status & ORGAN_DESTROYED) - status = "MISSING!" + status += "MISSING" if(org.status & ORGAN_MUTATED) - status = "weirdly shapen." - if(status == "") - status = "OK" - src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.name,status),1) + status += "weirdly shapen" + if(org.dislocated == 2) + status += "dislocated" + if(org.status & ORGAN_BROKEN) + status += "hurts when touched" + if(!org.is_usable()) + status += "dangling uselessly" + if(status.len) + src.show_message("My [org.name] is [english_list(status)].",1) + else + src.show_message("My [org.name] is OK.",1) + if((SKELETON in H.mutations) && (!H.w_uniform) && (!H.wear_suit)) H.play_xylophone() else if (on_fire) @@ -452,17 +460,17 @@ Stun(stun_duration) Weaken(Floor(stun_duration/2)) return 1 - + /mob/living/carbon/proc/add_chemical_effect(var/effect, var/magnitude = 1) if(effect in chem_effects) chem_effects[effect] += magnitude else - chem_effects[effect] = magnitude - + chem_effects[effect] = magnitude + /mob/living/carbon/get_default_language() if(default_language) return default_language if(!species) return null - return species.default_language ? all_languages[species.default_language] : null + return species.default_language ? all_languages[species.default_language] : null From df917e1538acfcf8b74c000b745a68df5641f3b6 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Tue, 19 May 2015 07:16:17 +0300 Subject: [PATCH 5/5] Changes from PR feedback. Moar feedback for inspecting mob. --- code/modules/mob/living/carbon/carbon.dm | 2 ++ code/modules/mob/mob_grab.dm | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index a70d6914c43..72bd64453d5 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -205,6 +205,8 @@ status += "dislocated" if(org.status & ORGAN_BROKEN) status += "hurts when touched" + if(org.status & ORGAN_DEAD) + status += "is bruised and necrotic" if(!org.is_usable()) status += "dangling uselessly" if(status.len) diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index fb02287db6b..4a51684139b 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -301,20 +301,24 @@ var/obj/item/organ/external/E = H.get_organ(hit_zone) if(E && !(E.status & ORGAN_DESTROYED)) assailant.visible_message("[assailant] starts inspecting [affecting]'s [E.name] carefully.") - if(do_after(assailant, 10) && H && E) + if(do_mob(assailant,H, 10)) if(E.wounds.len) assailant << "You find [E.get_wounds_desc()]" else assailant << "You find no visible wounds." + else + assailant << "You must stand still to inspect [E] for wounds." assailant << "Checking bones now..." - if(do_after(assailant, 20) && H && E) + if(do_mob(assailant, H, 20)) if(E.status & ORGAN_BROKEN) assailant << "The [E.encased ? E.encased : "bone in the [E.name]"] moves slightly when you poke it!" H.custom_pain("Your [E.name] hurts where it's poked.") else assailant << "The [E.encased ? E.encased : "bones in the [E.name]"] seem to be fine." + else + assailant << "You must stand still to feel [E] for fractures." assailant << "Checking skin now..." - if(do_after(assailant, 10) && H && E) + if(do_mob(assailant, H, 10)) var/bad = 0 if(H.getToxLoss() >= 40) assailant << "[H] has an unhealthy skin discoloration." @@ -322,9 +326,14 @@ if(H.getOxyLoss() >= 20) assailant << "[H]'s skin is unusaly pale." bad = 1 + if(E.status & ORGAN_DEAD) + assailant << "[E] is decaying!" if(!bad) assailant << "[H]'s skin is normal." - + else + assailant << "You must stand still to check [H]'s skin for abnormalities." + else + assailant << "[H] is missing that bodypart." if(I_GRAB) if(state < GRAB_AGGRESSIVE) assailant << "You require a better grab to do this."