Added the capability for the security PDA to scan items in like the detectives scanner, and for it to be loaded into the database in the same manner.

This commit is contained in:
SkyMarshal
2012-05-31 15:47:05 -07:00
parent b70673e0c8
commit e9ebf14acf
5 changed files with 98 additions and 62 deletions

View File

@@ -840,22 +840,23 @@ ________________________________________________________________________________
U << "\red Procedure interrupted. Protocol terminated."
return
else if(istype(I, /obj/item/weapon/disk/tech_disk))//If it's a data disk, we want to copy the research on to the suit.
if(I:stored)//If it has something on it.
var/obj/item/weapon/disk/tech_disk/T = I
if(T.stored)//If it has something on it.
U << "Research information detected, processing..."
if(do_after(U,s_delay))
for(var/datum/tech/current_data in stored_research)
if(current_data.id==I:stored.id)
if(current_data.level<I:stored.level)
current_data.level=I:stored.level
if(current_data.id==T.stored.id)
if(current_data.level<T.stored.level)
current_data.level=T.stored.level
break
I:stored = null
T.stored = null
U << "\blue Data analyzed and updated. Disk erased."
else
U << "\red <b>ERROR</b>: \black Procedure interrupted. Process terminated."
else
I.loc = src
t_disk = I
U << "\blue You slot \the [I] into \the [src]."
T.loc = src
t_disk = T
U << "\blue You slot \the [T] into \the [src]."
return
..()

View File

@@ -860,6 +860,8 @@
user.show_message("\blue No radiation detected.")
/obj/item/device/pda/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
if(!in_range(A, user))
return
switch(scanmode)
if(2)
if (!A.fingerprints)
@@ -878,6 +880,9 @@
user << "\blue Found [complete_prints.len] intact prints"
for(var/i in complete_prints)
user << "\blue [i]"
if(cartridge && cartridge.access_security)
cartridge.add_data(A)
user << "Data added to internal storage. Scan with a High-Resolution Scanner to retreive."
if(3)
if(!isnull(A.reagents))

View File

@@ -29,6 +29,7 @@
var/list/powermonitors = list()
var/message1 // used for status_displays
var/message2
var/list/stored = list()
engineering
name = "Power-ON Cartridge"
@@ -50,6 +51,7 @@
spawn(5)
radio = new /obj/item/radio/integrated/beepsky(src)
detective
name = "D.E.T.E.C.T. Cartridge"
icon_state = "cart-s"
@@ -570,6 +572,43 @@ Code:
else
menu += "ERROR: Unable to determine current location."
proc/add_data(atom/A as mob|obj|turf|area)
//I love hashtables.
var/list/data_entry = stored["\ref [A]"]
if(islist(data_entry)) //Yay, it was already stored!
//Merge the fingerprints.
var/list/data_prints = data_entry[1]
for(var/print in A.fingerprints)
var/merged_print = data_prints[print]
if(!merged_print)
data_prints[print] = A.fingerprints[print]
else
data_prints[print] = stringmerge(data_prints[print],A.fingerprints[print])
//Now the fibers
var/list/fibers = data_entry[2]
if(!fibers)
fibers = list()
if(A.suit_fibers && A.suit_fibers.len)
for(var/j = 1, j <= A.suit_fibers.len, j++) //Fibers~~~
if(!fibers.Find(A.suit_fibers[j])) //It isn't! Add!
fibers += A.suit_fibers[j]
var/list/blood = data_entry[3]
if(!blood)
blood = list()
if(A.blood_DNA && A.blood_DNA.len)
for(var/main_blood in A.blood_DNA)
if(!blood[main_blood])
blood[main_blood] = A.blood_DNA[blood]
return 1
var/list/sum_list[4] //Pack it back up!
sum_list[1] = A.fingerprints
sum_list[2] = A.suit_fibers
sum_list[3] = A.blood_DNA
sum_list[4] = "\The [A] in [get_area(A)]"
stored["\ref [A]"] = sum_list
return 0
/obj/item/weapon/cartridge/Topic(href, href_list)
..()

View File

