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 068c68b9bc9..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() ..() @@ -415,7 +418,7 @@ REAGENT SCANNER if(details) dat += "[R] ([blood_traces[R]] units) " else - dat += "[R] " + dat += "[R]
" recent_fail = 0 else if(recent_fail) @@ -426,17 +429,9 @@ REAGENT SCANNER recent_fail = 1 if(dat) to_chat(user, "Trace chemicals detected in blood sample: [dat]") - if(alert("Do you want to print a log file?","Scan Results","Yes", "No") == "Yes") - usr.visible_message("[src] rattles and prints out a sheet of paper.") - playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1) - sleep(30) - var/obj/item/weapon/paper/P = new(usr.loc) - P.name = "Mass Spectrometer Scanner Report: [worldtime2text()]" - P.info = "
Mass Spectrometer

Data Analysis:



Trace chemicals detected:
[dat]

" - usr.put_in_hands(P) - reagents.clear_reagents() - else - reagents.clear_reagents() + datatoprint = dat + scanning = 0 + reagents.clear_reagents() else reagents.clear_reagents() to_chat(user, "No trace chemicals detected in blood sample.") @@ -448,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." @@ -463,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) @@ -491,14 +511,8 @@ REAGENT SCANNER recent_fail = 1 if(dat) to_chat(user, "Chemicals found: [dat]") - if(alert("Do you want to print a log file?","Scan Results","Yes", "No") == "Yes") - usr.visible_message("[src] rattles and prints out a sheet of paper.") - playsound(loc, 'sound/goonstation/machines/printer_thermal.ogg', 50, 1) - sleep(30) - var/obj/item/weapon/paper/P = new(usr.loc) - P.name = "Reagent Scanner Report: [worldtime2text()]" - P.info = "
Reagent Scanner

Data Analysis:



Chemical agents detected:
[dat]

" - usr.put_in_hands(P) + datatoprint = dat + scanning = 0 else to_chat(user, "No active chemical agents found in [O].") else @@ -511,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"