diff --git a/code/ATMOSPHERICS/_atmos_setup.dm b/code/ATMOSPHERICS/_atmos_setup.dm
index 5f105c8e6c..c11b51dbc3 100644
--- a/code/ATMOSPHERICS/_atmos_setup.dm
+++ b/code/ATMOSPHERICS/_atmos_setup.dm
@@ -1,7 +1,7 @@
//--------------------------------------------
// Pipe colors
//
-// Add them here and to the pipe_colors list
+// Add them here and to the pipe_colors list
// to automatically add them to all relevant
// atmospherics devices.
//--------------------------------------------
@@ -37,11 +37,12 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
var/list/pipe_icons[]
var/list/manifold_icons[]
var/list/device_icons[]
- var/list/underlays_down[]
- var/list/underlays_exposed[]
- var/list/underlays_intact[]
- var/list/pipe_underlays_exposed[]
- var/list/pipe_underlays_intact[]
+ var/list/underlays[]
+ //var/list/underlays_down[]
+ //var/list/underlays_exposed[]
+ //var/list/underlays_intact[]
+ //var/list/pipe_underlays_exposed[]
+ //var/list/pipe_underlays_intact[]
var/list/omni_icons[]
/datum/pipe_icon_manager/New()
@@ -64,16 +65,18 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
return device_icons[state]
if("omni")
return omni_icons[state]
- if("underlay_intact")
- return underlays_intact[dir + color]
- if("underlay_exposed")
- return underlays_exposed[dir + color]
- if("underlay_down")
- return underlays_down[dir + color]
- if("pipe_underlay_exposed")
- return pipe_underlays_exposed[dir + color]
- if("pipe_underlay_intact")
- return pipe_underlays_intact[dir + color]
+ if("underlay")
+ return underlays[state + dir + color]
+ //if("underlay_intact")
+ // return underlays_intact[state + dir + color]
+ // if("underlay_exposed")
+ // return underlays_exposed[state + dir + color]
+ // if("underlay_down")
+ // return underlays_down[state + dir + color]
+ // if("pipe_underlay_exposed")
+ // return pipe_underlays_exposed[state + dir + color]
+ // if("pipe_underlay_intact")
+ // return pipe_underlays_intact[state + dir + color]
/datum/pipe_icon_manager/proc/check_icons()
if(!pipe_icons)
@@ -84,13 +87,14 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
gen_device_icons()
if(!omni_icons)
gen_omni_icons()
- if(!underlays_intact || !underlays_down || !underlays_exposed || !pipe_underlays_exposed || !pipe_underlays_intact)
+ //if(!underlays_intact || !underlays_down || !underlays_exposed || !pipe_underlays_exposed || !pipe_underlays_intact)
+ if(!underlays)
gen_underlay_icons()
/datum/pipe_icon_manager/proc/gen_pipe_icons()
if(!pipe_icons)
pipe_icons = new()
-
+
var/icon/pipe = new('icons/atmos/pipes.dmi')
for(var/state in pipe.IconStates())
@@ -109,7 +113,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
/datum/pipe_icon_manager/proc/gen_manifold_icons()
if(!manifold_icons)
manifold_icons = new()
-
+
var/icon/pipe = new('icons/atmos/manifold.dmi')
for(var/state in pipe.IconStates())
@@ -118,7 +122,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
manifold_icons[state] = I
continue
- if(state == "core" || state == "4way")
+ if(findtext(state, "core") || findtext(state, "4way"))
var/image/I = image('icons/atmos/manifold.dmi', icon_state = state)
manifold_icons[state] = I
for(var/pipe_color in pipe_colors)
@@ -129,7 +133,7 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
/datum/pipe_icon_manager/proc/gen_device_icons()
if(!device_icons)
device_icons = new()
-
+
var/icon/device
device = new('icons/atmos/vent_pump.dmi')
@@ -147,14 +151,37 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
/datum/pipe_icon_manager/proc/gen_omni_icons()
if(!omni_icons)
omni_icons = new()
-
+
var/icon/omni = new('icons/atmos/omni_devices.dmi')
-
+
for(var/state in omni.IconStates())
if(!state || findtext(state, "map"))
continue
omni_icons[state] = image('icons/atmos/omni_devices.dmi', icon_state = state)
+
+/datum/pipe_icon_manager/proc/gen_underlay_icons()
+
+ if(!underlays)
+ underlays = new()
+
+ var/icon/pipe = new('icons/atmos/pipe_underlays.dmi')
+
+ for(var/state in pipe.IconStates())
+ if(state == "")
+ continue
+
+ var/cache_name = state
+
+ for(var/D in cardinal)
+ var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
+ underlays[cache_name + "[D]"] = I
+ for(var/pipe_color in pipe_colors)
+ I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
+ I.color = pipe_colors[pipe_color]
+ underlays[state + "[D]" + "[pipe_colors[pipe_color]]"] = I
+
+/*
/datum/pipe_icon_manager/proc/gen_underlay_icons()
if(!underlays_intact)
underlays_intact = new()
@@ -168,11 +195,11 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
pipe_underlays_intact = new()
var/icon/pipe = new('icons/atmos/pipe_underlays.dmi')
-
+
for(var/state in pipe.IconStates())
if(state == "")
continue
-
+
for(var/D in cardinal)
var/image/I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
switch(state)
@@ -186,6 +213,26 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
pipe_underlays_exposed["[D]"] = I
if("pipe_intact")
pipe_underlays_intact["[D]"] = I
+ if("intact-supply")
+ underlays_intact["[D]"] = I
+ if("exposed-supply")
+ underlays_exposed["[D]"] = I
+ if("down-supply")
+ underlays_down["[D]"] = I
+ if("pipe_exposed-supply")
+ pipe_underlays_exposed["[D]"] = I
+ if("pipe_intact-supply")
+ pipe_underlays_intact["[D]"] = I
+ if("intact-scrubbers")
+ underlays_intact["[D]"] = I
+ if("exposed-scrubbers")
+ underlays_exposed["[D]"] = I
+ if("down-scrubbers")
+ underlays_down["[D]"] = I
+ if("pipe_exposed-scrubbers")
+ pipe_underlays_exposed["[D]"] = I
+ if("pipe_intact-scrubbers")
+ pipe_underlays_intact["[D]"] = I
for(var/pipe_color in pipe_colors)
I = image('icons/atmos/pipe_underlays.dmi', icon_state = state, dir = D)
I.color = pipe_colors[pipe_color]
@@ -199,4 +246,26 @@ var/global/list/pipe_colors = list("grey" = PIPE_COLOR_GREY, "red" = PIPE_COLOR_
if("pipe_exposed")
pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
if("pipe_intact")
- pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
\ No newline at end of file
+ pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
+ if("intact-supply")
+ underlays_intact["[D]" + pipe_colors[pipe_color]] = I
+ if("exposed-supply")
+ underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
+ if("down-supply")
+ underlays_down["[D]" + pipe_colors[pipe_color]] = I
+ if("pipe_exposed-supply")
+ pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
+ if("pipe_intact-supply")
+ pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
+ if("intact-scrubbers")
+ underlays_intact["[D]" + pipe_colors[pipe_color]] = I
+ if("exposed-scrubbers")
+ underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
+ if("down-scrubbers")
+ underlays_down["[D]" + pipe_colors[pipe_color]] = I
+ if("pipe_exposed-scrubbers")
+ pipe_underlays_exposed["[D]" + pipe_colors[pipe_color]] = I
+ if("pipe_intact-scrubbers")
+ pipe_underlays_intact["[D]" + pipe_colors[pipe_color]] = I
+
+*/
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/atmospherics.dm b/code/ATMOSPHERICS/atmospherics.dm
index a33b79158e..43d7d0fe4c 100644
--- a/code/ATMOSPHERICS/atmospherics.dm
+++ b/code/ATMOSPHERICS/atmospherics.dm
@@ -16,19 +16,25 @@ Pipelines + Other Objects -> Pipe network
power_channel = ENVIRON
var/nodealert = 0
+ layer = 2.4 //under wires with their 2.44
+
+ var/connect_types[] = list(1) //1=regular, 2=supply, 3=scrubber
+ var/connected_to = 1 //same as above, currently not used for anything
+ var/icon_connect_type = "" //"-supply" or "-scrubbers"
+
var/initialize_directions = 0
var/pipe_color
-
+
var/global/datum/pipe_icon_manager/icon_manager
/obj/machinery/atmospherics/New()
if(!icon_manager)
icon_manager = new()
-
+
if(!pipe_color)
pipe_color = color
color = null
-
+
if(!pipe_color_check(pipe_color))
pipe_color = null
..()
@@ -38,14 +44,17 @@ Pipelines + Other Objects -> Pipe network
return
..()
-/obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction)
+/obj/machinery/atmospherics/proc/add_underlay(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type)
if(node)
if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
- underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node))
+ //underlays += icon_manager.get_atmos_icon("underlay_down", direction, color_cache_name(node))
+ underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
else
- underlays += icon_manager.get_atmos_icon("underlay_intact", direction, color_cache_name(node))
+ //underlays += icon_manager.get_atmos_icon("underlay_intact", direction, color_cache_name(node))
+ underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
else
- underlays += icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color)
+ //underlays += icon_manager.get_atmos_icon("underlay_exposed", direction, pipe_color)
+ underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "exposed" + icon_connect_type)
/obj/machinery/atmospherics/proc/update_underlays()
if(check_icon_cache())
@@ -53,20 +62,45 @@ Pipelines + Other Objects -> Pipe network
else
return 0
+obj/machinery/atmospherics/proc/check_connect_types(obj/machinery/atmospherics/atmos1, obj/machinery/atmospherics/atmos2)
+ var/i
+ var/list1[] = atmos1.connect_types
+ var/list2[] = atmos2.connect_types
+ for(i=1,i<=list1.len,i++)
+ var/j
+ for(j=1,j<=list2.len,j++)
+ if(list1[i] == list2[j])
+ var/n = list1[i]
+ return n
+ return 0
+
+obj/machinery/atmospherics/proc/check_connect_types_construction(obj/machinery/atmospherics/atmos1, obj/item/pipe/pipe2)
+ var/i
+ var/list1[] = atmos1.connect_types
+ var/list2[] = pipe2.connect_types
+ for(i=1,i<=list1.len,i++)
+ var/j
+ for(j=1,j<=list2.len,j++)
+ if(list1[i] == list2[j])
+ var/n = list1[i]
+ return n
+ return 0
+
+
/obj/machinery/atmospherics/proc/check_icon_cache(var/safety = 0)
if(!istype(icon_manager))
if(!safety) //to prevent infinite loops
icon_manager = new()
check_icon_cache(1)
return 0
-
+
return 1
/obj/machinery/atmospherics/proc/color_cache_name(var/obj/machinery/atmospherics/node)
//Don't use this for standard pipes
if(!istype(node))
return null
-
+
return node.pipe_color
/obj/machinery/atmospherics/process()
diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
index 52f57b2958..649972297a 100644
--- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
@@ -67,13 +67,21 @@ obj/machinery/atmospherics/binary
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
if(target.initialize_directions & get_dir(target,src))
- node2 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ break
update_icon()
update_underlays()
diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
index 5a64a517ca..eb5fbe7abe 100644
--- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
+++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm
@@ -28,7 +28,7 @@
/obj/machinery/atmospherics/omni/New()
..()
icon_state = "base"
-
+
ports = new()
for(var/d in cardinal)
var/datum/omni_port/new_port = new(src, d)
@@ -44,7 +44,7 @@
if(new_port.mode > 0)
initialize_directions |= d
ports += new_port
-
+
build_icons()
/obj/machinery/atmospherics/omni/update_icon()
@@ -173,7 +173,7 @@
if(ATM_O2 to ATM_N2O)
ic_on += "_filter"
ic_off += "_out"
-
+
ic_on = icon_manager.get_atmos_icon("omni", , , ic_on)
ic_off = icon_manager.get_atmos_icon("omni", , , ic_off)
@@ -238,8 +238,12 @@
continue
for(var/obj/machinery/atmospherics/target in get_step(src, P.dir))
if(target.initialize_directions & get_dir(target,src))
- P.node = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ P.node = target
+ break
for(var/datum/omni_port/P in ports)
P.update = 1
@@ -285,7 +289,7 @@
P.node = null
P.update = 1
break
-
+
update_ports()
return null
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm
index 75d32718fa..4bfd61a0a2 100644
--- a/code/ATMOSPHERICS/components/portables_connector.dm
+++ b/code/ATMOSPHERICS/components/portables_connector.dm
@@ -81,8 +81,12 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
if(target.initialize_directions & get_dir(target,src))
- node = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node = target
+ break
update_icon()
update_underlays()
@@ -123,7 +127,7 @@
if(reference==node)
del(network)
node = null
-
+
update_underlays()
return null
diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
index 655e58ea38..822c9a4d6d 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
@@ -2,7 +2,7 @@ obj/machinery/atmospherics/trinary
dir = SOUTH
initialize_directions = SOUTH|NORTH|WEST
use_power = 1
-
+
var/on = 0
var/datum/gas_mixture/air1
@@ -82,18 +82,29 @@ obj/machinery/atmospherics/trinary
for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect))
if(target.initialize_directions & get_dir(target,src))
- node2 = target
- break
-
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node3_connect))
if(target.initialize_directions & get_dir(target,src))
- node3 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node3 = target
+ break
update_icon()
update_underlays()
@@ -163,7 +174,7 @@ obj/machinery/atmospherics/trinary
else if(reference==node3)
del(network3)
node3 = null
-
+
update_underlays()
return null
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm
index 603feb0294..a3555f5322 100644
--- a/code/ATMOSPHERICS/components/tvalve.dm
+++ b/code/ATMOSPHERICS/components/tvalve.dm
@@ -37,12 +37,12 @@
if(!istype(T))
return
add_underlay(T, node1, turn(dir, -180))
-
+
if(istype(src, /obj/machinery/atmospherics/tvalve/mirrored))
add_underlay(T, node2, turn(dir, 90))
else
add_underlay(T, node2, turn(dir, -90))
-
+
add_underlay(T, node3, dir)
/obj/machinery/atmospherics/tvalve/hide(var/i)
@@ -202,17 +202,29 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
if(target.initialize_directions & get_dir(target,src))
- node2 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
if(target.initialize_directions & get_dir(target,src))
- node3 = target
- break
-
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node3 = target
+ break
+
update_icon()
update_underlays()
@@ -407,7 +419,7 @@
if(target.initialize_directions & get_dir(target,src))
node3 = target
break
-
+
update_icon()
update_underlays()
diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm
index 2c5f63f607..8af26e51eb 100644
--- a/code/ATMOSPHERICS/components/unary/unary_base.dm
+++ b/code/ATMOSPHERICS/components/unary/unary_base.dm
@@ -1,7 +1,7 @@
/obj/machinery/atmospherics/unary
dir = SOUTH
initialize_directions = SOUTH
- layer = TURF_LAYER+0.1
+ //layer = TURF_LAYER+0.1
var/datum/gas_mixture/air_contents
@@ -46,8 +46,12 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
if(target.initialize_directions & get_dir(target,src))
- node = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node = target
+ break
update_icon()
update_underlays()
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 7e409f859d..0a9eb3ce80 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -18,7 +18,9 @@
use_power = 1
idle_power_usage = 150 //internal circuitry, friction losses and stuff
active_power_usage = 7500 //This also doubles as a measure of how powerful the pump is, in Watts. 7500 W ~ 10 HP
-
+
+ connect_types = list(1,2) //connects to regular and supply pipes
+
var/area/initial_loc
level = 1
var/area_uid
@@ -64,7 +66,7 @@
/obj/machinery/atmospherics/unary/vent_pump/New()
..()
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP
-
+
icon = null
initial_loc = get_area(loc)
if (initial_loc.master)
@@ -87,13 +89,13 @@
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800
/obj/machinery/atmospherics/unary/vent_pump/update_icon(var/safety = 0)
- if(!check_icon_cache())
+ if(!check_icon_cache())
return
if (!node)
on = 0
overlays.Cut()
-
+
var/vent_icon = "vent"
var/turf/T = get_turf(src)
@@ -102,7 +104,7 @@
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
vent_icon += "h"
-
+
if(welded)
vent_icon += "weld"
else if(!powered())
@@ -121,7 +123,10 @@
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
return
else
- add_underlay(T, node, dir)
+ if(node)
+ add_underlay(T, node, dir, node.icon_connect_type)
+ else
+ add_underlay(T,, dir)
/obj/machinery/atmospherics/unary/vent_pump/hide()
update_icon()
@@ -138,7 +143,7 @@
/obj/machinery/atmospherics/unary/vent_pump/process()
..()
-
+
if (!node)
on = 0
if(!can_pump())
@@ -150,27 +155,27 @@
var/datum/gas_mixture/environment = loc.return_air()
var/power_draw = -1
-
+
//Figure out the target pressure difference
var/pressure_delta = get_pressure_delta(environment)
//src.visible_message("DEBUG >>> [src]: pressure_delta = [pressure_delta]")
if((environment.temperature || air_contents.temperature) && pressure_delta > 0.5)
- if(pump_direction) //internal -> external
+ if(pump_direction) //internal -> external
var/output_volume = environment.volume * environment.group_multiplier
var/air_temperature = environment.temperature? environment.temperature : air_contents.temperature
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
//src.visible_message("DEBUG >>> [src]: output_volume = [output_volume]L; air_temperature = [air_temperature]K; transfer_moles = [transfer_moles] mol")
-
+
power_draw = pump_gas(src, air_contents, environment, transfer_moles, active_power_usage)
else //external -> internal
var/output_volume = air_contents.volume + (network? network.volume : 0)
var/air_temperature = air_contents.temperature? air_contents.temperature : environment.temperature
var/transfer_moles = pressure_delta*output_volume/(air_temperature * R_IDEAL_GAS_EQUATION)
-
+
//limit flow rate from turfs
transfer_moles = min(transfer_moles, environment.total_moles*MAX_SIPHON_FLOWRATE/environment.volume) //group_multiplier gets divided out here
-
+
power_draw = pump_gas(src, environment, air_contents, transfer_moles, active_power_usage)
if (power_draw < 0)
@@ -182,13 +187,13 @@
last_power_draw = handle_power_draw(power_draw)
if(network)
network.update = 1
-
+
return 1
/obj/machinery/atmospherics/unary/vent_pump/proc/get_pressure_delta(datum/gas_mixture/environment)
var/pressure_delta = DEFAULT_PRESSURE_DELTA
var/environment_pressure = environment.return_pressure()
-
+
if(pump_direction) //internal -> external
if(pressure_checks & PRESSURE_CHECK_EXTERNAL)
pressure_delta = min(pressure_delta, external_pressure_bound - environment_pressure) //increasing the pressure here
@@ -199,7 +204,7 @@
pressure_delta = min(pressure_delta, environment_pressure - external_pressure_bound) //decreasing the pressure here
if(pressure_checks & PRESSURE_CHECK_INTERNAL)
pressure_delta = min(pressure_delta, internal_pressure_bound - air_contents.return_pressure()) //increasing the pressure here
-
+
return pressure_delta
//Radio remote control
@@ -282,7 +287,7 @@
if(signal.data["checks_toggle"] != null)
pressure_checks = (pressure_checks?0:3)
-
+
if(signal.data["direction"] != null)
pump_direction = text2num(signal.data["direction"])
@@ -325,7 +330,7 @@
if(signal.data["init"] != null)
name = signal.data["init"]
return
-
+
if(signal.data["status"] != null)
spawn(2)
broadcast_status()
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 300a8a09ff..0e719addc9 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -9,6 +9,8 @@
active_power_usage = 7500 //This also doubles as a measure of how powerful the pump is, in Watts. 7500 W ~ 10 HP
var/last_power_draw = 0
+ connect_types = list(1,3) //connects to regular and scrubber pipes
+
level = 1
var/area/initial_loc
@@ -29,7 +31,7 @@
/obj/machinery/atmospherics/unary/vent_scrubber/New()
..()
air_contents.volume = ATMOS_DEFAULT_VOLUME_FILTER
-
+
icon = null
initial_loc = get_area(loc)
if (initial_loc.master)
@@ -70,7 +72,10 @@
if(T.intact && node && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
return
else
- add_underlay(T, node, dir)
+ if(node)
+ add_underlay(T, node, dir, node.icon_connect_type)
+ else
+ add_underlay(T,, dir)
/obj/machinery/atmospherics/unary/vent_scrubber/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
@@ -130,7 +135,7 @@
if(scrubbing)
//limit flow rate from turfs
var/transfer_moles = min(environment.total_moles, environment.total_moles*MAX_SCRUBBER_FLOWRATE/environment.volume) //group_multiplier gets divided out here
-
+
power_draw = scrub_gas(src, scrubbing_gas, environment, air_contents, transfer_moles, active_power_usage)
else //Just siphon all air
//limit flow rate from turfs
@@ -145,14 +150,15 @@
last_flow_rate = 0
else
last_power_draw = handle_power_draw(power_draw)
-
+
if(network)
network.update = 1
-
+
return 1
/obj/machinery/atmospherics/unary/vent_scrubber/hide(var/i) //to make the little pipe section invisible, the icon changes.
update_icon()
+ update_underlays()
/obj/machinery/atmospherics/unary/vent_scrubber/receive_signal(datum/signal/signal)
if(stat & (NOPOWER|BROKEN))
@@ -186,7 +192,7 @@
scrubbing = !scrubbing
var/list/toggle = list()
-
+
if(!isnull(signal.data["co2_scrub"]) && text2num(signal.data["co2_scrub"]) != ("carbon_dioxide" in scrubbing_gas))
toggle += "carbon_dioxide"
else if(signal.data["toggle_co2_scrub"])
diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm
index 75282275eb..a57458d2e0 100644
--- a/code/ATMOSPHERICS/components/valve.dm
+++ b/code/ATMOSPHERICS/components/valve.dm
@@ -163,15 +163,23 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
if(target.initialize_directions & get_dir(target,src))
- node2 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ break
build_network()
-
+
update_icon()
update_underlays()
@@ -230,7 +238,7 @@
name = "digital valve"
desc = "A digitally controlled valve."
icon = 'icons/atmos/digital_valve.dmi'
-
+
var/frequency = 0
var/id = null
var/datum/radio_frequency/radio_connection
diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm
index ea031592da..9d5d0c91ed 100644
--- a/code/ATMOSPHERICS/pipes.dm
+++ b/code/ATMOSPHERICS/pipes.dm
@@ -6,7 +6,7 @@
var/volume = 0
force = 20
- layer = 2.4 //under wires with their 2.44
+ //layer = 2.4 //under wires with their 2.44
use_power = 0
var/alert_pressure = 80*ONE_ATMOSPHERE
@@ -105,6 +105,7 @@
pipe_color = new_color
update_icon()
+/*
/obj/machinery/atmospherics/pipe/add_underlay(var/obj/machinery/atmospherics/node, var/direction)
if(istype(src, /obj/machinery/atmospherics/pipe/tank)) //todo: move tanks to unary devices
return ..()
@@ -117,6 +118,7 @@
underlays += icon_manager.get_atmos_icon("pipe_underlay_exposed", direction, pipe_color)
else
return null
+*/
/obj/machinery/atmospherics/pipe/color_cache_name(var/obj/machinery/atmospherics/node)
if(istype(src, /obj/machinery/atmospherics/pipe/tank))
@@ -134,7 +136,7 @@
/obj/machinery/atmospherics/pipe/simple
icon = 'icons/atmos/pipes.dmi'
- icon_state = ""
+ icon_state = ""
name = "pipe"
desc = "A one meter section of regular pipe"
@@ -253,9 +255,9 @@
del(meter)
del(src)
else if(node1 && node2)
- overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "intact")
+ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "intact" + icon_connect_type)
else
- overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "exposed[node1?1:0][node2?1:0]")
+ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "exposed[node1?1:0][node2?1:0]" + icon_connect_type)
/obj/machinery/atmospherics/pipe/simple/update_underlays()
return
@@ -274,12 +276,20 @@
for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir))
if(target.initialize_directions & get_dir(target,src))
- node2 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ break
if(!node1 && !node2)
del(src)
@@ -305,16 +315,26 @@
return null
-/obj/machinery/atmospherics/pipe/simple/visible
- icon_state = "intact"
+/obj/machinery/atmospherics/pipe/simple/visible
+ icon_state = "intact"
level = 2
/obj/machinery/atmospherics/pipe/simple/visible/scrubbers
name = "Scrubbers pipe"
+ desc = "A one meter section of scrubbers pipe"
+ icon = 'icons/obj/pipes_scrubbers.dmi'
+ connect_types = list(3)
+ layer = 2.38
+ icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/simple/visible/supply
name = "Air supply pipe"
+ desc = "A one meter section of supply pipe"
+ icon = 'icons/obj/pipes_supply.dmi'
+ connect_types = list(2)
+ layer = 2.39
+ icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/simple/visible/yellow
@@ -329,19 +349,131 @@
/obj/machinery/atmospherics/pipe/simple/visible/purple
color = PIPE_COLOR_PURPLE
-/obj/machinery/atmospherics/pipe/simple/hidden
- icon_state = "intact"
+/obj/machinery/atmospherics/pipe/simple/hidden
+ icon_state = "intact"
level = 1
alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers
name = "Scrubbers pipe"
+ desc = "A one meter section of scrubbers pipe"
+ icon = 'icons/obj/pipes_scrubbers.dmi'
+ connect_types = list(3)
+ layer = 2.38
+ icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/simple/hidden/supply
name = "Air supply pipe"
+ desc = "A one meter section of supply pipe"
+ icon = 'icons/obj/pipes_supply.dmi'
+ connect_types = list(2)
+ layer = 2.39
+ icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
+
+/obj/machinery/atmospherics/pipe/simple/visible/universal
+ name="Universal pipe adapter"
+ desc = "An adapter for regular, supply and scrubbers pipes"
+ connect_types = list(1,2,3)
+ icon_state = "map_universal"
+
+/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(var/safety = 0)
+ if(!check_icon_cache())
+ return
+
+ alpha = 255
+
+ overlays.Cut()
+ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
+ underlays.Cut()
+
+ if (node1)
+ universal_underlays(node1)
+ if(node2)
+ universal_underlays(node2)
+ else
+ var/node1_dir = get_dir(node1,src)
+ universal_underlays(,node1_dir)
+ else if (node2)
+ universal_underlays(node2)
+ else
+ universal_underlays(,dir)
+ universal_underlays(dir, -180)
+
+/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays()
+ ..()
+ update_icon()
+
+
+
+/obj/machinery/atmospherics/pipe/simple/hidden/universal
+ name="Universal pipe adapter"
+ desc = "An adapter for regular, supply and scrubbers pipes"
+ connect_types = list(1,2,3)
+ icon_state = "map_universal"
+
+/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(var/safety = 0)
+ if(!check_icon_cache())
+ return
+
+ alpha = 255
+
+ overlays.Cut()
+ overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal")
+ underlays.Cut()
+
+ if (node1)
+ universal_underlays(node1)
+ if(node2)
+ universal_underlays(node2)
+ else
+ var/node2_dir = turn(get_dir(src,node1),-180)
+ universal_underlays(,node2_dir)
+ else if (node2)
+ universal_underlays(node2)
+ var/node1_dir = turn(get_dir(src,node2),-180)
+ universal_underlays(,node1_dir)
+ else
+ universal_underlays(,dir)
+ universal_underlays(,turn(dir, -180))
+
+/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays()
+ ..()
+ update_icon()
+
+/obj/machinery/atmospherics/proc/universal_underlays(var/obj/machinery/atmospherics/node, var/direction)
+ var/turf/T = loc
+ if(node)
+ var/node_dir = get_dir(src,node)
+ if(node.icon_connect_type == "-supply")
+ add_underlay_adapter(T, , node_dir, "")
+ add_underlay_adapter(T, node, node_dir, "-supply")
+ add_underlay_adapter(T, , node_dir, "-scrubbers")
+ else if (node.icon_connect_type == "-scrubbers")
+ add_underlay_adapter(T, , node_dir, "")
+ add_underlay_adapter(T, , node_dir, "-supply")
+ add_underlay_adapter(T, node, node_dir, "-scrubbers")
+ else
+ add_underlay_adapter(T, node, node_dir, "")
+ add_underlay_adapter(T, , node_dir, "-supply")
+ add_underlay_adapter(T, , node_dir, "-scrubbers")
+ else
+ add_underlay_adapter(T, , direction, "-supply")
+ add_underlay_adapter(T, , direction, "-scrubbers")
+ add_underlay_adapter(T, , direction, "")
+
+/obj/machinery/atmospherics/proc/add_underlay_adapter(var/turf/T, var/obj/machinery/atmospherics/node, var/direction, var/icon_connect_type) //modified from add_underlay, does not make exposed underlays
+ if(node)
+ if(T.intact && node.level == 1 && istype(node, /obj/machinery/atmospherics/pipe))
+ underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "down" + icon_connect_type)
+ else
+ underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type)
+ else
+ underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type)
+
+
/obj/machinery/atmospherics/pipe/simple/hidden/yellow
color = PIPE_COLOR_YELLOW
@@ -368,8 +500,8 @@
/obj/machinery/atmospherics/pipe/manifold
- icon = 'icons/atmos/manifold.dmi'
- icon_state = ""
+ icon = 'icons/atmos/manifold.dmi'
+ icon_state = ""
name = "pipe manifold"
desc = "A manifold composed of regular pipes"
@@ -470,19 +602,25 @@
del(src)
else
overlays.Cut()
- overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core")
- overlays += icon_manager.get_atmos_icon("manifold", , , "clamps")
+ overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type)
+ overlays += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type)
underlays.Cut()
+ var/turf/T = get_turf(src)
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
+ var/node1_direction = get_dir(src, node1)
+ var/node2_direction = get_dir(src, node2)
+ var/node3_direction = get_dir(src, node3)
+
directions -= dir
- directions -= add_underlay(node1)
- directions -= add_underlay(node2)
- directions -= add_underlay(node3)
+ directions -= add_underlay(T,node1,node1_direction,icon_connect_type)
+ directions -= add_underlay(T,node2,node2_direction,icon_connect_type)
+ directions -= add_underlay(T,node3,node3_direction,icon_connect_type)
for(var/D in directions)
- add_underlay(,D)
+ add_underlay(T,,D,icon_connect_type)
+
/obj/machinery/atmospherics/pipe/manifold/update_underlays()
..()
@@ -495,9 +633,13 @@
if(direction&connect_directions)
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- connect_directions &= ~direction
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ connect_directions &= ~direction
+ break
if (node1)
break
@@ -506,9 +648,13 @@
if(direction&connect_directions)
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
if(target.initialize_directions & get_dir(target,src))
- node2 = target
- connect_directions &= ~direction
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ connect_directions &= ~direction
+ break
if (node2)
break
@@ -517,9 +663,13 @@
if(direction&connect_directions)
for(var/obj/machinery/atmospherics/target in get_step(src,direction))
if(target.initialize_directions & get_dir(target,src))
- node3 = target
- connect_directions &= ~direction
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node3 = target
+ connect_directions &= ~direction
+ break
if (node3)
break
@@ -529,15 +679,25 @@
update_icon()
/obj/machinery/atmospherics/pipe/manifold/visible
- icon_state = "map"
+ icon_state = "map"
level = 2
/obj/machinery/atmospherics/pipe/manifold/visible/scrubbers
- name = "Scrubbers pipe"
+ name="Scrubbers pipe manifold"
+ desc = "A manifold composed of scrubbers pipes"
+ icon_state = "map-scrubbers"
+ connect_types = list(3)
+ layer = 2.38
+ icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/manifold/visible/supply
- name = "Air supply pipe"
+ name="Air supply pipe manifold"
+ desc = "A manifold composed of supply pipes"
+ icon_state = "map-supply"
+ connect_types = list(2)
+ layer = 2.39
+ icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/manifold/visible/yellow
@@ -553,16 +713,26 @@
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/manifold/hidden
- icon_state = "map"
+ icon_state = "map"
level = 1
alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game
/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers
- name = "Scrubbers pipe"
+ name="Scrubbers pipe manifold"
+ desc = "A manifold composed of scrubbers pipes"
+ icon_state = "map-scrubbers"
+ connect_types = list(3)
+ layer = 2.38
+ icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/manifold/hidden/supply
- name = "Air supply pipe"
+ name="Air supply pipe manifold"
+ desc = "A manifold composed of supply pipes"
+ icon_state = "map-supply"
+ connect_types = list(2)
+ layer = 2.39
+ icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/manifold/hidden/yellow
@@ -578,8 +748,8 @@
color = PIPE_COLOR_PURPLE
/obj/machinery/atmospherics/pipe/manifold4w
- icon = 'icons/atmos/manifold.dmi'
- icon_state = ""
+ icon = 'icons/atmos/manifold.dmi'
+ icon_state = ""
name = "4-way pipe manifold"
desc = "A manifold composed of regular pipes"
@@ -675,12 +845,14 @@
del(src)
else
overlays.Cut()
- overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way")
- overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way")
+ overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type)
+ overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type)
underlays.Cut()
+ /*
var/list/directions = list(NORTH, SOUTH, EAST, WEST)
+
directions -= add_underlay(node1)
directions -= add_underlay(node2)
directions -= add_underlay(node3)
@@ -688,6 +860,25 @@
for(var/D in directions)
add_underlay(,D)
+ */
+
+ var/turf/T = get_turf(src)
+ var/list/directions = list(NORTH, SOUTH, EAST, WEST)
+ var/node1_direction = get_dir(src, node1)
+ var/node2_direction = get_dir(src, node2)
+ var/node3_direction = get_dir(src, node3)
+ var/node4_direction = get_dir(src, node4)
+
+ directions -= dir
+
+ directions -= add_underlay(T,node1,node1_direction,icon_connect_type)
+ directions -= add_underlay(T,node2,node2_direction,icon_connect_type)
+ directions -= add_underlay(T,node3,node3_direction,icon_connect_type)
+ directions -= add_underlay(T,node4,node4_direction,icon_connect_type)
+
+ for(var/D in directions)
+ add_underlay(T,,D,icon_connect_type)
+
/obj/machinery/atmospherics/pipe/manifold4w/update_underlays()
..()
@@ -702,39 +893,65 @@
for(var/obj/machinery/atmospherics/target in get_step(src,1))
if(target.initialize_directions & 2)
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,2))
if(target.initialize_directions & 1)
- node2 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node2 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,4))
if(target.initialize_directions & 8)
- node3 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node3 = target
+ break
for(var/obj/machinery/atmospherics/target in get_step(src,8))
if(target.initialize_directions & 4)
- node4 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node4 = target
+ break
var/turf/T = get_turf(src)
if(istype(T))
hide(T.intact)
update_icon()
-/obj/machinery/atmospherics/pipe/manifold4w/visible
- icon_state = "map_4way"
+/obj/machinery/atmospherics/pipe/manifold4w/visible
+ icon_state = "map_4way"
level = 2
/obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers
- name = "Scrubbers pipe"
+ name="4-way scrubbers pipe manifold"
+ desc = "A manifold composed of scrubbers pipes"
+ icon_state = "map_4way-scrubbers"
+ connect_types = list(3)
+ layer = 2.38
+ icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/manifold4w/visible/supply
- name = "Air supply pipe"
+ name="4-way air supply pipe manifold"
+ desc = "A manifold composed of supply pipes"
+ icon_state = "map_4way-supply"
+ connect_types = list(2)
+ layer = 2.39
+ icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/manifold4w/visible/yellow
@@ -749,17 +966,27 @@
/obj/machinery/atmospherics/pipe/manifold4w/visible/purple
color = PIPE_COLOR_PURPLE
-/obj/machinery/atmospherics/pipe/manifold4w/hidden
- icon_state = "map_4way"
+/obj/machinery/atmospherics/pipe/manifold4w/hidden
+ icon_state = "map_4way"
level = 1
alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game
/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers
- name = "Scrubbers pipe"
+ name="4-way scrubbers pipe manifold"
+ desc = "A manifold composed of scrubbers pipes"
+ icon_state = "map_4way-scrubbers"
+ connect_types = list(3)
+ layer = 2.38
+ icon_connect_type = "-scrubbers"
color = PIPE_COLOR_RED
/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply
- name = "Air supply pipe"
+ name="4-way air supply pipe manifold"
+ desc = "A manifold composed of supply pipes"
+ icon_state = "map_4way-supply"
+ connect_types = list(2)
+ layer = 2.39
+ icon_connect_type = "-supply"
color = PIPE_COLOR_BLUE
/obj/machinery/atmospherics/pipe/manifold4w/hidden/yellow
@@ -839,8 +1066,12 @@
/obj/machinery/atmospherics/pipe/cap/initialize()
for(var/obj/machinery/atmospherics/target in get_step(src, dir))
if(target.initialize_directions & get_dir(target,src))
- node = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node = target
+ break
var/turf/T = src.loc // hide if turf is not intact
hide(T.intact)
@@ -907,8 +1138,12 @@
for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
update_underlays()
@@ -1088,8 +1323,12 @@
for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction))
if(target.initialize_directions & get_dir(target,src))
- node1 = target
- break
+ var/c = check_connect_types(target,src)
+ if (c)
+ target.connected_to = c
+ src.connected_to = c
+ node1 = target
+ break
update_icon()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 421ad9a9bb..5ebbe54410 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -32,6 +32,16 @@ Buildable meters
#define PIPE_GAS_MIXER_M 25
#define PIPE_OMNI_MIXER 26
#define PIPE_OMNI_FILTER 27
+///// Supply, scrubbers and universal pipes
+#define PIPE_UNIVERSAL 28
+#define PIPE_SUPPLY_STRAIGHT 29
+#define PIPE_SUPPLY_BENT 30
+#define PIPE_SCRUBBERS_STRAIGHT 31
+#define PIPE_SCRUBBERS_BENT 32
+#define PIPE_SUPPLY_MANIFOLD 33
+#define PIPE_SCRUBBERS_MANIFOLD 34
+#define PIPE_SUPPLY_MANIFOLD4W 35
+#define PIPE_SCRUBBERS_MANIFOLD4W 36
/obj/item/pipe
name = "pipe"
@@ -39,6 +49,7 @@ Buildable meters
var/pipe_type = 0
//var/pipe_dir = 0
var/pipename
+ var/connect_types[] = list(1) //1=regular, 2=supply, 3=scrubber
force = 7
icon = 'icons/obj/pipe-item.dmi'
icon_state = "simple"
@@ -64,10 +75,29 @@ Buildable meters
src.pipe_type = PIPE_HE_STRAIGHT + is_bent
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/insulated))
src.pipe_type = PIPE_INSULATED_STRAIGHT + is_bent
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/visible/supply) || istype(make_from, /obj/machinery/atmospherics/pipe/simple/hidden/supply))
+ src.pipe_type = PIPE_SUPPLY_STRAIGHT + is_bent
+ connect_types = list(2)
+ src.color = PIPE_COLOR_BLUE
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/visible/scrubbers) || istype(make_from, /obj/machinery/atmospherics/pipe/simple/hidden/scrubbers))
+ src.pipe_type = PIPE_SCRUBBERS_STRAIGHT + is_bent
+ connect_types = list(3)
+ src.color = PIPE_COLOR_RED
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple/visible/universal) || istype(make_from, /obj/machinery/atmospherics/pipe/simple/hidden/universal))
+ src.pipe_type = PIPE_UNIVERSAL
+ connect_types = list(1,2,3)
else if(istype(make_from, /obj/machinery/atmospherics/pipe/simple))
src.pipe_type = PIPE_SIMPLE_STRAIGHT + is_bent
else if(istype(make_from, /obj/machinery/atmospherics/portables_connector))
src.pipe_type = PIPE_CONNECTOR
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold/visible/supply) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold/hidden/supply))
+ src.pipe_type = PIPE_SUPPLY_MANIFOLD
+ connect_types = list(2)
+ src.color = PIPE_COLOR_BLUE
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold/visible/scrubbers) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers))
+ src.pipe_type = PIPE_SCRUBBERS_MANIFOLD
+ connect_types = list(3)
+ src.color = PIPE_COLOR_RED
else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold))
src.pipe_type = PIPE_MANIFOLD
else if(istype(make_from, /obj/machinery/atmospherics/unary/vent_pump))
@@ -96,6 +126,14 @@ Buildable meters
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/visible/supply) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/hidden/supply))
+ src.pipe_type = PIPE_SUPPLY_MANIFOLD4W
+ connect_types = list(2)
+ src.color = PIPE_COLOR_BLUE
+ else if(istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers) || istype(make_from, /obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers))
+ src.pipe_type = PIPE_SCRUBBERS_MANIFOLD4W
+ connect_types = list(3)
+ src.color = PIPE_COLOR_RED
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))
@@ -113,6 +151,14 @@ Buildable meters
else
src.pipe_type = pipe_type
src.dir = dir
+ if (pipe_type == 29 || pipe_type == 30 || pipe_type == 33 || pipe_type == 35)
+ connect_types = list(2)
+ src.color = PIPE_COLOR_BLUE
+ else if (pipe_type == 31 || pipe_type == 32 || pipe_type == 34 || pipe_type == 36)
+ connect_types = list(3)
+ src.color = PIPE_COLOR_RED
+ else if (pipe_type == 28)
+ connect_types = list(1,2,3)
//src.pipe_dir = get_pipe_dir()
update()
src.pixel_x = rand(-5, 5)
@@ -151,7 +197,17 @@ Buildable meters
"gas mixer t", \
"gas mixer m", \
"omni mixer", \
- "omni filter"
+ "omni filter", \
+///// Supply and scrubbers pipes
+ "universal pipe adapter", \
+ "supply pipe", \
+ "bent supply pipe", \
+ "scrubbers pipe", \
+ "bent scrubbers pipe", \
+ "supply manifold", \
+ "scrubbers manifold", \
+ "supply 4-way manifold", \
+ "scrubbers 4-way manifold", \
)
name = nlist[pipe_type+1] + " fitting"
var/list/islist = list( \
@@ -184,7 +240,17 @@ Buildable meters
"t_mixer", \
"m_mixer", \
"omni_mixer", \
- "omni_filter"
+ "omni_filter", \
+///// Supply and scrubbers pipes
+ "universal", \
+ "simple", \
+ "simple", \
+ "simple", \
+ "simple", \
+ "manifold", \
+ "manifold", \
+ "manifold4w", \
+ "manifold4w", \
)
icon_state = islist[pipe_type + 1]
@@ -208,22 +274,22 @@ Buildable meters
src.dir = turn(src.dir, -90)
- if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
+ if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
dir = 1
else if(dir==8)
dir = 4
- else if (pipe_type == PIPE_MANIFOLD4W)
+ else if (pipe_type in list (PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W))
dir = 2
//src.pipe_dir = get_pipe_dir()
return
/obj/item/pipe/Move()
..()
- if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \
+ if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \
&& (src.dir in cardinal))
src.dir = src.dir|turn(src.dir, 90)
- else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
+ else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
dir = 1
else if(dir==8)
@@ -247,16 +313,19 @@ Buildable meters
PIPE_PUMP ,\
PIPE_VOLUME_PUMP ,\
PIPE_PASSIVE_GATE ,\
- PIPE_MVALVE \
+ PIPE_MVALVE, \
+ PIPE_SUPPLY_STRAIGHT, \
+ PIPE_SCRUBBERS_STRAIGHT, \
+ PIPE_UNIVERSAL, \
)
return dir|flip
- if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT)
+ if(PIPE_SIMPLE_BENT, PIPE_INSULATED_BENT, PIPE_HE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT)
return dir //dir|acw
if(PIPE_CONNECTOR,PIPE_UVENT,PIPE_SCRUBBER,PIPE_HEAT_EXCHANGE)
return dir
- if(PIPE_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER)
+ if(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER)
return dir|flip|cw|acw
- if(PIPE_MANIFOLD)
+ if(PIPE_MANIFOLD, PIPE_SUPPLY_MANIFOLD, PIPE_SCRUBBERS_MANIFOLD)
return flip|cw|acw
if(PIPE_GAS_FILTER, PIPE_GAS_MIXER,PIPE_MTVALVE)
return dir|flip|cw
@@ -314,18 +383,18 @@ Buildable meters
return ..()
if (!isturf(src.loc))
return 1
- if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
+ if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
dir = 1
else if(dir==8)
dir = 4
- else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
+ else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
dir = 2
var/pipe_dir = get_pipe_dir()
for(var/obj/machinery/atmospherics/M in src.loc)
- if(M.initialize_directions & pipe_dir) // matches at least one direction on either type of pipe
- user << "\red There is already a pipe at that location."
+ if((M.initialize_directions & pipe_dir) && M.check_connect_types_construction(M,src)) // matches at least one direction on either type of pipe & same connection type
+ user << "\red There is already a pipe of the same type at this location."
return 1
// no conflicts found
@@ -351,6 +420,63 @@ Buildable meters
P.node2.initialize()
P.node2.build_network()
+ if(PIPE_SUPPLY_STRAIGHT, PIPE_SUPPLY_BENT)
+ var/obj/machinery/atmospherics/pipe/simple/hidden/supply/P = new( src.loc )
+ P.color = color
+ P.dir = src.dir
+ P.initialize_directions = pipe_dir
+ var/turf/T = P.loc
+ P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << pipefailtext
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
+
+ if(PIPE_SCRUBBERS_STRAIGHT, PIPE_SCRUBBERS_BENT)
+ var/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers/P = new( src.loc )
+ P.color = color
+ P.dir = src.dir
+ P.initialize_directions = pipe_dir
+ var/turf/T = P.loc
+ P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << pipefailtext
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
+
+ if(PIPE_UNIVERSAL)
+ var/obj/machinery/atmospherics/pipe/simple/hidden/universal/P = new( src.loc )
+ P.color = color
+ P.dir = src.dir
+ P.initialize_directions = pipe_dir
+ var/turf/T = P.loc
+ P.level = T.intact ? 2 : 1
+ P.initialize()
+ if (!P)
+ usr << pipefailtext
+ return 1
+ P.build_network()
+ if (P.node1)
+ P.node1.initialize()
+ P.node1.build_network()
+ if (P.node2)
+ P.node2.initialize()
+ P.node2.build_network()
+
if(PIPE_HE_STRAIGHT, PIPE_HE_BENT)
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc )
P.dir = src.dir
@@ -408,6 +534,52 @@ Buildable meters
M.node3.initialize()
M.node3.build_network()
+ if(PIPE_SUPPLY_MANIFOLD) //manifold
+ var/obj/machinery/atmospherics/pipe/manifold/hidden/supply/M = new( src.loc )
+ M.color = color
+ 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(PIPE_SCRUBBERS_MANIFOLD) //manifold
+ var/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers/M = new( src.loc )
+ M.color = color
+ 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(PIPE_MANIFOLD4W) //4-way manifold
var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc )
M.pipe_color = color
@@ -434,6 +606,60 @@ Buildable meters
M.node4.initialize()
M.node4.build_network()
+ if(PIPE_SUPPLY_MANIFOLD4W) //4-way manifold
+ var/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply/M = new( src.loc )
+ M.color = color
+ M.dir = dir
+ M.initialize_directions = pipe_dir
+ M.connect_types = src.connect_types
+ //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_SCRUBBERS_MANIFOLD4W) //4-way manifold
+ var/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers/M = new( src.loc )
+ M.color = color
+ M.dir = dir
+ M.initialize_directions = pipe_dir
+ M.connect_types = src.connect_types
+ //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 )
P.dir = src.dir
@@ -818,4 +1044,11 @@ Buildable meters
#undef PIPE_GAS_FILTER_M
#undef PIPE_GAS_MIXER_T
#undef PIPE_GAS_MIXER_M
+#undef PIPE_SUPPLY_STRAIGHT
+#undef PIPE_SUPPLY_BENT
+#undef PIPE_SCRUBBERS_STRAIGHT
+#undef PIPE_SCRUBBERS_BENT
+#undef PIPE_SUPPLY_MANIFOLD
+#undef PIPE_SCRUBBERS_MANIFOLD
+#undef PIPE_UNIVERSAL
//#undef PIPE_MANIFOLD4W
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index fd61f30471..9f86d55ce2 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -25,7 +25,18 @@
Manual T-Valve
upward Pipe
downward Pipe
+Supply pipes:
+Pipe
+Bent Pipe
+Manifold
+4-Way Manifold
+Scrubbers pipes:
+Pipe
+Bent Pipe
+Manifold
+4-Way Manifold
Devices:
+Universal pipe adapter
Connector
Unary Vent
Gas Pump
diff --git a/icons/atmos/manifold.dmi b/icons/atmos/manifold.dmi
index f6b24341c9..b7c5d0a2f1 100644
Binary files a/icons/atmos/manifold.dmi and b/icons/atmos/manifold.dmi differ
diff --git a/icons/atmos/pipe_underlays.dmi b/icons/atmos/pipe_underlays.dmi
index 0edf79e500..f6f38a9a7d 100644
Binary files a/icons/atmos/pipe_underlays.dmi and b/icons/atmos/pipe_underlays.dmi differ
diff --git a/icons/atmos/pipes.dmi b/icons/atmos/pipes.dmi
index 019be28ffd..08b267c6d0 100644
Binary files a/icons/atmos/pipes.dmi and b/icons/atmos/pipes.dmi differ
diff --git a/icons/obj/pipe-item.dmi b/icons/obj/pipe-item.dmi
index b8e9bee280..2fa39fec04 100644
Binary files a/icons/obj/pipe-item.dmi and b/icons/obj/pipe-item.dmi differ