From 95ec0e65458ece9c5c80952e75d5d32c4fbb794b Mon Sep 17 00:00:00 2001 From: necromanceranne <40847847+necromanceranne@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:39:20 +1000 Subject: [PATCH] Dissection experiments are handled by autopsy surgery. Removes redundant dissection surgery. You can repeat an autopsy on someone who has come back to life. (#77386) ## About The Pull Request TRAIT_DISSECTED has had the surgical speed boost moved over to TRAIT_SURGICALLY_ANALYZED. TRAIT_DISSECTED now tracks if we can do an autopsy on the same body again, and blocks further autopsies if it is on the mob. A mob that comes back to life loses TRAIT_DISSECTED. This allows for mobs to be autopsied once again. Since it is completely redundant now (and was the whole time TBH), dissections have been removed in favour of just having the experiment track autopsies. Fixes https://github.com/tgstation/tgstation/issues/76775 ## Why It's Good For The Game Today I showed up to a round where someone autopsied all the bodies in the morgue, not realizing they were using the wrong surgery. Since I couldn't _redo_ the surgery, this rendered all these bodies useless. This was not out of maliciousness, they just didn't know better. There are two autopsies in the surgery list, but only one is valid for the experiment and doing the wrong one blocks _both surgeries_. Dissection is completely useless outside of experiments. This same issue also prevents additional autopsies on the same person, even if they had come back to life and died again after you had done the initial autopsy. Surely you would want to do more than one autopsy, right? That's two separate deaths! This resolves that by giving you a method of redoing any screwups on the same corpse if necessary. It only matters if the experiment is available anyway, so there isn't much reason to punish players unduly just because they weren't aware science hadn't hit a button on their side (especially since it isn't communicated to the coroner in any way to begin with). It also removes a completely useless surgery and ties in the experiment to what the coroner is already going to be doing. They can dissect their corpses to their hearts content without worrying about retribution from science for doing so. In addition, someone repeatedly dying can continue to have autopsies done on them over the course of the round. The surgery bonus only applies once, so the only reason to do autopsies after the first is to discover what might have killed someone. No reason this should block further surgeries, just block surgeries when the person remains a corpse. ## Changelog :cl: fix: You can do autopsies on people who were revived and died again after they had already been dissected. qol: Autopsies have become the surgery needed to complete the dissection experiments. As a result, the dissection surgery has been removed as it is now redundant. qol: A coroner knows whether someone has been autopsied and recently dissected (and thus hasn't been revived) by examining them. /:cl: --------- Co-authored-by: Jacquerel --- .../dcs/signals/signals_operating_computer.dm | 4 +- code/__DEFINES/traits.dm | 5 +- code/_globalvars/traits.dm | 1 + .../machinery/computer/operating_computer.dm | 2 +- .../experiment/handlers/experiment_handler.dm | 11 ++- .../experiment/types/autopsy_experiment.dm | 39 +++++++++ .../experiment/types/dissection_experiment.dm | 39 --------- code/modules/mob/living/carbon/carbon.dm | 2 + .../mob/living/carbon/human/examine.dm | 8 ++ code/modules/research/techweb/all_nodes.dm | 6 +- code/modules/surgery/autopsy.dm | 7 +- code/modules/surgery/dissection.dm | 85 ------------------- code/modules/surgery/surgery_step.dm | 2 +- code/modules/surgery/tools.dm | 2 +- tgstation.dme | 3 +- 15 files changed, 74 insertions(+), 142 deletions(-) create mode 100644 code/modules/experisci/experiment/types/autopsy_experiment.dm delete mode 100644 code/modules/experisci/experiment/types/dissection_experiment.dm delete mode 100644 code/modules/surgery/dissection.dm diff --git a/code/__DEFINES/dcs/signals/signals_operating_computer.dm b/code/__DEFINES/dcs/signals/signals_operating_computer.dm index 94f2f52ede2..8974bb99db8 100644 --- a/code/__DEFINES/dcs/signals/signals_operating_computer.dm +++ b/code/__DEFINES/dcs/signals/signals_operating_computer.dm @@ -1,5 +1,5 @@ // /obj/machinery/computer/operating signals -/// Fired when a dissection surgery completes. +/// Fired when a autopsy surgery completes. /// (mob/living/target) -#define COMSIG_OPERATING_COMPUTER_DISSECTION_COMPLETE "operating_computer_dissection_complete" +#define COMSIG_OPERATING_COMPUTER_AUTOPSY_COMPLETE "operating_computer_autopsy_complete" diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 5496b62277c..ee5d79ef110 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -328,6 +328,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NOSOFTCRIT "nosoftcrit" #define TRAIT_MINDSHIELD "mindshield" #define TRAIT_DISSECTED "dissected" +#define TRAIT_SURGICALLY_ANALYZED "surgically_analyzed" /// Lets the user succumb even if they got NODEATH #define TRAIT_SUCCUMB_OVERRIDE "succumb_override" /// Can hear observers @@ -563,7 +564,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai /// Projectile with this trait will always hit the defined zone of a struck living mob. #define TRAIT_ALWAYS_HIT_ZONE "always_hit_zone" -/// Mobs with this trait do care about a few grizzly things, such as digging up graves. They also really do not like bringing people back to life or tending wounds, but love autopies, dissections and amputations. +/// Mobs with this trait do care about a few grisly things, such as digging up graves. They also really do not like bringing people back to life or tending wounds, but love autopsies and amputations. #define TRAIT_MORBID "morbid" // METABOLISMS @@ -1101,6 +1102,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define HALLUCINATION_TRAIT "hallucination_trait" /// Trait given by simple/basic mob death #define BASIC_MOB_DEATH_TRAIT "basic_mob_death" +/// Trait given to mobs that have been autopsied +#define AUTOPSY_TRAIT "autopsy_trait" /** diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index e9825345653..d6e1a6457f5 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -93,6 +93,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_NOSOFTCRIT" = TRAIT_NOSOFTCRIT, "TRAIT_MINDSHIELD" = TRAIT_MINDSHIELD, "TRAIT_DISSECTED" = TRAIT_DISSECTED, + "TRAIT_SURGICALLY_ANALYZED" = TRAIT_SURGICALLY_ANALYZED, "TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE, "TRAIT_FEARLESS" = TRAIT_FEARLESS, "TRAIT_PARALYSIS_L_ARM" = TRAIT_PARALYSIS_L_ARM, diff --git a/code/game/machinery/computer/operating_computer.dm b/code/game/machinery/computer/operating_computer.dm index 954ec03caee..f512d92acb9 100644 --- a/code/game/machinery/computer/operating_computer.dm +++ b/code/game/machinery/computer/operating_computer.dm @@ -27,7 +27,7 @@ experiment_handler = AddComponent( \ /datum/component/experiment_handler, \ - allowed_experiments = list(/datum/experiment/dissection), \ + allowed_experiments = list(/datum/experiment/autopsy), \ config_flags = EXPERIMENT_CONFIG_ALWAYS_ACTIVE, \ config_mode = EXPERIMENT_CONFIG_ALTCLICK, \ ) diff --git a/code/modules/experisci/experiment/handlers/experiment_handler.dm b/code/modules/experisci/experiment/handlers/experiment_handler.dm index cf3576a62e1..4c0b6ae3b44 100644 --- a/code/modules/experisci/experiment/handlers/experiment_handler.dm +++ b/code/modules/experisci/experiment/handlers/experiment_handler.dm @@ -55,7 +55,7 @@ if(istype(parent, /obj/machinery/destructive_scanner)) RegisterSignal(parent, COMSIG_MACHINERY_DESTRUCTIVE_SCAN, PROC_REF(try_run_destructive_experiment)) if(istype(parent, /obj/machinery/computer/operating)) - RegisterSignal(parent, COMSIG_OPERATING_COMPUTER_DISSECTION_COMPLETE, PROC_REF(try_run_dissection_experiment)) + RegisterSignal(parent, COMSIG_OPERATING_COMPUTER_AUTOPSY_COMPLETE, PROC_REF(try_run_autopsy_experiment)) // Determine UI display mode switch(config_mode) @@ -166,15 +166,14 @@ playsound(src, 'sound/machines/buzz-sigh.ogg', 25) our_scanner.say("The scan did not result in anything.") -/// Hooks on a successful dissection experiment -/datum/component/experiment_handler/proc/try_run_dissection_experiment(obj/source, mob/living/target) +/// Hooks on a successful autopsy experiment +/datum/component/experiment_handler/proc/try_run_autopsy_experiment(obj/source, mob/living/target) SIGNAL_HANDLER if (action_experiment(source, target)) playsound(source, 'sound/machines/ping.ogg', 25) - else - playsound(source, 'sound/machines/buzz-sigh.ogg', 25) - source.say("The dissection did not result in anything, either prior dissections have not been complete, or this one has already been researched.") + source.say("New unique autopsy successfully catalogued.") + /** * Announces a message to all experiment handlers diff --git a/code/modules/experisci/experiment/types/autopsy_experiment.dm b/code/modules/experisci/experiment/types/autopsy_experiment.dm new file mode 100644 index 00000000000..3ef339b642a --- /dev/null +++ b/code/modules/experisci/experiment/types/autopsy_experiment.dm @@ -0,0 +1,39 @@ +/datum/experiment/autopsy + name = "Autopsy Experiment" + description = "An experiment requiring a autopsy surgery to progress" + exp_tag = "Autopsy" + performance_hint = "Perform a autopsy surgery while connected to an operating computer." + +/datum/experiment/autopsy/is_complete() + return completed + +/datum/experiment/autopsy/perform_experiment_actions(datum/component/experiment_handler/experiment_handler, mob/target) + if (is_valid_autopsy(target)) + completed = TRUE + return TRUE + else + return FALSE + +/datum/experiment/autopsy/proc/is_valid_autopsy(mob/target) + return TRUE + +/datum/experiment/autopsy/human + name = "Human Autopsy Experiment" + description = "We don't want to invest in a station that doesn't know their coccyx from their cochlea. Send us back data dissecting a human to receive more funding." + +/datum/experiment/autopsy/human/is_valid_autopsy(mob/target) + return ishumanbasic(target) + +/datum/experiment/autopsy/nonhuman + name = "Non-human Autopsy Experiment" + description = "When we asked for a tail bone, we didn't mean...look, just send us back data from something OTHER than a human. It could be a monkey for all we care, just send us research." + +/datum/experiment/autopsy/nonhuman/is_valid_autopsy(mob/target) + return ishuman(target) && !ishumanbasic(target) + +/datum/experiment/autopsy/xenomorph + name = "Xenomorph Autopsy Experiment" + description = "Our understanding of the xenomorph only scratches the surface. Send us research from dissecting a xenomorph." + +/datum/experiment/autopsy/xenomorph/is_valid_autopsy(mob/target) + return isalien(target) diff --git a/code/modules/experisci/experiment/types/dissection_experiment.dm b/code/modules/experisci/experiment/types/dissection_experiment.dm deleted file mode 100644 index 7e077920321..00000000000 --- a/code/modules/experisci/experiment/types/dissection_experiment.dm +++ /dev/null @@ -1,39 +0,0 @@ -/datum/experiment/dissection - name = "Dissection Experiment" - description = "An experiment requiring a dissection surgery to progress" - exp_tag = "Dissection" - performance_hint = "Perform a dissection surgery while connected to an operating computer." - -/datum/experiment/dissection/is_complete() - return completed - -/datum/experiment/dissection/perform_experiment_actions(datum/component/experiment_handler/experiment_handler, mob/target) - if (is_valid_dissection(target)) - completed = TRUE - return TRUE - else - return FALSE - -/datum/experiment/dissection/proc/is_valid_dissection(mob/target) - return TRUE - -/datum/experiment/dissection/human - name = "Human Dissection Experiment" - description = "We don't want to invest in a station that doesn't know their coccyx from their cochlea. Send us back data dissecting a human to receive more funding." - -/datum/experiment/dissection/human/is_valid_dissection(mob/target) - return ishumanbasic(target) - -/datum/experiment/dissection/nonhuman - name = "Non-human Dissection Experiment" - description = "When we asked for a tail bone, we didn't mean...look, just send us back data from something OTHER than a human. It could be a monkey for all we care, just send us research." - -/datum/experiment/dissection/nonhuman/is_valid_dissection(mob/target) - return ishuman(target) && !ishumanbasic(target) - -/datum/experiment/dissection/xenomorph - name = "Xenomorph Dissection Experiment" - description = "Our understanding of the xenomorph only scratches the surface. Send us research from dissecting a xenomorph." - -/datum/experiment/dissection/xenomorph/is_valid_dissection(mob/target) - return isalien(target) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index a921e8e482e..48d3560bcd1 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -821,6 +821,8 @@ if(health <= HEALTH_THRESHOLD_DEAD && !HAS_TRAIT(src, TRAIT_NODEATH)) death() return + if(HAS_TRAIT_FROM(src, TRAIT_DISSECTED, AUTOPSY_TRAIT)) + REMOVE_TRAIT(src, TRAIT_DISSECTED, AUTOPSY_TRAIT) if(health <= hardcrit_threshold && !HAS_TRAIT(src, TRAIT_NOHARDCRIT)) set_stat(HARD_CRIT) else if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT)) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index bf5aaf2f404..ff013ca09d3 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -361,6 +361,14 @@ if (!isnull(trait_exam)) . += trait_exam + if(isliving(user)) + var/mob/living/morbid_weirdo = user + if(HAS_MIND_TRAIT(morbid_weirdo, TRAIT_MORBID)) + if(HAS_TRAIT(src, TRAIT_DISSECTED)) + msg += "[span_notice("[t_He] appears to have been dissected. Useless for examination... for now.")]\n" + if(HAS_TRAIT(src, TRAIT_SURGICALLY_ANALYZED)) + msg += "[span_notice("A skilled hand has mapped this one's internal intricacies. It will be far easier to perform future experimentations upon [t_him]. Exquisite.")]\n" + var/perpname = get_face_name(get_id_name("")) if(perpname && (HAS_TRAIT(user, TRAIT_SECURITY_HUD) || HAS_TRAIT(user, TRAIT_MEDICAL_HUD))) var/datum/record/crew/target_record = find_record(perpname) diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index 11a4fd99c0a..a1bd972a34d 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -403,7 +403,7 @@ "soda_dispenser", ) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) - required_experiments = list(/datum/experiment/dissection/human) + required_experiments = list(/datum/experiment/autopsy/human) /datum/techweb_node/adv_biotech id = "adv_biotech" @@ -425,7 +425,7 @@ "smoke_machine", ) research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) - required_experiments = list(/datum/experiment/dissection/nonhuman) + required_experiments = list(/datum/experiment/autopsy/nonhuman) discount_experiments = list(/datum/experiment/scanning/random/material/meat = 4000) /datum/techweb_node/xenoorgan_biotech @@ -443,7 +443,7 @@ discount_experiments = list( /datum/experiment/scanning/random/cytology/easy = 1000, /datum/experiment/scanning/points/slime/hard = 5000, - /datum/experiment/dissection/xenomorph = 5000, + /datum/experiment/autopsy/xenomorph = 5000, ) /datum/techweb_node/bio_process diff --git a/code/modules/surgery/autopsy.dm b/code/modules/surgery/autopsy.dm index 4a552823d68..9bd232e4c0d 100644 --- a/code/modules/surgery/autopsy.dm +++ b/code/modules/surgery/autopsy.dm @@ -34,8 +34,13 @@ display_pain(target, "You feel a burning sensation in your chest!") /datum/surgery_step/autopsy/success(mob/user, mob/living/carbon/target, target_zone, obj/item/autopsy_scanner/tool, datum/surgery/surgery, default_display_results = FALSE) - ADD_TRAIT(target, TRAIT_DISSECTED, REF(src)) + ADD_TRAIT(target, TRAIT_DISSECTED, AUTOPSY_TRAIT) + if(!HAS_TRAIT(src, TRAIT_SURGICALLY_ANALYZED)) + ADD_TRAIT(target, TRAIT_SURGICALLY_ANALYZED, AUTOPSY_TRAIT) tool.scan_cadaver(user, target) + var/obj/machinery/computer/operating/operating_computer = surgery.locate_operating_computer(get_turf(target)) + if (!isnull(operating_computer)) + SEND_SIGNAL(operating_computer, COMSIG_OPERATING_COMPUTER_AUTOPSY_COMPLETE, target) if(HAS_MIND_TRAIT(user, TRAIT_MORBID) && ishuman(user)) var/mob/living/carbon/human/morbid_weirdo = user morbid_weirdo.add_mood_event("morbid_dissection_success", /datum/mood_event/morbid_dissection_success) diff --git a/code/modules/surgery/dissection.dm b/code/modules/surgery/dissection.dm deleted file mode 100644 index 917b67ff5f8..00000000000 --- a/code/modules/surgery/dissection.dm +++ /dev/null @@ -1,85 +0,0 @@ -/datum/surgery/dissection - name = "Dissection" - target_mobtypes = list( - /mob/living/carbon/human, - /mob/living/carbon/alien, - ) - surgery_flags = SURGERY_REQUIRE_RESTING | SURGERY_REQUIRE_LIMB | SURGERY_REQUIRES_REAL_LIMB | SURGERY_MORBID_CURIOSITY - possible_locs = list(BODY_ZONE_CHEST) - steps = list( - /datum/surgery_step/incise, - /datum/surgery_step/retract_skin, - /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/dissection, - /datum/surgery_step/close, - ) - -/datum/surgery/dissection/can_start(mob/user, mob/living/patient) - . = ..() - - // This isn't a real advanced tech, but it doesn't make sense using it without an operating computer - if (isnull(locate_operating_computer(get_turf(patient)))) - return FALSE - - if (HAS_TRAIT(patient, TRAIT_DISSECTED)) - return FALSE - - if (patient.stat != DEAD) - return FALSE - - return TRUE - -/datum/surgery_step/dissection - name = "dissect (autopsy scanner)" - time = 16 SECONDS - implements = list( - /obj/item/autopsy_scanner = 100, - ) - -/datum/surgery_step/dissection/preop(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery) - var/ending = "..." - if (isnull(surgery.locate_operating_computer(get_turf(target)))) - ending = ", but without a linked operating computer, you won't get any research!" - - display_results( - user, - target, - span_notice("You start to dissect [target][ending]"), - span_notice("[user] starts to dissect [target]..."), - span_notice("[user] begins to start poking around inside your corpse...hey, wait a minute!"), - ) - -/datum/surgery_step/dissection/success(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, default_display_results) - ADD_TRAIT(target, TRAIT_DISSECTED, REF(src)) - - var/obj/machinery/computer/operating/operating_computer = surgery.locate_operating_computer(get_turf(target)) - if (!isnull(operating_computer)) - SEND_SIGNAL(operating_computer, COMSIG_OPERATING_COMPUTER_DISSECTION_COMPLETE, target) - if(HAS_MIND_TRAIT(user, TRAIT_MORBID) && ishuman(user)) - var/mob/living/carbon/human/morbid_weirdo = user - morbid_weirdo.add_mood_event("morbid_dissection_success", /datum/mood_event/morbid_dissection_success) - - return TRUE - -/datum/surgery_step/dissection/failure(mob/user, mob/living/target, target_zone, obj/item/tool, datum/surgery/surgery, fail_prob) - display_results( - user, - target, - span_notice("You mess up, damaging some of the internal organs!"), - span_notice("[user] messes up, damaging some of the internal organs!"), - span_notice("[user] messes up, damaging some of your internal organs!"), - ) - - target.adjustOrganLoss(pick( - ORGAN_SLOT_APPENDIX, - ORGAN_SLOT_BRAIN, - ORGAN_SLOT_HEART, - ORGAN_SLOT_LIVER, - ORGAN_SLOT_LUNGS, - ORGAN_SLOT_STOMACH, - ), 20) - - return FALSE - -/datum/surgery_step/dissection/tool_check(mob/user, obj/item/tool) - return implement_type != /obj/item || tool.get_sharpness() > 0 diff --git a/code/modules/surgery/surgery_step.dm b/code/modules/surgery/surgery_step.dm index b6602c15139..eae33e305b8 100644 --- a/code/modules/surgery/surgery_step.dm +++ b/code/modules/surgery/surgery_step.dm @@ -87,7 +87,7 @@ if(tool) speed_mod = tool.toolspeed - if(HAS_TRAIT(target, TRAIT_DISSECTED)) + if(HAS_TRAIT(target, TRAIT_SURGICALLY_ANALYZED)) speed_mod *= SURGERY_SPEED_DISSECTION_MODIFIER if(check_morbid_curiosity(user, tool, surgery)) diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index 1c770141f6f..4a1b567a287 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -581,7 +581,7 @@ * * Bonuses if the surgery is being done by a morbid user and it is of their interest. * - * Morbid users are interested in; dissections, autospies, revival surgery, plastic surgery, organ/feature manipulations, amputations + * Morbid users are interested in; autospies, revival surgery, plastic surgery, organ/feature manipulations, amputations * * Otherwise, normal tool. */ diff --git a/tgstation.dme b/tgstation.dme index 4bbceb7eece..0bcbf65d79b 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3509,7 +3509,7 @@ #include "code\modules\experisci\experiment\experiments.dm" #include "code\modules\experisci\experiment\physical_experiments.dm" #include "code\modules\experisci\experiment\handlers\experiment_handler.dm" -#include "code\modules\experisci\experiment\types\dissection_experiment.dm" +#include "code\modules\experisci\experiment\types\autopsy_experiment.dm" #include "code\modules\experisci\experiment\types\experiment.dm" #include "code\modules\experisci\experiment\types\exploration.dm" #include "code\modules\experisci\experiment\types\ordnance.dm" @@ -5117,7 +5117,6 @@ #include "code\modules\surgery\core_removal.dm" #include "code\modules\surgery\coronary_bypass.dm" #include "code\modules\surgery\dental_implant.dm" -#include "code\modules\surgery\dissection.dm" #include "code\modules\surgery\ear_surgery.dm" #include "code\modules\surgery\eye_surgery.dm" #include "code\modules\surgery\gastrectomy.dm"