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:
SkyMarshal
2012-02-29 13:48:16 -07:00
parent 66f38fb34b
commit 4524a2ff10
21 changed files with 4979 additions and 4880 deletions

View File

@@ -3,6 +3,10 @@
new /datum/teleport/instant/science(arglist(args)) new /datum/teleport/instant/science(arglist(args))
return 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 /datum/teleport
var/atom/movable/teleatom //atom to teleport var/atom/movable/teleatom //atom to teleport
var/atom/destination //destination to teleport to var/atom/destination //destination to teleport to

View File

@@ -147,6 +147,9 @@
/atom/proc/add_blood(mob/living/carbon/human/M as mob) /atom/proc/add_blood(mob/living/carbon/human/M as mob)
if (!( istype(M, /mob/living/carbon/human) )) if (!( istype(M, /mob/living/carbon/human) ))
return 0 return 0
if (!istype(M.dna, /datum/dna))
M.dna = new /datum/dna(null)
M.check_dna()
if (!( src.flags ) & 256) if (!( src.flags ) & 256)
return return
if(!blood_DNA) if(!blood_DNA)
@@ -178,6 +181,14 @@
if(objsonturf) if(objsonturf)
for(var/i=1, i<=objsonturf.len, i++) for(var/i=1, i<=objsonturf.len, i++)
if(istype(objsonturf[i],/obj/effect/decal/cleanable/blood)) 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 return
var/obj/effect/decal/cleanable/blood/this = new /obj/effect/decal/cleanable/blood(source2) var/obj/effect/decal/cleanable/blood/this = new /obj/effect/decal/cleanable/blood(source2)
var/list/blood_DNA_temp[1] var/list/blood_DNA_temp[1]
@@ -203,7 +214,7 @@
else else
var/list/blood_DNA_temp[1] var/list/blood_DNA_temp[1]
blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.dna.b_type) blood_DNA_temp[1] = list(M.dna.unique_enzymes, M.dna.b_type)
src.blood_DNA = blood_DNA_temp src.blood_DNA = blood_DNA_temp
return return
/atom/proc/add_vomit_floor(mob/living/carbon/M as mob, var/toxvomit = 0) /atom/proc/add_vomit_floor(mob/living/carbon/M as mob, var/toxvomit = 0)
@@ -234,6 +245,7 @@
if( istype(src, /turf/simulated) ) if( istype(src, /turf/simulated) )
var/turf/simulated/source2 = src var/turf/simulated/source2 = src
var/obj/effect/decal/cleanable/xenoblood/this = new /obj/effect/decal/cleanable/xenoblood(source2) 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) for(var/datum/disease/D in M.viruses)
var/datum/disease/newDisease = new D.type var/datum/disease/newDisease = new D.type
this.viruses += newDisease this.viruses += newDisease

View File

@@ -160,6 +160,9 @@
screen = 0 screen = 0
if("editcode") if("editcode")
if(editingcode == usr) return
if(usr in viewingcode) return
if(!editingcode) if(!editingcode)
editingcode = usr editingcode = usr
winshow(editingcode, "Telecomms IDE", 1) // show the IDE winshow(editingcode, "Telecomms IDE", 1) // show the IDE

View File

@@ -34,6 +34,7 @@
sleep(3) sleep(3)
if (i > 0) if (i > 0)
var/obj/effect/decal/cleanable/xenoblood/b = new /obj/effect/decal/cleanable/xenoblood/xsplatter(src.loc) 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) for(var/datum/disease/D in src.viruses)
b.viruses += D b.viruses += D
if (step_to(src, get_step(src, direction), 0)) if (step_to(src, get_step(src, direction), 0))

View File

