mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
[MIRROR] Atmospherics/Initialize (#9387)
Co-authored-by: ShadowLarkens <shadowlarkens@gmail.com>
This commit is contained in:
committed by
GitHub
parent
4aa4946fee
commit
244d055d39
@@ -35,8 +35,8 @@ Pipelines + Other Objects -> Pipe network
|
||||
var/obj/machinery/atmospherics/node1
|
||||
var/obj/machinery/atmospherics/node2
|
||||
|
||||
/obj/machinery/atmospherics/New(loc, newdir)
|
||||
..()
|
||||
/obj/machinery/atmospherics/Initialize(mapload, newdir)
|
||||
. = ..()
|
||||
if(!icon_manager)
|
||||
icon_manager = new()
|
||||
if(!isnull(newdir))
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
var/datum/pipe_network/network1
|
||||
var/datum/pipe_network/network2
|
||||
|
||||
/obj/machinery/atmospherics/binary/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/Initialize()
|
||||
. = ..()
|
||||
|
||||
air1 = new
|
||||
air2 = new
|
||||
@@ -126,4 +126,4 @@
|
||||
update_icon()
|
||||
update_underlays()
|
||||
|
||||
return null
|
||||
return null
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
|
||||
density = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/binary/circulator/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/circulator/Initialize()
|
||||
. = ..()
|
||||
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
air1.volume = 400
|
||||
|
||||
@@ -149,4 +150,4 @@
|
||||
return
|
||||
|
||||
src.set_dir(turn(src.dir, 90))
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
|
||||
|
||||
@@ -42,8 +42,11 @@
|
||||
//2: Do not pass input_pressure_min
|
||||
//4: Do not pass output_pressure_max
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
icon = null
|
||||
@@ -55,8 +58,8 @@
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume
|
||||
name = "Large Dual Port Air Vent"
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/high_volume/Initialize()
|
||||
. = ..()
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800
|
||||
|
||||
@@ -194,11 +197,6 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user)
|
||||
. = ..()
|
||||
if(Adjacent(user))
|
||||
|
||||
@@ -27,10 +27,12 @@
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Initialize()
|
||||
. = ..()
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_PUMP * 2.5
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Destroy()
|
||||
unregister_radio(src, frequency)
|
||||
@@ -169,11 +171,6 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/passive_gate/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -37,10 +37,13 @@ Thus, the two variables affect pump operation are set in New():
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/binary/pump/Initialize()
|
||||
. = ..()
|
||||
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Destroy()
|
||||
unregister_radio(src, frequency)
|
||||
@@ -166,11 +169,6 @@ Thus, the two variables affect pump operation are set in New():
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/binary/pump/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
|
||||
var/list/filtering_outputs = list() //maps gasids to gas_mixtures
|
||||
|
||||
/obj/machinery/atmospherics/omni/atmos_filter/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/omni/atmos_filter/Initialize()
|
||||
. = ..()
|
||||
|
||||
rebuild_filtering_list()
|
||||
for(var/datum/omni_port/P in ports)
|
||||
P.air.volume = ATMOS_DEFAULT_VOLUME_FILTER
|
||||
|
||||
@@ -24,8 +24,9 @@
|
||||
|
||||
var/list/mixing_inputs = list()
|
||||
|
||||
/obj/machinery/atmospherics/omni/mixer/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/omni/mixer/Initialize()
|
||||
. = ..()
|
||||
|
||||
if(mapper_set())
|
||||
var/con = 0
|
||||
for(var/datum/omni_port/P in ports)
|
||||
|
||||
@@ -25,8 +25,9 @@
|
||||
|
||||
var/list/ports = new()
|
||||
|
||||
/obj/machinery/atmospherics/omni/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/omni/Initialize()
|
||||
. = ..()
|
||||
|
||||
icon_state = "base"
|
||||
|
||||
ports = new()
|
||||
|
||||
@@ -39,8 +39,9 @@
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/Initialize()
|
||||
. = ..()
|
||||
|
||||
switch(filter_type)
|
||||
if(0) //removing hydrocarbons
|
||||
filtered_out = list("phoron")
|
||||
@@ -56,6 +57,8 @@
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_FILTER
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_FILTER
|
||||
air3.volume = ATMOS_DEFAULT_VOLUME_FILTER
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/Destroy()
|
||||
unregister_radio(src, frequency)
|
||||
@@ -106,11 +109,6 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/atmos_filter/attack_hand(user) // -- TLE
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -37,8 +37,9 @@
|
||||
icon_state += "off"
|
||||
update_use_power(USE_POWER_OFF)
|
||||
|
||||
/obj/machinery/atmospherics/trinary/mixer/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/trinary/mixer/Initialize()
|
||||
. = ..()
|
||||
|
||||
air1.volume = ATMOS_DEFAULT_VOLUME_MIXER
|
||||
air2.volume = ATMOS_DEFAULT_VOLUME_MIXER
|
||||
air3.volume = ATMOS_DEFAULT_VOLUME_MIXER * 1.5
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
var/datum/pipe_network/network2
|
||||
var/datum/pipe_network/network3
|
||||
|
||||
/obj/machinery/atmospherics/trinary/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/trinary/Initialize()
|
||||
. = ..()
|
||||
|
||||
air1 = new
|
||||
air2 = new
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Initialize()
|
||||
. = ..()
|
||||
|
||||
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //Give it a small reservoir for injecting. Also allows it to have a higher flow rate limit than vent pumps, to differentiate injectors a bit more.
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Destroy()
|
||||
unregister_radio(src, frequency)
|
||||
@@ -122,11 +125,6 @@
|
||||
|
||||
return 1
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/Initialize()
|
||||
. = ..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/atmospherics/unary/outlet_injector/receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id) || (signal.data["sigtype"]!="command"))
|
||||
return 0
|
||||
|
||||
@@ -13,10 +13,10 @@
|
||||
|
||||
var/welded = 0 //defining this here for ventcrawl stuff
|
||||
|
||||
/obj/machinery/atmospherics/unary/New()
|
||||
..()
|
||||
air_contents = new
|
||||
/obj/machinery/atmospherics/unary/Initialize()
|
||||
. = ..()
|
||||
|
||||
air_contents = new
|
||||
air_contents.volume = 200
|
||||
|
||||
/obj/machinery/atmospherics/unary/init_dir()
|
||||
|
||||
@@ -81,10 +81,7 @@
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/Initialize()
|
||||
. = ..()
|
||||
//soundloop = new(list(src), FALSE)
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/New()
|
||||
..()
|
||||
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP
|
||||
|
||||
icon = null
|
||||
@@ -119,8 +116,8 @@
|
||||
icon_connect_type = "-aux"
|
||||
connect_types = CONNECT_TYPE_AUX //connects to aux pipes
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/high_volume/Initialize()
|
||||
. = ..()
|
||||
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 800
|
||||
|
||||
// VOREStation Edit Start - Wall mounted vents
|
||||
@@ -144,8 +141,8 @@
|
||||
power_channel = ENVIRON
|
||||
power_rating = 30000 //15 kW ~ 20 HP
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/engine/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_pump/engine/Initialize()
|
||||
. = ..()
|
||||
air_contents.volume = ATMOS_DEFAULT_VOLUME_PUMP + 500 //meant to match air injector
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_pump/update_icon(var/safety = 0)
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
use_power = USE_POWER_IDLE
|
||||
icon_state = "map_scrubber_on"
|
||||
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/Initialize()
|
||||
. = ..()
|
||||
air_contents.volume = ATMOS_DEFAULT_VOLUME_FILTER
|
||||
|
||||
icon = null
|
||||
|
||||
@@ -1,708 +0,0 @@
|
||||
// internal pipe, don't actually place or use these
|
||||
obj/machinery/atmospherics/pipe/mains_component
|
||||
var/obj/machinery/atmospherics/mains_pipe/parent_pipe
|
||||
var/list/obj/machinery/atmospherics/pipe/mains_component/nodes = new()
|
||||
|
||||
New(loc)
|
||||
..(loc)
|
||||
parent_pipe = loc
|
||||
|
||||
check_pressure(pressure)
|
||||
var/datum/gas_mixture/environment = loc.loc.return_air()
|
||||
|
||||
var/pressure_difference = pressure - environment.return_pressure()
|
||||
|
||||
if(pressure_difference > parent_pipe.maximum_pressure)
|
||||
mains_burst()
|
||||
|
||||
else if(pressure_difference > parent_pipe.fatigue_pressure)
|
||||
//TODO: leak to turf, doing pfshhhhh
|
||||
if(prob(5))
|
||||
mains_burst()
|
||||
|
||||
else return 1
|
||||
|
||||
pipeline_expansion()
|
||||
return nodes
|
||||
|
||||
disconnect(obj/machinery/atmospherics/reference)
|
||||
if(nodes.Find(reference))
|
||||
nodes.Remove(reference)
|
||||
|
||||
proc/mains_burst()
|
||||
parent_pipe.burst()
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe
|
||||
icon = 'icons/obj/atmospherics/mainspipe.dmi'
|
||||
layer = PIPES_LAYER
|
||||
plane = PLATING_PLANE
|
||||
|
||||
var/volume = 0
|
||||
|
||||
var/alert_pressure = 80*ONE_ATMOSPHERE
|
||||
|
||||
var/initialize_mains_directions = 0
|
||||
|
||||
var/list/obj/machinery/atmospherics/mains_pipe/nodes = new()
|
||||
var/obj/machinery/atmospherics/pipe/mains_component/supply
|
||||
var/obj/machinery/atmospherics/pipe/mains_component/scrubbers
|
||||
var/obj/machinery/atmospherics/pipe/mains_component/aux
|
||||
|
||||
var/minimum_temperature_difference = 300
|
||||
var/thermal_conductivity = 0 //WALL_HEAT_TRANSFER_COEFFICIENT No
|
||||
|
||||
var/maximum_pressure = 70*ONE_ATMOSPHERE
|
||||
var/fatigue_pressure = 55*ONE_ATMOSPHERE
|
||||
alert_pressure = 55*ONE_ATMOSPHERE
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
supply = new(src)
|
||||
supply.volume = volume
|
||||
supply.nodes.len = nodes.len
|
||||
scrubbers = new(src)
|
||||
scrubbers.volume = volume
|
||||
scrubbers.nodes.len = nodes.len
|
||||
aux = new(src)
|
||||
aux.volume = volume
|
||||
aux.nodes.len = nodes.len
|
||||
|
||||
hide(var/i)
|
||||
if(level == 1 && istype(loc, /turf/simulated))
|
||||
invisibility = i ? 101 : 0
|
||||
update_icon()
|
||||
|
||||
proc/burst()
|
||||
for(var/obj/machinery/atmospherics/pipe/mains_component/pipe in contents)
|
||||
burst()
|
||||
|
||||
proc/check_pressure(pressure)
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
var/pressure_difference = pressure - environment.return_pressure()
|
||||
|
||||
if(pressure_difference > maximum_pressure)
|
||||
burst()
|
||||
|
||||
else if(pressure_difference > fatigue_pressure)
|
||||
//TODO: leak to turf, doing pfshhhhh
|
||||
if(prob(5))
|
||||
burst()
|
||||
|
||||
else return 1
|
||||
|
||||
get_neighbor_nodes_for_init()
|
||||
return nodes
|
||||
|
||||
disconnect()
|
||||
..()
|
||||
for(var/obj/machinery/atmospherics/pipe/mains_component/node in nodes)
|
||||
node.disconnect()
|
||||
|
||||
Destroy()
|
||||
disconnect()
|
||||
..()
|
||||
|
||||
atmos_init()
|
||||
for(var/i = 1 to nodes.len)
|
||||
var/obj/machinery/atmospherics/mains_pipe/node = nodes[i]
|
||||
if(node)
|
||||
supply.nodes[i] = node.supply
|
||||
scrubbers.nodes[i] = node.scrubbers
|
||||
aux.nodes[i] = node.aux
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe/simple
|
||||
name = "mains pipe"
|
||||
desc = "A one meter section of 3-line mains pipe"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_mains_directions = SOUTH|NORTH
|
||||
|
||||
New()
|
||||
nodes.len = 2
|
||||
..()
|
||||
switch(dir)
|
||||
if(SOUTH || NORTH)
|
||||
initialize_mains_directions = SOUTH|NORTH
|
||||
if(EAST || WEST)
|
||||
initialize_mains_directions = EAST|WEST
|
||||
if(NORTHEAST)
|
||||
initialize_mains_directions = NORTH|EAST
|
||||
if(NORTHWEST)
|
||||
initialize_mains_directions = NORTH|WEST
|
||||
if(SOUTHEAST)
|
||||
initialize_mains_directions = SOUTH|EAST
|
||||
if(SOUTHWEST)
|
||||
initialize_mains_directions = SOUTH|WEST
|
||||
|
||||
proc/normalize_dir()
|
||||
if(dir==3)
|
||||
set_dir(1)
|
||||
else if(dir==12)
|
||||
set_dir(4)
|
||||
|
||||
update_icon()
|
||||
if(nodes[1] && nodes[2])
|
||||
icon_state = "intact[invisibility ? "-f" : "" ]"
|
||||
|
||||
//var/node1_direction = get_dir(src, node1)
|
||||
//var/node2_direction = get_dir(src, node2)
|
||||
|
||||
//set_dir(node1_direction|node2_direction)
|
||||
|
||||
else
|
||||
if(!nodes[1]&&!nodes[2])
|
||||
qdel(src) //TODO: silent deleting looks weird
|
||||
var/have_node1 = nodes[1]?1:0
|
||||
var/have_node2 = nodes[2]?1:0
|
||||
icon_state = "exposed[have_node1][have_node2][invisibility ? "-f" : "" ]"
|
||||
|
||||
atmos_init()
|
||||
normalize_dir()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&initialize_mains_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
else if (!node2_dir)
|
||||
node2_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[2] = target
|
||||
break
|
||||
|
||||
..() // initialize internal pipes
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
if(level == 1 && !T.is_plating()) hide(1)
|
||||
update_icon()
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "intact-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "intact"
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe/manifold
|
||||
name = "manifold pipe"
|
||||
desc = "A manifold composed of mains pipes"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_mains_directions = EAST|NORTH|WEST
|
||||
volume = 105
|
||||
|
||||
New()
|
||||
nodes.len = 3
|
||||
..()
|
||||
initialize_mains_directions = (NORTH|SOUTH|EAST|WEST) & ~dir
|
||||
|
||||
atmos_init()
|
||||
var/connect_directions = initialize_mains_directions
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if (nodes[1])
|
||||
break
|
||||
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[2] = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if (nodes[2])
|
||||
break
|
||||
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&connect_directions)
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,direction))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[3] = target
|
||||
connect_directions &= ~direction
|
||||
break
|
||||
if (nodes[3])
|
||||
break
|
||||
|
||||
..() // initialize internal pipes
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
if(level == 1 && !T.is_plating()) hide(1)
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
icon_state = "manifold[invisibility ? "-f" : "" ]"
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "manifold-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "manifold"
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe/manifold4w
|
||||
name = "manifold pipe"
|
||||
desc = "A manifold composed of mains pipes"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_mains_directions = EAST|NORTH|WEST|SOUTH
|
||||
volume = 105
|
||||
|
||||
New()
|
||||
nodes.len = 4
|
||||
..()
|
||||
|
||||
atmos_init()
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,NORTH))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,SOUTH))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[2] = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,EAST))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[3] = target
|
||||
break
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,WEST))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[3] = target
|
||||
break
|
||||
|
||||
..() // initialize internal pipes
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
if(level == 1 && !T.is_plating()) hide(1)
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
icon_state = "manifold4w[invisibility ? "-f" : "" ]"
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "manifold4w-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "manifold4w"
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe/split
|
||||
name = "mains splitter"
|
||||
desc = "A splitter for connecting to a single pipe off a mains."
|
||||
|
||||
var/obj/machinery/atmospherics/pipe/mains_component/split_node
|
||||
var/obj/machinery/atmospherics/node3
|
||||
var/icon_type
|
||||
|
||||
New()
|
||||
nodes.len = 2
|
||||
..()
|
||||
initialize_mains_directions = turn(dir, 90) | turn(dir, -90)
|
||||
initialize_directions = dir // actually have a normal connection too
|
||||
|
||||
atmos_init()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
var/node3_dir
|
||||
|
||||
node1_dir = turn(dir, 90)
|
||||
node2_dir = turn(dir, -90)
|
||||
node3_dir = dir
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[2] = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,node3_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
node3 = target
|
||||
break
|
||||
|
||||
..() // initialize internal pipes
|
||||
|
||||
// bind them
|
||||
spawn(5)
|
||||
if(node3 && split_node)
|
||||
var/datum/pipe_network/N1 = node3.return_network(src)
|
||||
var/datum/pipe_network/N2 = split_node.return_network(split_node)
|
||||
if(N1 && N2)
|
||||
N1.merge(N2)
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
if(level == 1 && !T.is_plating()) hide(1)
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
icon_state = "split-[icon_type][invisibility ? "-f" : "" ]"
|
||||
|
||||
return_network(A)
|
||||
return split_node.return_network(A)
|
||||
|
||||
supply
|
||||
icon_type = "supply"
|
||||
|
||||
New()
|
||||
..()
|
||||
split_node = supply
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "split-supply-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "split-supply"
|
||||
|
||||
scrubbers
|
||||
icon_type = "scrubbers"
|
||||
|
||||
New()
|
||||
..()
|
||||
split_node = scrubbers
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "split-scrubbers-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "split-scrubbers"
|
||||
|
||||
aux
|
||||
icon_type = "aux"
|
||||
|
||||
New()
|
||||
..()
|
||||
split_node = aux
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "split-aux-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "split-aux"
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe/split3
|
||||
name = "triple mains splitter"
|
||||
desc = "A splitter for connecting to the 3 pipes on a mainline."
|
||||
|
||||
var/obj/machinery/atmospherics/supply_node
|
||||
var/obj/machinery/atmospherics/scrubbers_node
|
||||
var/obj/machinery/atmospherics/aux_node
|
||||
|
||||
New()
|
||||
nodes.len = 1
|
||||
..()
|
||||
initialize_mains_directions = dir
|
||||
initialize_directions = cardinal & ~dir // actually have a normal connection too
|
||||
|
||||
atmos_init()
|
||||
var/node1_dir
|
||||
var/supply_node_dir
|
||||
var/scrubbers_node_dir
|
||||
var/aux_node_dir
|
||||
|
||||
node1_dir = dir
|
||||
aux_node_dir = turn(dir, 180)
|
||||
if(dir & (NORTH|SOUTH))
|
||||
supply_node_dir = EAST
|
||||
scrubbers_node_dir = WEST
|
||||
else
|
||||
supply_node_dir = SOUTH
|
||||
scrubbers_node_dir = NORTH
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src, node1_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,supply_node_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
supply_node = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,scrubbers_node_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
scrubbers_node = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/target in get_step(src,aux_node_dir))
|
||||
if(target.initialize_directions & get_dir(target,src))
|
||||
aux_node = target
|
||||
break
|
||||
|
||||
..() // initialize internal pipes
|
||||
|
||||
// bind them
|
||||
spawn(5)
|
||||
if(supply_node)
|
||||
var/datum/pipe_network/N1 = supply_node.return_network(src)
|
||||
var/datum/pipe_network/N2 = supply.return_network(supply)
|
||||
if(N1 && N2)
|
||||
N1.merge(N2)
|
||||
if(scrubbers_node)
|
||||
var/datum/pipe_network/N1 = scrubbers_node.return_network(src)
|
||||
var/datum/pipe_network/N2 = scrubbers.return_network(scrubbers)
|
||||
if(N1 && N2)
|
||||
N1.merge(N2)
|
||||
if(aux_node)
|
||||
var/datum/pipe_network/N1 = aux_node.return_network(src)
|
||||
var/datum/pipe_network/N2 = aux.return_network(aux)
|
||||
if(N1 && N2)
|
||||
N1.merge(N2)
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
if(level == 1 && !T.is_plating()) hide(1)
|
||||
update_icon()
|
||||
|
||||
update_icon()
|
||||
icon_state = "split-t[invisibility ? "-f" : "" ]"
|
||||
|
||||
return_network(obj/machinery/atmospherics/reference)
|
||||
var/obj/machinery/atmospherics/A
|
||||
|
||||
A = supply_node.return_network(reference)
|
||||
if(!A)
|
||||
A = scrubbers_node.return_network(reference)
|
||||
if(!A)
|
||||
A = aux_node.return_network(reference)
|
||||
|
||||
return A
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "split-t-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "split-t"
|
||||
|
||||
obj/machinery/atmospherics/mains_pipe/cap
|
||||
name = "pipe cap"
|
||||
desc = "A cap for the end of a mains pipe"
|
||||
|
||||
dir = SOUTH
|
||||
initialize_directions = SOUTH
|
||||
volume = 35
|
||||
|
||||
New()
|
||||
nodes.len = 1
|
||||
..()
|
||||
initialize_mains_directions = dir
|
||||
|
||||
update_icon()
|
||||
icon_state = "cap[invisibility ? "-f" : ""]"
|
||||
|
||||
atmos_init()
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
break
|
||||
|
||||
..()
|
||||
|
||||
var/turf/T = src.loc // hide if turf is not intact
|
||||
if(level == 1 && !T.is_plating()) hide(1)
|
||||
update_icon()
|
||||
|
||||
hidden
|
||||
level = 1
|
||||
icon_state = "cap-f"
|
||||
|
||||
visible
|
||||
level = 2
|
||||
icon_state = "cap"
|
||||
|
||||
//TODO: Get Mains valves working!
|
||||
/*
|
||||
obj/machinery/atmospherics/mains_pipe/valve
|
||||
icon_state = "mvalve0"
|
||||
|
||||
name = "mains shutoff valve"
|
||||
desc = "A mains pipe valve"
|
||||
|
||||
var/open = 1
|
||||
|
||||
dir = SOUTH
|
||||
initialize_mains_directions = SOUTH|NORTH
|
||||
|
||||
New()
|
||||
nodes.len = 2
|
||||
..()
|
||||
initialize_mains_directions = dir | turn(dir, 180)
|
||||
|
||||
update_icon(animation)
|
||||
var/turf/simulated/floor = loc
|
||||
var/hide = istype(floor) ? floor.intact : 0
|
||||
level = 1
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/node in nodes)
|
||||
if(node.level == 2)
|
||||
hide = 0
|
||||
level = 2
|
||||
break
|
||||
|
||||
if(animation)
|
||||
flick("[hide?"h":""]mvalve[src.open][!src.open]",src)
|
||||
else
|
||||
icon_state = "[hide?"h":""]mvalve[open]"
|
||||
|
||||
Initialize()
|
||||
normalize_dir()
|
||||
var/node1_dir
|
||||
var/node2_dir
|
||||
|
||||
for(var/direction in cardinal)
|
||||
if(direction&initialize_mains_directions)
|
||||
if (!node1_dir)
|
||||
node1_dir = direction
|
||||
else if (!node2_dir)
|
||||
node2_dir = direction
|
||||
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node1_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[1] = target
|
||||
break
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/target in get_step(src,node2_dir))
|
||||
if(target.initialize_mains_directions & get_dir(target,src))
|
||||
nodes[2] = target
|
||||
break
|
||||
|
||||
if(open)
|
||||
..() // initialize internal pipes
|
||||
|
||||
update_icon()
|
||||
|
||||
proc/normalize_dir()
|
||||
if(dir==3)
|
||||
set_dir(1)
|
||||
else if(dir==12)
|
||||
set_dir(4)
|
||||
|
||||
proc/open()
|
||||
if(open) return 0
|
||||
|
||||
open = 1
|
||||
update_icon()
|
||||
|
||||
Initialize()
|
||||
|
||||
return 1
|
||||
|
||||
proc/close()
|
||||
if(!open) return 0
|
||||
|
||||
open = 0
|
||||
update_icon()
|
||||
|
||||
for(var/obj/machinery/atmospherics/pipe/mains_component/node in src)
|
||||
for(var/obj/machinery/atmospherics/pipe/mains_component/o in node.nodes)
|
||||
o.disconnect(node)
|
||||
o.build_network()
|
||||
|
||||
return 1
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return
|
||||
|
||||
attack_paw(mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
src.add_fingerprint(usr)
|
||||
update_icon(1)
|
||||
sleep(10)
|
||||
if (open)
|
||||
close()
|
||||
else
|
||||
open()
|
||||
|
||||
digital // can be controlled by AI
|
||||
name = "digital mains valve"
|
||||
desc = "A digitally controlled valve."
|
||||
icon_state = "dvalve0"
|
||||
|
||||
attack_ai(mob/user as mob)
|
||||
return src.attack_hand(user)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(!src.allowed(user))
|
||||
to_chat(user, span_warning("Access denied."))
|
||||
return
|
||||
..()
|
||||
|
||||
//Radio remote control
|
||||
|
||||
proc
|
||||
set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
if(frequency)
|
||||
radio_connection = radio_controller.add_object(src, frequency, RADIO_ATMOSIA)
|
||||
|
||||
var/frequency = 0
|
||||
var/id = null
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
Initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
update_icon(animation)
|
||||
var/turf/simulated/floor = loc
|
||||
var/hide = istype(floor) ? floor.intact : 0
|
||||
level = 1
|
||||
for(var/obj/machinery/atmospherics/mains_pipe/node in nodes)
|
||||
if(node.level == 2)
|
||||
hide = 0
|
||||
level = 2
|
||||
break
|
||||
|
||||
if(animation)
|
||||
flick("[hide?"h":""]dvalve[src.open][!src.open]",src)
|
||||
else
|
||||
icon_state = "[hide?"h":""]dvalve[open]"
|
||||
|
||||
receive_signal(datum/signal/signal)
|
||||
if(!signal.data["tag"] || (signal.data["tag"] != id))
|
||||
return 0
|
||||
|
||||
switch(signal.data["command"])
|
||||
if("valve_open")
|
||||
if(!open)
|
||||
open()
|
||||
|
||||
if("valve_close")
|
||||
if(open)
|
||||
close()
|
||||
|
||||
if("valve_toggle")
|
||||
if(open)
|
||||
close()
|
||||
else
|
||||
open()
|
||||
*/
|
||||
@@ -23,8 +23,8 @@
|
||||
buckle_lying = 1
|
||||
|
||||
// BubbleWrap
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/pipe/simple/heat_exchanging/Initialize()
|
||||
. = ..()
|
||||
// BubbleWrap END
|
||||
color = "#404040" //we don't make use of the fancy overlay system for colours, use this to set the default.
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/pipe/manifold/Initialize()
|
||||
. = ..()
|
||||
alpha = 255
|
||||
icon = null
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/pipe/manifold4w/Initialize()
|
||||
. = ..()
|
||||
alpha = 255
|
||||
icon = null
|
||||
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
/obj/machinery/atmospherics/pipe/drain_power()
|
||||
return -1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/New()
|
||||
/obj/machinery/atmospherics/pipe/Initialize()
|
||||
if(istype(get_turf(src), /turf/simulated/wall) || istype(get_turf(src), /turf/simulated/shuttle/wall) || istype(get_turf(src), /turf/unsimulated/wall))
|
||||
level = 1
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/hides_under_flooring()
|
||||
return level != 2
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
level = 1
|
||||
|
||||
/obj/machinery/atmospherics/pipe/simple/New()
|
||||
..()
|
||||
/obj/machinery/atmospherics/pipe/simple/Initialize()
|
||||
. = ..()
|
||||
|
||||
// Pipe colors and icon states are handled by an image cache - so color and icon should
|
||||
// be null. For mapping purposes color is defined in the object definitions.
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
pipe_flags = PIPING_DEFAULT_LAYER_ONLY
|
||||
density = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/Initialize()
|
||||
icon_state = "air"
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/init_dir()
|
||||
initialize_directions = dir
|
||||
@@ -74,7 +74,7 @@
|
||||
name = "Pressure Tank (Air)"
|
||||
icon_state = "air_map"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/air/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/air/Initialize()
|
||||
air_temporary = new
|
||||
air_temporary.volume = volume
|
||||
air_temporary.temperature = T20C
|
||||
@@ -83,21 +83,21 @@
|
||||
"nitrogen",(start_pressure*N2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
||||
|
||||
|
||||
..()
|
||||
. = ..()
|
||||
icon_state = "air"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/oxygen
|
||||
name = "Pressure Tank (Oxygen)"
|
||||
icon_state = "o2_map"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/oxygen/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/oxygen/Initialize()
|
||||
air_temporary = new
|
||||
air_temporary.volume = volume
|
||||
air_temporary.temperature = T20C
|
||||
|
||||
air_temporary.adjust_gas("oxygen", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
||||
|
||||
..()
|
||||
. = ..()
|
||||
icon_state = "o2"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/nitrogen
|
||||
@@ -105,28 +105,28 @@
|
||||
icon_state = "n2_map"
|
||||
volume = 40000 //Vorestation edit
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/nitrogen/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/nitrogen/Initialize()
|
||||
air_temporary = new
|
||||
air_temporary.volume = volume
|
||||
air_temporary.temperature = T20C
|
||||
|
||||
air_temporary.adjust_gas("nitrogen", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
||||
|
||||
..()
|
||||
. = ..()
|
||||
icon_state = "n2"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/carbon_dioxide
|
||||
name = "Pressure Tank (Carbon Dioxide)"
|
||||
icon_state = "co2_map"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/carbon_dioxide/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/carbon_dioxide/Initialize()
|
||||
air_temporary = new
|
||||
air_temporary.volume = volume
|
||||
air_temporary.temperature = T20C
|
||||
|
||||
air_temporary.adjust_gas("carbon_dioxide", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
||||
|
||||
..()
|
||||
. = ..()
|
||||
icon_state = "co2"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/phoron
|
||||
@@ -134,26 +134,26 @@
|
||||
icon_state = "phoron_map"
|
||||
connect_types = CONNECT_TYPE_REGULAR|CONNECT_TYPE_FUEL
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/phoron/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/phoron/Initialize()
|
||||
air_temporary = new
|
||||
air_temporary.volume = volume
|
||||
air_temporary.temperature = T20C
|
||||
|
||||
air_temporary.adjust_gas("phoron", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
||||
|
||||
..()
|
||||
. = ..()
|
||||
icon_state = "phoron"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/nitrous_oxide
|
||||
name = "Pressure Tank (Nitrous Oxide)"
|
||||
icon_state = "n2o_map"
|
||||
|
||||
/obj/machinery/atmospherics/pipe/tank/nitrous_oxide/New()
|
||||
/obj/machinery/atmospherics/pipe/tank/nitrous_oxide/Initialize()
|
||||
air_temporary = new
|
||||
air_temporary.volume = volume
|
||||
air_temporary.temperature = T0C
|
||||
|
||||
air_temporary.adjust_gas("nitrous_oxide", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
|
||||
|
||||
..()
|
||||
. = ..()
|
||||
icon_state = "n2o"
|
||||
|
||||
@@ -177,8 +177,8 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin
|
||||
animate(src, color = fire_color(air_contents.temperature), 5)
|
||||
set_light(l_color = color)
|
||||
|
||||
/obj/fire/New(newLoc,fl)
|
||||
..()
|
||||
/obj/fire/Initialize(mapload, fl)
|
||||
. = ..()
|
||||
|
||||
if(!istype(loc, /turf))
|
||||
qdel(src)
|
||||
|
||||
Reference in New Issue
Block a user