Disposal updates, fixed a messed up maintenance door.

This commit is contained in:
SkyMarshal
2012-01-10 15:37:42 -07:00
parent e455f46cfd
commit f36c56f5c7
5 changed files with 99 additions and 9 deletions
@@ -12,7 +12,7 @@
m_amt = 1850
level = 2
var/ptype = 0
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk
// 0=straight, 1=bent, 2=junction-j1, 3=junction-j2, 4=junction-y, 5=trunk, 6=junction-j1s, 7=junction-j2s
var/dpdir = 0 // directions as disposalpipe
var/base_state = "pipe-s"
@@ -42,6 +42,12 @@
if(5)
base_state = "pipe-t"
dpdir = dir
if(6)
base_state = "pipe-j1s"
dpdir = dir | right | flip
if(7)
base_state = "pipe-j2s"
dpdir = dir | left | flip
icon_state = "con[base_state]"
@@ -93,6 +99,8 @@
return /obj/structure/disposalpipe/junction
if(5)
return /obj/structure/disposalpipe/trunk
if(6,7)
return /obj/structure/disposalpipe/sortjunction
return
+86 -7
View File
@@ -934,13 +934,19 @@
desc = "An underfloor disposal pipe with a package sorting mechanism."
icon_state = "pipe-j1s"
var/list/sortType = list()
var/list/backType = list()
var/backsort = 0 //For sending disposal packets to upstream destinations.
var/mailsort = 0
var/posdir = 0
var/negdir = 0
var/sortdir = 0
var
list/sortType = list()
list/backType = list()
backsort = 0 //For sending disposal packets to upstream destinations.
mailsort = 0
posdir = 0
negdir = 0
sortdir = 0
service = 0
screen = 0
icon_state_old = null
// mob/living/lastuser
New()
..()
@@ -965,6 +971,8 @@
nextdir(var/fromdir, var/sortTag, var/ismail)
//var/flipdir = turn(fromdir, 180)
if(service)
return posdir //If it's being worked on, it isn't sorting.
if(sortTag)
for(var/i, i <= backType.len, i++)
if(sortTag == src.backType[i])
@@ -1007,6 +1015,77 @@
return P
attackby(var/obj/item/I, var/mob/user)
if(istype(I, /obj/item/weapon/screwdriver))
if(service)
icon_state = icon_state_old
service = 0
user << "You close the service hatch on the sorter"
else
icon_state_old = icon_state
icon_state += "s"
service = 1
user << "You open up the service hatch on the sorter"
attack_hand(mob/user as mob)
if(service)
interact(user)
return
proc
interact(var/mob/user)
// lastuser = user
var/dat = "<TT><B>Sorting Mechanism</B><BR>"
if (!sortType)
dat += "<br>Currently Filtering: <A href='?src=\ref[src];choice=selectSort'>None</A><br>"
else
dat += "<br>Currently Filtering:"
for(var/i = 1, i <= sortType.len, i++)
dat += " <A href='?src=\ref[src];choice=selectSort'>[sortType[i]]</A>,"
dat += "<br>"
if (!backsort)
dat += "Backwards Sorting Disabled <A href='?src=\ref[src];choice=toggleBack'>Toggle</A><br>"
else if(!backType && backsort)
dat += "Backwards Sorting Active. Sorting: <A href='?src=\ref[src];choice=selectBack'>None.</A> <A href='?src=\ref[src];choice=toggleBack'>Toggle</A><br>"
else
dat += "Backwards Sorting Active. Sorting:"
for(var/i = 1, i <= backType.len, i++)
dat += " <A href='?src=\ref[src];choice=selectBack'>[backType[i]]</A>,"
dat += " <A href='?src=\ref[src];choice=toggleBack'>Toggle</A><br>"
user << browse(dat, "window=sortScreen")
onclose(user, "sortScreen")
return
Topic(href, href_list)
src.add_fingerprint(usr)
usr.machine = src
switch(href_list["choice"])
if("toggleBack")
backsort = !backsort
if("selectBack")
var/list/names = sortList(backType)
var/variable = input("Which tag?","Tag") as null|anything in names + "(ADD TAG)"
if(!variable)
return
if(variable == "(ADD TAG)")
var/var_value = input("Enter new tag:","Tag") as text|null
if(!var_value) return
backType |= var_value
else
backType -= variable
if("selectSort")
var/list/names = sortList(sortType)
var/variable = input("Which tag?","Tag") as null|anything in names + "(ADD TAG)"
if(!variable)
return
if(variable == "(ADD TAG)")
var/var_value = input("Enter new tag:","Tag") as text|null
if(!var_value) return
sortType |= var_value
else
sortType -= variable
// interact(lastuser)
updateUsrDialog()
//a trunk joining to a disposal bin or outlet on the same turf
/obj/structure/disposalpipe/trunk
@@ -12,6 +12,9 @@
attack_hand(mob/user as mob)
return unwrap()
proc/unwrap()
if (src.wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
src.wrapped.loc = (get_turf(src.loc))
if (istype(src.wrapped,/obj/structure/closet))