@@ -6,7 +6,7 @@
return (!density) return (!density)
/obj/structure/closet/proc/can_open() /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 0
return 1 return 1
@@ -117,20 +117,7 @@
del(src) del(src)
/obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/structure/closet/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/packageWrap)) if(src.opened)
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(istype(W, /obj/item/weapon/grab)) if(istype(W, /obj/item/weapon/grab))
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
@@ -147,6 +134,9 @@
if(isrobot(user)) if(isrobot(user))
return return
if(istype(W, /obj/item/weapon/packageWrap))
return
usr.drop_item() usr.drop_item()
if(W) if(W)
@@ -187,8 +177,8 @@
return return
if(!src.open()) if(!src.open())
if(istype(src.loc,/obj/effect/bigDelivery) && lasttry == 0) if(istype(src.loc,/obj/structure/bigDelivery) && lasttry == 0)
var/obj/effect/bigDelivery/Pack = src.loc var/obj/structure/bigDelivery/Pack = src.loc
if(istype(Pack.loc,/turf) && Pack.waswelded == 0) if(istype(Pack.loc,/turf) && Pack.waswelded == 0)
for (var/mob/M in hearers(src.loc, null)) 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))) M << text("<FONT size=[] color=red>BANG, bang, rrrrrip!</FONT>", max(0, 5 - get_dist(src, M)))
@@ -199,7 +189,7 @@
src.open() src.open()
spawn(30) spawn(30)
lasttry = 0 lasttry = 0
else if(!istype(src.loc,/obj/effect/bigDelivery)) else if(!istype(src.loc,/obj/structure/bigDelivery))
user << "\blue It won't budge!" user << "\blue It won't budge!"
if(!lastbang) if(!lastbang)
lastbang = 1 lastbang = 1

View File

@@ -54,6 +54,10 @@
gib.blood_DNA = list(list(MobDNA.unique_enzymes, MobDNA.b_type)) gib.blood_DNA = list(list(MobDNA.unique_enzymes, MobDNA.b_type))
if(MobDNA.original_name != "Unknown") if(MobDNA.original_name != "Unknown")
gib.OriginalMob = MobDNA.original_name 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] var/list/directions = gibdirections[i]
if(directions.len) if(directions.len)
gib.streak(directions) gib.streak(directions)

View File

