mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 07:08:00 +01:00
first pass of cleanup
makes simple pipes more OOP adjusts defines; puts them in __DEFINES/atmospherics.dm adds DEVICE_TYPE_LOOP define, which is used in a bunch of the for loops
This commit is contained in:
@@ -9,7 +9,6 @@ Pipes -> Pipelines
|
||||
Pipelines + Other Objects -> Pipe network
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics
|
||||
anchored = 1
|
||||
idle_power_usage = 0
|
||||
@@ -25,6 +24,9 @@ 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()
|
||||
..()
|
||||
SSair.atmos_machinery += src
|
||||
@@ -47,8 +49,19 @@ Pipelines + Other Objects -> Pipe network
|
||||
..()
|
||||
|
||||
//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)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node_connects[I]))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
NODE_I = target
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/proc/pipeline_expansion()
|
||||
var/list/return_nodes = list()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
return_nodes |= NODE_I
|
||||
return return_nodes
|
||||
|
||||
/obj/machinery/atmospherics/proc/SetInitDirections()
|
||||
return
|
||||
@@ -70,7 +83,14 @@ Pipelines + Other Objects -> Pipe network
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/proc/disconnect(obj/machinery/atmospherics/reference)
|
||||
return
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(reference == NODE_I)
|
||||
if(istype(NODE_I, /obj/machinery/atmospherics/pipe))
|
||||
var/obj/machinery/atmospherics/pipe/P = NODE_I
|
||||
qdel(P.parent)
|
||||
NODE_I = null
|
||||
break
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/atmospherics/update_icon()
|
||||
return
|
||||
|
||||
@@ -28,10 +28,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()
|
||||
|
||||
@@ -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
|
||||
|
||||
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,41 +3,19 @@ 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 //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++)
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/datum/gas_mixture/A = new
|
||||
A.volume = 200
|
||||
airs["a[I]"] = A
|
||||
AIR_I = A
|
||||
/*
|
||||
Iconnery
|
||||
*/
|
||||
@@ -57,7 +35,7 @@ Iconnery
|
||||
/obj/machinery/atmospherics/components/proc/update_icon_nopipes()
|
||||
return
|
||||
|
||||
/obj/machinery/atmospherics/components/update_icon() //not working
|
||||
/obj/machinery/atmospherics/components/update_icon()
|
||||
update_icon_nopipes()
|
||||
|
||||
underlays.Cut()
|
||||
@@ -66,9 +44,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, connected)
|
||||
|
||||
icon_addbroken(connected) //adds broken pieces
|
||||
|
||||
@@ -77,83 +55,66 @@ 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]"]
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/obj/machinery/atmospherics/N = NODE_I
|
||||
if(N)
|
||||
N.disconnect(src)
|
||||
nodes["n[I]"] = null
|
||||
nullifyPipenet(parents["p[I]"])
|
||||
NODE_I = null
|
||||
nullifyPipenet(PARENT_I)
|
||||
..()
|
||||
|
||||
/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
|
||||
/obj/machinery/atmospherics/components/atmosinit()
|
||||
if(level == 2)
|
||||
showpipe = 1
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
/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
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(reference == PARENT_I)
|
||||
var/datum/pipeline/P = PARENT_I
|
||||
P.other_airs -= AIR_I
|
||||
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]"]
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(reference == PARENT_I)
|
||||
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]"])
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(PARENT_I == 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
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(A == NODE_I)
|
||||
PARENT_I = reference
|
||||
break
|
||||
|
||||
/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
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(A == NODE_I)
|
||||
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
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(PARENT_I == Old)
|
||||
PARENT_I = New
|
||||
|
||||
/obj/machinery/atmospherics/components/unsafe_pressure_release(var/mob/user, var/pressures)
|
||||
..()
|
||||
@@ -164,15 +125,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
|
||||
@@ -195,6 +156,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()
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
..()
|
||||
|
||||
/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 @@
|
||||
..()
|
||||
/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()
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = 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)
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/toxins/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = 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)
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen_agent_b/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = AIR1
|
||||
air_contents.volume = volume
|
||||
air_contents.temperature = T0C
|
||||
var/datum/gas/oxygen_agent_b/trace_gas = new
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/oxygen/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = 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)
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/nitrogen/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = 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)
|
||||
@@ -68,7 +68,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/tank/air/New()
|
||||
..()
|
||||
var/datum/gas_mixture/air_contents = airs[AIR1]
|
||||
var/datum/gas_mixture/air_contents = 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)
|
||||
|
||||
@@ -23,21 +23,20 @@ Housekeeping and pipe network stuff below
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/components/unary/atmosinit()
|
||||
var/list/node_connects = new/list()
|
||||
node_connects.Add(dir)
|
||||
var/list/node_connects = list(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)
|
||||
|
||||
@@ -67,7 +67,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,7 +79,7 @@
|
||||
icon_state = "vent_welded"
|
||||
return
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "vent_off"
|
||||
return
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
..()
|
||||
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,7 +101,7 @@
|
||||
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()
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
icon_state = "scrub_welded"
|
||||
return
|
||||
|
||||
if(!nodes[NODE1] || !on || stat & (NOPOWER|BROKEN))
|
||||
if(!NODE1 || !on || stat & (NOPOWER|BROKEN))
|
||||
icon_state = "scrub_off"
|
||||
return
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if (!nodes[NODE1])
|
||||
if (!NODE1)
|
||||
on = 0
|
||||
//broadcast_status()
|
||||
if(!on || welded)
|
||||
@@ -159,7 +159,7 @@
|
||||
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((environment.toxins>0) || (environment.carbon_dioxide>0) || (environment.trace_gases.len>0))
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
color = "#404040"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/SetInitDirections()
|
||||
if(dir in diagonals)
|
||||
initialize_directions_he = dir
|
||||
switch(dir)
|
||||
if(SOUTH)
|
||||
initialize_directions_he = SOUTH|NORTH
|
||||
@@ -27,14 +29,6 @@
|
||||
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/atmosinit()
|
||||
normalize_dir()
|
||||
@@ -44,11 +38,11 @@
|
||||
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
|
||||
if(!NODE1 && N == 1)
|
||||
NODE1 = target
|
||||
break
|
||||
if(!node2 && N == 0)
|
||||
node2 = target
|
||||
if(!NODE2 && N == 0)
|
||||
NODE2 = target
|
||||
break
|
||||
update_icon()
|
||||
..()
|
||||
@@ -131,21 +125,21 @@
|
||||
initialize_directions_he = WEST
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/update_icon()
|
||||
if(node1&&node2)
|
||||
if(NODE1&&NODE2)
|
||||
icon_state = "intact"
|
||||
else
|
||||
var/have_node1 = node1?1:0
|
||||
var/have_node2 = node2?1:0
|
||||
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
|
||||
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
|
||||
NODE2 = target
|
||||
break
|
||||
update_icon()
|
||||
..()
|
||||
@@ -15,18 +15,13 @@
|
||||
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
|
||||
|
||||
device_type = TRINARY
|
||||
/*
|
||||
/obj/machinery/atmospherics/pipe/manifold/New()
|
||||
color = pipe_color
|
||||
|
||||
..()
|
||||
|
||||
*/
|
||||
/obj/machinery/atmospherics/pipe/manifold/SetInitDirections()
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
@@ -39,6 +34,12 @@
|
||||
initialize_directions = NORTH|EAST|SOUTH
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/atmosinit()
|
||||
var/node1_connect = turn(dir, 90)
|
||||
var/node2_connect = turn(dir, 270)
|
||||
var/node3_connect = turn(dir, 180)
|
||||
var/list/node_connects = list(node1_connect, node2_connect, node3_connect)
|
||||
..(node_connects)
|
||||
/*
|
||||
for(var/D in cardinal)
|
||||
if(D == dir)
|
||||
continue
|
||||
@@ -90,7 +91,7 @@
|
||||
node3 = null
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
*/
|
||||
/obj/machinery/atmospherics/pipe/manifold/update_icon()
|
||||
var/invis = invisibility ? "-f" : ""
|
||||
|
||||
@@ -99,15 +100,10 @@
|
||||
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))
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(NODE_I)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I))
|
||||
/*
|
||||
/obj/machinery/atmospherics/pipe/manifold/hide(i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
@@ -124,7 +120,7 @@
|
||||
node2.update_icon()
|
||||
if(node3)
|
||||
node3.update_icon()
|
||||
|
||||
*/
|
||||
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/manifold/general
|
||||
|
||||
@@ -13,22 +13,18 @@
|
||||
|
||||
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
|
||||
|
||||
device_type = QUATERNARY
|
||||
/*
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/New()
|
||||
color = pipe_color
|
||||
..()
|
||||
|
||||
*/
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
|
||||
return
|
||||
initialize_directions = initial(initialize_directions)
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/atmosinit()
|
||||
..(cardinal)
|
||||
/*
|
||||
for(var/D in cardinal)
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src, D))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
@@ -98,12 +94,8 @@
|
||||
node4 = null
|
||||
update_icon()
|
||||
..()
|
||||
|
||||
*/
|
||||
/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,18 +103,10 @@
|
||||
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)
|
||||
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
if(NODE_I)
|
||||
overlays += getpipeimage('icons/obj/atmospherics/pipes/manifold.dmi', "manifold_full[invis]", get_dir(src, NODE_I))
|
||||
/*
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/update_node_icon()
|
||||
..()
|
||||
if(node1)
|
||||
@@ -133,7 +117,7 @@
|
||||
node3.update_icon()
|
||||
if(node4)
|
||||
node4.update_icon()
|
||||
|
||||
*/
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/general
|
||||
name="pipe"
|
||||
|
||||
@@ -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,30 @@
|
||||
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/Destroy()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
var/obj/machinery/atmospherics/N = NODE_I
|
||||
if(N)
|
||||
var/obj/machinery/atmospherics/oldN = N
|
||||
N.disconnect(src)
|
||||
NODE_I = null
|
||||
oldN.build_network()
|
||||
releaseAirToTurf()
|
||||
..()
|
||||
|
||||
/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
|
||||
@@ -59,5 +84,7 @@
|
||||
..()
|
||||
|
||||
/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()
|
||||
|
||||
@@ -16,18 +16,17 @@ 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
|
||||
|
||||
device_type = BINARY
|
||||
/*
|
||||
/obj/machinery/atmospherics/pipe/simple/New()
|
||||
color = pipe_color
|
||||
|
||||
..()
|
||||
|
||||
*/
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/SetInitDirections()
|
||||
if(dir in diagonals)
|
||||
initialize_directions = dir
|
||||
switch(dir)
|
||||
if(NORTH)
|
||||
initialize_directions = SOUTH|NORTH
|
||||
@@ -37,34 +36,23 @@ The regular pipe you see everywhere, including bent ones.
|
||||
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()
|
||||
..()
|
||||
var/list/node_connects = list()
|
||||
|
||||
if(dir in diagonals) //bent pipes
|
||||
for(var/D in cardinal)
|
||||
if(D & initialize_directions)
|
||||
node_connects |= D
|
||||
else //straight pipes
|
||||
var/node1_connect = dir
|
||||
var/node2_connect = turn(dir, 180)
|
||||
node_connects = list(node1_connect, node2_connect)
|
||||
|
||||
..(node_connects)
|
||||
|
||||
/*
|
||||
/obj/machinery/atmospherics/pipe/simple/Destroy()
|
||||
if(node1)
|
||||
var/obj/machinery/atmospherics/A = node1
|
||||
@@ -89,7 +77,7 @@ The regular pipe you see everywhere, including bent ones.
|
||||
qdel(parent)
|
||||
node2 = null
|
||||
update_icon()
|
||||
|
||||
*/
|
||||
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
|
||||
if(dir==2)
|
||||
dir = 1
|
||||
@@ -97,13 +85,13 @@ The regular pipe you see everywhere, including bent ones.
|
||||
dir = 4
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/update_icon()
|
||||
if(node1&&node2)
|
||||
if(NODE1&&NODE2)
|
||||
icon_state = "intact[invisibility ? "-f" : "" ]"
|
||||
else
|
||||
var/have_node1 = node1?1:0
|
||||
var/have_node2 = node2?1:0
|
||||
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
|
||||
@@ -118,7 +106,7 @@ The regular pipe you see everywhere, including bent ones.
|
||||
node1.update_icon()
|
||||
if(node2)
|
||||
node2.update_icon()
|
||||
|
||||
*/
|
||||
//Colored pipes, use these for mapping
|
||||
/obj/machinery/atmospherics/pipe/simple/general
|
||||
name="pipe"
|
||||
|
||||
Reference in New Issue
Block a user