mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
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:
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user