WIP on detective work overhaul

Give command ported, with more sanity checks (It works, now!)
Added BS12 c4 in addition to TG c4
Fixed server air alarm
Book length increased 3 fold.
Blood and gibs now maintains DNA
Fixed evidence bags
Ported the awesome BS12 handcuff stuff, with flavor text.
This commit is contained in:
SkyMarshal
2012-01-29 22:53:47 -07:00
parent d2eff85c17
commit 5dba3ccf88
20 changed files with 411 additions and 53 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
layer = 2
var/level = 2
var/flags = FPRINT
var/fingerprints = null
var/list/fingerprints
var/list/fingerprintshidden = new/list()
var/fingerprintslast = null
var/blood_DNA = null
+1
View File
@@ -169,6 +169,7 @@ var
//Don't set this very much higher then 1024 unless you like inviting people in to dos your server with message spam
const/MAX_MESSAGE_LEN = 1024
const/MAX_PAPER_MESSAGE_LEN = 3072
const/MAX_BOOK_MESSAGE_LEN = 9216
list/paper_blacklist = list("script","frame","iframe","input","button","a","embed","object")
+104 -1
View File
@@ -187,4 +187,107 @@
var/dy = T.y - centerturf.y
if(dx*dx + dy*dy <= rsq)
turfs += T
return turfs
return turfs
proc/check_can_reach(atom/user, atom/target)
var/direct = get_dir(user, target)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( user.loc )
var/ok = 0
if ( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
var/turf/Step_1
var/turf/Step_2
switch(direct)
if(5.0)
Step_1 = get_step(user, NORTH)
Step_2 = get_step(user, EAST)
if(6.0)
Step_1 = get_step(user, SOUTH)
Step_2 = get_step(user, EAST)
if(9.0)
Step_1 = get_step(user, NORTH)
Step_2 = get_step(user, WEST)
if(10.0)
Step_1 = get_step(user, SOUTH)
Step_2 = get_step(user, WEST)
else
if(Step_1 && Step_2)
// ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
var/check_1 = 0
var/check_2 = 0
if(step_to(D, Step_1))
check_1 = 1
for(var/obj/border_obstacle in Step_1)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, target))
check_1 = 0
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
for(var/obj/border_obstacle in get_turf(target))
if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
check_1 = 0
D.loc = user.loc
if(step_to(D, Step_2))
check_2 = 1
for(var/obj/border_obstacle in Step_2)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, target))
check_2 = 0
for(var/obj/border_obstacle in get_turf(target))
if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
check_2 = 0
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
More info:
If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
*/
else
// ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
if(target.loc == user.loc)
ok = 1
// ------- OBJECT IS ON THE SAME TILE AS YOU -------
else
ok = 1
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in user.loc)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, target))
ok = 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in get_turf(target))
if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
/*
See the previous More info, for... more info...
*/
if(get_dist(user, target) > 1)
return 0
del(D)
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
return ok
+22 -1
View File
@@ -1490,4 +1490,25 @@ proc/get_opposite(var/checkdir)
list += found_string
found_char = findtext(cur_text,character,last_found)
list += copytext(cur_text,last_found,length(cur_text)+1)
return list
return list
/proc/stringmerge(var/text,var/compare,replace = "*")
//This proc fills in all spaces with the "replace" var (* by default) with whatever
//is in the other string at the same spot (assuming it is not a replace char).
//This is used for fingerprints
var/newtext = text
if(lentext(text) != lentext(compare))
return 0
for(var/i = 1, i < lentext(text), i++)
var/a = copytext(text,i,i+1)
var/b = copytext(compare,i,i+1)
//if it isn't both the same letter, or if they are both the replacement character
//(no way to know what it was supposed to be)
if(a != b)
if(a == replace) //if A is the replacement char
newtext = copytext(newtext,1,i) + b + copytext(newtext, i+1)
else if(b == replace) //if B is the replacement char
newtext = copytext(newtext,1,i) + a + copytext(newtext, i+1)
else //The lists disagree, Uh-oh!
return 0
return newtext