From fbf18ddd7e82a0be1ddb3f8879ae89bb5303f63c Mon Sep 17 00:00:00 2001 From: Miniature Date: Wed, 9 Nov 2011 00:20:02 +1030 Subject: [PATCH] Arrivals scanner --- baystation12.dme | 1 + code/game/machinery/scanner.dm | 117 +++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 code/game/machinery/scanner.dm diff --git a/baystation12.dme b/baystation12.dme index 1e8635b68d0..e654cf02ac9 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -441,6 +441,7 @@ #include "code\game\machinery\rechargestation.dm" #include "code\game\machinery\requests_console.dm" #include "code\game\machinery\robot_fabricator.dm" +#include "code\game\machinery\scanner.dm" #include "code\game\machinery\seed_extractor.dm" #include "code\game\machinery\shieldgen.dm" #include "code\game\machinery\sink.dm" diff --git a/code/game/machinery/scanner.dm b/code/game/machinery/scanner.dm new file mode 100644 index 00000000000..c07587ee787 --- /dev/null +++ b/code/game/machinery/scanner.dm @@ -0,0 +1,117 @@ +obj/machinery/scanner + name = "Scanner" + var/outputdir = 0 + icon = 'computer.dmi' + icon_state = "aiupload" + density = 1 + anchored = 1 + var/lastuser = null +obj/machinery/scanner/New() + if(!outputdir) + switch(dir) + if(1) + outputdir = 2 + if(2) + outputdir = 1 + if(4) + outputdir = 8 + if(8) + outputdir = 4 + if(!outputdir) + outputdir = 8 +obj/machinery/scanner/attack_hand(mob/living/carbon/human/user) + if(!ishuman(user) || lastuser == user.real_name) + return + lastuser = user.real_name + var/mname = user.real_name + var/dna = user.dna.unique_enzymes + var/bloodtype = user.b_type + var/fingerprint = md5(user.dna.uni_identity) + var/list/marks = list() + var/age = user.age + var/gender = user.gender + var/DBQuery/cquery = dbcon.NewQuery("SELECT * from jobban WHERE ckey='[user.ckey]'") + if(!cquery.Execute()) return + else + while(cquery.NextRow()) + var/list/row = cquery.GetRowData() + marks += row["rank"] + var/text = {" +
Report

+ Name: [mname] + Age: [age] + Sex: [gender] + DNA: [dna] + Blood Type: [bloodtype] + Fingerprint: [fingerprint] + + Black Marks:
"} + for(var/A in marks) + text += "\red[A]
" + user << "\blue You feel a sting as the scanner sucks all your information out of you and sticks it in it's database." + var/turf/T = get_step(src,outputdir) + var/obj/item/weapon/paper/print = new(T) + print.name = "[mname] Report" + print.info = text + print.stamped = 1 + + for(var/datum/data/record/test in data_core.general) + if (test.fields["name"] == mname) + return + + var/datum/data/record/G = new() + var/datum/data/record/M = new() + var/datum/data/record/S = new() + var/datum/data/record/L = new() + G.fields["rank"] = "Unassigned" + G.fields["name"] = H.real_name + G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6)) + M.fields["name"] = G.fields["name"] + M.fields["id"] = G.fields["id"] + S.fields["name"] = G.fields["name"] + S.fields["id"] = G.fields["id"] + if(H.gender == FEMALE) + G.fields["sex"] = "Female" + else + G.fields["sex"] = "Male" + G.fields["age"] = text("[]", H.age) + G.fields["fingerprint"] = text("[]", md5(H.dna.uni_identity)) + G.fields["p_stat"] = "Active" + G.fields["m_stat"] = "Stable" + M.fields["b_type"] = text("[]", H.b_type) + M.fields["b_dna"] = H.dna.unique_enzymes + M.fields["mi_dis"] = "None" + M.fields["mi_dis_d"] = "No minor disabilities have been declared." + M.fields["ma_dis"] = "None" + M.fields["ma_dis_d"] = "No major disabilities have been diagnosed." + M.fields["alg"] = "None" + M.fields["alg_d"] = "No allergies have been detected in this patient." + M.fields["cdi"] = "None" + M.fields["cdi_d"] = "No diseases have been diagnosed at the moment." + M.fields["notes"] = "No notes." + S.fields["criminal"] = "None" + S.fields["mi_crim"] = "None" + S.fields["mi_crim_d"] = "No minor crime convictions." + S.fields["ma_crim"] = "None" + S.fields["ma_crim_d"] = "No major crime convictions." + S.fields["notes"] = "No notes." + + //Begin locked reporting + L.fields["name"] = H.real_name + L.fields["sex"] = H.gender + L.fields["age"] = H.age + L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]") + L.fields["rank"] = H.mind.assigned_role + L.fields["b_type"] = H.b_type + L.fields["b_dna"] = H.dna.unique_enzymes + L.fields["enzymes"] = H.dna.struc_enzymes + L.fields["identity"] = H.dna.uni_identity + L.fields["image"] = H_icon//What the person looks like. Naked, in this case. + //End locked reporting + + data_core.general += G + data_core.medical += M + data_core.security += S + data_core.locked += L + +