@@ -105,6 +105,7 @@
var/turf/Z = get_turf(src) 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!") 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!") log_game("\red ERROR: [src] at [Z.x], [Z.y], [Z.z] is missing it's blood_DNA list!")
blood_DNA = list()
return return
usr << text("This is a []\icon[][]. It is a [] item.", !src.blood_DNA.len ? "" : "bloody ",src, src.name, t) usr << text("This is a []\icon[][]. It is a [] item.", !src.blood_DNA.len ? "" : "bloody ",src, src.name, t)
if(src.desc) if(src.desc)
@@ -200,30 +201,10 @@
user.update_clothing() user.update_clothing()
return return
/*
/obj/item/attackby(obj/item/W as obj, mob/user as mob) /obj/item/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/detective_scanner)) if(istype(W, /obj/item/device/detective_scanner))
return 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) /obj/item/attack_self(mob/user as mob)
..() ..()

View File

@@ -1,6 +1,6 @@
/obj/effect/portal/Bumped(mob/M as mob|obj) /obj/effect/portal/Bumped(atom/M as mob|obj)
spawn(0) spawn(0)
src.teleport(M) src.teleport(M)
return return
@@ -31,7 +31,48 @@
if (istype(M, /atom/movable)) if (istype(M, /atom/movable))
if(prob(failchance)) //oh dear a problem, put em in deep space if(prob(failchance)) //oh dear a problem, put em in deep space
src.icon_state = "portal1" 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 else
do_teleport(M, target, 1) ///You will appear adjacent to the beacon 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

View File

@@ -296,7 +296,7 @@
if (!ticker) if (!ticker)
user << "You can't buckle anyone in before the game starts." user << "You can't buckle anyone in before the game starts."
return 0 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 return 0
if (M == usr) if (M == usr)
M.visible_message(\ M.visible_message(\

View File

@@ -280,14 +280,7 @@
return attack_hand(user) return attack_hand(user)
/obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/structure/closet/crate/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/packageWrap)) if(opened)
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(isrobot(user)) if(isrobot(user))
return return
user.drop_item() user.drop_item()

View File

@@ -108,7 +108,7 @@ TABLE AND RACK OBJECT INTERATIONS
/obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0) /obj/structure/table/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (height==0)) return 1 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 return 1
else else
return 0 return 0
@@ -309,7 +309,7 @@ TABLE AND RACK OBJECT INTERATIONS
if(air_group || (height==0)) return 1 if(air_group || (height==0)) return 1
if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!| if(src.density == 0) //Because broken racks -Agouri |TODO: SPRITE!|
return 1 return 1
if(istype(mover) && (mover.checkpass(PASSTABLE) || mover.flags & TABLEPASS)) if(istype(mover) && (mover.checkpass(PASSTABLE) || mover.flags & TABLEPASS || mover.throwing))
return 1 return 1
else else
return 0 return 0

View File

@@ -92,16 +92,13 @@ obj/machinery/computer/forensic_scanning
scan_data = "" scan_data = ""
scan_name = "" scan_name = ""
scan_process = 0 scan_process = 0
booked = 0
req_access = list(access_forensics_lockers) req_access = list(access_forensics_lockers)
New() New()
..() ..()
if(!booked) new /obj/item/weapon/book/manual/detective(get_turf(src))
new /obj/item/weapon/book/manual/detective(get_turf(src))
booked = 1
return return
@@ -643,7 +640,7 @@ obj/machinery/computer/forensic_scanning
return 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++) for(var/k = 1, k <= files.len, k++)
var/list/perp_list = files[k] var/list/perp_list = files[k]
var/list/perp_prints = params2list(perp_list[1]) var/list/perp_prints = params2list(perp_list[1])
@@ -664,8 +661,7 @@ obj/machinery/computer/forensic_scanning
files[k] = perp_list files[k] = perp_list
return return
proc/process_card() //I am tired, but this updates the master print from a fingerprint card proc/process_card() //Same as above, but for fingerprint cards
//which is used to determine completion of a print.
if(card.fingerprints && !(card.amount > 1)) if(card.fingerprints && !(card.amount > 1))
for(var/k = 1, k <= card.fingerprints.len, k++) for(var/k = 1, k <= card.fingerprints.len, k++)
var/list/test_prints = params2list(card.fingerprints[k]) var/list/test_prints = params2list(card.fingerprints[k])
@@ -687,22 +683,22 @@ obj/machinery/computer/forensic_scanning
return return
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) if(misc && misc.len)
for(var/i = location, i < misc.len, i++) for(var/i = location, i < misc.len, i++)
misc[i] = misc[i+i] misc[i] = misc[i+i]
misc.len-- misc.len--
return return
proc/get_name(var/atom/A) proc/get_name(var/atom/A) //HurrDurr
return A.name 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 && files.len)
if(files.len < location) if(files.len > location)
for(var/i = location, i < files.len, i++) for(var/i = location, i < files.len, i++)
files[i] = files[i + 1] files[i] = files[i + 1]
if(files.len <= location) if(files.len >= location)
files[files.len] = list() files[files.len] = list()
files.len-- files.len--
return return
@@ -725,7 +721,7 @@ obj/item/clothing/gloves/var
obj/effect/decal/cleanable/blood/var obj/effect/decal/cleanable/blood/var
track_amt = 3 track_amt = 2
mob/blood_owner mob/blood_owner
turf/Exited(mob/living/carbon/human/M) turf/Exited(mob/living/carbon/human/M)
@@ -751,21 +747,21 @@ turf/Entered(mob/living/carbon/human/M)
M.shoes.track_blood-- M.shoes.track_blood--
src.add_bloody_footprints(M.shoes.track_blood_mob,0,M.dir,M.shoes.name) 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) for(var/obj/effect/decal/cleanable/blood/B in src)
// if(B.track_amt <= 0) continue if(B.track_amt <= 0) continue
// if(B.type != /obj/effect/decal/cleanable/blood/tracks) if(B.type != /obj/effect/decal/cleanable/blood/tracks)
// if(istype(M,/mob/living/carbon/human)) if(istype(M,/mob/living/carbon/human))
// if(M.shoes) if(M.shoes)
// M.shoes.add_blood(B.blood_owner) M.shoes.add_blood(B.blood_owner)
// M.shoes.track_blood_mob = B.blood_owner M.shoes.track_blood_mob = B.blood_owner
// M.shoes.track_blood = max(M.shoes.track_blood,8) M.shoes.track_blood = max(M.shoes.track_blood,8)
// else else
// M.add_blood(B.blood_owner) M.add_blood(B.blood_owner)
// M.track_blood_mob = B.blood_owner M.track_blood_mob = B.blood_owner
// M.track_blood = max(M.track_blood,rand(4,8)) M.track_blood = max(M.track_blood,rand(4,8))
// B.track_amt-- B.track_amt--
// break break
. = ..() . = ..()
turf/proc/add_bloody_footprints(mob/living/carbon/human/M,leaving,d,info) 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)) if(istype(A))
user.visible_message("[user] starts to wipe down [A] with [src]!") user.visible_message("[user] starts to wipe down [A] with [src]!")
if(do_after(user,30)) 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() A.clean_blood()
return return

View File

@@ -156,6 +156,9 @@ datum
if(!blood_prop) //first blood! if(!blood_prop) //first blood!
blood_prop = new(T) blood_prop = new(T)
blood_prop.blood_DNA = list(list(self.data["blood_DNA"], self.data["blood_type"])) 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"]) for(var/datum/disease/D in self.data["viruses"])
var/datum/disease/newVirus = new D.type var/datum/disease/newVirus = new D.type
@@ -179,7 +182,11 @@ datum
var/obj/effect/decal/cleanable/blood/blood_prop = locate() in T var/obj/effect/decal/cleanable/blood/blood_prop = locate() in T
if(!blood_prop) if(!blood_prop)
blood_prop = new(T) 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"]) for(var/datum/disease/D in self.data["viruses"])
var/datum/disease/newVirus = new D.type var/datum/disease/newVirus = new D.type
blood_prop.viruses += newVirus blood_prop.viruses += newVirus
@@ -196,7 +203,11 @@ datum
var/obj/effect/decal/cleanable/xenoblood/blood_prop = locate() in T var/obj/effect/decal/cleanable/xenoblood/blood_prop = locate() in T
if(!blood_prop) if(!blood_prop)
blood_prop = new(T) 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"]) for(var/datum/disease/D in self.data["viruses"])
var/datum/disease/newVirus = new D.type var/datum/disease/newVirus = new D.type
blood_prop.viruses += newVirus blood_prop.viruses += newVirus

View File

@@ -42,9 +42,9 @@
if(!effect || (blocked >= 2)) return 0 if(!effect || (blocked >= 2)) return 0
switch(effecttype) switch(effecttype)
if(STUN) if(STUN)
Stun((effect - (effect*getarmor(null, "melee")))/(blocked + 1)) Stun((effect - (effect*getarmor(null, "laser")))/(blocked + 1))
if(WEAKEN) if(WEAKEN)
Weaken((effect - (effect*getarmor(null, "melee")))/(blocked + 1)) Weaken((effect - (effect*getarmor(null, "laser")))/(blocked + 1))
if(PARALYZE) if(PARALYZE)
Paralyse(effect/(blocked+1)) Paralyse(effect/(blocked+1))
if(IRRADIATE) if(IRRADIATE)

View File

@@ -154,7 +154,7 @@
timeleft = 5 timeleft = 5
update() update()
return 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 ) if (T.anchored || get_dist(user, src) > 1 || get_dist(src,T) > 2 )
return return
@@ -572,8 +572,8 @@
if(H.mutations & FAT) // is a human and fat? if(H.mutations & FAT) // is a human and fat?
has_fat_guy = 1 // set flag on holder has_fat_guy = 1 // set flag on holder
*/ */
if(istype(AM, /obj/effect/bigDelivery)) if(istype(AM, /obj/structure/bigDelivery))
var/obj/effect/bigDelivery/T = AM var/obj/structure/bigDelivery/T = AM
src.destinationTag = T.sortTag src.destinationTag = T.sortTag
else if(istype(AM, /obj/item/smallDelivery)) else if(istype(AM, /obj/item/smallDelivery))
var/obj/item/smallDelivery/T = AM var/obj/item/smallDelivery/T = AM

