diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm index 5d3c27ad1b8..cbd9b4e0708 100644 --- a/code/ATMOSPHERICS/atmospherics.dm +++ b/code/ATMOSPHERICS/atmospherics.dm @@ -23,6 +23,8 @@ Pipelines + Other Objects -> Pipe network // Which directions can we connect with? var/initialize_directions = 0 + var/obj/machinery/atmospherics/mirror //not actually an object reference, but a type. The reflection of the current pipe + // Pipe painter color setting. var/_color diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 16060740686..cbeedeecdb6 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -5,6 +5,8 @@ obj/machinery/atmospherics/trinary/filter name = "Gas filter" + mirror = /obj/machinery/atmospherics/trinary/filter/mirrored + var/on = 0 var/temp = null // -- TLE @@ -235,3 +237,25 @@ obj/machinery/atmospherics/trinary/filter/Topic(href, href_list) // -- TLE return +/obj/machinery/atmospherics/trinary/filter/mirrored + icon_state = "intactm_off" + +/obj/machinery/atmospherics/trinary/filter/mirrored/initialize() + if(node1 && node2 && node3) return + + node1 = findConnecting(dir) + node2 = findConnecting(turn(dir, -90)) + node3 = findConnecting(turn(dir, -180)) + + update_icon() + +/obj/machinery/atmospherics/trinary/filter/mirrored/update_icon() + if(stat & NOPOWER) + icon_state = "intactm_off" + else if(node2 && node3 && node1) + icon_state = "intactm_[on?("on"):("off")]" + else + icon_state = "intactm_off" + on = 0 + + return \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 15fff568535..27c96a9a9dd 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -5,6 +5,8 @@ obj/machinery/atmospherics/trinary/mixer name = "Gas mixer" + mirror = /obj/machinery/atmospherics/trinary/mixer/mirrored + var/on = 0 var/target_pressure = ONE_ATMOSPHERE @@ -160,3 +162,26 @@ obj/machinery/atmospherics/trinary/mixer src.update_icon() src.updateUsrDialog() return + +/obj/machinery/atmospherics/trinary/mixer/mirrored + icon_state = "intactm_off" + +/obj/machinery/atmospherics/trinary/mixer/mirrored/update_icon() + if(stat & NOPOWER) + icon_state = "intactm_off" + else if(node2 && node3 && node1) + icon_state = "intactm_[on?("on"):("off")]" + else + icon_state = "intactm_off" + on = 0 + + return + +/obj/machinery/atmospherics/trinary/mixer/mirrored/initialize() + if(node1 && node2 && node3) return + + node1 = findConnecting(dir) + node2 = findConnecting(turn(dir, -90)) + node3 = findConnecting(turn(dir, -180)) + + update_icon() diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index a4c5fb35680..78bc20f20be 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -35,6 +35,11 @@ obj/machinery/atmospherics/trinary air3.volume = 200 buildFrom(var/mob/usr,var/obj/item/pipe/pipe) + if(!(pipe.dir in list(NORTH, SOUTH, EAST, WEST)) && src.mirror) //because the dir isn't in the right set, we want to make the mirror kind + var/obj/machinery/atmospherics/trinary/mirrored_pipe = new mirror(src.loc) + pipe.dir = turn(pipe.dir, -45) + qdel(src) + return mirrored_pipe.buildFrom(usr, pipe) dir = pipe.dir initialize_directions = pipe.get_pipe_dir() if (pipe.pipename) diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index 5f8d8bdf526..826cc236e98 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -8,6 +8,8 @@ obj/machinery/atmospherics/tvalve dir = SOUTH initialize_directions = SOUTH|NORTH|WEST + mirror = /obj/machinery/atmospherics/tvalve/mirrored + state = 0 // 0 = go straight, 1 = go to side // like a trinary component, node1 is input, node2 is side output, node3 is straight output @@ -30,6 +32,11 @@ obj/machinery/atmospherics/tvalve ..() buildFrom(var/mob/usr,var/obj/item/pipe/pipe) + if(!(pipe.dir in list(NORTH, SOUTH, EAST, WEST)) && src.mirror) + var/obj/machinery/atmospherics/tvalve/mirrored_pipe = new mirror(src.loc) + pipe.dir = turn(pipe.dir, -45) + qdel(src) + return mirrored_pipe.buildFrom(usr, pipe) dir = pipe.dir initialize_directions = pipe.get_pipe_dir() if (pipe.pipename) @@ -272,6 +279,8 @@ obj/machinery/atmospherics/tvalve desc = "A digitally controlled valve." icon = 'icons/obj/atmospherics/digital_valve.dmi' + mirror = /obj/machinery/atmospherics/tvalve/mirrored/digital + attack_ai(mob/user as mob) src.add_hiddenprint(user) return src.attack_hand(user) @@ -322,9 +331,6 @@ obj/machinery/atmospherics/tvalve attackby(var/obj/item/weapon/W as obj, var/mob/user as mob) if (!istype(W, /obj/item/weapon/wrench)) return ..() - if (istype(src, /obj/machinery/atmospherics/tvalve/digital)) - user << "\red You cannot unwrench this [src], it's too complicated." - return 1 var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) user << "\red You must remove the plating first." diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm index 9b053708cfe..a3306b3528e 100644 --- a/code/game/machinery/pipe/construction.dm +++ b/code/game/machinery/pipe/construction.dm @@ -2,6 +2,8 @@ Buildable pipes Buildable meters */ + +//Gas piping numbers - do NOT hardcode these, use the defines #define PIPE_SIMPLE_STRAIGHT 0 #define PIPE_SIMPLE_BENT 1 #define PIPE_HE_STRAIGHT 2 @@ -28,6 +30,17 @@ Buildable meters #define PIPE_INJECTOR 23 #define PIPE_DP_VENT 24 #define PIPE_PASV_VENT 25 +#define PIPE_DTVALVE 26 + +//Disposal piping numbers - do NOT hardcode these, use the defines +#define DISP_PIPE_STRAIGHT 0 +#define DISP_PIPE_BENT 1 +#define DISP_JUNCTION 2 +#define DISP_YJUNCTION 3 +#define DISP_END_TRUNK 4 +#define DISP_END_BIN 5 +#define DISP_END_OUTLET 6 +#define DISP_END_CHUTE 7 /obj/item/pipe_spawner name = "Pipe Spawner" @@ -101,8 +114,12 @@ Buildable meters src.pipe_type = PIPE_PUMP else if(istype(make_from, /obj/machinery/atmospherics/trinary/filter)) src.pipe_type = PIPE_GAS_FILTER + if(istype(make_from, /obj/machinery/atmospherics/trinary/filter/mirrored)) + src.dir = turn(src.dir, 45) //adjust it to have the proper icon else if(istype(make_from, /obj/machinery/atmospherics/trinary/mixer)) src.pipe_type = PIPE_GAS_MIXER + if(istype(make_from, /obj/machinery/atmospherics/trinary/mixer/mirrored)) + src.dir = turn(src.dir, 45) else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_scrubber)) src.pipe_type = PIPE_SCRUBBER else if(istype(make_from, /obj/machinery/atmospherics/binary/passive_gate)) @@ -112,7 +129,12 @@ Buildable meters else if(istype(make_from, /obj/machinery/atmospherics/unary/heat_exchanger)) src.pipe_type = PIPE_HEAT_EXCHANGE else if(istype(make_from, /obj/machinery/atmospherics/tvalve)) - src.pipe_type = PIPE_MTVALVE + if(istype(make_from, /obj/machinery/atmospherics/tvalve/digital) || istype(make_from, /obj/machinery/atmospherics/tvalve/mirrored/digital)) + src.pipe_type = PIPE_DTVALVE + else + src.pipe_type = PIPE_MTVALVE + if(istype(make_from, /obj/machinery/atmospherics/tvalve/mirrored)) + src.dir = turn(src.dir, 45) //sets the angle and icon correctly else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w)) src.pipe_type = PIPE_MANIFOLD4W else if(istype(make_from, /obj/machinery/atmospherics/unary/cap)) @@ -161,7 +183,8 @@ var/global/list/pipeID2State = list( "thermalplate", "injector", "binary vent", - "passive vent" + "passive vent", + "dtvalve" ) /obj/item/pipe/proc/update() var/list/nlist = list( \ @@ -190,7 +213,8 @@ var/global/list/pipeID2State = list( "thermal plate", \ "injector", \ "dual-port vent", \ - "passive vent" + "passive vent", \ + "digital t-valve" ) name = nlist[pipe_type+1] + " fitting" icon = 'icons/obj/pipe-item.dmi' @@ -262,7 +286,7 @@ var/global/list/pipeID2State = list( return dir|flip|cw|acw if(PIPE_MANIFOLD) return flip|cw|acw - if(PIPE_GAS_FILTER, PIPE_GAS_MIXER,PIPE_MTVALVE) + if(PIPE_GAS_FILTER, PIPE_GAS_MIXER,PIPE_MTVALVE,PIPE_DTVALVE) return dir|flip|cw if(PIPE_CAP) return flip @@ -396,6 +420,9 @@ var/global/list/pipeID2State = list( if(PIPE_PASV_VENT) P=new /obj/machinery/atmospherics/pipe/vent(src.loc) + if(PIPE_DTVALVE) + P=new /obj/machinery/atmospherics/tvalve/digital(src.loc) + if(P.buildFrom(usr,src)) playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) user.visible_message( \ diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm index 5069f5e8b88..8b69220ad54 100644 --- a/code/game/machinery/pipe/pipe_dispenser.dm +++ b/code/game/machinery/pipe/pipe_dispenser.dm @@ -4,7 +4,6 @@ icon_state = "pipe_d" density = 1 anchored = 1 - var/unwrenched = 0 var/wait = 0 machine_flags = WRENCHMOVE | FIXED2WORK @@ -36,42 +35,43 @@ var/dat = {" Regular pipes:
"
+ dirsel += render_dir_img(1,"s.png","West South East")
+ dirsel += render_dir_img(4,"w.png","North West South")
+ dirsel += "
"
+ dirsel += render_dir_img(2,"n.png","East North West")
+ dirsel += render_dir_img(8,"e.png","South East North")
+ dirsel += "
"
+ dirsel += render_dir_img(6,"sm.png","West South East")
+ dirsel += render_dir_img(5,"wm.png","North West South")
+ dirsel += "
"
+ dirsel += render_dir_img(9,"nm.png","East North West")
+ dirsel += render_dir_img(10,"em.png","South East North")
+ dirsel += "