From f85c58c082456959e5a659bc310a72df6f8e5f30 Mon Sep 17 00:00:00 2001
From: Luc <89928798+lewcc@users.noreply.github.com>
Date: Fri, 1 Mar 2024 07:46:41 -0500
Subject: [PATCH] Clarifies, cleans up auto-autopsy report functionality
(#24348)
* clarifies, cleans up long-neglected autopsy scanner mechanic
* constrain this a bit more
* Update code/game/objects/items/devices/autopsy.dm
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
---------
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
---
code/game/objects/items/devices/autopsy.dm | 35 +++++++++++++---------
1 file changed, 21 insertions(+), 14 deletions(-)
diff --git a/code/game/objects/items/devices/autopsy.dm b/code/game/objects/items/devices/autopsy.dm
index 8877f2a74ea..141a8973895 100644
--- a/code/game/objects/items/devices/autopsy.dm
+++ b/code/game/objects/items/devices/autopsy.dm
@@ -12,6 +12,7 @@
var/target_name = null
var/target_UID = null
var/timeofdeath = null
+ var/target_rank = null
/obj/item/autopsy_scanner/Destroy()
QDEL_LIST_ASSOC_VAL(wdata)
@@ -66,23 +67,28 @@
if(O.trace_chemicals[V] > 0 && !chemtraces.Find(V))
chemtraces += V
+/obj/item/autopsy_scanner/examine(mob/user)
+ . = ..()
+ if(Adjacent(user))
+ . += "You can use a pen on it to quickly write a coroner's report."
+
/obj/item/autopsy_scanner/attackby(obj/item/P, mob/user)
- if(is_pen(P))
- var/dead_name = input("Insert name of deceased individual")
- var/dead_rank = input("Insert rank of deceased individual")
- var/dead_tod = input("Insert time of death")
- var/dead_cause = input("Insert cause of death")
- var/dead_chems = input("Insert any chemical traces")
- var/dead_notes = input("Insert any relevant notes")
- var/obj/item/paper/R = new(user.loc)
- R.name = "Official Coroner's Report - [dead_name]"
- R.info = "[SSmapping.map_datum.fluff_name] - Coroner's Report
Name of Deceased: [dead_name]
Rank of Deceased: [dead_rank]
Time of Death: [dead_tod]
Cause of Death: [dead_cause]
Trace Chemicals: [dead_chems]
Additional Coroner's Notes: [dead_notes]
Coroner's Signature: "
- playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1)
- sleep(10)
- user.put_in_hands(R)
- else
+ if(!is_pen(P))
return ..()
+ var/dead_name = tgui_input_text(user, "Insert name of deceased individual", default = target_name, title = "Coroner's Report", max_length = 60)
+ var/rank = tgui_input_text(user, "Insert rank of deceased individual", default = target_rank, title = "Coroner's Report", max_length = 60)
+ var/tod = tgui_input_text(user, "Insert time of death", default = station_time_timestamp("hh:mm", timeofdeath), title = "Coroner's Report", max_length = 60)
+ var/cause = tgui_input_text(user, "Insert cause of death", title = "Coroner's Report", max_length = 60)
+ var/chems = tgui_input_text(user, "Insert any chemical traces", multiline = TRUE, title = "Coroner's Report")
+ var/notes = tgui_input_text(user, "Insert any relevant notes", multiline = TRUE, title = "Coroner's Report")
+ var/obj/item/paper/R = new(user.loc)
+ R.name = "Official Coroner's Report - [dead_name]"
+ R.info = "[station_name()] - Coroner's Report
Name of Deceased: [dead_name]
Rank of Deceased: [rank]
Time of Death: [tod]
Cause of Death: [cause]
Trace Chemicals: [chems]
Additional Coroner's Notes: [notes]
Coroner's Signature: "
+ playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, TRUE)
+ sleep(1 SECONDS)
+ user.put_in_hands(R)
+
/obj/item/autopsy_scanner/attack_self(mob/user)
var/scan_data = ""
@@ -161,6 +167,7 @@
if(target_UID != M.UID())
target_UID = M.UID()
target_name = M.name
+ target_rank = M.get_assignment(if_no_id = "Unknown", if_no_job = null)
wdata.Cut()
chemtraces.Cut()
timeofdeath = null