mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Merge pull request #563 from SkyMarshal/master
Disposals for mining, final blood_DNA stuff, cleaned up more code, fixed some scattered bugs, added 50% chance to end up in deep space.
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
new /datum/teleport/instant/science(arglist(args))
|
||||
return
|
||||
|
||||
/proc/do_teleport_stealth(ateleatom, adestination, aprecision=0, afteleport=1, aeffectin=null, aeffectout=null, asoundin=null, asoundout=null)
|
||||
new /datum/teleport/instant(arglist(args))
|
||||
return
|
||||
|
||||
/datum/teleport
|
||||
var/atom/movable/teleatom //atom to teleport
|
||||
var/atom/destination //destination to teleport to
|
||||
|
||||
@@ -147,6 +147,9 @@
|
||||
/atom/proc/add_blood(mob/living/carbon/human/M as mob)
|
||||
if (!( istype(M, /mob/living/carbon/human) ))
|
||||
return 0
|
||||
if (!istype(M.dna, /datum/dna))
|
||||
M.dna = new /datum/dna(null)
|
||||
M.check_dna()
|
||||
if (!( src.flags ) & 256)
|
||||
return
|
||||
if(!blood_DNA)
|
||||
@@ -178,6 +181,14 @@
|
||||
if(objsonturf)
|
||||
for(var/i=1, i<=objsonturf.len, i++)
|
||||
if(istype(objsonturf[i],/obj/effect/decal/cleanable/blood))
|
||||
var/obj/effect/decal/cleanable/blood/this = objsonturf[i]
|
||||
this.blood_DNA.len++
|
||||
this.blood_DNA[this.blood_DNA.len] = list(M.dna.unique_enzymes, M.dna.b_type)
|
||||
this.virus2 += M.virus2
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
var/datum/disease/newDisease = new D.type
|
||||
this.viruses += newDisease
|
||||
newDisease.holder = this
|
||||
return
|
||||
var/obj/effect/decal/cleanable/blood/this = new /obj/effect/decal/cleanable/blood(source2)
|
||||
var/list/blood_DNA_temp[1]
|
||||
@@ -234,6 +245,7 @@
|
||||
if( istype(src, /turf/simulated) )
|
||||
var/turf/simulated/source2 = src
|
||||
var/obj/effect/decal/cleanable/xenoblood/this = new /obj/effect/decal/cleanable/xenoblood(source2)
|
||||
this.blood_DNA = list(list("UNKNOWN BLOOD","X*"))
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
var/datum/disease/newDisease = new D.type
|
||||
this.viruses += newDisease
|
||||
|
||||
@@ -160,6 +160,9 @@
|
||||
screen = 0
|
||||
|
||||
if("editcode")
|
||||
if(editingcode == usr) return
|
||||
if(usr in viewingcode) return
|
||||
|
||||
if(!editingcode)
|
||||
editingcode = usr
|
||||
winshow(editingcode, "Telecomms IDE", 1) // show the IDE
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
sleep(3)
|
||||
if (i > 0)
|
||||
var/obj/effect/decal/cleanable/xenoblood/b = new /obj/effect/decal/cleanable/xenoblood/xsplatter(src.loc)
|
||||
b.blood_DNA = blood_DNA
|
||||
for(var/datum/disease/D in src.viruses)
|
||||
b.viruses += D
|
||||
if (step_to(src, get_step(src, direction), 0))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
return (!density)
|
||||
|
||||
/obj/structure/closet/proc/can_open()
|
||||
if(src.welded || istype(src.loc,/obj/effect/bigDelivery))
|
||||
if(src.welded || istype(src.loc,/obj/structure/bigDelivery))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -117,20 +117,7 @@
|
||||
del(src)
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/packageWrap))
|
||||
var/obj/item/weapon/packageWrap/O = W
|
||||
if (O.amount > 3)
|
||||
src.close()
|
||||
var/obj/effect/bigDelivery/P = new /obj/effect/bigDelivery(get_turf(src.loc))
|
||||
P.wrapped = src
|
||||
P.waswelded = welded
|
||||
src.welded = 0
|
||||
src.loc = P
|
||||
src.opened = 0
|
||||
O.amount -= 3
|
||||
else
|
||||
user << "\blue You need more paper."
|
||||
else if(src.opened)
|
||||
if(src.opened)
|
||||
if(istype(W, /obj/item/weapon/grab))
|
||||
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
|
||||
|
||||
@@ -147,6 +134,9 @@
|
||||
if(isrobot(user))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/packageWrap))
|
||||
return
|
||||
|
||||
usr.drop_item()
|
||||
|
||||
if(W)
|
||||
@@ -187,8 +177,8 @@
|
||||
return
|
||||
|
||||
if(!src.open())
|
||||
if(istype(src.loc,/obj/effect/bigDelivery) && lasttry == 0)
|
||||
var/obj/effect/bigDelivery/Pack = src.loc
|
||||
if(istype(src.loc,/obj/structure/bigDelivery) && lasttry == 0)
|
||||
var/obj/structure/bigDelivery/Pack = src.loc
|
||||
if(istype(Pack.loc,/turf) && Pack.waswelded == 0)
|
||||
for (var/mob/M in hearers(src.loc, null))
|
||||
M << text("<FONT size=[] color=red>BANG, bang, rrrrrip!</FONT>", max(0, 5 - get_dist(src, M)))
|
||||
@@ -199,7 +189,7 @@
|
||||
src.open()
|
||||
spawn(30)
|
||||
lasttry = 0
|
||||
else if(!istype(src.loc,/obj/effect/bigDelivery))
|
||||
else if(!istype(src.loc,/obj/structure/bigDelivery))
|
||||
user << "\blue It won't budge!"
|
||||
if(!lastbang)
|
||||
lastbang = 1
|
||||
|
||||
@@ -54,6 +54,10 @@
|
||||
gib.blood_DNA = list(list(MobDNA.unique_enzymes, MobDNA.b_type))
|
||||
if(MobDNA.original_name != "Unknown")
|
||||
gib.OriginalMob = MobDNA.original_name
|
||||
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)
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
var/turf/Z = get_turf(src)
|
||||
message_admins("\red ERROR: [src] at [Z.x], [Z.y], [Z.z] is missing it's blood_DNA list!")
|
||||
log_game("\red ERROR: [src] at [Z.x], [Z.y], [Z.z] is missing it's blood_DNA list!")
|
||||
blood_DNA = list()
|
||||
return
|
||||
usr << text("This is a []\icon[][]. It is a [] item.", !src.blood_DNA.len ? "" : "bloody ",src, src.name, t)
|
||||
if(src.desc)
|
||||
@@ -200,30 +201,10 @@
|
||||
user.update_clothing()
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
/obj/item/attackby(obj/item/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/device/detective_scanner))
|
||||
return
|
||||
if (istype(W, /obj/item/weapon/packageWrap))
|
||||
var/location = get_turf(src.loc)
|
||||
if(istype(src,/obj/item/weapon/storage) && istype(src.loc, /mob)) //Put it into the bag
|
||||
return
|
||||
if(istype(src.loc,/obj/item/weapon/storage)) //Taking stuff out of storage duplicates it.
|
||||
var/obj/item/weapon/storage/U = src.loc
|
||||
user.client.screen -= src //Fixed!
|
||||
U.contents.Remove(src)
|
||||
if(istype(src.loc,/obj/item/clothing/suit/storage/))
|
||||
var/obj/item/clothing/suit/storage/X = src.loc
|
||||
user.client.screen -= src
|
||||
X.contents.Remove(src)
|
||||
if(src in user)
|
||||
user.remove_from_mob(src)
|
||||
var/obj/item/weapon/packageWrap/O = W
|
||||
if (O.amount > 1)
|
||||
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(location)
|
||||
P.wrapped = src
|
||||
src.loc = P
|
||||
O.amount -= 1*/
|
||||
|
||||
/obj/item/attack_self(mob/user as mob)
|
||||
..()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
/obj/effect/portal/Bumped(mob/M as mob|obj)
|
||||
/obj/effect/portal/Bumped(atom/M as mob|obj)
|
||||
spawn(0)
|
||||
src.teleport(M)
|
||||
return
|
||||
@@ -31,7 +31,48 @@
|
||||
if (istype(M, /atom/movable))
|
||||
if(prob(failchance)) //oh dear a problem, put em in deep space
|
||||
src.icon_state = "portal1"
|
||||
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), 3), 0)
|
||||
do_teleport(M, locate(rand(5, world.maxx - 5), rand(5, world.maxy -5), pick(3,4,5,6)), 0)
|
||||
else
|
||||
do_teleport(M, target, 1) ///You will appear adjacent to the beacon
|
||||
|
||||
|
||||
//Adding in special portals to permit the use of trans-level disposals/mailing.
|
||||
/obj/effect/portal/zlev
|
||||
failchance = 0
|
||||
target = null
|
||||
invisibility = 101
|
||||
var/ID = 0
|
||||
|
||||
New()
|
||||
|
||||
CanPass(atom/A, turf/T)
|
||||
if(istype(A, /mob) || istype(A, /obj)) // You Shall Not Pass!
|
||||
teleport(A)
|
||||
return 1
|
||||
|
||||
teleport(var/atom/movable/M as mob|obj)
|
||||
if(istype(M, /obj/effect)) //sparks don't teleport
|
||||
return
|
||||
if (!( target ))
|
||||
for(var/obj/effect/portal/zlev/dest/A in world)
|
||||
if(ID == A.ID)
|
||||
target = A
|
||||
break
|
||||
if(!target)
|
||||
del(src)
|
||||
return
|
||||
if (istype(M, /atom/movable))
|
||||
var/temp = get_dir(M,src)
|
||||
do_teleport(M, target) ///You will appear at the beacon
|
||||
var/turf/target2 = get_edge_target_turf(M, temp)
|
||||
M.throw_at(target2,100,2)
|
||||
|
||||
dest //Holy shit that was bad.
|
||||
HasEntered(AM as mob|obj)
|
||||
return
|
||||
|
||||
Bumped(atom/M as mob|obj)
|
||||
return
|
||||
|
||||
CanPass(atom/A, turf/T)
|
||||
return 1
|
||||
@@ -296,7 +296,7 @@
|
||||
if (!ticker)
|
||||
user << "You can't buckle anyone in before the game starts."
|
||||
return 0
|
||||
if ((!( istype(M, /mob) ) || get_dist(src, user) > 1 || M.loc != src.loc || user.restrained() || usr.stat || M.buckled))
|
||||
if ((!( istype(M, /mob) ) || get_dist(src, user) >= 1 || M.loc != src.loc || user.restrained() || usr.stat || M.buckled))
|
||||
return 0
|
||||
if (M == usr)
|
||||
M.visible_message(\
|
||||
|
||||
@@ -280,14 +280,7 @@
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (istype(W, /obj/item/weapon/packageWrap))
|
||||
var/obj/item/weapon/packageWrap/O = W
|
||||
if (O.amount > 3)
|
||||
var/obj/effect/bigDelivery/P = new /obj/effect/bigDelivery(get_turf(src.loc))
|
||||
P.wrapped = src
|
||||
src.loc = P
|
||||
O.amount -= 3
|
||||
else if(opened)
|
||||
if(opened)
|
||||
if(isrobot(user))
|
||||
return
|
||||
user.drop_item()
|
||||
|
||||
@@ -108,7 +108,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)) //WTF do things hit tables like that? Jeez.
|
||||
if(istype(mover) && (mover.checkpass(PASSTABLE) || (mover.flags & TABLEPASS) || mover.throwing)) //WTF do things hit tables like that? Jeez.
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -309,7 +309,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))
|
||||
if(istype(mover) && (mover.checkpass(PASSTABLE) || mover.flags & TABLEPASS || mover.throwing))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
@@ -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
|
||||
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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ var/const
|
||||
GAS_N2O = 1 << 4
|
||||
|
||||
|
||||
var/list/accessable_z_levels = list("3" = 30, "4" = 70)
|
||||
var/list/accessable_z_levels = list("3" = 15, "4" = 35, "6" = 50)
|
||||
//This list contains the z-level numbers which can be accessed via space travel and the percentile chances to get there.
|
||||
//(Exceptions: extended, sandbox and nuke) -Errorage
|
||||
//Was list("1" = 10, "3" = 15, "4" = 60, "5" = 15); changed it to list("3" = 30, "4" = 70).
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user