diff --git a/code/datums/action.dm b/code/datums/action.dm index 0bec4e37d35..499570be291 100644 --- a/code/datums/action.dm +++ b/code/datums/action.dm @@ -145,7 +145,7 @@ name = "Pull The Starting Cord" /datum/action/item_action/print_report - name = "Print Forensic Report" + name = "Print Report" /datum/action/item_action/toggle_gunlight name = "Toggle Gunlight" diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index a2fd5881ca7..ca4da5b2107 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -379,6 +379,9 @@ REAGENT SCANNER origin_tech = "magnets=2;biotech=2" var/details = 0 var/recent_fail = 0 + var/datatoprint = "" + var/scanning = 1 + actions_types = list(/datum/action/item_action/print_report) /obj/item/device/mass_spectrometer/New() ..() @@ -409,13 +412,13 @@ REAGENT SCANNER else blood_traces = params2list(R.data["trace_chem"]) break - var/dat = "Trace Chemicals Found: " + var/dat = "" for(var/R in blood_traces) if(prob(reliability)) if(details) dat += "[R] ([blood_traces[R]] units) " else - dat += "[R] " + dat += "[R]
" recent_fail = 0 else if(recent_fail) @@ -424,8 +427,14 @@ REAGENT SCANNER return else recent_fail = 1 - to_chat(user, "[dat]") - reagents.clear_reagents() + if(dat) + to_chat(user, "Trace chemicals detected in blood sample: [dat]") + datatoprint = dat + scanning = 0 + reagents.clear_reagents() + else + reagents.clear_reagents() + to_chat(user, "No trace chemicals detected in blood sample.") return /obj/item/device/mass_spectrometer/adv @@ -434,6 +443,28 @@ REAGENT SCANNER details = 1 origin_tech = "magnets=4;biotech=2" +/obj/item/device/mass_spectrometer/proc/print_report() + if(!scanning) + usr.visible_message("[src] rattles and prints out a sheet of paper.") + playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1) + sleep(50) + + var/obj/item/weapon/paper/P = new(get_turf(src)) + P.name = "Mass Spectrometer Scanner Report: [worldtime2text()]" + P.info = "
Mass Spectrometer

Data Analysis:



Trace chemicals detected:
[datatoprint]

" + + if(ismob(loc)) + var/mob/M = loc + M.put_in_hands(P) + to_chat(M, "Report printed. Log cleared.") + datatoprint = "" + scanning = 1 + else + to_chat(usr, "[src] has no logs or is already in use.") + +/obj/item/device/mass_spectrometer/ui_action_click() + print_report() + /obj/item/device/reagent_scanner name = "reagent scanner" desc = "A hand-held reagent scanner which identifies chemical agents." @@ -449,6 +480,9 @@ REAGENT SCANNER origin_tech = "magnets=2;biotech=2" var/details = 0 var/recent_fail = 0 + var/datatoprint = "" + var/scanning = 1 + actions_types = list(/datum/action/item_action/print_report) /obj/item/device/reagent_scanner/afterattack(obj/O, mob/user as mob) if(user.stat) @@ -461,7 +495,6 @@ REAGENT SCANNER if(crit_fail) to_chat(user, "This device has critically failed and is no longer functional!") return - if(!isnull(O.reagents)) var/dat = "" if(O.reagents.reagent_list.len > 0) @@ -478,11 +511,12 @@ REAGENT SCANNER recent_fail = 1 if(dat) to_chat(user, "Chemicals found: [dat]") + datatoprint = dat + scanning = 0 else to_chat(user, "No active chemical agents found in [O].") else to_chat(user, "No significant chemical agents found in [O].") - return /obj/item/device/reagent_scanner/adv @@ -491,6 +525,28 @@ REAGENT SCANNER details = 1 origin_tech = "magnets=4;biotech=2" +/obj/item/device/reagent_scanner/proc/print_report() + if(!scanning) + usr.visible_message("[src] rattles and prints out a sheet of paper.") + playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1) + sleep(50) + + var/obj/item/weapon/paper/P = new(get_turf(src)) + P.name = "Reagent Scanner Report: [worldtime2text()]" + P.info = "
Reagent Scanner

Data Analysis:



Chemical agents detected:
[datatoprint]

" + + if(ismob(loc)) + var/mob/M = loc + M.put_in_hands(P) + to_chat(M, "Report printed. Log cleared.") + datatoprint = "" + scanning = 1 + else + to_chat(usr, "[src] has no logs or is already in use.") + +/obj/item/device/reagent_scanner/ui_action_click() + print_report() + /obj/item/device/slime_scanner name = "slime scanner" icon_state = "adv_spectrometer_s" @@ -532,4 +588,4 @@ REAGENT SCANNER user.show_message("Genetic destability: [T.mutation_chance]% chance of mutation on splitting", 1) if(T.cores > 1) user.show_message("Anomalous slime core amount detected", 1) - user.show_message("Growth progress: [T.amount_grown]/10", 1) + user.show_message("Growth progress: [T.amount_grown]/10", 1) \ No newline at end of file