diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 04eff0de6e..ca72fdc32f 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -873,6 +873,12 @@ C.ptype = 9 if("pipe-j2s") C.ptype = 10 +///// Z-Level stuff + if("pipe-u") + C.ptype = 11 + if("pipe-d") + C.ptype = 12 +///// Z-Level stuff src.transfer_fingerprints_to(C) C.dir = dir C.density = 0 @@ -900,8 +906,113 @@ update() return +///// Z-Level stuff +/obj/structure/disposalpipe/up + icon_state = "pipe-u" + New() + ..() + dpdir = dir + update() + return + nextdir(var/fromdir) + var/nextdir + if(fromdir == 11) + nextdir = dir + else + nextdir = 12 + return nextdir + + transfer(var/obj/structure/disposalholder/H) + var/nextdir = nextdir(H.dir) + H.dir = nextdir + + var/turf/T + var/obj/structure/disposalpipe/P + + if(nextdir == 12) + var/turf/controlerlocation = locate(1, 1, src.z) + for(var/obj/effect/landmark/zcontroler/controler in controlerlocation) + if(controler.up) + T = locate(src.x, src.y, controler.up_target) + if(!T) + H.loc = src.loc + return + else + for(var/obj/structure/disposalpipe/down/F in T) + P = F + + else + T = get_step(src.loc, H.dir) + P = H.findpipe(T) + + if(P) + // find other holder in next loc, if inactive merge it with current + var/obj/structure/disposalholder/H2 = locate() in P + if(H2 && !H2.active) + H.merge(H2) + + H.loc = P + else // if wasn't a pipe, then set loc to turf + H.loc = T + return null + + return P + +/obj/structure/disposalpipe/down + icon_state = "pipe-d" + + New() + ..() + dpdir = dir + update() + return + + nextdir(var/fromdir) + var/nextdir + if(fromdir == 12) + nextdir = dir + else + nextdir = 11 + return nextdir + + transfer(var/obj/structure/disposalholder/H) + var/nextdir = nextdir(H.dir) + H.dir = nextdir + + var/turf/T + var/obj/structure/disposalpipe/P + + if(nextdir == 11) + var/turf/controlerlocation = locate(1, 1, src.z) + for(var/obj/effect/landmark/zcontroler/controler in controlerlocation) + if(controler.down) + T = locate(src.x, src.y, controler.down_target) + if(!T) + H.loc = src.loc + return + else + for(var/obj/structure/disposalpipe/up/F in T) + P = F + + else + T = get_step(src.loc, H.dir) + P = H.findpipe(T) + + if(P) + // find other holder in next loc, if inactive merge it with current + var/obj/structure/disposalholder/H2 = locate() in P + if(H2 && !H2.active) + H.merge(H2) + + H.loc = P + else // if wasn't a pipe, then set loc to turf + H.loc = T + return null + + return P +///// Z-Level stuff //a three-way junction with dir being the dominant direction /obj/structure/disposalpipe/junction @@ -1325,7 +1436,7 @@ src.streak(dirs) -/obj/effect/decal/cleanable/blood/gibs/robot/pipe_eject(var/direction) +/obj/effect/decal/cleanable/robot_debris/gib/pipe_eject(var/direction) var/list/dirs if(direction) dirs = list( direction, turn(direction, -45), turn(direction, 45))