Files
CHOMPStation2/code/ATMOSPHERICS/components/unary/unary_base.dm
Loganbacca e05b5c0bfb Pipe rendering rewrite
- Complete rewrite of pipe rendering code. It now selects icons from a shared cache.
- Manifolds and other devices (pumps, filters, etc.) now match the color of the connected pipes.
- Updated omni devices to use the shared cache.
- Set separate pipe color definitions.
- Cleaned up a lot of pipe code, converting it to absolute paths and removing old commented out code.
- Tweaked t-ray rendering code.
- Tweaked pipe painter.
- Enhanced pipe checking debug command.
- Expanded tank capacity and resprited them.
2014-07-18 13:39:39 +00:00

92 lines
1.7 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))
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