Files
Bubberstation/code/modules/surgery/autopsy.dm
SkyratBot 6980bfd465 [MIRROR] Fixes surgeries runtiming constantly when having the surgery initator open, fixes some surgeries missing sounds (#26411)
* Fixes surgeries runtiming constantly when having the surgery initator open, fixes some surgeries missing sounds (#81307)

## About The Pull Request

Fixes #79318

- See the issue for more information. I fixed the runtimes as expected,
and then removed `SURGERY_REQUIRE_LIMB` from some surgeries which don't
actually require a limb, such as implant removal, dissection, and living
revival. I could've easily missed some, and as a result some surgeries
are lost to the void and unselectable, but from what I could tell in
testing it seems... fine.

- Adds `SHOULD_CALL_PARENT` to surgery `can_start`. Cleans up some
surgery `can_start` overrides.

- Adds missing sounds to puncture repair surgery.

## Changelog

🆑 Melbert
fix: Fixed Puncture Repair surgery not having surgical sounds
fix: Fixed Surgery Initiator potentially showing invalid surgeries
/🆑

* Fixes surgeries runtiming constantly when having the surgery initator open, fixes some surgeries missing sounds

* Fixeed

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
2024-02-08 21:54:06 +01:00

59 lines
2.3 KiB
Plaintext

/datum/surgery/autopsy
name = "Autopsy"
surgery_flags = SURGERY_IGNORE_CLOTHES | SURGERY_REQUIRE_RESTING | SURGERY_REQUIRE_LIMB | SURGERY_MORBID_CURIOSITY
possible_locs = list(BODY_ZONE_CHEST)
steps = list(
/datum/surgery_step/incise,
/datum/surgery_step/retract_skin,
/datum/surgery_step/autopsy,
/datum/surgery_step/close,
)
/datum/surgery/autopsy/can_start(mob/user, mob/living/patient)
if(!..())
return FALSE
if(patient.stat != DEAD)
return FALSE
if(HAS_TRAIT_FROM(patient, TRAIT_DISSECTED, AUTOPSY_TRAIT))
return FALSE
return TRUE
/datum/surgery_step/autopsy
name = "Perform Autopsy (autopsy scanner)"
implements = list(/obj/item/autopsy_scanner = 100)
time = 10 SECONDS
success_sound = 'sound/machines/printer.ogg'
/datum/surgery_step/autopsy/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
target,
span_notice("You begins performing an autopsy on [target]..."),
span_notice("[user] uses [tool] to perform an autopsy on [target]."),
span_notice("[user] uses [tool] on [target]'s chest."),
)
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, 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)
return ..()
/datum/surgery_step/autopsy/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(
user,
target,
span_warning("You screw up, bruising [target]'s chest!"),
span_warning("[user] screws up, brusing [target]'s chest!"),
span_warning("[user] screws up!"),
)
target.adjustBruteLoss(5)