@@ -64,7 +64,6 @@ MASS SPECTROMETER
desc = "Used to scan objects for DNA and fingerprints."
icon_state = "forensic1"
var/amount = 20.0
// var/printing = 0.0
var/list/stored = list()
w_class = 3.0
item_state = "electronic"
@@ -90,16 +89,6 @@ MASS SPECTROMETER
W.add_fingerprint(user)
return
// attack_self(mob/user as mob)
// src.printing = !( src.printing )
// if(src.printing)
// user << "\blue Printing turned on"
// else
// user << "\blue Printing turned off"
// src.icon_state = text("forensic[]", src.printing)
// add_fingerprint(user)
// return
attack(mob/living/carbon/human/M as mob, mob/user as mob)
if (!ishuman(M))
user << "\red [M] is not human and cannot have the fingerprints."
@@ -132,17 +121,16 @@ MASS SPECTROMETER
return
afterattack(atom/A as obj|turf|area, mob/user as mob)
if(!(locate(A) in oview(1,user)))
if(!in_range(A,user))
return
if(src.loc != user)
if(loc != user)
return
if(istype(A,/obj/machinery/computer/forensic_scanning)) //breaks shit.
return
if(istype(A,/obj/item/weapon/f_card))
user << "Haha, nice try. Cheater. (It would break stuff anyways.)"
user << "The scanner displays on the screen: \"ERROR 43: Object on Excluded Object List.\""
return
if(!A.fingerprints)
A.fingerprints = list()
add_fingerprint(user)
//Special case for blood splaters.
@@ -151,50 +139,46 @@ MASS SPECTROMETER
for(var/blood in A.blood_DNA)
user << "\blue Blood type: [A.blood_DNA[blood]]\nDNA: [blood]"
return
var/duplicate = 0
//General
if ((!A.fingerprints || !A.fingerprints.len) && !A.suit_fibers && !A.blood_DNA)
user << "\blue Unable to locate any fingerprints, materials, fibers, or blood on [A]!"
user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "his": "her"] humming[prob(70) ? " gently." : "."]" ,\
"\blue Unable to locate any fingerprints, materials, fibers, or blood on [A]!",\
"You hear a faint hum of electrical equipment.")
return 0
//BLOOD
else if (A.blood_DNA)
user << "\blue Blood found on [A]. Analysing..."
sleep(15)
if(!duplicate)
duplicate = 1
var/i = add_data(A)
if(i)
user << "\blue Blood already in memory."
for(var/blood in A.blood_DNA)
user << "\blue Blood type: [A.blood_DNA[blood]]\nDNA: [blood]"
else
user << "\blue No Blood Located"
if(add_data(A))
user << "\blue Object already in internal memory. Consolidating data..."
return
//PRINTS
if(!A.fingerprints || !A.fingerprints.len)
user << "\blue No Fingerprints Located."
if(A.fingerprints)
del(A.fingerprints)
else
user << text("\blue Isolated [A.fingerprints.len] fingerprints: Data Stored: Scan with Hi-Res Forensic Scanner to retrieve.")
if(!duplicate)
duplicate = 1
var/i = add_data(A)
if(i)
user << "\blue Fingerprints already in memory."
user << "\blue Isolated [A.fingerprints.len] fingerprints: Data Stored: Scan with Hi-Res Forensic Scanner to retrieve."
//FIBERS
if(!A.suit_fibers)
user << "\blue No Fibers/Materials Located."
else
if(A.suit_fibers)
user << "\blue Fibers/Materials Data Stored: Scan with Hi-Res Forensic Scanner to retrieve."
if(!duplicate)
duplicate = 1
var/i = add_data(A)
if(i)
user << "\blue Fibers/Materials already in memory."
//Blood
if (A.blood_DNA)
user << "\blue Blood found on [A]. Analysing..."
spawn(15)
for(var/blood in A.blood_DNA)
user << "Blood type: \red [A.blood_DNA[blood]] \t \black DNA: \red [blood]"
if(prob(5))
user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "his": "her"] humming[prob(70) ? " gently." : "."]" ,\
"You finish scanning \the [A].",\
"You hear a faint hum of electrical equipment.")
return 0
else
user.visible_message("\The [user] scans \the [A] with \a [src], the air around [user.gender == MALE ? "his": "her"] humming[prob(70) ? " gently." : "."]\n[user.gender == MALE ? "He": "She"] seems to perk up slightly at the readout." ,\
"The results of the scan pique your interest.",\
"You hear a faint hum of electrical equipment, and someone making a thoughtful noise.")
return 0
return
proc/add_data(atom/A as mob|obj|turf|area)

View File

@@ -392,7 +392,7 @@ obj/machinery/computer/forensic_scanning
scan_data += "Fibers/Materials Found:<br>"
for(var/data in scanning.suit_fibers)
scan_data += "- [data]<br>"
if(istype(scanning,/obj/item/device/detective_scanner))
if(istype(scanning,/obj/item/device/detective_scanner) || (istype(scanning, /obj/item/device/pda) && scanning:cartridge && scanning:cartridge.access_security))
scan_data += "<br><b>Data transfered from Scanner to Database.</b><br>"
add_data_scanner(scanning)
else if(!scanning.fingerprints)
@@ -425,12 +425,19 @@ obj/machinery/computer/forensic_scanning
return
proc/add_data_scanner(var/obj/item/device/detective_scanner/W)
if(W.stored)
for(var/atom in W.stored)
var/list/data = W.stored[atom]
add_data_master(atom,data[1],data[2],data[3],data[4])
W.stored = list()
proc/add_data_scanner(var/obj/item/device/W)
if(istype(W, /obj/item/device/detective_scanner))
if(W:stored)
for(var/atom in W:stored)
var/list/data = W:stored[atom]
add_data_master(atom,data[1],data[2],data[3],data[4])
W:stored = list()
else if(istype(W, /obj/item/device/pda) && W:cartridge && W:cartridge.access_security)
if(W:cartridge.stored)
for(var/atom in W:cartridge.stored)
var/list/data = W:cartridge.stored[atom]
add_data_master(atom,data[1],data[2],data[3],data[4])
W:cartridge.stored = list()
return
proc/add_data(var/atom/scanned_atom)
@@ -475,7 +482,7 @@ obj/machinery/computer/forensic_scanning
if(!files)
files = list()
for(var/main_print in atom_fingerprints)
var/list/data_entry = files[main_print]
data_entry = files[main_print]
if(data_entry)//The print is already in here!
var/list/internal_atom = data_entry[atom_reference] //Lets see if we can find the current object
if(internal_atom)