I'm back with the greatest feature additions ever, as before!

* You can now dispense sort junctions from the disposal dispenser.
* Sort junctions can now properly be unwelded.
* You can now change a sort junctions filter using a package tagger (examining a sort junction shows its current filter).
This also means that you can now construct a disposal and package system entirely from scratch!

* Updated the package tagger with a slightly updated interface, and more user feedback.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4742 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
daniel.cf.hultgren@gmail.com
2012-09-23 18:53:31 +00:00
parent ff4f9a7699
commit 7b6e58969f
5 changed files with 135 additions and 87 deletions

View File

@@ -58,8 +58,16 @@
base_state = "intake"
dpdir = dir
if(9)
base_state = "pipe-j1s"
dpdir = dir | right | flip
if(ptype<6)
if(10)
base_state = "pipe-j2s"
dpdir = dir | left | flip
if(ptype<6 || ptype>8)
icon_state = "con[base_state]"
else
icon_state = base_state
@@ -100,10 +108,16 @@
return
dir = turn(dir, 180)
if(ptype == 2)
ptype = 3
else if(ptype == 3)
ptype = 2
switch(ptype)
if(2)
ptype = 3
if(3)
ptype = 2
if(9)
ptype = 10
if(10)
ptype = 9
update()
// returns the type path of disposalpipe corresponding to this item dtype
@@ -121,6 +135,8 @@
return /obj/structure/disposaloutlet
if(8)
return /obj/machinery/disposal/deliveryChute
if(9,10)
return /obj/structure/disposalpipe/sortjunction
return
@@ -140,6 +156,9 @@
nicetype = "disposal outlet"
if(8)
nicetype = "delivery chute"
if(9, 10)
nicetype = "sorting pipe"
ispipe = 1
else
nicetype = "pipe"
ispipe = 1
@@ -150,7 +169,7 @@
return
var/obj/structure/disposalpipe/CP = locate() in T
if(ptype>=6) // Disposal or outlet
if(ptype>=6 && ptype <= 8) // Disposal or outlet
if(CP) // There's something there
if(!istype(CP,/obj/structure/disposalpipe/trunk))
user << "The [nicetype] requires a trunk underneath it in order to work."
@@ -168,7 +187,6 @@
user << "There is already a [nicetype] at that location."
return
var/obj/structure/disposalpipe/trunk/Trunk = CP
if(istype(I, /obj/item/weapon/wrench))
if(anchored)
@@ -210,6 +228,11 @@
P.dpdir = dpdir
P.updateicon()
//Needs some special treatment ;)
if(ptype==9 || ptype==10)
var/obj/structure/disposalpipe/sortjunction/SortP = P
SortP.updatedir()
else if(ptype==6) // Disposal bin
var/obj/machinery/disposal/P = new /obj/machinery/disposal(src.loc)
src.transfer_fingerprints_to(P)
@@ -220,6 +243,7 @@
var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
src.transfer_fingerprints_to(P)
P.dir = dir
var/obj/structure/disposalpipe/trunk/Trunk = CP
Trunk.linked = P
else if(ptype==8) // Disposal outlet

View File

