-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:
RavingManiac
2014-09-05 00:18:33 +08:00
parent aba09de9d7
commit 9801dfa9a9
18 changed files with 822 additions and 174 deletions
@@ -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
+22 -10
View File
@@ -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()
+22 -17
View File
@@ -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"])
+14 -6
View File
@@ -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