Files
CHOMPStation2/code/ATMOSPHERICS/components/unary/unary_base.dm
RavingManiac 9801dfa9a9 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
2014-09-05 00:18:33 +08:00

96 lines
1.9 KiB
Plaintext

/obj/machinery/atmospherics/unary
dir = SOUTH
initialize_directions = SOUTH
//layer = TURF_LAYER+0.1
var/datum/gas_mixture/air_contents
var/obj/machinery/atmospherics/node
var/datum/pipe_network/network
New()
..()
initialize_directions = dir
air_contents = new
air_contents.volume = 200
// Housekeeping and pipe network stuff below
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
if(reference == node)
network = new_network
if(new_network.normal_members.Find(src))
return 0
new_network.normal_members += src
return null
Del()
loc = null
if(node)
node.disconnect(src)
del(network)
node = null
..()
initialize()
if(node) return
var/node_connect = dir
for(var/obj/machinery/atmospherics/target in get_step(src,node_connect))
if(target.initialize_directions & get_dir(target,src))
var/c = check_connect_types(target,src)
if (c)
target.connected_to = c
src.connected_to = c
node = target
break
update_icon()
update_underlays()
build_network()
if(!network && node)
network = new /datum/pipe_network()
network.normal_members += src
network.build_network(node, src)
return_network(obj/machinery/atmospherics/reference)
build_network()
if(reference==node)
return network
return null
reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
if(network == old_network)
network = new_network
return 1
return_network_air(datum/pipe_network/reference)
var/list/results = list()
if(network == reference)
results += air_contents
return results
disconnect(obj/machinery/atmospherics/reference)
if(reference==node)
del(network)
node = null
update_icon()
update_underlays()
return null