mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-01-02 13:33:29 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -92,16 +92,13 @@ obj/machinery/computer/forensic_scanning
|
||||
scan_data = ""
|
||||
scan_name = ""
|
||||
scan_process = 0
|
||||
booked = 0
|
||||
|
||||
req_access = list(access_forensics_lockers)
|
||||
|
||||
|
||||
New()
|
||||
..()
|
||||
if(!booked)
|
||||
new /obj/item/weapon/book/manual/detective(get_turf(src))
|
||||
booked = 1
|
||||
new /obj/item/weapon/book/manual/detective(get_turf(src))
|
||||
return
|
||||
|
||||
|
||||
@@ -643,7 +640,7 @@ obj/machinery/computer/forensic_scanning
|
||||
return
|
||||
|
||||
|
||||
proc/update_fingerprints() //I am tired, but this updates the master print, which is used to determine completion of a print.
|
||||
proc/update_fingerprints() //I am tired, but this updates the master print from evidence, which is used to determine completion of a print.
|
||||
for(var/k = 1, k <= files.len, k++)
|
||||
var/list/perp_list = files[k]
|
||||
var/list/perp_prints = params2list(perp_list[1])
|
||||
@@ -664,8 +661,7 @@ obj/machinery/computer/forensic_scanning
|
||||
files[k] = perp_list
|
||||
return
|
||||
|
||||
proc/process_card() //I am tired, but this updates the master print from a fingerprint card
|
||||
//which is used to determine completion of a print.
|
||||
proc/process_card() //Same as above, but for fingerprint cards
|
||||
if(card.fingerprints && !(card.amount > 1))
|
||||
for(var/k = 1, k <= card.fingerprints.len, k++)
|
||||
var/list/test_prints = params2list(card.fingerprints[k])
|
||||
@@ -687,22 +683,22 @@ obj/machinery/computer/forensic_scanning
|
||||
return
|
||||
return
|
||||
|
||||
proc/delete_record(var/location)
|
||||
proc/delete_record(var/location) //Deletes an entry in the misc database at the given location
|
||||
if(misc && misc.len)
|
||||
for(var/i = location, i < misc.len, i++)
|
||||
misc[i] = misc[i+i]
|
||||
misc.len--
|
||||
return
|
||||
|
||||
proc/get_name(var/atom/A)
|
||||
proc/get_name(var/atom/A) //HurrDurr
|
||||
return A.name
|
||||
|
||||
proc/delete_dossier(var/location)
|
||||
proc/delete_dossier(var/location) //Deletes a Dossier at a given location.
|
||||
if(files && files.len)
|
||||
if(files.len < location)
|
||||
if(files.len > location)
|
||||
for(var/i = location, i < files.len, i++)
|
||||
files[i] = files[i + 1]
|
||||
if(files.len <= location)
|
||||
if(files.len >= location)
|
||||
files[files.len] = list()
|
||||
files.len--
|
||||
return
|
||||
@@ -725,7 +721,7 @@ obj/item/clothing/gloves/var
|
||||
|
||||
|
||||
obj/effect/decal/cleanable/blood/var
|
||||
track_amt = 3
|
||||
track_amt = 2
|
||||
mob/blood_owner
|
||||
|
||||
turf/Exited(mob/living/carbon/human/M)
|
||||
@@ -751,21 +747,21 @@ turf/Entered(mob/living/carbon/human/M)
|
||||
M.shoes.track_blood--
|
||||
src.add_bloody_footprints(M.shoes.track_blood_mob,0,M.dir,M.shoes.name)
|
||||
|
||||
//REMOVED until we improve it.
|
||||
// for(var/obj/effect/decal/cleanable/blood/B in src)
|
||||
// if(B.track_amt <= 0) continue
|
||||
// if(B.type != /obj/effect/decal/cleanable/blood/tracks)
|
||||
// if(istype(M,/mob/living/carbon/human))
|
||||
// if(M.shoes)
|
||||
// M.shoes.add_blood(B.blood_owner)
|
||||
// M.shoes.track_blood_mob = B.blood_owner
|
||||
// M.shoes.track_blood = max(M.shoes.track_blood,8)
|
||||
// else
|
||||
// M.add_blood(B.blood_owner)
|
||||
// M.track_blood_mob = B.blood_owner
|
||||
// M.track_blood = max(M.track_blood,rand(4,8))
|
||||
// B.track_amt--
|
||||
// break
|
||||
|
||||
for(var/obj/effect/decal/cleanable/blood/B in src)
|
||||
if(B.track_amt <= 0) continue
|
||||
if(B.type != /obj/effect/decal/cleanable/blood/tracks)
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
if(M.shoes)
|
||||
M.shoes.add_blood(B.blood_owner)
|
||||
M.shoes.track_blood_mob = B.blood_owner
|
||||
M.shoes.track_blood = max(M.shoes.track_blood,8)
|
||||
else
|
||||
M.add_blood(B.blood_owner)
|
||||
M.track_blood_mob = B.blood_owner
|
||||
M.track_blood = max(M.track_blood,rand(4,8))
|
||||
B.track_amt--
|
||||
break
|
||||
. = ..()
|
||||
|
||||
turf/proc/add_bloody_footprints(mob/living/carbon/human/M,leaving,d,info)
|
||||
@@ -831,6 +827,6 @@ proc/blood_incompatible(donor,receiver)
|
||||
if(istype(A))
|
||||
user.visible_message("[user] starts to wipe down [A] with [src]!")
|
||||
if(do_after(user,30))
|
||||
user.visible_message("[user] finishes wiping away the evidence!")
|
||||
user.visible_message("[user] finishes wiping off the [A]!")
|
||||
A.clean_blood()
|
||||
return
|
||||
@@ -156,6 +156,9 @@ datum
|
||||
if(!blood_prop) //first blood!
|
||||
blood_prop = new(T)
|
||||
blood_prop.blood_DNA = list(list(self.data["blood_DNA"], self.data["blood_type"]))
|
||||
else
|
||||
blood_prop.blood_DNA.len++
|
||||
blood_prop.blood_DNA[blood_prop.blood_DNA.len] = list(self.data["blood_DNA"], self.data["blood_type"])
|
||||
|
||||
for(var/datum/disease/D in self.data["viruses"])
|
||||
var/datum/disease/newVirus = new D.type
|
||||
@@ -179,7 +182,11 @@ datum
|
||||
var/obj/effect/decal/cleanable/blood/blood_prop = locate() in T
|
||||
if(!blood_prop)
|
||||
blood_prop = new(T)
|
||||
blood_prop.blood_DNA = list(list(self.data["blood_DNA"]))
|
||||
blood_prop.blood_DNA = list(list(self.data["blood_DNA"],"A+"))
|
||||
else
|
||||
blood_prop.blood_DNA.len++
|
||||
blood_prop.blood_DNA[blood_prop.blood_DNA.len] = list(self.data["blood_DNA"], "A+")
|
||||
|
||||
for(var/datum/disease/D in self.data["viruses"])
|
||||
var/datum/disease/newVirus = new D.type
|
||||
blood_prop.viruses += newVirus
|
||||
@@ -196,7 +203,11 @@ datum
|
||||
var/obj/effect/decal/cleanable/xenoblood/blood_prop = locate() in T
|
||||
if(!blood_prop)
|
||||
blood_prop = new(T)
|
||||
blood_prop.blood_DNA = list(list(self.data["blood_DNA"]))
|
||||
blood_prop.blood_DNA = list(list("UNKNOWN DNA","X*"))
|
||||
else
|
||||
blood_prop.blood_DNA.len++
|
||||
blood_prop.blood_DNA[blood_prop.blood_DNA.len] = list("UNKNOWN DNA","X*")
|
||||
|
||||
for(var/datum/disease/D in self.data["viruses"])
|
||||
var/datum/disease/newVirus = new D.type
|
||||
blood_prop.viruses += newVirus
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
if(!effect || (blocked >= 2)) return 0
|
||||
switch(effecttype)
|
||||
if(STUN)
|
||||
Stun((effect - (effect*getarmor(null, "melee")))/(blocked + 1))
|
||||
Stun((effect - (effect*getarmor(null, "laser")))/(blocked + 1))
|
||||
if(WEAKEN)
|
||||
Weaken((effect - (effect*getarmor(null, "melee")))/(blocked + 1))
|
||||
Weaken((effect - (effect*getarmor(null, "laser")))/(blocked + 1))
|
||||
if(PARALYZE)
|
||||
Paralyse(effect/(blocked+1))
|
||||
if(IRRADIATE)
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
timeleft = 5
|
||||
update()
|
||||
return
|
||||
if(istype(T,/obj/effect/bigDelivery))
|
||||
if(istype(T,/obj/structure/bigDelivery))
|
||||
if (T.anchored || get_dist(user, src) > 1 || get_dist(src,T) > 2 )
|
||||
return
|
||||
|
||||
@@ -572,8 +572,8 @@
|
||||
if(H.mutations & FAT) // is a human and fat?
|
||||
has_fat_guy = 1 // set flag on holder
|
||||
*/
|
||||
if(istype(AM, /obj/effect/bigDelivery))
|
||||
var/obj/effect/bigDelivery/T = AM
|
||||
if(istype(AM, /obj/structure/bigDelivery))
|
||||
var/obj/structure/bigDelivery/T = AM
|
||||
src.destinationTag = T.sortTag
|
||||
else if(istype(AM, /obj/item/smallDelivery))
|
||||
var/obj/item/smallDelivery/T = AM
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/obj/effect/bigDelivery
|
||||
/obj/structure/bigDelivery
|
||||
desc = "A big wrapped package."
|
||||
name = "large parcel"
|
||||
icon = 'storage.dmi'
|
||||
@@ -171,9 +171,13 @@
|
||||
var/amount = 25.0
|
||||
|
||||
|
||||
afterattack(target as obj, mob/user as mob)
|
||||
afterattack(var/obj/target as obj, mob/user as mob)
|
||||
if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack))
|
||||
return
|
||||
if(target.anchored)
|
||||
return
|
||||
if(target in user)
|
||||
return
|
||||
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='blue'>Has used [src.name] on \ref[target]</font>")
|
||||
|
||||
@@ -190,7 +194,7 @@
|
||||
else if (istype(target, /obj/structure/closet/crate))
|
||||
var/obj/structure/closet/crate/O = target
|
||||
if (src.amount > 3)
|
||||
var/obj/effect/bigDelivery/P = new /obj/effect/bigDelivery(get_turf(O.loc))
|
||||
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
|
||||
P.wrapped = O
|
||||
O.loc = P
|
||||
src.amount -= 3
|
||||
@@ -199,9 +203,11 @@
|
||||
else if (istype (target, /obj/structure/closet))
|
||||
var/obj/structure/closet/O = target
|
||||
if (src.amount > 3)
|
||||
var/obj/effect/bigDelivery/P = new /obj/effect/bigDelivery(get_turf(O.loc))
|
||||
P.wrapped = O
|
||||
O.close()
|
||||
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
|
||||
P.wrapped = O
|
||||
P.waswelded = O.welded
|
||||
O.opened = 0
|
||||
O.welded = 1
|
||||
O.loc = P
|
||||
src.amount -= 3
|
||||
@@ -242,9 +248,10 @@
|
||||
desc = "Used to set the destination of properly wrapped packages."
|
||||
icon_state = "forensic0"
|
||||
var/currTag = null
|
||||
var/list/spaceList = list(0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0) // Breaks up departments with whitespace.
|
||||
var/list/spaceList = list(0,1,0,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0) // Breaks up departments with whitespace.
|
||||
var/list/locationList = list("Disposals",
|
||||
"Mail Office", "Cargo Bay", "QM Office",
|
||||
"Mining Base", "Mining West", "Mining North",
|
||||
"Locker Room", "Tool Storage", "Laundry Room", "Toilets",
|
||||
"Security", "Courtroom", "Detective's Office", "Law Office",
|
||||
"Research Division", "Research Director", "Genetics",
|
||||
@@ -253,11 +260,6 @@
|
||||
"Bar", "Kitchen", "Diner", "Hydroponics",
|
||||
"Meeting Room", "HoP Office", "Captain",
|
||||
"Atmospherics", "Engineering", "Chief Engineer", "Robotics",)
|
||||
//The whole system for the sorttype var is determined based on the order of this list,
|
||||
//disposals must always be 1, since anything that's untagged will automatically go to disposals, or sorttype = 1 --Superxpdude
|
||||
|
||||
//If you don't want to fuck up disposals, add to this list, and don't change the order.
|
||||
//If you insist on changing the order, you'll have to change every sort junction to reflect the new order. --Pete
|
||||
|
||||
w_class = 1
|
||||
item_state = "electronic"
|
||||
@@ -300,9 +302,9 @@
|
||||
return
|
||||
|
||||
attack(target as obj, mob/user as mob)
|
||||
if (istype(target, /obj/effect/bigDelivery))
|
||||
if (istype(target, /obj/structure/bigDelivery))
|
||||
user << "\blue *TAGGED*"
|
||||
var/obj/effect/bigDelivery/O = target
|
||||
var/obj/structure/bigDelivery/O = target
|
||||
O.sortTag = src.currTag
|
||||
O.update_icon()
|
||||
else if (istype(target, /obj/item/smallDelivery))
|
||||
@@ -339,7 +341,7 @@
|
||||
var/deliveryCheck = 0
|
||||
var/obj/structure/disposalholder/H = new() // virtual holder object which actually
|
||||
// travels through the pipes.
|
||||
for(var/obj/effect/bigDelivery/O in src)
|
||||
for(var/obj/structure/bigDelivery/O in src)
|
||||
deliveryCheck = 1
|
||||
if(!O.sortTag)
|
||||
O.sortTag = "Disposals"
|
||||
|
||||
@@ -35,25 +35,6 @@
|
||||
interpreter.persist = 1
|
||||
interpreter.Compiler= src
|
||||
|
||||
// Set up all the preprocessor bullshit
|
||||
//TCS_Setup(program)
|
||||
// Apply preprocessor global variables
|
||||
program.SetVar("PI" , 3.141592653) // value of pi
|
||||
program.SetVar("E" , 2.718281828) // value of e
|
||||
program.SetVar("SQURT2" , 1.414213562) // value of the square root of 2
|
||||
program.SetVar("FALSE" , 0) // boolean shortcut to 0
|
||||
program.SetVar("TRUE" , 1) // boolean shortcut to 1
|
||||
|
||||
program.SetVar("NORTH" , NORTH) // NORTH (1)
|
||||
program.SetVar("SOUTH" , SOUTH) // SOUTH (2)
|
||||
program.SetVar("EAST" , EAST) // EAST (4)
|
||||
program.SetVar("WEST" , WEST) // WEST (8)
|
||||
|
||||
program.SetVar("HONK" , "clown griff u")
|
||||
program.SetVar("CODERS" , "hide the fun")
|
||||
program.SetVar("GRIFF" , pick("HALP IM BEING GRIFFED", "HALP AI IS MALF", "HALP GRIFFE", "HALP TRAITORS", "HALP WIZ GRIEFE ME"))
|
||||
|
||||
|
||||
return returnerrors
|
||||
|
||||
/* -- Execute the compiled code -- */
|
||||
@@ -63,6 +44,32 @@
|
||||
if(!ready)
|
||||
return
|
||||
|
||||
if(!interpreter)
|
||||
return
|
||||
|
||||
interpreter.SetVar("PI" , 3.141592653) // value of pi
|
||||
interpreter.SetVar("E" , 2.718281828) // value of e
|
||||
interpreter.SetVar("SQURT2" , 1.414213562) // value of the square root of 2
|
||||
interpreter.SetVar("FALSE" , 0) // boolean shortcut to 0
|
||||
interpreter.SetVar("TRUE" , 1) // boolean shortcut to 1
|
||||
|
||||
interpreter.SetVar("NORTH" , NORTH) // NORTH (1)
|
||||
interpreter.SetVar("SOUTH" , SOUTH) // SOUTH (2)
|
||||
interpreter.SetVar("EAST" , EAST) // EAST (4)
|
||||
interpreter.SetVar("WEST" , WEST) // WEST (8)
|
||||
|
||||
// Channel macros
|
||||
interpreter.SetVar("$common", 1459)
|
||||
interpreter.SetVar("$science", 1351)
|
||||
interpreter.SetVar("$command", 1353)
|
||||
interpreter.SetVar("$medical", 1355)
|
||||
interpreter.SetVar("$engineering",1357)
|
||||
interpreter.SetVar("$security", 1359)
|
||||
interpreter.SetVar("$mining", 1349)
|
||||
interpreter.SetVar("$cargo", 1347)
|
||||
|
||||
// Signal data
|
||||
|
||||
interpreter.SetVar("$content", signal.data["message"])
|
||||
interpreter.SetVar("$freq" , signal.frequency)
|
||||
interpreter.SetVar("$source" , signal.data["name"])
|
||||
@@ -154,25 +161,24 @@
|
||||
interpreter.Run()
|
||||
|
||||
// Backwards-apply variables onto signal data
|
||||
/* html_encode() EVERYTHING. fucking players can't be trusted with SHIT */
|
||||
/* sanitize EVERYTHING. fucking players can't be trusted with SHIT */
|
||||
|
||||
signal.data["message"] = html_encode(interpreter.GetVar("$content"))
|
||||
signal.data["message"] = trim(copytext(sanitize(interpreter.GetVar("$content")), 1, MAX_MESSAGE_LEN))
|
||||
signal.frequency = interpreter.GetVar("$freq")
|
||||
|
||||
var/setname = ""
|
||||
var/obj/machinery/telecomms/server/S = signal.data["server"]
|
||||
if(interpreter.GetVar("$source") in S.stored_names)
|
||||
setname = html_encode(interpreter.GetVar("$source"))
|
||||
setname = interpreter.GetVar("$source")
|
||||
else
|
||||
setname = "<i>[html_encode(interpreter.GetVar("$source"))]</i>"
|
||||
setname = "<i>[trim(copytext(sanitize(interpreter.GetVar("$source")), 1, MAX_MESSAGE_LEN))]</i>"
|
||||
|
||||
if(signal.data["name"] != setname)
|
||||
signal.data["realname"] = setname
|
||||
signal.data["name"] = setname
|
||||
signal.data["job"] = html_encode(interpreter.GetVar("$job"))
|
||||
signal.data["job"] = trim(copytext(sanitize(interpreter.GetVar("$job")), 1, MAX_MESSAGE_LEN))
|
||||
signal.data["reject"] = !(interpreter.GetVar("$pass")) // set reject to the opposite of $pass
|
||||
|
||||
|
||||
/* -- Actual language proc code -- */
|
||||
|
||||
datum/signal
|
||||
@@ -203,6 +209,9 @@ datum/signal
|
||||
hradio = new // sets the hradio as a radio intercom
|
||||
if(!freq)
|
||||
freq = 1459
|
||||
if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal
|
||||
freq *= 10 // shift the decimal one place
|
||||
|
||||
if(!job)
|
||||
job = "None"
|
||||
|
||||
@@ -233,4 +242,4 @@ datum/signal
|
||||
newsign.data["vmessage"] = H.voice_message
|
||||
newsign.data["vname"] = H.voice_name
|
||||
newsign.data["vmask"] = 0
|
||||
S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters
|
||||
S.relay_information(newsign, "/obj/machinery/telecomms/broadcaster") // send this simple message to broadcasters
|
||||
|
||||
@@ -120,4 +120,4 @@
|
||||
/proc/smartlength(var/container)
|
||||
if(container)
|
||||
if(istype(container, /list) || istext(container))
|
||||
return length(container)
|
||||
return length(container)
|
||||
@@ -32,6 +32,7 @@
|
||||
returnVal
|
||||
|
||||
max_iterations=100 // max iterations without any kind of delay
|
||||
cur_iterations=0 // current iteration
|
||||
max_recursion=50 // max recursions without returning anything (or completing the code block)
|
||||
cur_recursion=0 // current amount of recursion
|
||||
/*
|
||||
@@ -211,9 +212,14 @@
|
||||
*/
|
||||
RunWhile(node/statement/WhileLoop/stmt)
|
||||
var/i=1
|
||||
if(!cur_iterations)
|
||||
cur_iterations = 1
|
||||
while(Eval(stmt.cond) && Iterate(stmt.block, i++))
|
||||
cur_iterations++
|
||||
continue
|
||||
status &= ~BREAKING
|
||||
cur_iterations -= i
|
||||
if(cur_iterations <= 0) cur_iterations = 0
|
||||
|
||||
/*
|
||||
Proc:Iterate
|
||||
@@ -221,7 +227,7 @@
|
||||
*/
|
||||
Iterate(node/BlockDefinition/block, count)
|
||||
RunBlock(block)
|
||||
if(max_iterations > 0 && count >= max_iterations)
|
||||
if(max_iterations > 0 && (count >= max_iterations || cur_iterations + 1 >= max_iterations))
|
||||
RaiseError(new/runtimeError/IterationLimitReached())
|
||||
return 0
|
||||
if(status & (BREAKING|RETURNING))
|
||||
@@ -288,4 +294,3 @@
|
||||
else if(!istype(value) && isobject(value)) value = new/node/expression/value/reference(value)
|
||||
//TODO: check for invalid name
|
||||
S.variables["[name]"] = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user