Merge pull request #4475 from Firecage/recyclingabsolutes

Absolute paths for recycling folder files
This commit is contained in:
Cheridan
2014-08-19 09:05:36 -05:00
3 changed files with 853 additions and 854 deletions
+219 -219
View File
@@ -19,245 +19,245 @@
var/base_state = "pipe-s"
// update iconstate and dpdir due to dir and type
proc/update()
var/flip = turn(dir, 180)
var/left = turn(dir, 90)
var/right = turn(dir, -90)
/obj/structure/disposalconstruct/proc/update()
var/flip = turn(dir, 180)
var/left = turn(dir, 90)
var/right = turn(dir, -90)
switch(ptype)
if(0)
base_state = "pipe-s"
dpdir = dir | flip
if(1)
base_state = "pipe-c"
dpdir = dir | right
if(2)
base_state = "pipe-j1"
dpdir = dir | right | flip
if(3)
base_state = "pipe-j2"
dpdir = dir | left | flip
if(4)
base_state = "pipe-y"
dpdir = dir | left | right
if(5)
base_state = "pipe-t"
dpdir = dir
// disposal bin has only one dir, thus we don't need to care about setting it
if(6)
if(anchored)
base_state = "disposal"
else
base_state = "condisposal"
switch(ptype)
if(0)
base_state = "pipe-s"
dpdir = dir | flip
if(1)
base_state = "pipe-c"
dpdir = dir | right
if(2)
base_state = "pipe-j1"
dpdir = dir | right | flip
if(3)
base_state = "pipe-j2"
dpdir = dir | left | flip
if(4)
base_state = "pipe-y"
dpdir = dir | left | right
if(5)
base_state = "pipe-t"
dpdir = dir
// disposal bin has only one dir, thus we don't need to care about setting it
if(6)
if(anchored)
base_state = "disposal"
else
base_state = "condisposal"
if(7)
base_state = "outlet"
dpdir = dir
if(7)
base_state = "outlet"
dpdir = dir
if(8)
base_state = "intake"
dpdir = dir
if(8)
base_state = "intake"
dpdir = dir
if(9)
base_state = "pipe-j1s"
dpdir = dir | right | flip
if(9)
base_state = "pipe-j1s"
dpdir = dir | right | flip
if(10)
base_state = "pipe-j2s"
dpdir = dir | left | flip
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
if(ptype<6 || ptype>8)
icon_state = "con[base_state]"
else
icon_state = base_state
// if invisible, fade icon
alpha = (invisibility ? 0 : 255)
// if invisible, fade icon
alpha = (invisibility ? 0 : 255)
// hide called by levelupdate if turf intact status changes
// change visibility status and force update of icon
hide(var/intact)
invisibility = (intact && level==1) ? 101: 0 // hide if floor is intact
update()
// hide called by levelupdate if turf intact status changes
// change visibility status and force update of icon
/obj/structure/disposalconstruct/hide(var/intact)
invisibility = (intact && level==1) ? 101: 0 // hide if floor is intact
update()
// flip and rotate verbs
verb/rotate()
set name = "Rotate Pipe"
set category = "Object"
set src in view(1)
// flip and rotate verbs
/obj/structure/disposalconstruct/verb/rotate()
set name = "Rotate Pipe"
set category = "Object"
set src in view(1)
if(usr.stat)
return
if(anchored)
usr << "You must unfasten the pipe before rotating it."
return
dir = turn(dir, -90)
update()
verb/flip()
set name = "Flip Pipe"
set category = "Object"
set src in view(1)
if(usr.stat)
return
if(anchored)
usr << "You must unfasten the pipe before flipping it."
return
dir = turn(dir, 180)
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
proc/dpipetype()
switch(ptype)
if(0,1)
return /obj/structure/disposalpipe/segment
if(2,3,4)
return /obj/structure/disposalpipe/junction
if(5)
return /obj/structure/disposalpipe/trunk
if(6)
return /obj/machinery/disposal
if(7)
return /obj/structure/disposaloutlet
if(8)
return /obj/machinery/disposal/deliveryChute
if(9,10)
return /obj/structure/disposalpipe/sortjunction
if(usr.stat)
return
if(anchored)
usr << "You must unfasten the pipe before rotating it."
return
dir = turn(dir, -90)
update()
/obj/structure/disposalconstruct/verb/flip()
set name = "Flip Pipe"
set category = "Object"
set src in view(1)
if(usr.stat)
return
if(anchored)
usr << "You must unfasten the pipe before flipping it."
return
dir = turn(dir, 180)
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
/obj/structure/disposalconstruct/proc/dpipetype()
switch(ptype)
if(0,1)
return /obj/structure/disposalpipe/segment
if(2,3,4)
return /obj/structure/disposalpipe/junction
if(5)
return /obj/structure/disposalpipe/trunk
if(6)
return /obj/machinery/disposal
if(7)
return /obj/structure/disposaloutlet
if(8)
return /obj/machinery/disposal/deliveryChute
if(9,10)
return /obj/structure/disposalpipe/sortjunction
return
// attackby item
// wrench: (un)anchor
// weldingtool: convert to real pipe
attackby(var/obj/item/I, var/mob/user)
var/nicetype = "pipe"
var/ispipe = 0 // Indicates if we should change the level of this pipe
src.add_fingerprint(user)
switch(ptype)
if(6)
nicetype = "disposal bin"
if(7)
nicetype = "disposal outlet"
if(8)
nicetype = "delivery chute"
if(9, 10)
nicetype = "sorting pipe"
ispipe = 1
// attackby item
// wrench: (un)anchor
// weldingtool: convert to real pipe
/obj/structure/disposalconstruct/attackby(var/obj/item/I, var/mob/user)
var/nicetype = "pipe"
var/ispipe = 0 // Indicates if we should change the level of this pipe
src.add_fingerprint(user)
switch(ptype)
if(6)
nicetype = "disposal bin"
if(7)
nicetype = "disposal outlet"
if(8)
nicetype = "delivery chute"
if(9, 10)
nicetype = "sorting pipe"
ispipe = 1
else
nicetype = "pipe"
ispipe = 1
var/turf/T = src.loc
if(T.intact)
user << "You can only attach the [nicetype] if the floor plating is removed."
return
var/obj/structure/disposalpipe/CP = locate() in T
if(istype(I, /obj/item/weapon/wrench))
if(anchored)
anchored = 0
if(ispipe)
level = 2
density = 0
else
nicetype = "pipe"
ispipe = 1
var/turf/T = src.loc
if(T.intact)
user << "You can only attach the [nicetype] if the floor plating is removed."
return
var/obj/structure/disposalpipe/CP = locate() in T
if(istype(I, /obj/item/weapon/wrench))
if(anchored)
anchored = 0
if(ispipe)
level = 2
density = 0
else
density = 1
user << "You detach the [nicetype] from the underfloor."
else
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."
return
else // Nothing under, fuck.
density = 1
user << "You detach the [nicetype] from the underfloor."
else
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."
return
else
if(CP)
update()
var/pdir = CP.dpdir
if(istype(CP, /obj/structure/disposalpipe/broken))
pdir = CP.dir
if(pdir & dpdir)
user << "There is already a [nicetype] at that location."
return
anchored = 1
if(ispipe)
level = 1 // We don't want disposal bins to disappear under the floors
density = 0
else
density = 1 // We don't want disposal bins or outlets to go density 0
user << "You attach the [nicetype] to the underfloor."
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
update()
else if(istype(I, /obj/item/weapon/weldingtool))
if(anchored)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "Welding the [nicetype] in place."
if(do_after(user, 20))
if(!src || !W.isOn()) return
user << "The [nicetype] has been welded in place!"
update() // TODO: Make this neat
if(ispipe) // Pipe
var/pipetype = dpipetype()
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
src.transfer_fingerprints_to(P)
P.base_icon_state = base_state
P.dir = dir
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)
P.mode = 0 // start with pump off
else if(ptype==7) // Disposal outlet
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
var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc)
src.transfer_fingerprints_to(P)
P.dir = dir
qdel(src)
return
else
user << "You need more welding fuel to complete this task."
else // Nothing under, fuck.
user << "The [nicetype] requires a trunk underneath it in order to work."
return
else
user << "You need to attach it to the plating first!"
if(CP)
update()
var/pdir = CP.dpdir
if(istype(CP, /obj/structure/disposalpipe/broken))
pdir = CP.dir
if(pdir & dpdir)
user << "There is already a [nicetype] at that location."
return
anchored = 1
if(ispipe)
level = 1 // We don't want disposal bins to disappear under the floors
density = 0
else
density = 1 // We don't want disposal bins or outlets to go density 0
user << "You attach the [nicetype] to the underfloor."
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
update()
else if(istype(I, /obj/item/weapon/weldingtool))
if(anchored)
var/obj/item/weapon/weldingtool/W = I
if(W.remove_fuel(0,user))
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
user << "Welding the [nicetype] in place."
if(do_after(user, 20))
if(!src || !W.isOn()) return
user << "The [nicetype] has been welded in place!"
update() // TODO: Make this neat
if(ispipe) // Pipe
var/pipetype = dpipetype()
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
src.transfer_fingerprints_to(P)
P.base_icon_state = base_state
P.dir = dir
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)
P.mode = 0 // start with pump off
else if(ptype==7) // Disposal outlet
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
var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc)
src.transfer_fingerprints_to(P)
P.dir = dir
qdel(src)
return
else
user << "You need more welding fuel to complete this task."
return
else
user << "You need to attach it to the plating first!"
return
File diff suppressed because it is too large Load Diff
+106 -106
View File
@@ -58,38 +58,38 @@
var/sortTag = 0
attack_self(mob/user as mob)
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = user.loc
if(ishuman(user))
user.put_in_hands(wrapped)
else
wrapped.loc = get_turf(src)
/obj/item/smallDelivery/attack_self(mob/user as mob)
if(wrapped) //sometimes items can disappear. For example, bombs. --rastaf0
wrapped.loc = user.loc
if(ishuman(user))
user.put_in_hands(wrapped)
else
wrapped.loc = get_turf(src)
qdel(src)
qdel(src)
attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
/obj/item/smallDelivery/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/destTagger))
var/obj/item/device/destTagger/O = W
if(sortTag != O.currTag)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
user << "\blue *[tag]*"
sortTag = O.currTag
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)
if(sortTag != O.currTag)
var/tag = uppertext(TAGGERLOCATIONS[O.currTag])
user << "\blue *[tag]*"
sortTag = O.currTag
playsound(loc, 'sound/machines/twobeep.ogg', 100, 1)
else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
user.visible_message("<span class='notice'>[user] labels [src] as [str].</span>")
name = "[name] ([str])"
else if(istype(W, /obj/item/weapon/pen))
var/str = copytext(sanitize(input(user,"Label text?","Set label","")),1,MAX_NAME_LEN)
if(!str || !length(str))
user << "<span class='notice'>Invalid text.</span>"
return
user.visible_message("<span class='notice'>[user] labels [src] as [str].</span>")
name = "[name] ([str])"
else if(istype(W, /obj/item/weapon/wrapping_paper))
icon_state = "giftcrate[wrapped.w_class]"
user.visible_message("<span class='notice'>[user] wraps the package in festive paper!</span>")
else if(istype(W, /obj/item/weapon/wrapping_paper))
icon_state = "giftcrate[wrapped.w_class]"
user.visible_message("<span class='notice'>[user] wraps the package in festive paper!</span>")
/obj/item/weapon/packageWrap
@@ -101,71 +101,71 @@
var/amount = 25.0
afterattack(var/obj/target as obj, mob/user as mob, proximity)
if(!proximity) return
if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete
return
if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
|| istype(target, /obj/item/weapon/evidencebag) || istype(target, /obj/structure/closet/body_bag))
return
if(target.anchored)
return
if(target in user)
return
user.attack_log += text("\[[time_stamp()]\] <font color='blue'>Has used [name] on \ref[target]</font>")
if(istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage) && !istype(target,/obj/item/weapon/storage/box)))
var/obj/item/O = target
if(amount > 1)
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
if(!istype(O.loc, /turf))
if(user.client)
user.client.screen -= O
P.wrapped = O
O.loc = P
var/i = round(O.w_class)
if(i in list(1,2,3,4,5))
P.icon_state = "deliverycrate[i]"
P.w_class = i
P.add_fingerprint(usr)
O.add_fingerprint(usr)
add_fingerprint(usr)
amount -= 1
else if(istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target
if(amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = "deliverycrate"
P.wrapped = O
O.loc = P
amount -= 3
else if(amount < 3)
user << "<span class='notice'>You need more paper.</span>"
else if(istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if(amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.welded = 1
O.loc = P
amount -= 3
else if(amount < 3)
user << "<span class='notice'>You need more paper.</span>"
else
user << "<span class='notice'>The object you are trying to wrap is unsuitable for the sorting machinery.</span>"
if(amount <= 0)
new /obj/item/weapon/c_tube( loc )
qdel(src)
return
/obj/item/weapon/packageWrap/afterattack(var/obj/target as obj, mob/user as mob, proximity)
if(!proximity) return
if(!istype(target)) //this really shouldn't be necessary (but it is). -Pete
return
if(istype(target, /obj/item/smallDelivery) || istype(target,/obj/structure/bigDelivery) \
|| istype(target, /obj/item/weapon/evidencebag) || istype(target, /obj/structure/closet/body_bag))
return
if(target.anchored)
return
if(target in user)
return
user.attack_log += text("\[[time_stamp()]\] <font color='blue'>Has used [name] on \ref[target]</font>")
examine()
if(src in usr)
usr << "<span class='notice'>There are [amount] units of package wrap left.</span>"
..()
if(istype(target, /obj/item) && !(istype(target, /obj/item/weapon/storage) && !istype(target,/obj/item/weapon/storage/box)))
var/obj/item/O = target
if(amount > 1)
var/obj/item/smallDelivery/P = new /obj/item/smallDelivery(get_turf(O.loc)) //Aaannd wrap it up!
if(!istype(O.loc, /turf))
if(user.client)
user.client.screen -= O
P.wrapped = O
O.loc = P
var/i = round(O.w_class)
if(i in list(1,2,3,4,5))
P.icon_state = "deliverycrate[i]"
P.w_class = i
P.add_fingerprint(usr)
O.add_fingerprint(usr)
add_fingerprint(usr)
amount -= 1
else if(istype(target, /obj/structure/closet/crate))
var/obj/structure/closet/crate/O = target
if(amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.icon_state = "deliverycrate"
P.wrapped = O
O.loc = P
amount -= 3
else if(amount < 3)
user << "<span class='notice'>You need more paper.</span>"
else if(istype (target, /obj/structure/closet))
var/obj/structure/closet/O = target
if(amount > 3 && !O.opened)
var/obj/structure/bigDelivery/P = new /obj/structure/bigDelivery(get_turf(O.loc))
P.wrapped = O
O.welded = 1
O.loc = P
amount -= 3
else if(amount < 3)
user << "<span class='notice'>You need more paper.</span>"
else
user << "<span class='notice'>The object you are trying to wrap is unsuitable for the sorting machinery.</span>"
if(amount <= 0)
new /obj/item/weapon/c_tube( loc )
qdel(src)
return
return
/obj/item/weapon/packageWrap/examine()
if(src in usr)
usr << "<span class='notice'>There are [amount] units of package wrap left.</span>"
..()
return
/obj/item/device/destTagger
@@ -184,31 +184,31 @@
flags = CONDUCT
slot_flags = SLOT_BELT
proc/openwindow(mob/user as mob)
var/dat = "<tt><center><h1><b>TagMaster 2.2</b></h1></center>"
/obj/item/device/destTagger/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>"
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 += "</tr><tr>"
if(i%4==0)
dat += "</tr><tr>"
dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"
dat += "</tr></table><br>Current Selection: [currTag ? TAGGERLOCATIONS[currTag] : "None"]</tt>"
user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")
user << browse(dat, "window=destTagScreen;size=450x350")
onclose(user, "destTagScreen")
attack_self(mob/user as mob)
openwindow(user)
return
/obj/item/device/destTagger/attack_self(mob/user as mob)
openwindow(user)
return
Topic(href, href_list)
add_fingerprint(usr)
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
currTag = n
openwindow(usr)
/obj/item/device/destTagger/Topic(href, href_list)
add_fingerprint(usr)
if(href_list["nextTag"])
var/n = text2num(href_list["nextTag"])
currTag = n
openwindow(usr)
/obj/machinery/disposal/deliveryChute
name = "delivery chute"