BS12 Detective Work port.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3229 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
joe.heinemeyer@gmail.com
2012-03-02 05:23:08 +00:00
parent 39b8f7b798
commit 113beeb052
35 changed files with 9900 additions and 8470 deletions
@@ -163,6 +163,7 @@
new /obj/item/weapon/fcardholder(src)
new /obj/item/weapon/clipboard(src)
new /obj/item/device/detective_scanner(src)
new /obj/item/weapon/storage/box/evidence(src)
return
+18 -6
View File
@@ -766,12 +766,14 @@
user << "\blue No fingerprints found on [C]"
else
user << text("\blue [C]'s Fingerprints: [md5(C:dna.uni_identity)]")
if ( !(C:blood_DNA) )
if ( !(C:blood_DNA.len) )
user << "\blue No blood found on [C]"
else
user << "\blue Blood found on [C]. Analysing..."
spawn(15)
user << "\blue Blood type: [C:blood_type]\nDNA: [C:blood_DNA]"
for(var/i = 1, i < C:blood_DNA.len, i++)
var/list/templist = C:blood_DNA[i]
user << "\blue Blood type: [templist[2]]\nDNA: [templist[1]]"
if(4)
for (var/mob/O in viewers(C, null))
@@ -789,10 +791,20 @@
if (!A.fingerprints)
user << "\blue Unable to locate any fingerprints on [A]!"
else
var/list/L = params2list(A:fingerprints)
user << "\blue Isolated [L.len] fingerprints."
for(var/i in L)
user << "\blue \t [i]"
user << "\blue Isolated [A:fingerprints.len] fingerprints."
var/list/prints = A:fingerprints
var/list/complete_prints = list()
for(var/i in prints)
var/list/templist = params2list(i)
var/temp = stringpercent(templist["2"])
if(temp <= 6)
complete_prints += templist["2"]
if(complete_prints.len < 1)
user << "\blue No intact prints found"
else
user << "\blue Found [complete_prints.len] intact prints"
for(var/i in complete_prints)
user << "\blue " + i
if(3)
if(!isnull(A.reagents))
+189 -91
View File
@@ -59,111 +59,209 @@ MASS SPECTROMETER
if(M)
M.invisibility = 2
/obj/item/device/detective_scanner
name = "Scanner"
desc = "Used to scan objects for DNA and fingerprints."
icon_state = "forensic0"
icon_state = "forensic1"
var/amount = 20.0
var/printing = 0.0
// var/printing = 0.0
var/list/stored = list()
w_class = 3.0
item_state = "electronic"
flags = FPRINT | TABLEPASS | ONBELT | CONDUCT | USEDELAY
/obj/item/device/detective_scanner/attackby(obj/item/weapon/f_card/W as obj, mob/user as mob)
..()
attackby(obj/item/weapon/f_card/W as obj, mob/user as mob)
..()
if (istype(W, /obj/item/weapon/f_card))
if (W.fingerprints)
return
if (src.amount == 20)
return
if (W.amount + src.amount > 20)
src.amount = 20
W.amount = W.amount + src.amount - 20
else
src.amount += W.amount
//W = null
del(W)
src.add_fingerprint(user)
if (W)
W.add_fingerprint(user)
return
if (istype(W, /obj/item/weapon/f_card))
if (W.fingerprints)
return
if (src.amount == 20)
return
if (W.amount + src.amount > 20)
src.amount = 20
W.amount = W.amount + src.amount - 20
// 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."
return 0
if (( !( istype(M.dna, /datum/dna) ) || M.gloves) )
user << "\blue No fingerprints found on [M]"
return 0
else
src.amount += W.amount
//W = null
del(W)
if (src.amount < 1)
user << text("\blue Fingerprints scanned on [M]. Need more cards to print.")
// src.printing = 0
// src.icon_state = text("forensic[]", src.printing)
// if (src.printing)
else
src.amount--
var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user.loc )
F.amount = 1
F.fingerprints += md5(M.dna.uni_identity)
F.icon_state = "fingerprint1"
F.name = text("FPrintC- '[M.name]'")
user << "\blue Done printing."
user << text("\blue [M]'s Fingerprints: [md5(M.dna.uni_identity)]")
if ( !(M.blood_DNA.len) )
user << "\blue No blood found on [M]"
else
user << "\blue Blood found on [M]. Analysing..."
spawn(15)
for(var/i = 1, i <= M.blood_DNA.len, i++)
var/list/templist = M.blood_DNA[i]
user << "\blue Blood type: [templist[2]]\nDNA: [templist[1]]"
return
afterattack(atom/A as obj|turf|area, mob/user as mob)
if(!(locate(A) in oview(1,user)))
return
if(src.loc != user)
return 0
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.)"
return
src.add_fingerprint(user)
if (W)
W.add_fingerprint(user)
return
if (istype(A, /obj/effect/decal/cleanable/blood) || istype(A, /obj/effect/rune))
if(!isnull(A.blood_DNA.len))
for(var/i = 1, i <= A.blood_DNA.len, i++)
var/list/templist = A.blood_DNA[i]
user << "\blue Blood type: [templist[2]]\nDNA: [templist[1]]"
return
var/duplicate = 0
if ((!A.fingerprints || A.fingerprints.len == 0) && !(A.suit_fibers) && !(A.blood_DNA.len))
user << "\blue Unable to locate any fingerprints, materials, fibers, or blood on [A]!"
return 0
else if (A.blood_DNA.len)
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/i = 1, i < (A.blood_DNA.len + 1), i++)
var/list/templist = A.blood_DNA[i]
user << "\blue Blood type: [templist[2]]\nDNA: [templist[1]]"
else
user << "\blue No Blood Located"
if(!A.fingerprints || A.fingerprints.len == 0)
user << "\blue No Fingerprints Located."
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."
if(!A.suit_fibers)
user << "\blue No Fibers/Materials Located."
else
user << "\blue Fibers/Materials Data Stored: Scan with Hi-Res Forensic Scanner to retrieve."
/obj/item/device/detective_scanner/attack_self(mob/user as mob)
if(!duplicate)
duplicate = 1
var/i = add_data(A)
if(i)
user << "\blue Fibers/Materials already in memory."
// else
// if ((src.amount < 1 && src.printing))
// user << "\blue Fingerprints found. Need more cards to print."
// src.printing = 0
// src.icon_state = text("forensic[]", src.printing)
// if (src.printing)
// src.amount--
// var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user.loc )
// F.amount = 1
// F.fingerprints = A.fingerprints
// F.icon_state = "fingerprint1"
// user << "\blue Done printing."
// for(var/i in L)
// user << text("\blue \t [i]")
// //Foreach goto(186)
return
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
/obj/item/device/detective_scanner/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."
return 0
if (( !( istype(M.dna, /datum/dna) ) || M.gloves) )
user << "\blue No fingerprints found on [M]"
return 0
else
if ((src.amount < 1 && src.printing))
user << text("\blue Fingerprints scanned on [M]. Need more cards to print.")
src.printing = 0
src.icon_state = text("forensic[]", src.printing)
if (src.printing)
src.amount--
var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user.loc )
F.amount = 1
F.fingerprints = md5(M.dna.uni_identity)
F.icon_state = "fingerprint1"
F.name = text("FPrintC- '[M.name]'")
user << "\blue Done printing."
user << text("\blue [M]'s Fingerprints: [md5(M.dna.uni_identity)]")
if ( !(M.blood_DNA) )
user << "\blue No blood found on [M]"
else
user << "\blue Blood found on [M]. Analysing..."
spawn(15)
user << "\blue Blood type: [M.blood_type]\nDNA: [M.blood_DNA]"
return
/obj/item/device/detective_scanner/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
src.add_fingerprint(user)
if (istype(A, /obj/effect/decal/cleanable/blood) || istype(A, /obj/effect/rune))
if(A.blood_DNA)
user << "\blue Blood type: [A.blood_type]\nDNA: [A.blood_DNA]"
else if (A.blood_DNA)
user << "\blue Blood found on [A]. Analysing..."
sleep(15)
user << "\blue Blood type: [A.blood_type]\nDNA: [A.blood_DNA]"
else
user << "\blue No blood found on [A]."
if (!( A.fingerprints ))
user << "\blue Unable to locate any fingerprints on [A]!"
return 0
else
if ((src.amount < 1 && src.printing))
user << "\blue Fingerprints found. Need more cards to print."
src.printing = 0
src.icon_state = text("forensic[]", src.printing)
if (src.printing)
src.amount--
var/obj/item/weapon/f_card/F = new /obj/item/weapon/f_card( user.loc )
F.amount = 1
F.fingerprints = A.fingerprints
F.icon_state = "fingerprint1"
user << "\blue Done printing."
var/list/L = params2list(A.fingerprints)
user << text("\blue Isolated [L.len] fingerprints.")
for(var/i in L)
user << text("\blue \t [i]")
//Foreach goto(186)
return
proc/add_data(atom/A as mob|obj|turf|area)
var/merged = 0
for(var/i = 1, i < (stored.len + 1), i++) //Lets see if the object is already in there!
var/list/temp = stored[i]
var/atom/checker = temp[1]
if(checker.original_atom == A || checker.original_atom == A.original_atom) //It is! Merge!
merged = 1
var/list/prints = temp[2]
if(!prints)
prints = list()
if(A.fingerprints && A.fingerprints.len)
for(var/j = 1, j <= A.fingerprints.len, j++) //Fingerprints~~~
var/list/print_test1 = params2list(A.fingerprints[j])
var/test_print1 = print_test1[num2text(1)]
var/found = 0
for(var/k = 1, k <= prints.len, k++) //Lets see if the print is already in there
var/list/print_test2 = params2list(prints[k])
var/test_print2 = print_test2[num2text(1)]
if(test_print2 == test_print1) //It is! Merge!
prints[k] = test_print2 + "&" + stringmerge(print_test2[num2text(2)],print_test1[num2text(2)])
found = 1
break //We found it, we're done here.
if(!found) //It isn't! Add!
prints += A.fingerprints[j]
var/list/fibers = temp[3]
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 = temp[4]
if(!blood)
blood = list()
if(A.blood_DNA.len && A.blood_DNA)
for(var/j = 1, j <= A.blood_DNA.len, j++) //Blood~~~
if(!blood.Find(A.blood_DNA[j])) //It isn't! Add!
blood += A.blood_DNA[j]
var/list/sum_list[4] //Pack it back up!
sum_list[1] = checker
sum_list[2] = prints
sum_list[3] = fibers
sum_list[4] = blood
stored[i] = sum_list //Store it!
break //We found it, we're done here.
if(!merged) //Uh, oh! New data point!
var/list/sum_list[4] //Pack it back up!
sum_list[1] = A.get_duplicate(src)
if(!A.fingerprints)
world << "Report this to a dev! [A] was lacking a list() for fingerprints!"
sum_list[2] = list()
else
sum_list[2] = A.fingerprints
sum_list[3] = A.suit_fibers
sum_list[4] = A.blood_DNA
stored.len++
stored[stored.len] = sum_list
return merged
/obj/item/device/healthanalyzer
+11 -5
View File
@@ -1,7 +1,7 @@
//HUMANS
/proc/gibs(atom/location, var/list/viruses)
new /obj/effect/gibspawner/human(get_turf(location),viruses)
/proc/gibs(atom/location, var/list/viruses, var/datum/dna/MobDNA)
new /obj/effect/gibspawner/human(get_turf(location),viruses,MobDNA)
/proc/xgibs(atom/location, var/list/viruses)
new /obj/effect/gibspawner/xeno(get_turf(location),viruses)
@@ -16,13 +16,13 @@
var/list/gibamounts = list()
var/list/gibdirections = list() //of lists
New(location, var/list/viruses)
New(location, var/list/viruses, var/datum/dna/MobDNA)
..()
if(istype(loc,/turf)) //basically if a badmin spawns it
Gib(loc,viruses)
Gib(loc,viruses,MobDNA)
proc/Gib(atom/location, var/list/viruses = list())
proc/Gib(atom/location, var/list/viruses = list(), var/datum/dna/MobDNA = null)
if(gibtypes.len != gibamounts.len || gibamounts.len != gibdirections.len)
world << "\red Gib list length mismatch!"
return
@@ -50,6 +50,12 @@
gib.viruses += viruus
viruus.holder = gib
viruus.spread_type = CONTACT_FEET
if(MobDNA)
gib.blood_DNA = list(list(MobDNA.unique_enzymes, MobDNA.b_type))
else if(istype(src, /obj/effect/gibspawner/xeno))
gib.blood_DNA = list(list("UNKNOWN DNA", "X*"))
else if(istype(src, /obj/effect/gibspawner/human)) // Probably a monkey
gib.blood_DNA = list(list("Non-human DNA", "A+"))
var/list/directions = gibdirections[i]
if(directions.len)
gib.streak(directions)
+1 -1
View File
@@ -100,7 +100,7 @@
t = "huge"
else
if ((usr.mutations & CLUMSY) && prob(50)) t = "funny-looking"
usr << text("This is a []\icon[][]. It is a [] item.", !src.blood_DNA ? "" : "bloody ",src, src.name, t)
usr << text("This is a []\icon[][]. It is a [] item.", !src.blood_DNA.len ? "" : "bloody ",src, src.name, t)
if(src.desc)
usr << src.desc
return
+43 -1
View File
@@ -716,4 +716,46 @@
</body>
</html>
"}
"}
/obj/item/weapon/book/manual/detective
name = "The Film Noir: Proper Procedures for Investigations"
icon_state ="bookHacking"
author = "NanoTrasen"
dat = {"<html>
<head>
<style>
h1 {font-size: 18px; margin: 15px 0px 5px;}
h2 {font-size: 15px; margin: 15px 0px 5px;}
li {margin: 2px 0px 2px 15px;}
ul {list-style: none; margin: 5px; padding: 0px;}
ol {margin: 5px; padding: 0px 15px;}
</style>
</head>
<body>
<h3>Detective Work</h3>
Between your bouts of self-narration, and drinking whiskey on the rocks, you might get a case or two to solve.<br>
To have the best chance to solve your case, follow these directions:
<p>
<ol>
<li>Go to the crime scene. </li>
<li>Take your scanner and scan EVERYTHING (Yes, the doors, the tables, even the dog.) </li>
<li>Once you are reasonably certain you have every scrap of evidence you can use, find all possible entry points and scan them, too. </li>
<li>Return to your office. </li>
<li>Using your forensic scanning computer, scan your Scanner to upload all of your evidence into the database.</li>
<li>Browse through the resulting dossiers, looking for the one that either has the most complete set of prints, or the most suspicious items handled. </li>
<li>If you have 80% or more of the print (The print is displayed) go to step 10, otherwise continue to step 8.</li>
<li>Look for clues from the suit fibres you found on your perp, and go about looking for more evidence with this new information, scanning as you go. </li>
<li>Try to get a fingerprint card of your perp, as if used in the computer, the prints will be completed on their dossier.</li>
<li>Assuming you have enough of a print to see it, grab the biggest complete piece of the print and search the security records for it. </li>
<li>Since you now have both your dossier and the name of the person, print both out as evidence, and get security to nab your baddie.</li>
<li>Give yourself a pat on the back and a bottle of the ships finest vodka, you did it!. </li>
</ol>
<p>
It really is that easy! Good luck!
</body>
</html>"}
-1
View File
@@ -82,7 +82,6 @@
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
src.blood_DNA = from.blood_DNA
src.blood_type = from.blood_type
src.fingerprints = from.fingerprints
src.fingerprintshidden = from.fingerprintshidden
src.fingerprintslast = from.fingerprintslast