Merge pull request #2106 from Markolie/pipenet

Pipenet revamp
This commit is contained in:
Fox-McCloud
2015-09-20 20:47:02 -04:00
90 changed files with 13678 additions and 16468 deletions
@@ -33,7 +33,7 @@
return 1
if(href_list["set_subject"])
var/list/valves=list()
for(var/obj/machinery/atmospherics/valve/digital/V in world)
for(var/obj/machinery/atmospherics/binary/valve/digital/V in world)
if(!isnull(V.id_tag) && V.frequency == parent.frequency)
valves|=V.id_tag
if(valves.len==0)
+3 -3
View File
@@ -17,8 +17,8 @@
/datum/event/alien_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded && temp_vent.network)
if(temp_vent.network.normal_members.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
vents += temp_vent
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET)
@@ -33,4 +33,4 @@
spawncount--
successSpawn = 1
+3 -3
View File
@@ -17,9 +17,9 @@
/datum/event/borer_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded && temp_vent.network)
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
//Stops cortical borers getting stuck in small networks. See: Security, Virology
if(temp_vent.network.normal_members.len > 50)
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
var/list/candidates = get_candidates(BE_ALIEN,ALIEN_AFK_BRACKET)
@@ -32,4 +32,4 @@
spawncount--
successSpawn = 1
+2 -2
View File
@@ -16,8 +16,8 @@
var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded && temp_vent.network)
if(temp_vent.network.normal_members.len > 50)
if((temp_vent.loc.z in config.station_levels) && !temp_vent.welded)
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
while((spawncount >= 1) && vents.len)
+2 -2
View File
@@ -11,8 +11,8 @@
/datum/event/vent_clog/setup()
endWhen = rand(25, 100)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/temp_vent in machines)
if((temp_vent.loc.z in config.station_levels) && temp_vent.network)
if(temp_vent.network.normal_members.len > 50)
if((temp_vent.loc.z in config.station_levels))
if(temp_vent.parent.other_atmosmch.len > 50)
vents += temp_vent
/datum/event/vent_clog/tick()
@@ -175,7 +175,7 @@ var/global/list/ghdels_profiled = list()
if(garbageCollector)
while(garbageCollector.queue.len)
var/datum/o = locate(garbageCollector.queue[1])
if(istype(o) && o.gcDestroyed)
if(istype(o) && !isnull(o.gcDestroyed))
del(o)
garbageCollector.dels_count++
garbageCollector.queue.Cut(1, 2)
+1 -1
View File
@@ -728,7 +728,7 @@
else if(mechanical && istype(O, /obj/item/weapon/wrench))
//If there's a connector here, the portable_atmospherics setup can handle it.
if(locate(/obj/machinery/atmospherics/portables_connector/) in loc)
if(locate(/obj/machinery/atmospherics/unary/portables_connector) in loc)
return ..()
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
@@ -79,7 +79,7 @@
// If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses
if (closed_system && connected_port)
update_connected_network()
connected_port.parent.update = 1
// Toxin levels beyond the plant's tolerance cause damage, but
// toxins are sucked up each tick and slowly reduce over time.
+11 -9
View File
@@ -329,7 +329,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
break
if(vent_found)
if(vent_found.network && (vent_found.network.normal_members.len || vent_found.network.line_members.len))
if(vent_found.parent && (vent_found.parent.members.len || vent_found.parent.other_atmosmch))
visible_message("<span class='notice'>[src] begins climbing into the ventilation system...</span>", \
"<span class='notice'>You begin climbing into the ventilation system...</span>")
@@ -362,15 +362,17 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
/mob/living/proc/add_ventcrawl(obj/machinery/atmospherics/starting_machine)
var/datum/pipe_network/network = starting_machine.return_network(starting_machine)
if(!network)
if(!istype(starting_machine) || !starting_machine.returnPipenet())
return
for(var/datum/pipeline/pipeline in network.line_members)
for(var/obj/machinery/atmospherics/A in (pipeline.members || pipeline.edges))
if(!A.pipe_image)
A.pipe_image = image(A, A.loc, layer = 20, dir = A.dir) //the 20 puts it above Byond's darkness (not its opacity view)
pipes_shown += A.pipe_image
client.images += A.pipe_image
var/datum/pipeline/pipeline = starting_machine.returnPipenet()
var/list/totalMembers = list()
totalMembers |= pipeline.members
totalMembers |= pipeline.other_atmosmch
for(var/obj/machinery/atmospherics/A in totalMembers)
if(!A.pipe_image)
A.pipe_image = image(A, A.loc, layer = 20, dir = A.dir) //the 20 puts it above Byond's darkness (not its opacity view)
pipes_shown += A.pipe_image
client.images += A.pipe_image
/mob/living/proc/remove_ventcrawl()
if(client)
+2 -4
View File
@@ -97,10 +97,8 @@
circ2.air2.merge(air2)
//Update the gas networks
if(circ1.network2)
circ1.network2.update = 1
if(circ2.network2)
circ2.network2.update = 1
circ1.parent2.update = 1
circ2.parent2.update = 1
// update icon overlays and power usage only if displayed level has changed
if(lastgen > powercap && prob(10))
+2 -5
View File
@@ -74,11 +74,8 @@
//world << "POWER: [lastgen] W generated at [efficiency*100]% efficiency and sinks sizes [cold_air_heat_capacity], [hot_air_heat_capacity]"
if(input1.network)
input1.network.update = 1
if(input2.network)
input2.network.update = 1
input1.parent.update = 1
input2.parent.update = 1
add_avail(lastgen)
// update icon overlays only if displayed level has changed