Pipenet revamp

-Removed the pipenet network datum, now it will all be done with the pipeline datum
-All atmos pipes and machines will always have a pipeline datum
-Moved the valves to the binary subtype and the portable connectors to the unary subtype
-The pipe vents (who were barely used in three spots of the map) are removed, the map slots will replaced with outlets
-Fixes some bugs of pipenet disconnection, mostly on explosions
-Cleaned a bit the copypaste of construction.dm of pipes
-Removed the ID restrictions of digital valves and the frequency (both unused)
This commit is contained in:
Aranclanos
2014-11-03 08:21:31 -03:00
parent 0cc07336d8
commit 8aa5a137c5
38 changed files with 754 additions and 1628 deletions
@@ -10,8 +10,8 @@
var/obj/machinery/atmospherics/node1
var/obj/machinery/atmospherics/node2
var/datum/pipe_network/network1
var/datum/pipe_network/network2
var/datum/pipeline/parent1
var/datum/pipeline/parent2
var/showpipe = 0
@@ -60,33 +60,15 @@
..(intact)
// Housekeeping and pipe network stuff below
/obj/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
if(reference == node1)
network1 = new_network
else if(reference == node2)
network2 = new_network
if(new_network.normal_members.Find(src))
return 0
new_network.normal_members += src
return null
/obj/machinery/atmospherics/binary/Destroy()
loc = null
if(node1)
node1.disconnect(src)
del(network1)
node1 = null
nullifyPipenet(parent1)
if(node2)
node2.disconnect(src)
del(network2)
node1 = null
node2 = null
node2 = null
nullifyPipenet(parent2)
..()
/obj/machinery/atmospherics/binary/initialize()
@@ -111,58 +93,63 @@
update_icon()
/obj/machinery/atmospherics/binary/build_network()
if(!network1 && node1)
network1 = new /datum/pipe_network()
network1.normal_members += src
network1.build_network(node1, src)
if(!parent1)
parent1 = new /datum/pipeline()
parent1.build_pipeline(src)
if(!network2 && node2)
network2 = new /datum/pipe_network()
network2.normal_members += src
network2.build_network(node2, src)
/obj/machinery/atmospherics/binary/return_network(obj/machinery/atmospherics/reference)
build_network()
if(reference==node1)
return network1
if(reference==node2)
return network2
return null
/obj/machinery/atmospherics/binary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network)
if(network1 == old_network)
network1 = new_network
if(network2 == old_network)
network2 = new_network
return 1
/obj/machinery/atmospherics/binary/return_network_air(datum/pipe_network/reference)
var/list/results = list()
if(network1 == reference)
results += air1
if(network2 == reference)
results += air2
return results
if(!parent2)
parent2 = new /datum/pipeline()
parent2.build_pipeline(src)
/obj/machinery/atmospherics/binary/disconnect(obj/machinery/atmospherics/reference)
if(reference==node1)
del(network1)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
qdel(parent1)
node1 = null
else if(reference==node2)
del(network2)
else if(reference == node2)
if(istype(node2, /obj/machinery/atmospherics/pipe))
qdel(parent2)
node2 = null
update_icon()
return null
/obj/machinery/atmospherics/binary/nullifyPipenet(datum/pipeline/P)
..()
if(P == parent1)
parent1.other_airs -= air1
parent1 = null
else if(P == parent2)
parent2.other_airs -= air2
parent2 = null
/obj/machinery/atmospherics/binary/nullifyPipenetwork()
network1 = null
network2 = null
/obj/machinery/atmospherics/binary/returnPipenetAir(datum/pipeline/P)
if(P == parent1)
return air1
else if(P == parent2)
return air2
/obj/machinery/atmospherics/binary/pipeline_expansion(datum/pipeline/P)
if(P)
if(parent1 == P)
return list(node1)
else if(parent2 == P)
return list(node2)
else
return list(node1, node2)
/obj/machinery/atmospherics/binary/setPipenet(datum/pipeline/P, obj/machinery/atmospherics/A)
if(A == node1)
parent1 = P
else if(A == node2)
parent2 = P
/obj/machinery/atmospherics/binary/returnPipenet(obj/machinery/atmospherics/A)
if(A == node1)
return parent1
else if(A == node2)
return parent2
/obj/machinery/atmospherics/binary/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
if(Old == parent1)
parent1 = New
else if(Old == parent2)
parent2 = New