View File

@@ -1,4 +1,4 @@
/obj/effect/bigDelivery /obj/structure/bigDelivery
desc = "A big wrapped package." desc = "A big wrapped package."
name = "large parcel" name = "large parcel"
icon = 'storage.dmi' icon = 'storage.dmi'
@@ -171,9 +171,13 @@
var/amount = 25.0 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)) if(istype(target, /obj/structure/table) || istype(target, /obj/structure/rack))
return 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>") 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)) else if (istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target var/obj/structure/closet/crate/O = target
if (src.amount > 3) 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 P.wrapped = O
O.loc = P O.loc = P
src.amount -= 3 src.amount -= 3
@@ -199,9 +203,11 @@
else if (istype (target, /obj/structure/closet)) else if (istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target var/obj/structure/closet/O = target
if (src.amount > 3) if (src.amount > 3)
var/obj/effect/bigDelivery/P = new /obj/effect/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.close() 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.welded = 1
O.loc = P O.loc = P
src.amount -= 3 src.amount -= 3
@@ -242,9 +248,10 @@
desc = "Used to set the destination of properly wrapped packages." desc = "Used to set the destination of properly wrapped packages."
icon_state = "forensic0" icon_state = "forensic0"
var/currTag = null 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", var/list/locationList = list("Disposals",
"Mail Office", "Cargo Bay", "QM Office", "Mail Office", "Cargo Bay", "QM Office",
"Mining Base", "Mining West", "Mining North",
"Locker Room", "Tool Storage", "Laundry Room", "Toilets", "Locker Room", "Tool Storage", "Laundry Room", "Toilets",
"Security", "Courtroom", "Detective's Office", "Law Office", "Security", "Courtroom", "Detective's Office", "Law Office",
"Research Division", "Research Director", "Genetics", "Research Division", "Research Director", "Genetics",
@@ -253,11 +260,6 @@
"Bar", "Kitchen", "Diner", "Hydroponics", "Bar", "Kitchen", "Diner", "Hydroponics",
"Meeting Room", "HoP Office", "Captain", "Meeting Room", "HoP Office", "Captain",
"Atmospherics", "Engineering", "Chief Engineer", "Robotics",) "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 w_class = 1
item_state = "electronic" item_state = "electronic"
@@ -300,9 +302,9 @@
return return
attack(target as obj, mob/user as mob) attack(target as obj, mob/user as mob)
if (istype(target, /obj/effect/bigDelivery)) if (istype(target, /obj/structure/bigDelivery))
user << "\blue *TAGGED*" user << "\blue *TAGGED*"
var/obj/effect/bigDelivery/O = target var/obj/structure/bigDelivery/O = target
O.sortTag = src.currTag O.sortTag = src.currTag
O.update_icon() O.update_icon()
else if (istype(target, /obj/item/smallDelivery)) else if (istype(target, /obj/item/smallDelivery))
@@ -339,7 +341,7 @@
var/deliveryCheck = 0 var/deliveryCheck = 0
var/obj/structure/disposalholder/H = new() // virtual holder object which actually var/obj/structure/disposalholder/H = new() // virtual holder object which actually
// travels through the pipes. // travels through the pipes.
for(var/obj/effect/bigDelivery/O in src) for(var/obj/structure/bigDelivery/O in src)
deliveryCheck = 1 deliveryCheck = 1
if(!O.sortTag) if(!O.sortTag)
O.sortTag = "Disposals" O.sortTag = "Disposals"

