Files
CHOMPStation2/code/ATMOSPHERICS/pipes/tank.dm
Leshana 89f77e78ff Reorganizes atmos pipes into separate files by type.
This changes absolutely nothing codewise, it is straight up just splitting pipes.dm into separate files because it was over a thousand lines long.
2018-02-25 03:30:50 -05:00

161 lines
4.4 KiB
Plaintext

//
// Tanks - These are implemented as pipes with large volume
//
/obj/machinery/atmospherics/pipe/tank
icon = 'icons/atmos/tank.dmi'
icon_state = "air_map"
name = "Pressure Tank"
desc = "A large vessel containing pressurized gas."
volume = 10000 //in liters, 1 meters by 1 meters by 2 meters ~tweaked it a little to simulate a pressure tank without needing to recode them yet
var/start_pressure = 25*ONE_ATMOSPHERE
level = 1
dir = SOUTH
initialize_directions = SOUTH
density = 1
/obj/machinery/atmospherics/pipe/tank/New()
icon_state = "air"
..()
/obj/machinery/atmospherics/pipe/tank/init_dir()
initialize_directions = dir
/obj/machinery/atmospherics/pipe/tank/Destroy()
if(node1)
node1.disconnect(src)
node1 = null
. = ..()
/obj/machinery/atmospherics/pipe/tank/pipeline_expansion()
return list(node1)
/obj/machinery/atmospherics/pipe/tank/update_underlays()
if(..())
underlays.Cut()
var/turf/T = get_turf(src)
if(!istype(T))
return
add_underlay(T, node1, dir)
/obj/machinery/atmospherics/pipe/tank/hide()
update_underlays()
/obj/machinery/atmospherics/pipe/tank/atmos_init()
var/connect_direction = dir
for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction))
if(target.initialize_directions & get_dir(target,src))
if (check_connect_types(target,src))
node1 = target
break
update_underlays()
/obj/machinery/atmospherics/pipe/tank/disconnect(obj/machinery/atmospherics/reference)
if(reference == node1)
if(istype(node1, /obj/machinery/atmospherics/pipe))
qdel(parent)
node1 = null
update_underlays()
return null
/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob)
if(istype(W, /obj/item/device/pipe_painter))
return
if(istype(W, /obj/item/device/analyzer) && in_range(user, src))
var/obj/item/device/analyzer/A = W
A.analyze_gases(src, user)
/obj/machinery/atmospherics/pipe/tank/air
name = "Pressure Tank (Air)"
icon_state = "air_map"
/obj/machinery/atmospherics/pipe/tank/air/New()
air_temporary = new
air_temporary.volume = volume
air_temporary.temperature = T20C
air_temporary.adjust_multi("oxygen", (start_pressure*O2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature), \
"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()
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
name = "Pressure Tank (Nitrogen)"
icon_state = "n2_map"
/obj/machinery/atmospherics/pipe/tank/nitrogen/New()
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()
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
name = "Pressure Tank (Phoron)"
icon_state = "phoron_map"
/obj/machinery/atmospherics/pipe/tank/phoron/New()
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()
air_temporary = new
air_temporary.volume = volume
air_temporary.temperature = T0C
air_temporary.adjust_gas("sleeping_agent", (start_pressure)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature))
..()
icon_state = "n2o"