@@ -853,6 +853,10 @@
C.ptype = 4
if("pipe-t")
C.ptype = 5
if("pipe-j1s")
C.ptype = 9
if("pipe-j2s")
C.ptype = 10
src.transfer_fingerprints_to(C)
C.dir = dir
C.density = 0
@@ -930,28 +934,51 @@
//a three-way junction that sorts objects
/obj/structure/disposalpipe/sortjunction
desc = "An underfloor disposal pipe with a package sorting mechanism."
icon_state = "pipe-j1s"
var/sortType = 0
var/posdir = 0
var/negdir = 0
var/sortdir = 0
New()
..()
proc/updatedesc()
desc = "An underfloor disposal pipe with a package sorting mechanism."
if(sortType>0)
var/tag = uppertext(TAGGERLOCATIONS[sortType])
desc += "\nIt's tagged with [tag]"
proc/updatedir()
posdir = dir
negdir = turn(posdir, 180)
if(icon_state == "pipe-j1s")
sortdir = turn(posdir, -90)
negdir = turn(posdir, 180)
else
icon_state = "pipe-j2s"
sortdir = turn(posdir, 90)
negdir = turn(posdir, 180)
dpdir = sortdir | posdir | negdir
New()
..()
updatedir()
updatedesc()
update()
return
attackby(var/obj/item/I, var/mob/user)
if(..())
return
if(istype(I, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = I
if(O.currTag > 0)// Tag set
sortType = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
user << "\blue Changed filter to [tag]"
updatedesc()
// next direction to move
// if coming in from negdir, then next is primary dir or sortdir
@@ -1014,6 +1041,21 @@
update()
return
New()
..()
posdir = dir
if(icon_state == "pipe-j1s")
sortdir = turn(posdir, -90)
negdir = turn(posdir, 180)
else
icon_state = "pipe-j2s"
sortdir = turn(posdir, 90)
negdir = turn(posdir, 180)
dpdir = sortdir | posdir | negdir
update()
return
// next direction to move
// if coming in from negdir, then next is primary dir or sortdir

View File

@@ -21,8 +21,13 @@
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
user << "\blue *TAGGED*"
src.sortTag = O.currTag
if(src.sortTag != O.currTag)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
user << "\blue *[tag]*"
src.sortTag = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
@@ -57,8 +62,13 @@
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
user << "\blue *TAGGED*"
src.sortTag = O.currTag
if(src.sortTag != O.currTag)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
user << "\blue *[tag]*"
src.sortTag = O.currTag
playsound(src.loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(usr,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
@@ -140,17 +150,18 @@
return
/obj/item/device/destTagger
name = "destination tagger"
desc = "Used to set the destination of properly wrapped packages."
icon_state = "forensic0"
var/currTag = 0
var/list/locationList = list("Disposals",
// Old, non-global name: "locationList"
var/list/TAGGERLOCATIONS = list("Disposals",
"Cargo Bay", "QM Office", "Engineering", "CE Office",
"Atmospherics", "Security", "HoS Office", "Medbay",
"CMO Office", "Chemistry", "Research", "RD Office",
"Robotics", "HoP Office", "Library", "Chapel", "Theatre",
"Bar", "Kitchen", "Hydroponics", "Janitor Closet","Genetics")
/obj/item/device/destTagger
name = "destination tagger"
desc = "Used to set the destination of properly wrapped packages."
icon_state = "forensic0"
var/currTag = 0
//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
@@ -162,20 +173,23 @@
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
attack_self(mob/user as mob)
var/dat = "<TT><B>TagMaster 2.2</B><BR><BR>"
if (src.currTag == 0)
dat += "<br>Current Selection: None<br>"
else
dat += "<br>Current Selection: [locationList[currTag]]<br><br>"
for (var/i = 1, i <= locationList.len, i++)
dat += "<A href='?src=\ref[src];nextTag=[i]'>[locationList[i]]</A>"
proc/openwindow(mob/user as mob)
var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"
dat += "<table style='width:100%; padding:4px;'><tr>"
for (var/i = 1, i <= TAGGERLOCATIONS.len, i++)
dat += "<td><a href='?src=\ref[src];nextTag=[i]'>[TAGGERLOCATIONS[i]]</a></td>"
if (i%4==0)
dat += "<br>"
else
dat += " "
user << browse(dat, "window=destTagScreen")
dat += "</tr><tr>"
dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"
user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")
attack_self(mob/user as mob)
openwindow(user)
return
Topic(href, href_list)
@@ -183,29 +197,7 @@
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
src.currTag = n
src.updateUsrDialog()
/*
attack(target as obj, mob/user as mob)
user << "/blue *TAGGED*"
target.sortTag = src.currTag
attack(target as obj, mob/user as mob)
user << "/blue You can only tag properly wrapped delivery packages!"
*/
attack(target as obj, mob/user as mob)
if (istype(target, /obj/structure/bigDelivery))
user << "\blue *TAGGED*"
var/obj/structure/bigDelivery/O = target
O.sortTag = src.currTag
else if (istype(target, /obj/item/smallDelivery))
user << "\blue *TAGGED*"
var/obj/item/smallDelivery/O = target
O.sortTag = src.currTag
else
user << "\blue You can only tag properly wrapped delivery packages!"
return
openwindow(usr)
/obj/machinery/disposal/deliveryChute
name = "Delivery chute"