diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm
index 61cd0f6c6e..5683df4bf7 100644
--- a/code/ATMOSPHERICS/components/tvalve.dm
+++ b/code/ATMOSPHERICS/components/tvalve.dm
@@ -395,7 +395,7 @@ obj/machinery/atmospherics/tvalve/mirrored
return
..()
- //Radio remote control
+ //Radio remote control -eh?
proc
set_frequency(new_frequency)
diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm
index cbff1f1b64..e13a58f601 100644
--- a/code/ATMOSPHERICS/pipes.dm
+++ b/code/ATMOSPHERICS/pipes.dm
@@ -721,7 +721,7 @@ obj/machinery/atmospherics/pipe
icon_state = "manifold_[connected]_[unconnected]"
- if(!connected)
+ if(!connected)
del(src)
return
@@ -832,7 +832,7 @@ obj/machinery/atmospherics/pipe
icon_state = "manifold-y-f"
manifold4w
- icon = 'pipe_manifold.dmi'
+ icon = 'icons/obj/atmospherics/pipe_manifold.dmi'
icon_state = "manifold4w-f"
name = "4-way pipe manifold"
@@ -841,7 +841,7 @@ obj/machinery/atmospherics/pipe
volume = 140
dir = SOUTH
- initialize_directions = EAST|NORTH|WEST|SOUTH
+ initialize_directions = NORTH|SOUTH|EAST|WEST
var/obj/machinery/atmospherics/node1
var/obj/machinery/atmospherics/node2
@@ -849,6 +849,7 @@ obj/machinery/atmospherics/pipe
var/obj/machinery/atmospherics/node4
level = 1
+ layer = 2.4 //under wires with their 2.44
hide(var/i)
if(level == 1 && istype(loc, /turf/simulated))
@@ -862,7 +863,7 @@ obj/machinery/atmospherics/pipe
if(!parent)
..()
else
- machines.Remove(src)
+ . = PROCESS_KILL
/*
if(!node1)
parent.mingle_with_turf(loc, 70)
@@ -913,14 +914,13 @@ obj/machinery/atmospherics/pipe
if(reference == node4)
if(istype(node4, /obj/machinery/atmospherics/pipe))
del(parent)
- node3 = null
+ node4 = null
update_icon()
..()
update_icon()
- overlays = new()
if(node1&&node2&&node3&&node4)
var/C = ""
switch(color)
@@ -934,7 +934,7 @@ obj/machinery/atmospherics/pipe
else
icon_state = "manifold4w_ex"
- var/icon/con = new/icon('pipe_manifold.dmi',"manifold4w_con")
+ var/icon/con = new/icon('pipe_manifold.dmi',"manifold4w_con") //Since 4-ways are supposed to be directionless, they need an overlay instead it seems.
if(node1)
overlays += new/image(con,dir=1)
@@ -950,23 +950,24 @@ obj/machinery/atmospherics/pipe
return
initialize()
+
for(var/obj/machinery/atmospherics/target in get_step(src,1))
- if(target.initialize_directions & get_dir(target,src))
+ if(target.initialize_directions & 2)
node1 = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,2))
- if(target.initialize_directions & get_dir(target,src))
+ if(target.initialize_directions & 1)
node2 = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,4))
- if(target.initialize_directions & get_dir(target,src))
+ if(target.initialize_directions & 8)
node3 = target
break
for(var/obj/machinery/atmospherics/target in get_step(src,8))
- if(target.initialize_directions & get_dir(target,src))
+ if(target.initialize_directions & 4)
node4 = target
break
@@ -1026,6 +1027,88 @@ obj/machinery/atmospherics/pipe
manifold4w/general/hidden
level = 1
icon_state = "manifold4w-f"
+
+ cap
+ name = "pipe endcap"
+ desc = "An endcap for pipes"
+ icon = 'pipes.dmi'
+ icon_state = "cap"
+ level = 2
+ layer = 2.4 //under wires with their 2.44
+
+ volume = 35
+
+ dir = SOUTH
+ initialize_directions = NORTH
+
+ var/obj/machinery/atmospherics/node
+
+ New()
+ ..()
+ switch(dir)
+ if(SOUTH)
+ initialize_directions = NORTH
+ if(NORTH)
+ initialize_directions = SOUTH
+ if(WEST)
+ initialize_directions = EAST
+ if(EAST)
+ initialize_directions = WEST
+
+ hide(var/i)
+ if(level == 1 && istype(loc, /turf/simulated))
+ invisibility = i ? 101 : 0
+ update_icon()
+
+ pipeline_expansion()
+ return list(node)
+
+ process()
+ if(!parent)
+ ..()
+ else
+ . = PROCESS_KILL
+ Del()
+ if(node)
+ node.disconnect(src)
+
+ ..()
+
+ disconnect(obj/machinery/atmospherics/reference)
+ if(reference == node)
+ if(istype(node, /obj/machinery/atmospherics/pipe))
+ del(parent)
+ node = null
+
+ update_icon()
+
+ ..()
+
+ update_icon()
+ overlays = new()
+
+ icon_state = "cap[invisibility ? "-f" : ""]"
+ return
+
+ initialize()
+ for(var/obj/machinery/atmospherics/target in get_step(src, dir))
+ if(target.initialize_directions & get_dir(target,src))
+ node = target
+ break
+
+ var/turf/T = src.loc // hide if turf is not intact
+ hide(T.intact)
+ //update_icon()
+ update_icon()
+
+ visible
+ level = 2
+ icon_state = "cap"
+
+ hidden
+ level = 1
+ icon_state = "cap-f"
+
obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
if (istype(src, /obj/machinery/atmospherics/pipe/tank))
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index a8488e8c2d..1babba054e 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -20,6 +20,9 @@ Buildable meters
#define PIPE_PASSIVE_GATE 15
#define PIPE_VOLUME_PUMP 16
#define PIPE_HEAT_EXCHANGE 17
+#define PIPE_MTVALVE 18
+#define PIPE_MANIFOLD4W 19
+#define PIPE_CAP 20
/obj/item/pipe
name = "pipe"
@@ -75,6 +78,12 @@ Buildable meters
src.pipe_type = PIPE_VOLUME_PUMP
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
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w))
+ src.pipe_type = PIPE_MANIFOLD4W
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/cap))
+ src.pipe_type = PIPE_CAP
else
src.pipe_type = pipe_type
src.dir = dir
@@ -105,6 +114,9 @@ Buildable meters
"passive gate", \
"volume pump", \
"heat exchanger", \
+ "t-valve", \
+ "4-way manifold", \
+ "pipe cap", \
)
name = nlist[pipe_type+1] + " fitting"
var/list/islist = list( \
@@ -126,6 +138,9 @@ Buildable meters
"passivegate", \
"volumepump", \
"heunary", \
+ "mtvalve", \
+ "manifold4w", \
+ "cap", \
)
icon_state = islist[pipe_type + 1]
@@ -149,6 +164,8 @@ Buildable meters
dir = 1
else if(dir==8)
dir = 4
+ else if (pipe_type == PIPE_MANIFOLD4W)
+ dir = 2
//src.pipe_dir = get_pipe_dir()
return
@@ -188,10 +205,14 @@ Buildable meters
return dir //dir|acw
if(PIPE_CONNECTOR,PIPE_UVENT,PIPE_SCRUBBER,PIPE_HEAT_EXCHANGE)
return dir
+ if(PIPE_MANIFOLD4W)
+ return dir|flip|cw|acw
if(PIPE_MANIFOLD)
return flip|cw|acw
- if(PIPE_GAS_FILTER, PIPE_GAS_MIXER)
+ if(PIPE_GAS_FILTER, PIPE_GAS_MIXER,PIPE_MTVALVE)
return dir|flip|cw
+ if(PIPE_CAP)
+ return flip
return 0
/obj/item/pipe/proc/get_pdir() //endpoints for regular pipes
@@ -241,6 +262,8 @@ Buildable meters
dir = 1
else if(dir==8)
dir = 4
+ else if (pipe_type == PIPE_MANIFOLD4W)
+ dir = 2
var/pipe_dir = get_pipe_dir()
for(var/obj/machinery/atmospherics/M in src.loc)
@@ -325,6 +348,31 @@ Buildable meters
if (M.node3)
M.node3.initialize()
M.node3.build_network()
+
+ if(PIPE_MANIFOLD4W) //4-way manifold
+ var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc )
+ M.dir = dir
+ M.initialize_directions = pipe_dir
+ //M.New()
+ var/turf/T = M.loc
+ M.level = T.intact ? 2 : 1
+ M.initialize()
+ if (!M)
+ usr << "There's nothing to connect this manifold to! (with how the pipe code works, at least one end needs to be connected to something, otherwise the game deletes the segment)"
+ return 1
+ M.build_network()
+ if (M.node1)
+ M.node1.initialize()
+ M.node1.build_network()
+ if (M.node2)
+ M.node2.initialize()
+ M.node2.build_network()
+ if (M.node3)
+ M.node3.initialize()
+ M.node3.build_network()
+ if (M.node4)
+ M.node4.initialize()
+ M.node4.build_network()
if(PIPE_JUNCTION)
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/P = new ( src.loc )
@@ -467,6 +515,36 @@ Buildable meters
if (P.node2)
P.node2.initialize()
P.node2.build_network()
+
+ if(PIPE_MTVALVE) //manual t-valve
+ var/obj/machinery/atmospherics/tvalve/V = new(src.loc)
+ V.dir = dir
+ V.initialize_directions = pipe_dir
+ if (pipename)
+ V.name = pipename
+ var/turf/T = V.loc
+ V.level = T.intact ? 2 : 1
+ V.initialize()
+ V.build_network()
+ if (V.node1)
+ V.node1.initialize()
+ V.node1.build_network()
+ if (V.node2)
+ V.node2.initialize()
+ V.node2.build_network()
+ if (V.node3)
+ V.node3.initialize()
+ V.node3.build_network()
+
+ if(PIPE_CAP)
+ var/obj/machinery/atmospherics/pipe/cap/C = new(src.loc)
+ C.dir = dir
+ C.initialize_directions = pipe_dir
+ C.initialize()
+ C.build_network()
+ if(C.node)
+ C.node.initialize()
+ C.node.build_network()
if(PIPE_PASSIVE_GATE) //passive gate
var/obj/machinery/atmospherics/binary/passive_gate/P = new(src.loc)
@@ -551,7 +629,7 @@ Buildable meters
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user << "\blue You have fastened the meter to the pipe"
del(src)
-
+//not sure why these are necessary
#undef PIPE_SIMPLE_STRAIGHT
#undef PIPE_SIMPLE_BENT
#undef PIPE_HE_STRAIGHT
@@ -569,4 +647,6 @@ Buildable meters
#undef PIPE_GAS_MIXER
#undef PIPE_PASSIVE_GATE
#undef PIPE_VOLUME_PUMP
-#undef PIPE_OUTLET_INJECT
\ No newline at end of file
+#undef PIPE_OUTLET_INJECT
+#undef PIPE_MTVALVE
+//#undef PIPE_MANIFOLD4W
\ No newline at end of file
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index d5da74c569..87001bcf47 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -19,6 +19,9 @@
Bent Pipe
Manifold
Manual Valve
+Pipe Cap
+4-Way Manifold
+Manual T-Valve
Devices:
Connector
Unary Vent
@@ -37,8 +40,9 @@
Insulated pipes:
Pipe
Bent Pipe
-"}
+"}
+//What number the make points to is in the define # at the top of construction.dm in same folder
user << browse("