/obj/machinery/artifact_analyser name = "Anomaly Analyser" desc = "Studies the emissions of anomalous materials to discover their uses." icon = 'icons/obj/virology.dmi' icon_state = "isolator" anchored = 1 density = 1 var/scan_in_progress = 0 var/scan_num = 0 var/obj/scanned_obj var/obj/machinery/artifact_scanpad/owned_scanner = null var/scan_completion_time = 0 var/scan_duration = 50 var/obj/scanned_object var/report_num = 0 /obj/machinery/artifact_analyser/Initialize() . = ..() reconnect_scanner() /obj/machinery/artifact_analyser/proc/reconnect_scanner() //connect to a nearby scanner pad owned_scanner = locate(/obj/machinery/artifact_scanpad) in get_step(src, dir) if(!owned_scanner) owned_scanner = locate(/obj/machinery/artifact_scanpad) in orange(1, src) /obj/machinery/artifact_analyser/attack_hand(var/mob/user as mob) src.add_fingerprint(user) interact(user) /obj/machinery/artifact_analyser/interact(mob/user) if(stat & (NOPOWER|BROKEN) || get_dist(src, user) > 1) user.unset_machine(src) return var/dat = "Anomalous material analyser
" dat += "
" if(!owned_scanner) reconnect_scanner() if(!owned_scanner) dat += "Unable to locate analysis pad.
" else if(scan_in_progress) dat += "Please wait. Analysis in progress.
" dat += "Halt scanning.
" else dat += "Scanner is ready.
" dat += "Begin scanning.
" dat += "
" dat += "
" dat += "Refresh Close" user << browse(dat, "window=artanalyser;size=450x500") user.set_machine(src) onclose(user, "artanalyser") /obj/machinery/artifact_analyser/process() if(scan_in_progress && world.time > scan_completion_time) scan_in_progress = 0 updateDialog() var/results = "" if(!owned_scanner) reconnect_scanner() if(!owned_scanner) results = "Error communicating with scanner." else if(!scanned_object || scanned_object.loc != owned_scanner.loc) results = "Unable to locate scanned object. Ensure it was not moved in the process." else results = get_scan_info(scanned_object) src.visible_message("[name] states, \"Scanning complete.\"") var/obj/item/weapon/paper/P = new(src.loc) P.name = "[src] report #[++report_num]" P.info = "[src] analysis report #[report_num]
" P.info += "
" P.info += "[bicon(scanned_object)] [results]" P.stamped = list(/obj/item/weapon/stamp) P.overlays = list("paper_stamped") if(scanned_object && istype(scanned_object, /obj/machinery/artifact)) var/obj/machinery/artifact/A = scanned_object A.anchored = 0 A.being_used = 0 scanned_object = null /obj/machinery/artifact_analyser/Topic(href, href_list) if(href_list["begin_scan"]) if(!owned_scanner) reconnect_scanner() if(owned_scanner) var/artifact_in_use = 0 for(var/obj/O in owned_scanner.loc) if(O == owned_scanner) continue if(O.invisibility) continue if(istype(O, /obj/machinery/artifact)) var/obj/machinery/artifact/A = O if(A.being_used) artifact_in_use = 1 else A.anchored = 1 A.being_used = 1 if(artifact_in_use) src.visible_message("[name] states, \"Cannot scan. Too much interference.\"") else scanned_object = O scan_in_progress = 1 scan_completion_time = world.time + scan_duration src.visible_message("[name] states, \"Scanning begun.\"") break if(!scanned_object) src.visible_message("[name] states, \"Unable to isolate scan target.\"") if(href_list["halt_scan"]) scan_in_progress = 0 src.visible_message("[name] states, \"Scanning halted.\"") if(href_list["close"]) usr.unset_machine(src) usr << browse(null, "window=artanalyser") ..() updateDialog() //hardcoded responses, oh well /obj/machinery/artifact_analyser/proc/get_scan_info(var/obj/scanned_obj) switch(scanned_obj.type) if(/obj/machinery/auto_cloner) return "Automated cloning pod - appears to rely on an artificial ecosystem formed by semi-organic nanomachines and the contained liquid.
The liquid resembles protoplasmic residue supportive of unicellular organism developmental conditions.
The structure is composed of a titanium alloy." if(/obj/machinery/power/supermatter) return "Superdense phoron clump - appears to have been shaped or hewn, structure is composed of matter aproximately 20 times denser than ordinary refined phoron." if(/obj/structure/constructshell) return "Tribal idol - subject resembles statues/emblems built by superstitious pre-warp civilisations to honour their gods. Material appears to be a rock/plastcrete composite." if(/obj/machinery/giga_drill) return "Automated mining drill - structure composed of titanium-carbide alloy, with tip and drill lines edged in an alloy of diamond and phoron." if(/obj/structure/cult/pylon) return "Tribal pylon - subject resembles statues/emblems built by cargo cult civilisations to honour energy systems from post-warp civilisations." if(/obj/machinery/replicator) return "Automated construction unit - subject appears to be able to synthesize various objects given a material, some with simple internal circuitry. Method unknown." if(/obj/structure/crystal) return "Crystal formation - pseudo-organic crystalline matrix, unlikely to have formed naturally. No known technology exists to synthesize this exact composition." if(/obj/machinery/artifact) var/obj/machinery/artifact/A = scanned_obj var/out = "Anomalous alien device - composed of an unknown alloy.

" if(A.my_effect) out += A.my_effect.getDescription() if(A.secondary_effect && A.secondary_effect.activated) out += "

Internal scans indicate ongoing secondary activity operating independently from primary systems.

" out += A.secondary_effect.getDescription() return out else return "[scanned_obj.name] - mundane application."