From b70673e0c81eff81ca3f20b780a1f0e15c318636 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Wed, 30 May 2012 13:24:52 -0700 Subject: [PATCH 1/2] Some comments, tweaks, and improvements to detective work, evidence bags, and packages. Removed a worthless proc, and moved a few proc definitions into better places. --- code/game/atom_procs.dm | 99 +++---------- code/game/gamemodes/blob/theblob.dm | 2 +- code/game/machinery/OpTable.dm | 2 +- code/game/machinery/deployable.dm | 4 +- code/game/machinery/doors/door.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 4 +- code/game/machinery/shieldgen.dm | 2 +- code/game/objects/alien/resin.dm | 2 +- code/game/objects/grille.dm | 2 +- code/game/objects/tables_racks.dm | 4 +- code/game/objects/window.dm | 4 +- code/game/supplyshuttle.dm | 2 +- code/modules/DetectiveWork/detective_work.dm | 139 +++++++++---------- code/modules/mob/living/living.dm | 16 --- code/modules/mob/mob.dm | 24 +--- 15 files changed, 103 insertions(+), 205 deletions(-) diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index be85dacac69..b8eddc87a6d 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -1080,95 +1080,32 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl var/mob/living/carbon/U = M U.swap_hand() -/* -/atom/proc/get_global_map_pos() - if(!islist(global_map) || isemptylist(global_map)) return - var/cur_x = null - var/cur_y = null - var/list/y_arr = null - for(cur_x=1,cur_x<=global_map.len,cur_x++) - y_arr = global_map[cur_x] - cur_y = y_arr.Find(src.z) - if(cur_y) - break -// world << "X = [cur_x]; Y = [cur_y]" - if(cur_x && cur_y) - return list("x"=cur_x,"y"=cur_y) - else - return 0 -*/ //Don't touch this either. DMTG -/atom/proc/checkpass(passflag) - return pass_flags&passflag - - //Could not find object proc defines and this could almost be an atom level one. /obj/proc/process() processing_objects.Remove(src) return 0 +// Show a message to all mobs in sight of this one +// This would be for visible actions by the src mob +// message is the message output to anyone who can see e.g. "[src] does something!" +// self_message (optional) is what the src mob sees e.g. "You do something!" +// blind_message (optional) is what blind people will hear e.g. "You hear something!" -/*Really why was this in the click proc of all the places you could put it - if (usr:a_intent == "help") - // ------- YOU HAVE THE HELP INTENT SELECTED ------- - if(istype(src, /mob/living/carbon)) - // ------- YOUR TARGET IS LIVING CARBON CREATURE (NOT AI OR CYBORG OR SIMPLE ANIMAL) ------- - var/mob/living/carbon/C = src - if(usr:mutations & HEAL) - // ------- YOU ARE HUMAN, WITH THE HELP INTENT TARGETING A HUMAN AND HAVE THE 'HEAT' GENETIC MUTATION ------- - - if(C.stat != 2) - // ------- THE PERSON YOU'RE TOUCHING IS NOT DEAD ------- - - var/t_him = "it" - if (src.gender == MALE) - t_him = "his" - else if (src.gender == FEMALE) - t_him = "her" - var/u_him = "it" - if (usr.gender == MALE) - t_him = "him" - else if (usr.gender == FEMALE) - t_him = "her" - - if(src != usr) - usr.visible_message( \ - "\blue [usr] places [u_him] palms on [src], healing [t_him]!", \ - "\blue You place your palms on [src] and heal [t_him].", \ - ) - else - usr.visible_message( \ - "\blue [usr] places [u_him] palms on [u_him]self and heals.", \ - "\blue You place your palms on yourself and heal.", \ - ) - - C.adjustOxyLoss(-25) - C.adjustToxLoss(-25) - - if(istype(C, /mob/living/carbon/human)) - // ------- YOUR TARGET IS HUMAN ------- - var/mob/living/carbon/human/H = C - var/datum/organ/external/affecting = H.get_organ(check_zone(usr:zone_sel:selecting)) - if(affecting && affecting.heal_damage(25, 25)) - H.UpdateDamageIcon() - else - C.heal_organ_damage(25, 25) - C.adjustCloneLoss(-25) - C.stunned = max(0, C.stunned-5) - C.paralysis = max(0, C.paralysis-5) - C.stuttering = max(0, C.stuttering-5) - C.drowsyness = max(0, C.drowsyness-5) - C.weakened = max(0, C.weakened-5) - usr:nutrition -= rand(1,10) - usr.next_move = world.time + 6 - else - // ------- PERSON YOU'RE TOUCHING IS ALREADY DEAD ------- - usr << "\red [src] is dead and can't be healed." - return - - // ------- IF YOU DON'T HAVE THE SILLY ABILITY ABOVE OR FAIL ON ANY OTHER CHECK, THEN YOU'RE CLICKING ON SOMETHING WITH AN EMPTY HAND. ATTACK_HAND IT IS THEN ------- -*/ +/mob/visible_message(var/message, var/self_message, var/blind_message) + for(var/mob/M in viewers(src)) + var/msg = message + if(self_message && M==src) + msg = self_message + M.show_message( msg, 1, blind_message, 2) +// Show a message to all mobs in sight of this atom +// Use for objects performing visible actions +// message is output to anyone who can see, e.g. "The [src] does something!" +// blind_message (optional) is what blind people will hear e.g. "You hear something!" +/atom/proc/visible_message(var/message, var/blind_message) + for(var/mob/M in viewers(src)) + M.show_message( message, 1, blind_message, 2) diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 7c82a932425..52e578ac0a5 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -50,7 +50,7 @@ CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if((air_group && blobtype != "Shield") || (height==0)) return 1 - if(istype(mover) && mover.checkpass(PASSBLOB)) return 1 + if(istype(mover) && mover.pass_flags&PASSBLOB) return 1 return 0 diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm index 429fe4be8d2..ba7db1eaaa1 100644 --- a/code/game/machinery/OpTable.dm +++ b/code/game/machinery/OpTable.dm @@ -80,7 +80,7 @@ /obj/machinery/optable/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && mover.checkpass(PASSTABLE)) + if(istype(mover) && mover.pass_flags&PASSTABLE) return 1 else return 0 diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 057e9800c0b..e89d98ed8cf 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -133,7 +133,7 @@ for reference: CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. if(air_group || (height==0)) return 1 - if(istype(mover) && mover.checkpass(PASSTABLE)) + if(istype(mover) && mover.pass_flags&PASSTABLE) return 1 else return 0 @@ -260,7 +260,7 @@ for reference: CanPass(atom/movable/mover, turf/target, height=0, air_group=0)//So bullets will fly over and stuff. if(air_group || (height==0)) return 1 - if(istype(mover) && mover.checkpass(PASSTABLE)) + if(istype(mover) && mover.pass_flags&PASSTABLE) return 1 else return 0 diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index d69782a62f0..b902ffb9662 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -81,7 +81,7 @@ CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) return 0 - if(istype(mover) && mover.checkpass(PASSGLASS)) + if(istype(mover) && mover.pass_flags&PASSGLASS) return !opacity return !density diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 27967591d0d..d3323663982 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -58,7 +58,7 @@ return /obj/machinery/door/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(istype(mover) && mover.checkpass(PASSGLASS)) + if(istype(mover) && mover.pass_flags & PASSGLASS) return 1 if(get_dir(loc, target) == dir) //Make sure looking at appropriate border if(air_group) return 0 @@ -67,7 +67,7 @@ return 1 /obj/machinery/door/window/CheckExit(atom/movable/mover as mob|obj, turf/target as turf) - if(istype(mover) && mover.checkpass(PASSGLASS)) + if(istype(mover) && mover.pass_flags & PASSGLASS) return 1 if(get_dir(loc, target) == dir) return !density diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 6050615cdcc..9b98922870b 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -475,7 +475,7 @@ /obj/machinery/shieldwall/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && mover.checkpass(PASSGLASS)) + if(istype(mover) && mover.pass_flags&PASSGLASS) return prob(20) else if (istype(mover, /obj/item/projectile)) diff --git a/code/game/objects/alien/resin.dm b/code/game/objects/alien/resin.dm index e08ffaf5c42..fafae271222 100644 --- a/code/game/objects/alien/resin.dm +++ b/code/game/objects/alien/resin.dm @@ -161,6 +161,6 @@ /obj/effect/alien/resin/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group) return 0 - if(istype(mover) && mover.checkpass(PASSGLASS)) + if(istype(mover) && mover.pass_flags & PASSGLASS) return !opacity return !density diff --git a/code/game/objects/grille.dm b/code/game/objects/grille.dm index 065977e07eb..db3021c05df 100644 --- a/code/game/objects/grille.dm +++ b/code/game/objects/grille.dm @@ -94,7 +94,7 @@ CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && mover.checkpass(PASSGRILLE)) + if(istype(mover) && mover.pass_flags & PASSGRILLE) return 1 else if (istype(mover, /obj/item/projectile)) diff --git a/code/game/objects/tables_racks.dm b/code/game/objects/tables_racks.dm index 451208b164f..6c26e34b28c 100644 --- a/code/game/objects/tables_racks.dm +++ b/code/game/objects/tables_racks.dm @@ -117,7 +117,7 @@ TABLE AND RACK OBJECT INTERATIONS /obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) if(air_group || (height==0)) return 1 - if(istype(mover) && (mover.checkpass(PASSTABLE) || (mover.flags & TABLEPASS) || mover.throwing)) //WTF do things hit tables like that? Jeez. + if(istype(mover) && (mover.pass_flags & PASSTABLE || (mover.flags & TABLEPASS) || mover.throwing)) //WTF do things hit tables like that? Jeez. return 1 else return 0 @@ -358,7 +358,7 @@ TABLE AND RACK OBJECT INTERATIONS if(air_group || (height==0)) return 1 if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!| return 1 - if(istype(mover) && (mover.checkpass(PASSTABLE) || mover.flags & TABLEPASS || mover.throwing)) + if(istype(mover) && (mover.pass_flags & PASSTABLE || mover.flags & TABLEPASS || mover.throwing)) return 1 else return 0 diff --git a/code/game/objects/window.dm b/code/game/objects/window.dm index f3e69130cf6..3f10f483bcd 100644 --- a/code/game/objects/window.dm +++ b/code/game/objects/window.dm @@ -34,7 +34,7 @@ del(src) /obj/structure/window/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) - if(istype(mover) && mover.checkpass(PASSGLASS)) + if(istype(mover) && mover.pass_flags & PASSGLASS) return 1 if (src.dir == SOUTHWEST || src.dir == SOUTHEAST || src.dir == NORTHWEST || src.dir == NORTHEAST) return 0 //full tile window, you can't move into it! @@ -44,7 +44,7 @@ return 1 /obj/structure/window/CheckExit(atom/movable/O as mob|obj, target as turf) - if(istype(O) && O.checkpass(PASSGLASS)) + if(istype(O) && O.pass_flags & PASSGLASS) return 1 if (get_dir(O.loc, target) == dir) return 0 diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index c601a5582e8..e7e7a06a884 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -46,7 +46,7 @@ var/list/supply_groups = new() layer = 4 /obj/structure/plasticflaps/CanPass(atom/A, turf/T) - if(istype(A) && A.checkpass(PASSGLASS)) + if(istype(A) && A.pass_flags&PASSGLASS) return prob(60) else if(istype(A, /mob/living)) // You Shall Not Pass! var/mob/living/M = A diff --git a/code/modules/DetectiveWork/detective_work.dm b/code/modules/DetectiveWork/detective_work.dm index 9dee00f6014..1f2467ff270 100644 --- a/code/modules/DetectiveWork/detective_work.dm +++ b/code/modules/DetectiveWork/detective_work.dm @@ -446,89 +446,88 @@ obj/machinery/computer/forensic_scanning //What follows is massive. It cross references all stored data in the scanner with the other stored data, //and what is already in the computer. Not sure how bad the lag may/may not be. - if(!atom_fingerprints) //No prints - if(!misc) - misc = list() - var/list/data_entry = misc[atom_reference] - if(data_entry) - var/list/fibers = data_entry[1] - if(!fibers) - fibers = list() - if(atom_suit_fibers) - for(var/j = 1, j <= atom_suit_fibers.len, j++) //Fibers~~~ - if(!fibers.Find(atom_suit_fibers[j])) //It isn't! Add! - fibers += atom_suit_fibers[j] - var/list/blood = data_entry[2] - if(!blood) - blood = list() - if(atom_blood_DNA) - for(var/main_blood in atom_blood_DNA) - if(!blood[main_blood]) - blood[main_blood] = atom_blood_DNA[blood] - return 1 + if(!misc) + misc = list() + var/list/data_entry = misc[atom_reference] + if(data_entry) + var/list/fibers = data_entry[1] + if(!fibers) + fibers = list() + if(atom_suit_fibers) + for(var/j = 1, j <= atom_suit_fibers.len, j++) //Fibers~~~ + if(!fibers.Find(atom_suit_fibers[j])) //It isn't! Add! + fibers += atom_suit_fibers[j] + var/list/blood = data_entry[2] + if(!blood) + blood = list() + if(atom_blood_DNA) + for(var/main_blood in atom_blood_DNA) + if(!blood[main_blood]) + blood[main_blood] = atom_blood_DNA[blood] + else var/list/templist[3] templist[1] = atom_suit_fibers templist[2] = atom_blood_DNA templist[3] = atom_name misc[atom_reference] = templist //Store it! - return 0 //Has prints. - if(!files) - files = list() - for(var/main_print in atom_fingerprints) - var/list/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) - //We must be on a roll! Just update what needs to be updated. - var/list/internal_prints = internal_atom[1] - for(var/print in atom_fingerprints) //Sorry for the double loop! D: - var/associated_print = internal_prints[print] - var/reference_print = atom_fingerprints[print] - if(associated_print && associated_print != reference_print) //It does not match - internal_prints[print] = stringmerge(associated_print, reference_print) - else if(!associated_print) - internal_prints[print] = reference_print - //If the main print was updated, lets update the master as well. - if(print == main_print && (!associated_print || (associated_print && associated_print != reference_print))) - update_fingerprints(main_print, internal_prints[print]) - //Fibers. - var/list/fibers = internal_atom[2] - if(!fibers) - fibers = list() - if(atom_suit_fibers) - for(var/j = 1, j < atom_suit_fibers.len, j++) //Fibers~~~ - if(!fibers.Find(atom_suit_fibers[j])) //It isn't! Add! - fibers += atom_suit_fibers[j] - //Blood. - var/list/blood = internal_atom[3] - if(!blood) - blood = list() - if(atom_blood_DNA) - for(var/main_blood in atom_blood_DNA) - if(!blood[main_blood]) - blood[main_blood] = atom_blood_DNA[blood] + if(atom_fingerprints) + if(!files) + files = list() + for(var/main_print in atom_fingerprints) + var/list/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) + //We must be on a roll! Just update what needs to be updated. + var/list/internal_prints = internal_atom[1] + for(var/print in atom_fingerprints) //Sorry for the double loop! D: + var/associated_print = internal_prints[print] + var/reference_print = atom_fingerprints[print] + if(associated_print && associated_print != reference_print) //It does not match + internal_prints[print] = stringmerge(associated_print, reference_print) + else if(!associated_print) + internal_prints[print] = reference_print + //If the main print was updated, lets update the master as well. + if(print == main_print && (!associated_print || (associated_print && associated_print != reference_print))) + update_fingerprints(main_print, internal_prints[print]) + //Fibers. + var/list/fibers = internal_atom[2] + if(!fibers) + fibers = list() + if(atom_suit_fibers) + for(var/j = 1, j < atom_suit_fibers.len, j++) //Fibers~~~ + if(!fibers.Find(atom_suit_fibers[j])) //It isn't! Add! + fibers += atom_suit_fibers[j] + //Blood. + var/list/blood = internal_atom[3] + if(!blood) + blood = list() + if(atom_blood_DNA) + for(var/main_blood in atom_blood_DNA) + if(!blood[main_blood]) + blood[main_blood] = atom_blood_DNA[blood] + continue + //It's not in there! We gotta add it. + update_fingerprints(main_print, atom_fingerprints[main_print]) + var/list/data_point[4] + data_point[1] = atom_fingerprints + data_point[2] = atom_suit_fibers + data_point[3] = atom_blood_DNA + data_point[4] = atom_name + data_entry[atom_reference] = data_point continue - //It's not in there! We gotta add it. - update_fingerprints(main_print, atom_fingerprints[main_print]) + //No print at all! New data entry, go! var/list/data_point[4] data_point[1] = atom_fingerprints data_point[2] = atom_suit_fibers data_point[3] = atom_blood_DNA data_point[4] = atom_name - data_entry[atom_reference] = data_point - continue - //No print at all! New data entry, go! - var/list/data_point[4] - data_point[1] = atom_fingerprints - data_point[2] = atom_suit_fibers - data_point[3] = atom_blood_DNA - data_point[4] = atom_name - var/list/new_file[1] - new_file[1] = atom_fingerprints[main_print] - new_file[atom_reference] = data_point - files[main_print] = new_file + var/list/new_file[1] + new_file[1] = atom_fingerprints[main_print] + new_file[atom_reference] = data_point + files[main_print] = new_file return 1 /******************************** ***END DO NOT DIRECTLY CALL ME*** diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c1067a0523a..0695669ef39 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1,19 +1,3 @@ -/mob/living/Life() - - ..() - - // While I'm doing a terriblly lazy way of initalizing things, why don't I make it so people's preferences tag along with them. This could be useful in fixing the fucking cloned-as-unknown thing, making me not have to dynamically load them during tensioner, and of course, storing metadata. -//Whoever wrote this should go suck a choad. This was causing runtimes, asshat. IN ADDITION, YOU PUT IT IN THE LIFE PROC YOU ASSHAT -// if(!src.storedpreferences) -// src.storedpreferences = new -// storedpreferences.savefile_load(src, 0) - - - - - return - - /mob/living/verb/succumb() set hidden = 1 if ((src.health < 0 && src.health > -95.0)) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 6c752c4da8c..38cd6d3b1a6 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -64,28 +64,6 @@ src << msg return -// Show a message to all mobs in sight of this one -// This would be for visible actions by the src mob -// message is the message output to anyone who can see e.g. "[src] does something!" -// self_message (optional) is what the src mob sees e.g. "You do something!" -// blind_message (optional) is what blind people will hear e.g. "You hear something!" - -/mob/visible_message(var/message, var/self_message, var/blind_message) - for(var/mob/M in viewers(src)) - var/msg = message - if(self_message && M==src) - msg = self_message - M.show_message( msg, 1, blind_message, 2) - -// Show a message to all mobs in sight of this atom -// Use for objects performing visible actions -// message is output to anyone who can see, e.g. "The [src] does something!" -// blind_message (optional) is what blind people will hear e.g. "You hear something!" -/atom/proc/visible_message(var/message, var/blind_message) - for(var/mob/M in viewers(src)) - M.show_message( message, 1, blind_message, 2) - - /mob/proc/findname(msg) for(var/mob/M in world) if (M.real_name == text("[]", msg)) @@ -1158,7 +1136,7 @@ note dizziness decrements automatically in the mob's Life() proc. if(!isemptylist(args)) for(var/file in args) src << browse_rsc(file) - return 1 + return 1 return 0 From e9ebf14acf9561240ff3a9ee17a712c75585b345 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Thu, 31 May 2012 15:47:05 -0700 Subject: [PATCH 2/2] 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. --- .../game/events/EventProcs/ninja_equipment.dm | 17 +++-- code/game/objects/devices/PDA/PDA.dm | 5 ++ code/game/objects/devices/PDA/cart.dm | 39 ++++++++++ code/game/objects/devices/scanners.dm | 76 ++++++++----------- code/modules/DetectiveWork/detective_work.dm | 23 ++++-- 5 files changed, 98 insertions(+), 62 deletions(-) diff --git a/code/game/events/EventProcs/ninja_equipment.dm b/code/game/events/EventProcs/ninja_equipment.dm index bf09f2f7c33..4221c8590ae 100644 --- a/code/game/events/EventProcs/ninja_equipment.dm +++ b/code/game/events/EventProcs/ninja_equipment.dm @@ -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.levelERROR: \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 ..() diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index 82b5235c2c4..afde626c9ce 100755 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -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)) diff --git a/code/game/objects/devices/PDA/cart.dm b/code/game/objects/devices/PDA/cart.dm index 0c750fed264..a24ce18dab4 100644 --- a/code/game/objects/devices/PDA/cart.dm +++ b/code/game/objects/devices/PDA/cart.dm @@ -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) ..() diff --git a/code/game/objects/devices/scanners.dm b/code/game/objects/devices/scanners.dm index 8d0211e7f29..6a1a980345d 100644 --- a/code/game/objects/devices/scanners.dm +++ b/code/game/objects/devices/scanners.dm @@ -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) diff --git a/code/modules/DetectiveWork/detective_work.dm b/code/modules/DetectiveWork/detective_work.dm index 1f2467ff270..1f2b8dd4a3e 100644 --- a/code/modules/DetectiveWork/detective_work.dm +++ b/code/modules/DetectiveWork/detective_work.dm @@ -392,7 +392,7 @@ obj/machinery/computer/forensic_scanning scan_data += "Fibers/Materials Found:
" for(var/data in scanning.suit_fibers) scan_data += "- [data]
" - 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 += "
Data transfered from Scanner to Database.
" 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)