View File

@@ -35,25 +35,6 @@
interpreter.persist = 1 interpreter.persist = 1
interpreter.Compiler= src 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 return returnerrors
/* -- Execute the compiled code -- */ /* -- Execute the compiled code -- */
@@ -63,6 +44,32 @@
if(!ready) if(!ready)
return 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("$content", signal.data["message"])
interpreter.SetVar("$freq" , signal.frequency) interpreter.SetVar("$freq" , signal.frequency)
interpreter.SetVar("$source" , signal.data["name"]) interpreter.SetVar("$source" , signal.data["name"])
@@ -154,25 +161,24 @@
interpreter.Run() interpreter.Run()
// Backwards-apply variables onto signal data // 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") signal.frequency = interpreter.GetVar("$freq")
var/setname = "" var/setname = ""
var/obj/machinery/telecomms/server/S = signal.data["server"] var/obj/machinery/telecomms/server/S = signal.data["server"]
if(interpreter.GetVar("$source") in S.stored_names) if(interpreter.GetVar("$source") in S.stored_names)
setname = html_encode(interpreter.GetVar("$source")) setname = interpreter.GetVar("$source")
else 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) if(signal.data["name"] != setname)
signal.data["realname"] = setname signal.data["realname"] = setname
signal.data["name"] = 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 signal.data["reject"] = !(interpreter.GetVar("$pass")) // set reject to the opposite of $pass
/* -- Actual language proc code -- */ /* -- Actual language proc code -- */
datum/signal datum/signal
@@ -203,6 +209,9 @@ datum/signal
hradio = new // sets the hradio as a radio intercom hradio = new // sets the hradio as a radio intercom
if(!freq) if(!freq)
freq = 1459 freq = 1459
if(findtext(num2text(freq), ".")) // if the frequency has been set as a decimal
freq *= 10 // shift the decimal one place
if(!job) if(!job)
job = "None" job = "None"
@@ -233,4 +242,4 @@ datum/signal
newsign.data["vmessage"] = H.voice_message newsign.data["vmessage"] = H.voice_message
newsign.data["vname"] = H.voice_name newsign.data["vname"] = H.voice_name
newsign.data["vmask"] = 0 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

