mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
@@ -9,7 +9,6 @@ Pipes -> Pipelines
|
||||
Pipelines + Other Objects -> Pipe network
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics
|
||||
anchored = 1
|
||||
idle_power_usage = 0
|
||||
@@ -25,14 +24,21 @@ Pipelines + Other Objects -> Pipe network
|
||||
|
||||
var/image/pipe_vision_img = null
|
||||
|
||||
var/device_type = 0
|
||||
var/list/obj/machinery/atmospherics/nodes = list()
|
||||
|
||||
/obj/machinery/atmospherics/New()
|
||||
..()
|
||||
nodes.len = device_type
|
||||
SSair.atmos_machinery += src
|
||||
SetInitDirections()
|
||||
if(can_unwrench)
|
||||
stored = new(src, make_from=src)
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
nullifyNode(I)
|
||||
|
||||
SSair.atmos_machinery -= src
|
||||
if(stored)
|
||||
qdel(stored)
|
||||
@@ -45,10 +51,42 @@ Pipelines + Other Objects -> Pipe network
|
||||
qdel(pipe_vision_img)
|
||||
|
||||
return ..()
|
||||
//return QDEL_HINT_FINDREFERENCE
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyNode(I)
|
||||
if(NODE_I)
|
||||
var/obj/machinery/atmospherics/N = NODE_I
|
||||
N.disconnect(src)
|
||||
NODE_I = null
|
||||
|
||||
//this is called just after the air controller sets up turfs
|
||||
/obj/machinery/atmospherics/proc/atmosinit()
|
||||
return
|
||||
/obj/machinery/atmospherics/proc/atmosinit(var/list/node_connects)
|
||||
if(!node_connects) //for pipes where order of nodes doesn't matter
|
||||
node_connects = list()
|
||||
node_connects.len = device_type
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/D in cardinal)
|
||||
if(D & GetInitDirections())
|
||||
if(D in node_connects)
|
||||
continue
|
||||
node_connects[I] = D
|
||||
break
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I]))
|
||||
if(can_be_node(target, I))
|
||||
NODE_I = target
|
||||
break
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/can_be_node(obj/machinery/atmospherics/target)
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
@@ -73,7 +111,12 @@ Pipelines + Other Objects -> Pipe network
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
return
|
||||
if(istype(reference, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = reference
|
||||
qdel(P.parent)
|
||||
var/I = nodes.Find(reference)
|
||||
NODE_I = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/update_icon()
|
||||
return
|
||||
@@ -138,9 +181,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/atmospherics/proc/nullifyPipenet(datum/pipeline/P)
|
||||
P.other_atmosmch -= src
|
||||
|
||||
/obj/machinery/atmospherics/proc/getpipeimage(iconset, iconstate, direction, col=rgb(255,255,255))
|
||||
|
||||
//Add identifiers for the iconset
|
||||
|
||||
@@ -27,10 +27,8 @@ Housekeeping and pipe network stuff
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/atmosinit()
|
||||
|
||||
var/node2_connect = dir
|
||||
var/node1_connect = turn(dir, 180)
|
||||
|
||||
var/list/node_connects = new/list()
|
||||
node_connects.Add(node1_connect, node2_connect)
|
||||
var/list/node_connects = list(node1_connect, node2_connect)
|
||||
..(node_connects)
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/circulator/proc/return_transfer_air()
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
|
||||
var/output_starting_pressure = air1.return_pressure()
|
||||
var/input_starting_pressure = air2.return_pressure()
|
||||
|
||||
@@ -42,8 +42,8 @@ Acts like a normal vent, but has an input AND output.
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/dp_vent_pump/high_volume/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
air1.volume = 1000
|
||||
air2.volume = 1000
|
||||
|
||||
@@ -66,8 +66,8 @@ Acts like a normal vent, but has an input AND output.
|
||||
|
||||
if(!on)
|
||||
return 0
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
@@ -89,7 +89,7 @@ Acts like a normal vent, but has an input AND output.
|
||||
loc.assume_air(removed)
|
||||
air_update_turf()
|
||||
|
||||
var/datum/pipeline/parent1 = parents[PARENT1]
|
||||
var/datum/pipeline/parent1 = PARENT1
|
||||
parent1.update = 1
|
||||
|
||||
else //external -> output
|
||||
@@ -109,7 +109,7 @@ Acts like a normal vent, but has an input AND output.
|
||||
air2.merge(removed)
|
||||
air_update_turf()
|
||||
|
||||
var/datum/pipeline/parent2 = parents[PARENT2]
|
||||
var/datum/pipeline/parent2 = PARENT2
|
||||
parent2.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
@@ -40,8 +40,8 @@ Passive gate is similar to the regular pump except:
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
var/input_starting_pressure = air1.return_pressure()
|
||||
|
||||
@@ -29,8 +29,9 @@ Thus, the two variables affect pump operation are set in New():
|
||||
/obj/machinery/atmospherics/components/binary/pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
if(radio_connection)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/binary/pump/on
|
||||
on = 1
|
||||
|
||||
@@ -48,8 +49,8 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
|
||||
var/output_starting_pressure = air2.return_pressure()
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ It's like a regular ol' straight pipe, but you can turn it on and off.
|
||||
open = 1
|
||||
update_icon_nopipes()
|
||||
update_parents()
|
||||
var/datum/pipeline/parent1 = parents[PARENT1]
|
||||
var/datum/pipeline/parent1 = PARENT1
|
||||
parent1.reconcile_air()
|
||||
investigate_log("was opened by [usr ? key_name(usr) : "a remote signal"]", "atmos")
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ Thus, the two variables affect pump operation are set in New():
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
|
||||
// Pump mechanism just won't do anything if the pressure is too high/too low
|
||||
|
||||
@@ -125,7 +125,7 @@ Thus, the two variables affect pump operation are set in New():
|
||||
on = !on
|
||||
|
||||
if("set_transfer_rate" in signal.data)
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
transfer_rate = Clamp(
|
||||
text2num(signal.data["set_transfer_rate"]),
|
||||
0,
|
||||
|
||||
@@ -3,50 +3,31 @@ So much of atmospherics.dm was used solely by components, so separating this mak
|
||||
On top of that, now people can add component-speciic procs/vars if they want!
|
||||
*/
|
||||
|
||||
#define UNARY 1
|
||||
#define BINARY 2
|
||||
#define TRINARY 3
|
||||
|
||||
#define AIR1 "a1"
|
||||
#define AIR2 "a2"
|
||||
#define AIR3 "a3"
|
||||
|
||||
#define PARENT1 "p1"
|
||||
#define PARENT2 "p2"
|
||||
#define PARENT3 "p3"
|
||||
|
||||
#define NODE1 "n1"
|
||||
#define NODE2 "n2"
|
||||
#define NODE3 "n3"
|
||||
|
||||
/obj/machinery/atmospherics/components/
|
||||
var/welded = 0 //Used on pumps and scrubbers
|
||||
var/showpipe = 0
|
||||
|
||||
var/device_type = 0//used for initialization stuff
|
||||
//UNARY = 1
|
||||
//BINARY = 2
|
||||
//TRINARY = 3
|
||||
|
||||
var/list/obj/machinery/atmospherics/nodes = list()
|
||||
var/list/datum/pipeline/parents = list()
|
||||
var/list/datum/gas_mixture/airs = list()
|
||||
|
||||
/obj/machinery/atmospherics/components/New()
|
||||
..()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
parents.len = device_type
|
||||
airs.len = device_type
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/gas_mixture/A = new
|
||||
A.volume = 200
|
||||
airs["a[I]"] = A
|
||||
AIR_I = A
|
||||
/*
|
||||
Iconnery
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node, var/connected = 0)
|
||||
/obj/machinery/atmospherics/components/proc/icon_addintact(var/obj/machinery/atmospherics/node)
|
||||
var/image/img = getpipeimage('icons/obj/atmospherics/components/binary_devices.dmi', "pipe_intact", get_dir(src,node), node.pipe_color)
|
||||
underlays += img
|
||||
|
||||
return connected | img.dir
|
||||
return img.dir
|
||||
|
||||
/obj/machinery/atmospherics/components/proc/icon_addbroken(var/connected = 0)
|
||||
var/unconnected = (~connected) & initialize_directions
|
||||
@@ -73,9 +54,9 @@ Iconnery
|
||||
|
||||
var/connected = 0
|
||||
|
||||
for(var/I = 1; I <= device_type; I++) //adds intact pieces
|
||||
if(nodes["n[I]"])
|
||||
connected = icon_addintact(nodes["n[I]"], connected)
|
||||
for(DEVICE_TYPE_LOOP) //adds intact pieces
|
||||
if(NODE_I)
|
||||
connected |= icon_addintact(NODE_I)
|
||||
|
||||
icon_addbroken(connected) //adds broken pieces
|
||||
|
||||
@@ -83,82 +64,52 @@ Iconnery
|
||||
/*
|
||||
Pipenet stuff; housekeeping
|
||||
*/
|
||||
/obj/machinery/atmospherics/components/Destroy()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
var/obj/machinery/atmospherics/N = nodes["n[I]"]
|
||||
if(N)
|
||||
N.disconnect(src)
|
||||
nodes["n[I]"] = null
|
||||
nullifyPipenet(parents["p[I]"])
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/atmosinit(var/list/node_connects)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I]))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
nodes["n[I]"] = target
|
||||
break
|
||||
update_icon()
|
||||
/obj/machinery/atmospherics/components/nullifyNode(I)
|
||||
..()
|
||||
nullifyPipenet(PARENT_I)
|
||||
qdel(AIR_I)
|
||||
AIR_I = null
|
||||
|
||||
/obj/machinery/atmospherics/components/construction()
|
||||
..()
|
||||
update_parents()
|
||||
|
||||
/obj/machinery/atmospherics/components/build_network()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(!parents["p[I]"])
|
||||
parents["p[I]"] = new /datum/pipeline()
|
||||
var/datum/pipeline/P = parents["p[I]"]
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(!PARENT_I)
|
||||
PARENT_I = new /datum/pipeline()
|
||||
var/datum/pipeline/P = PARENT_I
|
||||
P.build_pipeline(src)
|
||||
|
||||
/obj/machinery/atmospherics/components/disconnect(obj/machinery/atmospherics/reference)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(reference == nodes["n[I]"])
|
||||
if(istype(nodes["n[I]"], /obj/machinery/atmospherics/pipe))
|
||||
qdel(parents["p[I]"])
|
||||
nodes["n[I]"] = null
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/nullifyPipenet(datum/pipeline/reference)
|
||||
..()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(reference == parents["p[I]"])
|
||||
var/datum/pipeline/P = parents["p[I]"]
|
||||
P.other_airs -= airs["a[I]"]
|
||||
parents["p[I]"] = null
|
||||
/obj/machinery/atmospherics/components/proc/nullifyPipenet(datum/pipeline/reference)
|
||||
var/I = parents.Find(reference)
|
||||
reference.other_airs -= AIR_I
|
||||
reference.other_atmosmch -= src
|
||||
PARENT_I = null
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenetAir(datum/pipeline/reference)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(reference == parents["p[I]"])
|
||||
return airs["a[I]"]
|
||||
var/I = parents.Find(reference)
|
||||
return AIR_I
|
||||
|
||||
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference)
|
||||
if(reference)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(parents["p[I]"] == reference)
|
||||
return list(nodes["n[I]"])
|
||||
var/I = parents.Find(reference)
|
||||
return list(NODE_I)
|
||||
else
|
||||
var/list/obj/machinery/atmospherics/return_nodes = list()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
return_nodes += nodes["n[I]"]
|
||||
return return_nodes
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/setPipenet(datum/pipeline/reference, obj/machinery/atmospherics/A)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(A == nodes["n[I]"])
|
||||
parents["p[I]"] = reference
|
||||
break
|
||||
var/I = nodes.Find(A)
|
||||
PARENT_I = reference
|
||||
|
||||
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = nodes[NODE1]) //returns PARENT1 if called without argument
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(A == nodes["n[I]"])
|
||||
return parents["p[I]"]
|
||||
/obj/machinery/atmospherics/components/returnPipenet(obj/machinery/atmospherics/A = NODE1) //returns PARENT1 if called without argument
|
||||
var/I = nodes.Find(A)
|
||||
return PARENT_I
|
||||
|
||||
/obj/machinery/atmospherics/components/replacePipenet(datum/pipeline/Old, datum/pipeline/New)
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
if(parents["p[I]"] == Old)
|
||||
parents["p[I]"] = New
|
||||
var/I = parents.Find(Old)
|
||||
PARENT_I = New
|
||||
|
||||
/obj/machinery/atmospherics/components/unsafe_pressure_release(var/mob/user, var/pressures)
|
||||
..()
|
||||
@@ -169,15 +120,15 @@ Pipenet stuff; housekeeping
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
var/lost = null
|
||||
var/times_lost = 0
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
var/datum/gas_mixture/air = airs["a[I]"]
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/gas_mixture/air = AIR_I
|
||||
lost += pressures*environment.volume/(air.temperature * R_IDEAL_GAS_EQUATION)
|
||||
times_lost++
|
||||
var/shared_loss = lost/times_lost
|
||||
|
||||
var/datum/gas_mixture/to_release
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
var/datum/gas_mixture/air = airs["a[I]"]
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/gas_mixture/air = AIR_I
|
||||
if(!to_release)
|
||||
to_release = air.remove(shared_loss)
|
||||
continue
|
||||
@@ -200,6 +151,6 @@ Helpers
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/proc/update_parents()
|
||||
for(var/I = 1; I <= device_type; I++)
|
||||
var/datum/pipeline/parent = parents["p[I]"]
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/pipeline/parent = PARENT_I
|
||||
parent.update = 1
|
||||
@@ -62,7 +62,7 @@ Filter types:
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes()
|
||||
|
||||
if(!(stat & NOPOWER) && on && nodes[NODE1] && nodes[NODE2] && nodes[NODE3])
|
||||
if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3)
|
||||
icon_state = "filter_on[flipped?"_f":""]"
|
||||
return
|
||||
|
||||
@@ -80,12 +80,12 @@ Filter types:
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
if(!(nodes[NODE1] && nodes[NODE2] && nodes[NODE3]))
|
||||
if(!(NODE1 && NODE2 && NODE3))
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air3 = airs[AIR3]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
var/datum/gas_mixture/air3 = AIR3
|
||||
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@
|
||||
overlays += getpipeimage('icons/obj/atmospherics/components/trinary_devices.dmi', "cap", direction, node.pipe_color)
|
||||
continue
|
||||
overlays += getpipeimage('icons/obj/atmospherics/components/trinary_devices.dmi', "cap", direction)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes()
|
||||
if(!(stat & NOPOWER) && on && nodes[NODE1] && nodes[NODE2] && nodes[NODE3])
|
||||
if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3)
|
||||
icon_state = "mixer_on[flipped?"_f":""]"
|
||||
return
|
||||
|
||||
@@ -48,20 +48,20 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air3 = airs[AIR3]
|
||||
var/datum/gas_mixture/air3 = AIR3
|
||||
air3.volume = 300
|
||||
airs[AIR3] = air3
|
||||
AIR3 = air3
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/mixer/process_atmos()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
if(!(nodes[NODE1] && nodes[NODE2] && nodes[NODE3]))
|
||||
if(!(NODE1 && NODE2 && NODE3))
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air1 = airs[AIR1]
|
||||
var/datum/gas_mixture/air2 = airs[AIR2]
|
||||
var/datum/gas_mixture/air3 = airs[AIR3]
|
||||
var/datum/gas_mixture/air1 = AIR1
|
||||
var/datum/gas_mixture/air2 = AIR2
|
||||
var/datum/gas_mixture/air3 = AIR3
|
||||
|
||||
var/output_starting_pressure = air3.return_pressure()
|
||||
|
||||
@@ -107,14 +107,14 @@
|
||||
air3.merge(removed2)
|
||||
|
||||
if(transfer_moles1)
|
||||
var/datum/pipeline/parent1 = parents[PARENT1]
|
||||
var/datum/pipeline/parent1 = PARENT1
|
||||
parent1.update = 1
|
||||
|
||||
if(transfer_moles2)
|
||||
var/datum/pipeline/parent2 = parents[PARENT2]
|
||||
var/datum/pipeline/parent2 = PARENT2
|
||||
parent2.update = 1
|
||||
|
||||
var/datum/pipeline/parent3 = parents[PARENT3]
|
||||
var/datum/pipeline/parent3 = PARENT3
|
||||
parent3.update = 1
|
||||
|
||||
return 1
|
||||
|
||||
@@ -43,7 +43,5 @@ Housekeeping and pipe network stuff
|
||||
node1_connect = turn(node1_connect, 180)
|
||||
node3_connect = turn(node3_connect, 180)
|
||||
|
||||
var/list/node_connects = new/list()
|
||||
|
||||
node_connects.Add(node1_connect, node2_connect, node3_connect)
|
||||
var/list/node_connects = list(node1_connect, node2_connect, node3_connect)
|
||||
..(node_connects)
|
||||
@@ -69,7 +69,7 @@
|
||||
/obj/machinery/atmospherics/components/unary/cold_sink/freezer/interact(mob/user)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
user.set_machine(src)
|
||||
var/temp_text = ""
|
||||
if(air_contents.temperature > (T0C - 20))
|
||||
@@ -194,7 +194,7 @@
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/heat_reservoir/heater/interact(mob/user)
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
if(showpipe)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //scrub_cap works for now
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "cold_off"
|
||||
return
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
return ..()
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/process_atmos()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
if(air_contents)
|
||||
temperature_archived = air_contents.temperature
|
||||
@@ -62,14 +62,14 @@
|
||||
on = 0
|
||||
open_machine()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
if(!nodes[NODE1] || !is_operational())
|
||||
if(!NODE1 || !is_operational())
|
||||
return
|
||||
|
||||
if(!on)
|
||||
updateDialog()
|
||||
return
|
||||
|
||||
if(airs[AIR1])
|
||||
if(AIR1)
|
||||
if (occupant)
|
||||
process_occupant()
|
||||
expel_gas()
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/get_ui_data()
|
||||
// this is the data which will be sent to the ui
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
var/data = list()
|
||||
data["isOperating"] = on
|
||||
@@ -289,7 +289,7 @@
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/process_occupant()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
if(air_contents.total_moles() < 10)
|
||||
return
|
||||
if(occupant)
|
||||
@@ -321,7 +321,7 @@
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/heat_gas_contents()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
if(air_contents.total_moles() < 1)
|
||||
return
|
||||
@@ -332,7 +332,7 @@
|
||||
air_contents.temperature = combined_energy/combined_heat_capacity
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/cryo_cell/proc/expel_gas()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
if(air_contents.total_moles() < 1)
|
||||
return
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
var/update_cycle
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/generator_input/update_icon()
|
||||
if(nodes[NODE1])
|
||||
if(NODE1)
|
||||
icon_state = "intact"
|
||||
else
|
||||
icon_state = "exposed"
|
||||
@@ -17,4 +17,4 @@
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/generator_input/proc/return_exchange_air()
|
||||
return airs[AIR1]
|
||||
return AIR1
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
var/update_cycle
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/heat_exchanger/update_icon()
|
||||
if(nodes[NODE1])
|
||||
if(NODE1)
|
||||
icon_state = "he_intact"
|
||||
var/obj/machinery/atmospherics/node = nodes[NODE1]
|
||||
var/obj/machinery/atmospherics/node = NODE1
|
||||
color = node.color
|
||||
else
|
||||
icon_state = "he_exposed"
|
||||
@@ -43,8 +43,8 @@
|
||||
update_cycle = SSair.times_fired
|
||||
partner.update_cycle = SSair.times_fired
|
||||
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/partner_air_contents = partner.airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
var/datum/gas_mixture/partner_air_contents = partner.AIR1
|
||||
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/other_air_heat_capacity = partner_air_contents.heat_capacity()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
if(showpipe)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //scrub_cap works for now
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "cold_off"
|
||||
return
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
var/air_heat_capacity = air_contents.heat_capacity()
|
||||
var/combined_heat_capacity = current_heat_capacity + air_heat_capacity
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
on = 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/outlet_injector/update_icon_nopipes()
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "inje_off"
|
||||
return
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
if(!on || stat & NOPOWER)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
if(air_contents.temperature > 0)
|
||||
var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.temperature * R_IDEAL_GAS_EQUATION)
|
||||
@@ -63,7 +63,7 @@
|
||||
if(on || injecting)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
injecting = 1
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
if("set_volume_rate" in signal.data)
|
||||
var/number = text2num(signal.data["set_volume_rate"])
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
volume_rate = Clamp(number, 0, air_contents.volume)
|
||||
|
||||
if("status" in signal.data)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if(showpipe)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/components/unary_devices.dmi', "scrub_cap", initialize_directions) //it works for now
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & BROKEN)
|
||||
if(!NODE1 || !on || stat & BROKEN)
|
||||
icon_state = "o2gen_off"
|
||||
return
|
||||
|
||||
@@ -27,16 +27,16 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/oxygen_generator/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.volume = 50
|
||||
airs[AIR1] = air_contents
|
||||
AIR1 = air_contents
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/oxygen_generator/process_atmos()
|
||||
..()
|
||||
if(!on)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
var/total_moles = air_contents.total_moles()
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#define AIR_CONTENTS (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
/obj/machinery/atmospherics/components/unary/tank
|
||||
icon = 'icons/obj/atmospherics/pipes/pressure_tank.dmi'
|
||||
icon_state = "generic"
|
||||
@@ -6,15 +7,19 @@
|
||||
var/volume = 10000 //in liters, 1 meters by 1 meters by 2 meters
|
||||
density = 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide
|
||||
name = "pressure tank (Carbon Dioxide)"
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.carbon_dioxide = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.carbon_dioxide = AIR_CONTENTS
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/toxins
|
||||
icon_state = "orange"
|
||||
@@ -22,10 +27,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/toxins/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.toxins = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.toxins = AIR_CONTENTS
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b
|
||||
icon_state = "orange_2"
|
||||
@@ -33,11 +36,9 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T0C
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
var/datum/gas/oxygen_agent_b/trace_gas = new
|
||||
trace_gas.moles = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
trace_gas.moles = AIR_CONTENTS
|
||||
air_contents.trace_gases += trace_gas
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen
|
||||
@@ -46,10 +47,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.oxygen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.oxygen = AIR_CONTENTS
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/nitrogen
|
||||
icon_state = "red"
|
||||
@@ -57,10 +56,8 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/nitrogen/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.nitrogen = (25*ONE_ATMOSPHERE)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.nitrogen = AIR_CONTENTS
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/air
|
||||
icon_state = "grey"
|
||||
@@ -68,8 +65,6 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/air/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T20C
|
||||
air_contents.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
air_contents.nitrogen = (25*ONE_ATMOSPHERE*N2STANDARD)*(air_contents.volume)/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.oxygen = AIR_CONTENTS
|
||||
air_contents.nitrogen = AIR_CONTENTS
|
||||
@@ -17,26 +17,17 @@ Iconnery
|
||||
|
||||
..(intact)
|
||||
|
||||
/*
|
||||
Housekeeping and pipe network stuff below
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/atmosinit()
|
||||
var/list/node_connects = new/list()
|
||||
node_connects.Add(dir)
|
||||
..(node_connects)
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/default_change_direction_wrench(mob/user, obj/item/weapon/wrench/W)
|
||||
if(!..())
|
||||
return
|
||||
SetInitDirections()
|
||||
var/obj/machinery/atmospherics/node = nodes[NODE1]
|
||||
var/obj/machinery/atmospherics/node = NODE1
|
||||
if(node)
|
||||
node.disconnect(src)
|
||||
node = null
|
||||
nullifyPipenet(parents[PARENT1])
|
||||
nullifyPipenet(PARENT1)
|
||||
atmosinit()
|
||||
node = nodes[NODE1]
|
||||
node = NODE1
|
||||
if(node)
|
||||
node.atmosinit()
|
||||
node.addMember(src)
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define INT_BOUND 2
|
||||
#define NO_BOUND 3
|
||||
|
||||
#define SIPHONING 0
|
||||
#define RELEASING 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump
|
||||
icon_state = "vent_map"
|
||||
|
||||
@@ -19,12 +22,12 @@
|
||||
var/id_tag = null
|
||||
|
||||
var/on = 0
|
||||
var/pump_direction = 1 //0 = siphoning, 1 = releasing
|
||||
var/pump_direction = RELEASING
|
||||
|
||||
var/external_pressure_bound = ONE_ATMOSPHERE
|
||||
var/internal_pressure_bound = 0
|
||||
|
||||
var/pressure_checks = 1
|
||||
var/pressure_checks = EXT_BOUND
|
||||
//EXT_BOUND: Do not pass external_pressure_bound
|
||||
//INT_BOUND: Do not pass internal_pressure_bound
|
||||
//NO_BOUND: Do not pass either
|
||||
@@ -40,7 +43,7 @@
|
||||
icon_state = "vent_out"
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/siphon
|
||||
pump_direction = 0
|
||||
pump_direction = SIPHONING
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/siphon/on
|
||||
on = 1
|
||||
@@ -59,6 +62,11 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
radio_connection = null
|
||||
if(initial_loc)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
initial_loc = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/high_volume
|
||||
@@ -67,7 +75,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/high_volume/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.volume = 1000
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes()
|
||||
@@ -79,20 +87,20 @@
|
||||
icon_state = "vent_welded"
|
||||
return
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "vent_off"
|
||||
return
|
||||
|
||||
if(pump_direction)
|
||||
if(pump_direction & RELEASING)
|
||||
icon_state = "vent_out"
|
||||
else
|
||||
if(pump_direction & SIPHONING)
|
||||
icon_state = "vent_in"
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/process_atmos()
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!nodes[NODE1])
|
||||
if (!NODE1)
|
||||
on = 0
|
||||
//broadcast_status() // from now air alarm/control computer should request update purposely --rastaf0
|
||||
if(!on)
|
||||
@@ -101,11 +109,11 @@
|
||||
if(welded)
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
var/environment_pressure = environment.return_pressure()
|
||||
|
||||
if(pump_direction) //internal -> external
|
||||
if(pump_direction & RELEASING) //internal -> external
|
||||
var/pressure_delta = 10000
|
||||
|
||||
if(pressure_checks&EXT_BOUND)
|
||||
@@ -122,7 +130,7 @@
|
||||
loc.assume_air(removed)
|
||||
air_update_turf()
|
||||
|
||||
else //external -> internal
|
||||
if(pump_direction & SIPHONING) //external -> internal
|
||||
var/pressure_delta = 10000
|
||||
if(pressure_checks&EXT_BOUND)
|
||||
pressure_delta = min(pressure_delta, (environment_pressure - external_pressure_bound))
|
||||
@@ -201,11 +209,11 @@
|
||||
|
||||
if("purge" in signal.data)
|
||||
pressure_checks &= ~EXT_BOUND
|
||||
pump_direction = 0
|
||||
pump_direction = SIPHONING
|
||||
|
||||
if("stabalize" in signal.data)
|
||||
pressure_checks |= EXT_BOUND
|
||||
pump_direction = 1
|
||||
pump_direction = RELEASING
|
||||
|
||||
if("power" in signal.data)
|
||||
on = text2num(signal.data["power"])
|
||||
@@ -305,8 +313,15 @@
|
||||
if(initial_loc)
|
||||
initial_loc.air_vent_info -= id_tag
|
||||
initial_loc.air_vent_names -= id_tag
|
||||
return ..()
|
||||
..()
|
||||
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_pump/can_crawl_through()
|
||||
return !welded
|
||||
|
||||
#undef INT_BOUND
|
||||
#undef EXT_BOUND
|
||||
#undef NO_BOUND
|
||||
|
||||
#undef SIPHONING
|
||||
#undef RELEASING
|
||||
@@ -1,3 +1,6 @@
|
||||
#define SIPHONING 0
|
||||
#define SCRUBBING 1
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber
|
||||
icon_state = "scrub_map"
|
||||
|
||||
@@ -22,7 +25,7 @@
|
||||
var/list/turf/simulated/adjacent_turfs = list()
|
||||
|
||||
var/on = 0
|
||||
var/scrubbing = 1 //0 = siphoning, 1 = scrubbing
|
||||
var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing
|
||||
var/scrub_CO2 = 1
|
||||
var/scrub_Toxins = 0
|
||||
var/scrub_N2O = 0
|
||||
@@ -48,9 +51,13 @@
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy()
|
||||
if(radio_controller)
|
||||
radio_controller.remove_object(src,frequency)
|
||||
radio_connection = null
|
||||
if(initial_loc)
|
||||
initial_loc.air_scrub_info -= id_tag
|
||||
initial_loc.air_scrub_names -= id_tag
|
||||
initial_loc = null
|
||||
for(var/I in adjacent_turfs)
|
||||
I = null
|
||||
return ..()
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/auto_use_power()
|
||||
if(!powered(power_channel))
|
||||
@@ -62,14 +69,14 @@
|
||||
|
||||
var/amount = idle_power_usage
|
||||
|
||||
if (scrubbing)
|
||||
if(scrubbing & SCRUBBING)
|
||||
if (scrub_CO2)
|
||||
amount += idle_power_usage
|
||||
if (scrub_Toxins)
|
||||
amount += idle_power_usage
|
||||
if (scrub_N2O)
|
||||
amount += idle_power_usage
|
||||
else
|
||||
if(scrubbing & SIPHONING)
|
||||
amount = active_power_usage
|
||||
|
||||
if (widenet)
|
||||
@@ -86,13 +93,13 @@
|
||||
icon_state = "scrub_welded"
|
||||
return
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "scrub_off"
|
||||
return
|
||||
|
||||
if(scrubbing)
|
||||
if(scrubbing & SCRUBBING)
|
||||
icon_state = "scrub_on"
|
||||
else
|
||||
if(scrubbing & SIPHONING)
|
||||
icon_state = "scrub_purge"
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/set_frequency(new_frequency)
|
||||
@@ -142,7 +149,7 @@
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!nodes[NODE1])
|
||||
if (!NODE1)
|
||||
on = 0
|
||||
//broadcast_status()
|
||||
if(!on || welded)
|
||||
@@ -159,9 +166,9 @@
|
||||
return 0
|
||||
|
||||
var/datum/gas_mixture/environment = tile.return_air()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
|
||||
if(scrubbing)
|
||||
if(scrubbing & SCRUBBING)
|
||||
if((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
|
||||
var/transfer_moles = min(1, volume_rate/environment.volume)*environment.total_moles()
|
||||
|
||||
@@ -196,7 +203,7 @@
|
||||
tile.assume_air(removed)
|
||||
tile.air_update_turf()
|
||||
|
||||
else //Just siphoning all air
|
||||
if(scrubbing & SIPHONING) //Just siphoning all air
|
||||
if (air_contents.return_pressure()>=50*ONE_ATMOSPHERE)
|
||||
return
|
||||
|
||||
@@ -312,3 +319,6 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/vent_scrubber/can_crawl_through()
|
||||
return !welded
|
||||
|
||||
#undef SIPHONING
|
||||
#undef SCRUBBING
|
||||
@@ -1,154 +0,0 @@
|
||||
////////////
|
||||
//HE Pipes
|
||||
////////////
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging
|
||||
icon = 'icons/obj/atmospherics/pipes/heat.dmi'
|
||||
icon_state = "intact"
|
||||
level = 2
|
||||
var/initialize_directions_he
|
||||
var/minimum_temperature_difference = 20
|
||||
var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
|
||||
color = "#404040"
|
||||
buckle_lying = 1
|
||||
var/icon_temperature = T20C //stop small changes in temperature causing icon refresh
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New()
|
||||
..()
|
||||
color = "#404040"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/SetInitDirections()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
if(NORTH)
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
if(EAST)
|
||||
initialize_directions_he = EAST|WEST
|
||||
if(WEST)
|
||||
initialize_directions_he = WEST|EAST
|
||||
if(NORTHEAST)
|
||||
initialize_directions_he = NORTH|EAST
|
||||
if(NORTHWEST)
|
||||
initialize_directions_he = NORTH|WEST
|
||||
if(SOUTHEAST)
|
||||
initialize_directions_he = SOUTH|EAST
|
||||
if(SOUTHWEST)
|
||||
initialize_directions_he = SOUTH|WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/GetInitDirections()
|
||||
return ..() | initialize_directions_he
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/atmosinit()
|
||||
normalize_dir()
|
||||
var/N = 2
|
||||
for(var/D in cardinal)
|
||||
if(D & initialize_directions_he)
|
||||
N--
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src, D))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
if(!node1 && N == 1)
|
||||
node1 = target
|
||||
break
|
||||
if(!node2 && N == 0)
|
||||
node2 = target
|
||||
break
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process_atmos()
|
||||
var/environment_temperature = 0
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
|
||||
if(istype(loc, /turf/simulated))
|
||||
if(loc:blocks_air)
|
||||
environment_temperature = loc:temperature
|
||||
else
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
environment_temperature = environment.temperature
|
||||
else
|
||||
environment_temperature = loc:temperature
|
||||
|
||||
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
|
||||
parent.temperature_interact(loc, volume, thermal_conductivity)
|
||||
|
||||
|
||||
//heatup/cooldown any mobs buckled to ourselves based on our temperature
|
||||
if(buckled_mob)
|
||||
var/hc = pipe_air.heat_capacity()
|
||||
var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500)
|
||||
pipe_air.temperature = avg_temp
|
||||
buckled_mob.bodytemperature = avg_temp
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process()
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
//Burn any mobs buckled to ourselves based on our temperature
|
||||
if(buckled_mob)
|
||||
var/heat_limit = 1000
|
||||
if(pipe_air.temperature > heat_limit + 1)
|
||||
buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest")
|
||||
|
||||
//Heat causes pipe to glow
|
||||
if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //glow starts at 500K
|
||||
if(abs(pipe_air.temperature - icon_temperature) > 10)
|
||||
icon_temperature = pipe_air.temperature
|
||||
|
||||
var/h_r = heat2colour_r(icon_temperature)
|
||||
var/h_g = heat2colour_g(icon_temperature)
|
||||
var/h_b = heat2colour_b(icon_temperature)
|
||||
|
||||
if(icon_temperature < 2000)//scale glow until 2000K
|
||||
var/scale = (icon_temperature - 500) / 1500
|
||||
h_r = 64 + (h_r - 64) * scale
|
||||
h_g = 64 + (h_g - 64) * scale
|
||||
h_b = 64 + (h_b - 64) * scale
|
||||
|
||||
animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING)
|
||||
|
||||
////////////////
|
||||
//HE Junctions
|
||||
////////////////
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction
|
||||
icon = 'icons/obj/atmospherics/pipes/junction.dmi'
|
||||
icon_state = "intact"
|
||||
level = 2
|
||||
minimum_temperature_difference = 300
|
||||
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/normalize_dir()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/SetInitDirections()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH
|
||||
initialize_directions_he = SOUTH
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH
|
||||
initialize_directions_he = NORTH
|
||||
if(EAST)
|
||||
initialize_directions = WEST
|
||||
initialize_directions_he = EAST
|
||||
if(WEST)
|
||||
initialize_directions = EAST
|
||||
initialize_directions_he = WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/update_icon()
|
||||
if(node1&&node2)
|
||||
icon_state = "intact"
|
||||
else
|
||||
var/have_node1 = node1?1:0
|
||||
var/have_node2 = node2?1:0
|
||||
icon_state = "exposed[have_node1][have_node2]"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/atmosinit()
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,initialize_directions))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node1 = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,initialize_directions_he))
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
node2 = target
|
||||
break
|
||||
update_icon()
|
||||
..()
|
||||
@@ -0,0 +1,75 @@
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/
|
||||
icon = 'icons/obj/atmospherics/pipes/heat.dmi'
|
||||
level = 2
|
||||
var/initialize_directions_he
|
||||
var/minimum_temperature_difference = 20
|
||||
var/thermal_conductivity = WINDOW_HEAT_TRANSFER_COEFFICIENT
|
||||
color = "#404040"
|
||||
buckle_lying = 1
|
||||
var/icon_temperature = T20C //stop small changes in temperature causing icon refresh
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/New()
|
||||
..()
|
||||
color = "#404040"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/can_be_node(obj/machinery/atmospherics/pipe/heat_exchanging/target)
|
||||
if(!istype(target))
|
||||
return 0
|
||||
if(target.initialize_directions_he & get_dir(target,src))
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/hide()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/GetInitDirections()
|
||||
return ..() | initialize_directions_he
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/process_atmos()
|
||||
var/environment_temperature = 0
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
|
||||
var/turf/simulated/T = loc
|
||||
if(istype(T))
|
||||
if(T.blocks_air)
|
||||
environment_temperature = T.temperature
|
||||
else
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
environment_temperature = environment.temperature
|
||||
else
|
||||
environment_temperature = T.temperature
|
||||
|
||||
if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference)
|
||||
parent.temperature_interact(T, volume, thermal_conductivity)
|
||||
|
||||
|
||||
//heatup/cooldown any mobs buckled to ourselves based on our temperature
|
||||
if(buckled_mob)
|
||||
var/hc = pipe_air.heat_capacity()
|
||||
var/avg_temp = (pipe_air.temperature * hc + buckled_mob.bodytemperature * 3500) / (hc + 3500)
|
||||
pipe_air.temperature = avg_temp
|
||||
buckled_mob.bodytemperature = avg_temp
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/process()
|
||||
var/datum/gas_mixture/pipe_air = return_air()
|
||||
//Burn any mobs buckled to ourselves based on our temperature
|
||||
if(buckled_mob)
|
||||
var/heat_limit = 1000
|
||||
if(pipe_air.temperature > heat_limit + 1)
|
||||
buckled_mob.apply_damage(4 * log(pipe_air.temperature - heat_limit), BURN, "chest")
|
||||
|
||||
//Heat causes pipe to glow
|
||||
if(pipe_air.temperature && (icon_temperature > 500 || pipe_air.temperature > 500)) //glow starts at 500K
|
||||
if(abs(pipe_air.temperature - icon_temperature) > 10)
|
||||
icon_temperature = pipe_air.temperature
|
||||
|
||||
var/h_r = heat2colour_r(icon_temperature)
|
||||
var/h_g = heat2colour_g(icon_temperature)
|
||||
var/h_b = heat2colour_b(icon_temperature)
|
||||
|
||||
if(icon_temperature < 2000)//scale glow until 2000K
|
||||
var/scale = (icon_temperature - 500) / 1500
|
||||
h_r = 64 + (h_r - 64) * scale
|
||||
h_g = 64 + (h_g - 64) * scale
|
||||
h_b = 64 + (h_b - 64) * scale
|
||||
|
||||
animate(src, color = rgb(h_r, h_g, h_b), time = 20, easing = SINE_EASING)
|
||||
@@ -0,0 +1,51 @@
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction
|
||||
icon = 'icons/obj/atmospherics/pipes/junction.dmi'
|
||||
icon_state = "intact"
|
||||
|
||||
name = "junction"
|
||||
desc = "A one meter junction that connects regular and heat-exchanging pipe"
|
||||
|
||||
minimum_temperature_difference = 300
|
||||
thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT
|
||||
volume = 70
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = NORTH
|
||||
initialize_directions_he = SOUTH
|
||||
|
||||
device_type = BINARY
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/SetInitDirections()
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
initialize_directions = NORTH
|
||||
initialize_directions_he = SOUTH
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH
|
||||
initialize_directions_he = NORTH
|
||||
if(EAST)
|
||||
initialize_directions = WEST
|
||||
initialize_directions_he = EAST
|
||||
if(WEST)
|
||||
initialize_directions = EAST
|
||||
initialize_directions_he = WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/atmosinit()
|
||||
var/node2_connect = dir
|
||||
var/node1_connect = turn(dir, 180)
|
||||
var/list/node_connects = list(node1_connect, node2_connect)
|
||||
|
||||
..(node_connects)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/junction/can_be_node(obj/machinery/atmospherics/target, iteration)
|
||||
var/init_dir
|
||||
switch(iteration)
|
||||
if(1)
|
||||
init_dir = target.initialize_directions
|
||||
if(2)
|
||||
var/obj/machinery/atmospherics/pipe/heat_exchanging/H = target
|
||||
if(!istype(H))
|
||||
return 0
|
||||
init_dir = H.initialize_directions_he
|
||||
if(init_dir & get_dir(target,src))
|
||||
return 1
|
||||
@@ -0,0 +1,35 @@
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple
|
||||
icon_state = "intact"
|
||||
|
||||
name = "pipe"
|
||||
desc = "A one meter section of heat-exchanging pipe"
|
||||
|
||||
volume = 70
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
|
||||
device_type = BINARY
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/SetInitDirections()
|
||||
if(dir in diagonals)
|
||||
initialize_directions_he = dir
|
||||
switch(dir)
|
||||
if(NORTH,SOUTH)
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
if(EAST,WEST)
|
||||
initialize_directions_he = WEST|EAST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/proc/normalize_dir()
|
||||
if(dir==SOUTH)
|
||||
dir = NORTH
|
||||
else if(dir==WEST)
|
||||
dir = EAST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/atmosinit()
|
||||
normalize_dir()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/heat_exchanging/simple/update_icon()
|
||||
normalize_dir()
|
||||
..()
|
||||
@@ -1,8 +1,6 @@
|
||||
|
||||
/*
|
||||
3-Way Manifold
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold
|
||||
icon = 'icons/obj/atmospherics/pipes/manifold.dmi'
|
||||
icon_state = "manifold"
|
||||
@@ -15,17 +13,7 @@
|
||||
dir = SOUTH
|
||||
initialize_directions = EAST|NORTH|WEST
|
||||
|
||||
var/obj/machinery/atmospherics/node1
|
||||
var/obj/machinery/atmospherics/node2
|
||||
var/obj/machinery/atmospherics/node3
|
||||
|
||||
level = 1
|
||||
layer = 2.4 //under wires with their 2.44
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/New()
|
||||
color = pipe_color
|
||||
|
||||
..()
|
||||
device_type = TRINARY
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/SetInitDirections()
|
||||
switch(dir)
|
||||
@@ -38,59 +26,6 @@
|
||||
if(WEST)
|
||||
initialize_directions = NORTH|EAST|SOUTH
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/atmosinit()
|
||||
for(var/D in cardinal)
|
||||
if(D == dir)
|
||||
continue
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, D))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(turn(dir, 90) == D)
|
||||
node1 = target
|
||||
if(turn(dir, 270) == D)
|
||||
node2 = target
|
||||
if(turn(dir, 180) == D)
|
||||
node3 = target
|
||||
break
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/Destroy()
|
||||
if(node1)
|
||||
var/obj/machinery/atmospherics/A = node1
|
||||
node1.disconnect(src)
|
||||
node1 = null
|
||||
A.build_network()
|
||||
if(node2)
|
||||
var/obj/machinery/atmospherics/A = node2
|
||||
node2.disconnect(src)
|
||||
node2 = null
|
||||
A.build_network()
|
||||
if(node3)
|
||||
var/obj/machinery/atmospherics/A = node3
|
||||
node3.disconnect(src)
|
||||
node3 = null
|
||||
A.build_network()
|
||||
releaseAirToTurf()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference == node1)
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node1 = null
|
||||
if(reference == node2)
|
||||
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node2 = null
|
||||
if(reference == node3)
|
||||
if(istype(node3, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node3 = null
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/update_icon()
|
||||
var/invis = invisibility ? "-f" : ""
|
||||
|
||||
@@ -99,32 +34,9 @@
|
||||
overlays.Cut()
|
||||
|
||||
//Add non-broken pieces
|
||||
if(node1)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node1))
|
||||
|
||||
if(node2)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node2))
|
||||
|
||||
if(node3)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src,node3))
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/hide(i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/pipeline_expansion()
|
||||
return list(node1, node2, node3)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/update_node_icon()
|
||||
..()
|
||||
if(node1)
|
||||
node1.update_icon()
|
||||
if(node2)
|
||||
node2.update_icon()
|
||||
if(node3)
|
||||
node3.update_icon()
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(NODE_I)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I))
|
||||
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/manifold/general
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
4-way manifold
|
||||
*/
|
||||
@@ -13,97 +12,12 @@
|
||||
|
||||
initialize_directions = NORTH|SOUTH|EAST|WEST
|
||||
|
||||
var/obj/machinery/atmospherics/node1 // North
|
||||
var/obj/machinery/atmospherics/node2 // South
|
||||
var/obj/machinery/atmospherics/node3 // East
|
||||
var/obj/machinery/atmospherics/node4 // West
|
||||
|
||||
level = 1
|
||||
layer = 2.4 //under wires with their 2.44
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/New()
|
||||
color = pipe_color
|
||||
..()
|
||||
device_type = QUATERNARY
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/atmosinit()
|
||||
for(var/D in cardinal)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, D))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(D == NORTH)
|
||||
node1 = target
|
||||
else if(D == SOUTH)
|
||||
node2 = target
|
||||
else if(D == EAST)
|
||||
node3 = target
|
||||
else if(D == WEST)
|
||||
node4 = target
|
||||
break
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/hide(i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion()
|
||||
return list(node1, node2, node3, node4)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/Destroy()
|
||||
if(node1)
|
||||
var/obj/machinery/atmospherics/A = node1
|
||||
node1.disconnect(src)
|
||||
node1 = null
|
||||
A.build_network()
|
||||
if(node2)
|
||||
var/obj/machinery/atmospherics/A = node2
|
||||
node2.disconnect(src)
|
||||
node2 = null
|
||||
A.build_network()
|
||||
if(node3)
|
||||
var/obj/machinery/atmospherics/A = node3
|
||||
node3.disconnect(src)
|
||||
node3 = null
|
||||
A.build_network()
|
||||
if(node4)
|
||||
var/obj/machinery/atmospherics/A = node4
|
||||
node4.disconnect(src)
|
||||
node4 = null
|
||||
A.build_network()
|
||||
releaseAirToTurf()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference == node1)
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node1 = null
|
||||
if(reference == node2)
|
||||
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node2 = null
|
||||
if(reference == node3)
|
||||
if(istype(node3, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node3 = null
|
||||
if(reference == node4)
|
||||
if(istype(node4, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node4 = null
|
||||
update_icon()
|
||||
..()
|
||||
initialize_directions = initial(initialize_directions)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/update_icon()
|
||||
if(!node1 && !node2 && !node3 && !node4) //Remove us if we ain't connected to anything.
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
var/invis = invisibility ? "-f" : ""
|
||||
|
||||
icon_state = "manifold4w_center[invis]"
|
||||
@@ -111,28 +25,9 @@
|
||||
overlays.Cut()
|
||||
|
||||
//Add non-broken pieces
|
||||
if(node1)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", NORTH)
|
||||
|
||||
if(node2)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", SOUTH)
|
||||
|
||||
if(node3)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", EAST)
|
||||
|
||||
if(node4)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", WEST)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/update_node_icon()
|
||||
..()
|
||||
if(node1)
|
||||
node1.update_icon()
|
||||
if(node2)
|
||||
node2.update_icon()
|
||||
if(node3)
|
||||
node3.update_icon()
|
||||
if(node4)
|
||||
node4.update_icon()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(NODE_I)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I))
|
||||
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/general
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
/obj/machinery/atmospherics/pipe
|
||||
var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke
|
||||
var/volume = 0
|
||||
|
||||
level = 1
|
||||
layer = 2.4 //under wires with their 2.44
|
||||
|
||||
use_power = 0
|
||||
can_unwrench = 1
|
||||
var/datum/pipeline/parent = null
|
||||
@@ -11,8 +14,32 @@
|
||||
buckle_requires_restraints = 1
|
||||
buckle_lying = -1
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
return null
|
||||
/obj/machinery/atmospherics/pipe/New()
|
||||
color = pipe_color
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/nullifyNode(I)
|
||||
var/obj/machinery/atmospherics/oldN = NODE_I
|
||||
..()
|
||||
oldN.build_network()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/update_icon() //overridden by manifolds
|
||||
if(NODE1&&NODE2)
|
||||
icon_state = "intact[invisibility ? "-f" : "" ]"
|
||||
else
|
||||
var/have_node1 = NODE1?1:0
|
||||
var/have_node2 = NODE2?1:0
|
||||
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/atmosinit()
|
||||
var/turf/T = loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/hide(i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/proc/check_pressure(pressure)
|
||||
//Return 1 if parent should continue checking other pipes
|
||||
@@ -50,14 +77,24 @@
|
||||
parent = P
|
||||
|
||||
/obj/machinery/atmospherics/pipe/Destroy()
|
||||
releaseAirToTurf()
|
||||
qdel(air_temporary)
|
||||
air_temporary = null
|
||||
|
||||
var/turf/T = loc
|
||||
for(var/obj/machinery/meter/meter in T)
|
||||
if(meter.target == src)
|
||||
var/obj/item/pipe_meter/PM = new (T)
|
||||
meter.transfer_fingerprints_to(PM)
|
||||
qdel(meter)
|
||||
return ..()
|
||||
. = ..()
|
||||
|
||||
if(parent && !parent.gc_destroyed)
|
||||
qdel(parent)
|
||||
parent = null
|
||||
|
||||
/obj/machinery/atmospherics/pipe/proc/update_node_icon()
|
||||
//Used for pipe painting. Overriden in the children.
|
||||
return
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(NODE_I)
|
||||
var/obj/machinery/atmospherics/N = NODE_I
|
||||
N.update_icon()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
Simple Pipe
|
||||
The regular pipe you see everywhere, including bent ones.
|
||||
@@ -16,108 +15,30 @@ The regular pipe you see everywhere, including bent ones.
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH|NORTH
|
||||
|
||||
var/obj/machinery/atmospherics/node1
|
||||
var/obj/machinery/atmospherics/node2
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/New()
|
||||
color = pipe_color
|
||||
|
||||
..()
|
||||
|
||||
device_type = BINARY
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/SetInitDirections()
|
||||
if(dir in diagonals)
|
||||
initialize_directions = dir
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
if(NORTH,SOUTH)
|
||||
initialize_directions = SOUTH|NORTH
|
||||
if(SOUTH)
|
||||
initialize_directions = SOUTH|NORTH
|
||||
if(EAST)
|
||||
if(EAST,WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
if(WEST)
|
||||
initialize_directions = EAST|WEST
|
||||
if(NORTHEAST)
|
||||
initialize_directions = NORTH|EAST
|
||||
if(NORTHWEST)
|
||||
initialize_directions = NORTH|WEST
|
||||
if(SOUTHEAST)
|
||||
initialize_directions = SOUTH|EAST
|
||||
if(SOUTHWEST)
|
||||
initialize_directions = SOUTH|WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/atmosinit()
|
||||
normalize_dir()
|
||||
var/N = 2
|
||||
for(var/D in cardinal)
|
||||
if(D & initialize_directions)
|
||||
N--
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, D))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
if(!node1 && N == 1)
|
||||
node1 = target
|
||||
break
|
||||
if(!node2 && N == 0)
|
||||
node2 = target
|
||||
break
|
||||
var/turf/T = loc // hide if turf is not intact
|
||||
hide(T.intact)
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/Destroy()
|
||||
if(node1)
|
||||
var/obj/machinery/atmospherics/A = node1
|
||||
node1.disconnect(src)
|
||||
node1 = null
|
||||
A.build_network()
|
||||
if(node2)
|
||||
var/obj/machinery/atmospherics/A = node2
|
||||
node2.disconnect(src)
|
||||
node2 = null
|
||||
A.build_network()
|
||||
releaseAirToTurf()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference)
|
||||
if(reference == node1)
|
||||
if(istype(node1, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node1 = null
|
||||
if(reference == node2)
|
||||
if(istype(node2, /obj/machinery/atmospherics/pipe))
|
||||
qdel(parent)
|
||||
node2 = null
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
else if(dir==8)
|
||||
dir = 4
|
||||
if(dir==SOUTH)
|
||||
dir = NORTH
|
||||
else if(dir==WEST)
|
||||
dir = EAST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/update_icon()
|
||||
if(node1&&node2)
|
||||
icon_state = "intact[invisibility ? "-f" : "" ]"
|
||||
else
|
||||
var/have_node1 = node1?1:0
|
||||
var/have_node2 = node2?1:0
|
||||
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/hide(i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/pipeline_expansion()
|
||||
return list(node1, node2)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/update_node_icon()
|
||||
normalize_dir()
|
||||
..()
|
||||
if(node1)
|
||||
node1.update_icon()
|
||||
if(node2)
|
||||
node2.update_icon()
|
||||
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/simple/general
|
||||
|
||||
Reference in New Issue
Block a user