mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-25 22:28:00 +01:00
NewPipe
-Supply and scrubber pipes can be run in parallel without connecting to each other -Supply pipes will only connect to supply pipes, vents and Universal Pipe Adapters(UPAs) -Scrubber pipes will only connect to scrubber pipes, scrubbers and UPAs -Supply and scrubber pipes are offset along the x and y axes to prevent sprite overlap -UPAs will connect to regular, scrubber and supply pipes, as well as anything else that connects to a regular pipe. UPAs will be used to interface between the supply/scrubber loops and atmos
This commit is contained in:
@@ -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
|
||||
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
|
||||
|
||||
*/
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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"])
|
||||
|
||||
@@ -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
|
||||
|
||||
+300
-61
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user