View File

@@ -120,4 +120,4 @@
/proc/smartlength(var/container) /proc/smartlength(var/container)
if(container) if(container)
if(istype(container, /list) || istext(container)) if(istype(container, /list) || istext(container))
return length(container) return length(container)

View File

@@ -32,6 +32,7 @@
returnVal returnVal
max_iterations=100 // max iterations without any kind of delay 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) max_recursion=50 // max recursions without returning anything (or completing the code block)
cur_recursion=0 // current amount of recursion cur_recursion=0 // current amount of recursion
/* /*
@@ -211,9 +212,14 @@
*/ */
RunWhile(node/statement/WhileLoop/stmt) RunWhile(node/statement/WhileLoop/stmt)
var/i=1 var/i=1
if(!cur_iterations)
cur_iterations = 1
while(Eval(stmt.cond) && Iterate(stmt.block, i++)) while(Eval(stmt.cond) && Iterate(stmt.block, i++))
cur_iterations++
continue continue
status &= ~BREAKING status &= ~BREAKING
cur_iterations -= i
if(cur_iterations <= 0) cur_iterations = 0
/* /*
Proc:Iterate Proc:Iterate
@@ -221,7 +227,7 @@
*/ */
Iterate(node/BlockDefinition/block, count) Iterate(node/BlockDefinition/block, count)
RunBlock(block) 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()) RaiseError(new/runtimeError/IterationLimitReached())
return 0 return 0
if(status & (BREAKING|RETURNING)) if(status & (BREAKING|RETURNING))
@@ -288,4 +294,3 @@
else if(!istype(value) && isobject(value)) value = new/node/expression/value/reference(value) else if(!istype(value) && isobject(value)) value = new/node/expression/value/reference(value)
//TODO: check for invalid name //TODO: check for invalid name
S.variables["[name]"] = value S.variables["[name]"] = value

View File

@@ -206,7 +206,7 @@ var/const
GAS_N2O = 1 << 4 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. //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 //(Exceptions: extended, sandbox and nuke) -Errorage
//Was list("1" = 10, "3" = 15, "4" = 60, "5" = 15); changed it to list("3" = 30, "4" = 70). //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