From e5250972a99a82641776a7cd1ce7dbcfe4485450 Mon Sep 17 00:00:00 2001 From: Erthilo Date: Tue, 5 Jun 2012 01:29:35 +0100 Subject: [PATCH] TG: Readded detective work, with much bugfixing and optimizations. Any PDA that can access the Security Records can, via the forensic scanner function (that was already there) store data on what was scanned, the same way that the Detective's scanner can. Scanning a PDA with said stored data in the Detective's computer-o-doom will transfer the data from the PDA to the computer's database. Made some area names improper as needed (Only ones where it makes sense to be improper.) Updated changelog. Revision: r3713 Author: joeheinemeyer --- code/game/atom_procs.dm | 32 ++++++++------------ code/game/machinery/bots/mulebot.dm | 3 +- code/game/machinery/doors/door.dm | 2 +- code/game/machinery/igniter.dm | 2 ++ code/game/magic/cultist/ritual.dm | 4 +-- code/game/objects/devices/PDA/cart.dm | 6 ++-- code/game/objects/gibs.dm | 1 + code/game/objects/items/weapons/cards_ids.dm | 10 +++--- code/modules/DetectiveWork/detective_work.dm | 10 +++--- code/modules/mob/mob_helpers.dm | 4 +-- 10 files changed, 34 insertions(+), 40 deletions(-) diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 82a32e9112e..0e3c6eaef59 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -62,16 +62,10 @@ return /atom/proc/attackby(obj/item/weapon/W as obj, mob/user as mob) - if (istype(W, /obj/item/device/detective_scanner)) + if (!(istype(W, /obj/item/weapon/grab) ) && !(istype(W, /obj/item/weapon/plastique)) && !(istype(W, /obj/item/weapon/cleaner)) && !(istype(W, /obj/item/weapon/chemsprayer)) && !(istype(W, /obj/item/weapon/pepperspray)) && !(istype(W, /obj/item/weapon/plantbgone)) && !istype(W, /obj/item/device/detective_scanner) && !(istype(W, /obj/item/weapon/reagent_containers/glass/rag)) ) for(var/mob/O in viewers(src, null)) if ((O.client && !( O.blinded ))) - O << "\red [src] has been scanned by [user] with the [W]" - else - if (!( istype(W, /obj/item/weapon/grab) ) && !(istype(W, /obj/item/weapon/plastique)) &&!(istype(W, /obj/item/weapon/cleaner)) &&!(istype(W, /obj/item/weapon/chemsprayer)) &&!(istype(W, /obj/item/weapon/pepperspray)) && !(istype(W, /obj/item/weapon/plantbgone)) && !(istype(W, /obj/item/weapon/reagent_containers/glass/rag)) ) - for(var/mob/O in viewers(src, null)) - if ((O.client && !( O.blinded ))) - O << "\red [src] has been hit by [user] with [W]" - + O << "\red [src] has been hit by [user] with [W]" return /atom/proc/add_hiddenprint(mob/living/M as mob) @@ -135,15 +129,6 @@ return 0 else if(H.gloves && !istype(H.gloves, /obj/item/clothing/gloves/latex) && !istype(H.gloves, /obj/item/clothing/gloves/fingerless)) return 0 - //Smudge up dem prints some - for(var/P in fingerprints) - if(P == md5(H.dna.uni_identity)) - continue - var/test_print = stars(fingerprints[P], rand(85,95)) - if(stringpercent(test_print) == 32) //She's full of stars! (No actual print left) - fingerprints.Remove(P) - else - fingerprints[P] = test_print //More adminstuffz if(fingerprintslast != H.key) fingerprintshidden += text("Real name: [], Key: []",H.real_name, H.key) @@ -153,6 +138,15 @@ fingerprints = list() //Hash this shit. var/full_print = md5(H.dna.uni_identity) + //Smudge up dem prints some + for(var/P in fingerprints) + if(P == full_print) + continue + var/test_print = stars(fingerprints[P], rand(85,95)) + if(stringpercent(test_print) == 32) //She's full of stars! (No actual print left) + fingerprints.Remove(P) + else + fingerprints[P] = test_print var/print = fingerprints[full_print] //Find if the print is already there. //It is not! We need to add it! if(!print) @@ -209,6 +203,7 @@ O.overlays += O.blood_overlay //if this blood isn't already in the list, add it + if(blood_DNA[M.dna.unique_enzymes]) return 0 //already bloodied with this blood. Cannot add more. blood_DNA[M.dna.unique_enzymes] = M.dna.b_type @@ -302,7 +297,7 @@ if (!( src.flags ) & FPRINT) return - if (blood_DNA ) + if (blood_DNA) //Cleaning blood off of mobs if (istype (src, /mob/living/carbon)) @@ -914,7 +909,6 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl usr << "\blue You look at your stump." return*/ src.attack_hand(usr, usr.hand) -// usr:afterattack(src, usr, (t5 ? 1 : 0), params) else // ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED ------- if (istype(usr, /mob/living/carbon/monkey)) diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm index 6ad3d0a7dcf..4dde1c71209 100644 --- a/code/game/machinery/bots/mulebot.dm +++ b/code/game/machinery/bots/mulebot.dm @@ -1,4 +1,4 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:04 +//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 // Mulebot - carries crates around for Quartermaster // Navigates via floor navbeacons @@ -802,6 +802,7 @@ H.apply_damage(0.5*damage, BRUTE, "r_arm") var/obj/effect/decal/cleanable/blood/B = new(src.loc) + B.blood_DNA = list() B.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type bloodiness += 4 diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index b902ffb9662..07b05358923 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -117,7 +117,7 @@ attackby(obj/item/I as obj, mob/user as mob) if(istype(I, /obj/item/device/detective_scanner)) - return ..() + return if(src.operating || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them. src.add_fingerprint(user) if(!src.requiresID()) diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 9c4852d16a5..015a35bc4b1 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -60,6 +60,8 @@ src.sd_SetLuminosity(0) /obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/device/detective_scanner)) + return if (istype(W, /obj/item/weapon/screwdriver)) add_fingerprint(user) src.disable = !src.disable diff --git a/code/game/magic/cultist/ritual.dm b/code/game/magic/cultist/ritual.dm index 23705004bb7..5011601c110 100644 --- a/code/game/magic/cultist/ritual.dm +++ b/code/game/magic/cultist/ritual.dm @@ -590,8 +590,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", R.word2 = w2 R.word3 = w3 R.check_icon() - if(!R.blood_DNA) - R.blood_DNA = list() + R.blood_DNA = list() R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type return else @@ -637,6 +636,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology", var/obj/effect/rune/R = new /obj/effect/rune if(istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = user + R.blood_DNA = list() R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type switch(r) if("teleport") diff --git a/code/game/objects/devices/PDA/cart.dm b/code/game/objects/devices/PDA/cart.dm index 39375f593ac..85fcfe08d44 100644 --- a/code/game/objects/devices/PDA/cart.dm +++ b/code/game/objects/devices/PDA/cart.dm @@ -29,7 +29,7 @@ var/list/powermonitors = list() var/message1 // used for status_displays var/message2 - var/list/stored = list() + var/list/stored_data = list() engineering name = "Power-ON Cartridge" @@ -584,7 +584,7 @@ Code: proc/add_data(atom/A as mob|obj|turf|area) //I love hashtables. - var/list/data_entry = stored["\ref [A]"] + var/list/data_entry = stored_data["\ref [A]"] if(islist(data_entry)) //Yay, it was already stored! //Merge the fingerprints. var/list/data_prints = data_entry[1] @@ -616,7 +616,7 @@ Code: sum_list[2] = A.suit_fibers sum_list[3] = A.blood_DNA sum_list[4] = "\The [A] in \the [get_area(A)]" - stored["\ref [A]"] = sum_list + stored_data["\ref [A]"] = sum_list return 0 /obj/item/weapon/cartridge/Topic(href, href_list) diff --git a/code/game/objects/gibs.dm b/code/game/objects/gibs.dm index ab11d1caf5b..0dcbf964503 100644 --- a/code/game/objects/gibs.dm +++ b/code/game/objects/gibs.dm @@ -51,6 +51,7 @@ gib.viruses += viruus viruus.holder = gib viruus.spread_type = CONTACT_FEET + gib.blood_DNA = list() if(MobDNA) gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.b_type if(MobDNA.original_name != "Unknown") diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 96e712bc5d0..0241b13390b 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -233,15 +233,13 @@ FINGERPRINT CARD return /obj/item/weapon/f_card/proc/display() - if(!fingerprints) return - if (length(fingerprints)) + if(!fingerprints || !fingerprints.len) + return "There are no fingerprints on this card." + else var/dat = "Fingerprints on Card
" for(var/name in fingerprints) dat += "[name]
" - //Foreach goto(41) return dat - else - return "There are no fingerprints on this card." return /* @@ -297,7 +295,7 @@ FINGERPRINT CARD else src.name = "Finger Print Card" W.add_fingerprint(user) - add_fingerprint(user) + src.add_fingerprint(user) return /obj/item/weapon/f_card/add_fingerprint() diff --git a/code/modules/DetectiveWork/detective_work.dm b/code/modules/DetectiveWork/detective_work.dm index 37524d9c691..fc6cf153156 100644 --- a/code/modules/DetectiveWork/detective_work.dm +++ b/code/modules/DetectiveWork/detective_work.dm @@ -466,11 +466,11 @@ obj/machinery/computer/forensic_scanning 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] + if(W:cartridge.stored_data) + for(var/atom in W:cartridge.stored_data) + var/list/data = W:cartridge.stored_data[atom] add_data_master(atom,data[1],data[2],data[3],data[4]) - W:cartridge.stored = list() + W:cartridge.stored_data = list() return proc/add_data(var/atom/scanned_atom) @@ -624,4 +624,4 @@ obj/machinery/computer/forensic_scanning detective icon_state = "old" - name = "PowerScan Mk.I" + name = "PowerScan Mk.I" \ No newline at end of file diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 57f08b32062..c01be193cc2 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1,5 +1,3 @@ -//This file was auto-corrected by findeclaration.exe on 29/05/2012 15:03:05 - // fun if you want to typecast humans/monkeys/etc without writing long path-filled lines. /proc/ishuman(A) @@ -345,7 +343,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return 0 -/mob/proc/put_in_hands(var/obj/item/I) +/mob/proc/put_in_hands(var/obj/item/I) //A suprisingly useful proc. Allows a simple way to place an object in a mob's hands, or, if they are full, on the ground below them. if(!r_hand) I.loc = src r_hand = I