From d614145f40f535734142432819d25409b09b3f8f Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 8 Jul 2015 15:43:24 -0700 Subject: [PATCH 1/4] Clean up pipecode and split huge file into folder structure This commit cleans up any remaining relative pathing in the ATMOSPHERICS/ folder, and splits the absolutely huge pipes.dm file into 6-7 files in the pipes/ folder tree. --- .../binary_devices/binary_atmos_base.dm | 230 +-- .../components/trinary_devices/mixer.dm | 14 +- .../trinary_devices/trinary_base.dm | 270 ++-- .../components/unary/cold_sink.dm | 42 +- .../components/unary/generator_input.dm | 17 +- .../components/unary/heat_exchanger.dm | 124 +- .../components/unary/heat_source.dm | 42 +- .../components/unary/oxygen_generator.dm | 48 +- .../components/unary/thermal_plate.dm | 155 +- .../components/unary/unary_base.dm | 146 +- code/ATMOSPHERICS/datum_pipe_network.dm | 224 +-- code/ATMOSPHERICS/datum_pipeline.dm | 288 ++-- code/ATMOSPHERICS/he_pipes.dm | 119 -- code/ATMOSPHERICS/pipes.dm | 1380 +---------------- code/ATMOSPHERICS/pipes/cap.dm | 122 ++ code/ATMOSPHERICS/pipes/manifold.dm | 251 +++ code/ATMOSPHERICS/pipes/manifold4w.dm | 256 +++ code/ATMOSPHERICS/pipes/pipe.dm | 138 ++ code/ATMOSPHERICS/pipes/simple/pipe_simple.dm | 181 +++ .../pipes/simple/pipe_simple_he.dm | 118 ++ .../pipes/simple/pipe_simple_hidden.dm | 69 + .../pipes/simple/pipe_simple_insulated.dm | 11 + .../pipes/simple/pipe_simple_visible.dm | 66 + code/ATMOSPHERICS/pipes/tank.dm | 166 ++ code/ATMOSPHERICS/pipes/vent.dm | 105 ++ paradise.dme | 11 + 26 files changed, 2294 insertions(+), 2299 deletions(-) create mode 100644 code/ATMOSPHERICS/pipes/cap.dm create mode 100644 code/ATMOSPHERICS/pipes/manifold.dm create mode 100644 code/ATMOSPHERICS/pipes/manifold4w.dm create mode 100644 code/ATMOSPHERICS/pipes/pipe.dm create mode 100644 code/ATMOSPHERICS/pipes/simple/pipe_simple.dm create mode 100644 code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm create mode 100644 code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm create mode 100644 code/ATMOSPHERICS/pipes/simple/pipe_simple_insulated.dm create mode 100644 code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm create mode 100644 code/ATMOSPHERICS/pipes/tank.dm create mode 100644 code/ATMOSPHERICS/pipes/vent.dm diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index 1b801ad3e13..aeb146fe57a 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -1,4 +1,4 @@ -obj/machinery/atmospherics/binary +/obj/machinery/atmospherics/binary dir = SOUTH initialize_directions = SOUTH|NORTH use_power = 1 @@ -12,131 +12,131 @@ obj/machinery/atmospherics/binary var/datum/pipe_network/network1 var/datum/pipe_network/network2 - New() - ..() - switch(dir) - if(NORTH) - initialize_directions = NORTH|SOUTH - if(SOUTH) - initialize_directions = NORTH|SOUTH - if(EAST) - initialize_directions = EAST|WEST - if(WEST) - initialize_directions = EAST|WEST - air1 = new - air2 = new +/obj/machinery/atmospherics/binary/New() + ..() + switch(dir) + if(NORTH) + initialize_directions = NORTH|SOUTH + if(SOUTH) + initialize_directions = NORTH|SOUTH + if(EAST) + initialize_directions = EAST|WEST + if(WEST) + initialize_directions = EAST|WEST + air1 = new + air2 = new - air1.volume = 200 - air2.volume = 200 + air1.volume = 200 + air2.volume = 200 + +/obj/machinery/atmospherics/binary/Destroy() + loc = null + + if(node1) + node1.disconnect(src) + qdel(network1) + if(node2) + node2.disconnect(src) + qdel(network2) + + node1 = null + node2 = null + + return ..() // Housekeeping and pipe network stuff below - network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - if(reference == node1) - network1 = new_network +/obj/machinery/atmospherics/binary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) + if(reference == node1) + network1 = new_network - else if(reference == node2) - network2 = new_network + else if(reference == node2) + network2 = new_network - if(new_network.normal_members.Find(src)) - return 0 + if(new_network.normal_members.Find(src)) + return 0 - new_network.normal_members += src + new_network.normal_members += src - return null + return null - Destroy() - loc = null +/obj/machinery/atmospherics/binary/initialize() + if(node1 && node2) return - if(node1) - node1.disconnect(src) - qdel(network1) - if(node2) - node2.disconnect(src) - qdel(network2) + var/node2_connect = dir + var/node1_connect = turn(dir, 180) + for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node1 = target + break + + for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node2 = target + break + + update_icon() + update_underlays() + +/obj/machinery/atmospherics/binary/build_network() + if(!network1 && node1) + network1 = new /datum/pipe_network() + network1.normal_members += src + network1.build_network(node1, src) + + if(!network2 && node2) + network2 = new /datum/pipe_network() + network2.normal_members += src + network2.build_network(node2, src) + + +/obj/machinery/atmospherics/binary/return_network(obj/machinery/atmospherics/reference) + build_network() + + if(reference==node1) + return network1 + + if(reference==node2) + return network2 + + return null + +/obj/machinery/atmospherics/binary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) + if(network1 == old_network) + network1 = new_network + if(network2 == old_network) + network2 = new_network + + return 1 + +/obj/machinery/atmospherics/binary/return_network_air(datum/pipe_network/reference) + var/list/results = list() + + if(network1 == reference) + results += air1 + if(network2 == reference) + results += air2 + + return results + +/obj/machinery/atmospherics/binary/disconnect(obj/machinery/atmospherics/reference) + if(reference==node1) + del(network1) node1 = null + + else if(reference==node2) + del(network2) node2 = null - return ..() + update_icon() + update_underlays() - initialize() - if(node1 && node2) return - - var/node2_connect = dir - var/node1_connect = turn(dir, 180) - - for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node1 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node2 = target - break - - update_icon() - update_underlays() - - build_network() - if(!network1 && node1) - network1 = new /datum/pipe_network() - network1.normal_members += src - network1.build_network(node1, src) - - if(!network2 && node2) - network2 = new /datum/pipe_network() - network2.normal_members += src - network2.build_network(node2, src) - - - return_network(obj/machinery/atmospherics/reference) - build_network() - - if(reference==node1) - return network1 - - if(reference==node2) - return network2 - - return null - - reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) - if(network1 == old_network) - network1 = new_network - if(network2 == old_network) - network2 = new_network - - return 1 - - return_network_air(datum/pipe_network/reference) - var/list/results = list() - - if(network1 == reference) - results += air1 - if(network2 == reference) - results += air2 - - return results - - disconnect(obj/machinery/atmospherics/reference) - if(reference==node1) - del(network1) - node1 = null - - else if(reference==node2) - del(network2) - node2 = null - - update_icon() - update_underlays() - - return null \ No newline at end of file + return null \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 841e9761231..23a44b376e6 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -19,7 +19,7 @@ icon_state = "t" else icon_state = "" - + if(!powered()) icon_state += "off" else if(node2 && node3 && node1) @@ -183,7 +183,7 @@ src.updateUsrDialog() return -obj/machinery/atmospherics/trinary/mixer/t_mixer +/obj/machinery/atmospherics/trinary/mixer/t_mixer icon_state = "tmap" dir = SOUTH @@ -191,7 +191,7 @@ obj/machinery/atmospherics/trinary/mixer/t_mixer //node 3 is the outlet, nodes 1 & 2 are intakes -obj/machinery/atmospherics/trinary/mixer/t_mixer/New() +/obj/machinery/atmospherics/trinary/mixer/t_mixer/New() ..() switch(dir) if(NORTH) @@ -203,7 +203,7 @@ obj/machinery/atmospherics/trinary/mixer/t_mixer/New() if(WEST) initialize_directions = WEST|NORTH|SOUTH -obj/machinery/atmospherics/trinary/mixer/t_mixer/initialize() +/obj/machinery/atmospherics/trinary/mixer/t_mixer/initialize() if(node1 && node2 && node3) return var/node1_connect = turn(dir, -90) @@ -228,7 +228,7 @@ obj/machinery/atmospherics/trinary/mixer/t_mixer/initialize() update_icon() update_underlays() -obj/machinery/atmospherics/trinary/mixer/m_mixer +/obj/machinery/atmospherics/trinary/mixer/m_mixer icon_state = "mmap" dir = SOUTH @@ -236,7 +236,7 @@ obj/machinery/atmospherics/trinary/mixer/m_mixer //node 3 is the outlet, nodes 1 & 2 are intakes -obj/machinery/atmospherics/trinary/mixer/m_mixer/New() +/obj/machinery/atmospherics/trinary/mixer/m_mixer/New() ..() switch(dir) if(NORTH) @@ -248,7 +248,7 @@ obj/machinery/atmospherics/trinary/mixer/m_mixer/New() if(WEST) initialize_directions = WEST|SOUTH|EAST -obj/machinery/atmospherics/trinary/mixer/m_mixer/initialize() +/obj/machinery/atmospherics/trinary/mixer/m_mixer/initialize() if(node1 && node2 && node3) return var/node1_connect = turn(dir, -180) diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index a2ab2ad9163..2486f38d45f 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -1,4 +1,4 @@ -obj/machinery/atmospherics/trinary +/obj/machinery/atmospherics/trinary dir = SOUTH initialize_directions = SOUTH|NORTH|WEST use_power = 1 @@ -17,153 +17,153 @@ obj/machinery/atmospherics/trinary var/datum/pipe_network/network2 var/datum/pipe_network/network3 - New() - ..() - switch(dir) - if(NORTH) - initialize_directions = EAST|NORTH|SOUTH - if(SOUTH) - initialize_directions = SOUTH|WEST|NORTH - if(EAST) - initialize_directions = EAST|WEST|SOUTH - if(WEST) - initialize_directions = WEST|NORTH|EAST - air1 = new - air2 = new - air3 = new +/obj/machinery/atmospherics/trinary/New() + ..() + switch(dir) + if(NORTH) + initialize_directions = EAST|NORTH|SOUTH + if(SOUTH) + initialize_directions = SOUTH|WEST|NORTH + if(EAST) + initialize_directions = EAST|WEST|SOUTH + if(WEST) + initialize_directions = WEST|NORTH|EAST + air1 = new + air2 = new + air3 = new - air1.volume = 200 - air2.volume = 200 - air3.volume = 200 + air1.volume = 200 + air2.volume = 200 + air3.volume = 200 + +/obj/machinery/atmospherics/trinary/Destroy() + loc = null + + if(node1) + node1.disconnect(src) + qdel(network1) + if(node2) + node2.disconnect(src) + qdel(network2) + if(node3) + node3.disconnect(src) + qdel(network3) + + node1 = null + node2 = null + node3 = null + + return ..() // Housekeeping and pipe network stuff below - network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - if(reference == node1) - network1 = new_network +/obj/machinery/atmospherics/trinary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) + if(reference == node1) + network1 = new_network - else if(reference == node2) - network2 = new_network + else if(reference == node2) + network2 = new_network - else if (reference == node3) - network3 = new_network + else if (reference == node3) + network3 = new_network - if(new_network.normal_members.Find(src)) - return 0 + if(new_network.normal_members.Find(src)) + return 0 - new_network.normal_members += src + new_network.normal_members += src - return null + return null - Destroy() - loc = null +/obj/machinery/atmospherics/trinary/initialize() + if(node1 && node2 && node3) return - if(node1) - node1.disconnect(src) - qdel(network1) - if(node2) - node2.disconnect(src) - qdel(network2) - if(node3) - node3.disconnect(src) - qdel(network3) + var/node1_connect = turn(dir, -180) + var/node2_connect = turn(dir, -90) + var/node3_connect = dir + for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect)) + if(target.initialize_directions & get_dir(target,src)) + node1 = target + break + + for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect)) + if(target.initialize_directions & get_dir(target,src)) + node2 = target + break + + for(var/obj/machinery/atmospherics/target in get_step(src,node3_connect)) + if(target.initialize_directions & get_dir(target,src)) + node3 = target + break + + update_icon() + update_underlays() + +/obj/machinery/atmospherics/trinary/build_network() + if(!network1 && node1) + network1 = new /datum/pipe_network() + network1.normal_members += src + network1.build_network(node1, src) + + if(!network2 && node2) + network2 = new /datum/pipe_network() + network2.normal_members += src + network2.build_network(node2, src) + + if(!network3 && node3) + network3 = new /datum/pipe_network() + network3.normal_members += src + network3.build_network(node3, src) + + +/obj/machinery/atmospherics/trinary/return_network(obj/machinery/atmospherics/reference) + build_network() + + if(reference==node1) + return network1 + + if(reference==node2) + return network2 + + if(reference==node3) + return network3 + + return null + +/obj/machinery/atmospherics/trinary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) + if(network1 == old_network) + network1 = new_network + if(network2 == old_network) + network2 = new_network + if(network3 == old_network) + network3 = new_network + + return 1 + +/obj/machinery/atmospherics/trinary/return_network_air(datum/pipe_network/reference) + var/list/results = list() + + if(network1 == reference) + results += air1 + if(network2 == reference) + results += air2 + if(network3 == reference) + results += air3 + + return results + +/obj/machinery/atmospherics/trinary/disconnect(obj/machinery/atmospherics/reference) + if(reference==node1) + del(network1) node1 = null + + else if(reference==node2) + del(network2) node2 = null + + else if(reference==node3) + del(network3) node3 = null - return ..() + update_underlays() - initialize() - if(node1 && node2 && node3) return - - var/node1_connect = turn(dir, -180) - var/node2_connect = turn(dir, -90) - var/node3_connect = dir - - for(var/obj/machinery/atmospherics/target in get_step(src,node1_connect)) - if(target.initialize_directions & get_dir(target,src)) - node1 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,node2_connect)) - if(target.initialize_directions & get_dir(target,src)) - node2 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,node3_connect)) - if(target.initialize_directions & get_dir(target,src)) - node3 = target - break - - update_icon() - update_underlays() - - build_network() - if(!network1 && node1) - network1 = new /datum/pipe_network() - network1.normal_members += src - network1.build_network(node1, src) - - if(!network2 && node2) - network2 = new /datum/pipe_network() - network2.normal_members += src - network2.build_network(node2, src) - - if(!network3 && node3) - network3 = new /datum/pipe_network() - network3.normal_members += src - network3.build_network(node3, src) - - - return_network(obj/machinery/atmospherics/reference) - build_network() - - if(reference==node1) - return network1 - - if(reference==node2) - return network2 - - if(reference==node3) - return network3 - - return null - - reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) - if(network1 == old_network) - network1 = new_network - if(network2 == old_network) - network2 = new_network - if(network3 == old_network) - network3 = new_network - - return 1 - - return_network_air(datum/pipe_network/reference) - var/list/results = list() - - if(network1 == reference) - results += air1 - if(network2 == reference) - results += air2 - if(network3 == reference) - results += air3 - - return results - - disconnect(obj/machinery/atmospherics/reference) - if(reference==node1) - del(network1) - node1 = null - - else if(reference==node2) - del(network2) - node2 = null - - else if(reference==node3) - del(network3) - node3 = null - - update_underlays() - - return null \ No newline at end of file + return null \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index b1fa6a21b47..6e0a6e53259 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -12,30 +12,30 @@ var/current_temperature = T20C var/current_heat_capacity = 50000 //totally random - update_icon() - if(node) - icon_state = "intact_[on?("on"):("off")]" - else - icon_state = "exposed" +/obj/machinery/atmospherics/unary/cold_sink/update_icon() + if(node) + icon_state = "intact_[on?("on"):("off")]" + else + icon_state = "exposed" - on = 0 + on = 0 - return + return - process() - ..() - if(!on || !network) - return 0 - var/air_heat_capacity = air_contents.heat_capacity() - var/combined_heat_capacity = current_heat_capacity + air_heat_capacity - var/old_temperature = air_contents.temperature +/obj/machinery/atmospherics/unary/cold_sink/process() + ..() + if(!on || !network) + return 0 + var/air_heat_capacity = air_contents.heat_capacity() + var/combined_heat_capacity = current_heat_capacity + air_heat_capacity + var/old_temperature = air_contents.temperature - if(combined_heat_capacity > 0) - var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature - air_contents.temperature = combined_energy/combined_heat_capacity + if(combined_heat_capacity > 0) + var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature + air_contents.temperature = combined_energy/combined_heat_capacity - //todo: have current temperature affected. require power to bring down current temperature again + //todo: have current temperature affected. require power to bring down current temperature again - if(abs(old_temperature-air_contents.temperature) > 1) - network.update = 1 - return 1 \ No newline at end of file + if(abs(old_temperature-air_contents.temperature) > 1) + network.update = 1 + return 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/generator_input.dm b/code/ATMOSPHERICS/components/unary/generator_input.dm index 2b31097dc41..bcbd124eca5 100644 --- a/code/ATMOSPHERICS/components/unary/generator_input.dm +++ b/code/ATMOSPHERICS/components/unary/generator_input.dm @@ -8,14 +8,13 @@ var/update_cycle - update_icon() - if(node) - icon_state = "intact" - else - icon_state = "exposed" +/obj/machinery/atmospherics/unary/generator_input/update_icon() + if(node) + icon_state = "intact" + else + icon_state = "exposed" - return + return - proc - return_exchange_air() - return air_contents \ No newline at end of file +/obj/machinery/atmospherics/unary/generator_input/proc/return_exchange_air() + return air_contents diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index 54e49e89378..bfa2b08f908 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -10,80 +10,80 @@ var/obj/machinery/atmospherics/unary/heat_exchanger/partner = null var/update_cycle - update_icon() - if(node) - icon_state = "intact" - else - icon_state = "exposed" +/obj/machinery/atmospherics/unary/heat_exchanger/update_icon() + if(node) + icon_state = "intact" + else + icon_state = "exposed" - return + return - initialize() - if(!partner) - var/partner_connect = turn(dir,180) +/obj/machinery/atmospherics/unary/heat_exchanger/initialize() + if(!partner) + var/partner_connect = turn(dir,180) - for(var/obj/machinery/atmospherics/unary/heat_exchanger/target in get_step(src,partner_connect)) - if(target.dir & get_dir(src,target)) - partner = target - partner.partner = src - break + for(var/obj/machinery/atmospherics/unary/heat_exchanger/target in get_step(src,partner_connect)) + if(target.dir & get_dir(src,target)) + partner = target + partner.partner = src + break - ..() + ..() - process() - ..() - if(!partner) - return 0 +/obj/machinery/atmospherics/unary/heat_exchanger/process() + ..() + if(!partner) + return 0 - if(!air_master || air_master.current_cycle <= update_cycle) - return 0 + if(!air_master || air_master.current_cycle <= update_cycle) + return 0 - update_cycle = air_master.current_cycle - partner.update_cycle = air_master.current_cycle + update_cycle = air_master.current_cycle + partner.update_cycle = air_master.current_cycle - var/air_heat_capacity = air_contents.heat_capacity() - var/other_air_heat_capacity = partner.air_contents.heat_capacity() - var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity + var/air_heat_capacity = air_contents.heat_capacity() + var/other_air_heat_capacity = partner.air_contents.heat_capacity() + var/combined_heat_capacity = other_air_heat_capacity + air_heat_capacity - var/old_temperature = air_contents.temperature - var/other_old_temperature = partner.air_contents.temperature + var/old_temperature = air_contents.temperature + var/other_old_temperature = partner.air_contents.temperature - if(combined_heat_capacity > 0) - var/combined_energy = partner.air_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature + if(combined_heat_capacity > 0) + var/combined_energy = partner.air_contents.temperature*other_air_heat_capacity + air_heat_capacity*air_contents.temperature - var/new_temperature = combined_energy/combined_heat_capacity - air_contents.temperature = new_temperature - partner.air_contents.temperature = new_temperature + var/new_temperature = combined_energy/combined_heat_capacity + air_contents.temperature = new_temperature + partner.air_contents.temperature = new_temperature - if(network) - if(abs(old_temperature-air_contents.temperature) > 1) - network.update = 1 + if(network) + if(abs(old_temperature-air_contents.temperature) > 1) + network.update = 1 - if(partner.network) - if(abs(other_old_temperature-partner.air_contents.temperature) > 1) - partner.network.update = 1 + if(partner.network) + if(abs(other_old_temperature-partner.air_contents.temperature) > 1) + partner.network.update = 1 + return 1 + +/obj/machinery/atmospherics/unary/heat_exchanger/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) + if (!istype(W, /obj/item/weapon/wrench)) + return ..() + var/turf/T = src.loc + if (level==1 && isturf(T) && T.intact) + user << "\red You must remove the plating first." return 1 - - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - var/turf/T = src.loc - if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." - return 1 - var/datum/gas_mixture/int_air = return_air() - var/datum/gas_mixture/env_air = loc.return_air() - if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." - add_fingerprint(user) - return 1 - playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." - if (do_after(user, 40)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) - del(src) \ No newline at end of file + var/datum/gas_mixture/int_air = return_air() + var/datum/gas_mixture/env_air = loc.return_air() + if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) + user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + add_fingerprint(user) + return 1 + playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) + user << "\blue You begin to unfasten \the [src]..." + if (do_after(user, 40)) + user.visible_message( \ + "[user] unfastens \the [src].", \ + "\blue You have unfastened \the [src].", \ + "You hear ratchet.") + new /obj/item/pipe(loc, make_from=src) + del(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm index 2d3e9b67a8e..2837bcf188d 100644 --- a/code/ATMOSPHERICS/components/unary/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary/heat_source.dm @@ -14,30 +14,30 @@ var/current_temperature = T20C var/current_heat_capacity = 50000 //totally random - update_icon() - if(node) - icon_state = "intact_[on?("on"):("off")]" - else - icon_state = "exposed" +/obj/machinery/atmospherics/unary/heat_reservoir/update_icon() + if(node) + icon_state = "intact_[on?("on"):("off")]" + else + icon_state = "exposed" - on = 0 + on = 0 - return + return - process() - ..() - if(!on || !network) - return 0 - var/air_heat_capacity = air_contents.heat_capacity() - var/combined_heat_capacity = current_heat_capacity + air_heat_capacity - var/old_temperature = air_contents.temperature +/obj/machinery/atmospherics/unary/heat_reservoir/process() + ..() + if(!on || !network) + return 0 + var/air_heat_capacity = air_contents.heat_capacity() + var/combined_heat_capacity = current_heat_capacity + air_heat_capacity + var/old_temperature = air_contents.temperature - if(combined_heat_capacity > 0) - var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature - air_contents.temperature = combined_energy/combined_heat_capacity + if(combined_heat_capacity > 0) + var/combined_energy = current_temperature*current_heat_capacity + air_heat_capacity*air_contents.temperature + air_contents.temperature = combined_energy/combined_heat_capacity - //todo: have current temperature affected. require power to bring up current temperature again + //todo: have current temperature affected. require power to bring up current temperature again - if(abs(old_temperature-air_contents.temperature) > 1) - network.update = 1 - return 1 \ No newline at end of file + if(abs(old_temperature-air_contents.temperature) > 1) + network.update = 1 + return 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm index 9a58be7c302..805079db234 100644 --- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm +++ b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm @@ -1,4 +1,4 @@ -obj/machinery/atmospherics/unary/oxygen_generator +/obj/machinery/atmospherics/unary/oxygen_generator icon = 'icons/obj/atmospherics/oxygen_generator.dmi' icon_state = "intact_off" density = 1 @@ -13,37 +13,37 @@ obj/machinery/atmospherics/unary/oxygen_generator var/oxygen_content = 10 - update_icon() - if(node) - icon_state = "intact_[on?("on"):("off")]" - else - icon_state = "exposed_off" +/obj/machinery/atmospherics/unary/oxygen_generator/update_icon() + if(node) + icon_state = "intact_[on?("on"):("off")]" + else + icon_state = "exposed_off" - on = 0 + on = 0 - return + return - New() - ..() +/obj/machinery/atmospherics/unary/oxygen_generator/New() + ..() - air_contents.volume = 50 + air_contents.volume = 50 - process() - ..() - if(!on) - return 0 +/obj/machinery/atmospherics/unary/oxygen_generator/process() + ..() + if(!on) + return 0 - var/total_moles = air_contents.total_moles() + var/total_moles = air_contents.total_moles() - if(total_moles < oxygen_content) - var/current_heat_capacity = air_contents.heat_capacity() + if(total_moles < oxygen_content) + var/current_heat_capacity = air_contents.heat_capacity() - var/added_oxygen = oxygen_content - total_moles + var/added_oxygen = oxygen_content - total_moles - air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen) - air_contents.oxygen += added_oxygen + air_contents.temperature = (current_heat_capacity*air_contents.temperature + 20*added_oxygen*T0C)/(current_heat_capacity+20*added_oxygen) + air_contents.oxygen += added_oxygen - if(network) - network.update = 1 + if(network) + network.update = 1 - return 1 \ No newline at end of file + return 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm index 1f5c78de6cf..60fb9571d53 100644 --- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -12,102 +12,101 @@ name = "Thermal Transfer Plate" desc = "Transfers heat to and from an area" - update_icon() - var/prefix="" - //var/suffix="_idle" // Also available: _heat, _cool - if(level == 1 && istype(loc, /turf/simulated)) - prefix="h" - icon_state = "[prefix]off" +/obj/machinery/atmospherics/unary/thermal_plate/update_icon() + var/prefix="" + //var/suffix="_idle" // Also available: _heat, _cool + if(level == 1 && istype(loc, /turf/simulated)) + prefix="h" + icon_state = "[prefix]off" - process() - ..() +/obj/machinery/atmospherics/unary/thermal_plate/process() + ..() - var/datum/gas_mixture/environment = loc.return_air() + var/datum/gas_mixture/environment = loc.return_air() - //Get processable air sample and thermal info from environment + //Get processable air sample and thermal info from environment - var/transfer_moles = 0.25 * environment.total_moles() - var/datum/gas_mixture/external_removed = environment.remove(transfer_moles) + var/transfer_moles = 0.25 * environment.total_moles() + var/datum/gas_mixture/external_removed = environment.remove(transfer_moles) - if (!external_removed) - return radiate() + if (!external_removed) + return radiate() - if (external_removed.total_moles() < 10) - return radiate() + if (external_removed.total_moles() < 10) + return radiate() - //Get same info from connected gas + //Get same info from connected gas - var/internal_transfer_moles = 0.25 * air_contents.total_moles() - var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) + var/internal_transfer_moles = 0.25 * air_contents.total_moles() + var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) - if (!internal_removed) - environment.merge(external_removed) - return 1 - - var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity() - var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature - - if(!combined_heat_capacity) combined_heat_capacity = 1 - var/final_temperature = combined_energy / combined_heat_capacity - - external_removed.temperature = final_temperature + if (!internal_removed) environment.merge(external_removed) - - internal_removed.temperature = final_temperature - air_contents.merge(internal_removed) - - network.update = 1 - return 1 - hide(var/i) //to make the little pipe section invisible, the icon changes. - var/prefix="" - //var/suffix="_idle" // Also available: _heat, _cool - if(i == 1 && istype(loc, /turf/simulated)) - prefix="h" - icon_state = "[prefix]off" - return + var/combined_heat_capacity = internal_removed.heat_capacity() + external_removed.heat_capacity() + var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + external_removed.heat_capacity() * external_removed.temperature - attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - var/turf/T = src.loc - if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." - return 1 - var/datum/gas_mixture/int_air = return_air() - var/datum/gas_mixture/env_air = loc.return_air() - if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." - add_fingerprint(user) - return 1 - playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." - if (do_after(user, 40)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") - new /obj/item/pipe(loc, make_from=src) - del(src) + if(!combined_heat_capacity) combined_heat_capacity = 1 + var/final_temperature = combined_energy / combined_heat_capacity - proc/radiate() + external_removed.temperature = final_temperature + environment.merge(external_removed) - var/internal_transfer_moles = 0.25 * air_contents.total_moles() - var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) + internal_removed.temperature = final_temperature + air_contents.merge(internal_removed) - if (!internal_removed) - return 1 + network.update = 1 - var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY - var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * 6.4) + return 1 - var/final_temperature = combined_energy / combined_heat_capacity +/obj/machinery/atmospherics/unary/thermal_plate/hide(var/i) //to make the little pipe section invisible, the icon changes. + var/prefix="" + //var/suffix="_idle" // Also available: _heat, _cool + if(i == 1 && istype(loc, /turf/simulated)) + prefix="h" + icon_state = "[prefix]off" + return - internal_removed.temperature = final_temperature - air_contents.merge(internal_removed) +/obj/machinery/atmospherics/unary/thermal_plate/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) + if (!istype(W, /obj/item/weapon/wrench)) + return ..() + var/turf/T = src.loc + if (level==1 && isturf(T) && T.intact) + user << "\red You must remove the plating first." + return 1 + var/datum/gas_mixture/int_air = return_air() + var/datum/gas_mixture/env_air = loc.return_air() + if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) + user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + add_fingerprint(user) + return 1 + playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) + user << "\blue You begin to unfasten \the [src]..." + if (do_after(user, 40)) + user.visible_message( \ + "[user] unfastens \the [src].", \ + "\blue You have unfastened \the [src].", \ + "You hear ratchet.") + new /obj/item/pipe(loc, make_from=src) + del(src) - if (network) - network.update = 1 +/obj/machinery/atmospherics/unary/thermal_plate/proc/radiate() + var/internal_transfer_moles = 0.25 * air_contents.total_moles() + var/datum/gas_mixture/internal_removed = air_contents.remove(internal_transfer_moles) - return 1 \ No newline at end of file + if (!internal_removed) + return 1 + + var/combined_heat_capacity = internal_removed.heat_capacity() + RADIATION_CAPACITY + var/combined_energy = internal_removed.temperature * internal_removed.heat_capacity() + (RADIATION_CAPACITY * 6.4) + + var/final_temperature = combined_energy / combined_heat_capacity + + internal_removed.temperature = final_temperature + air_contents.merge(internal_removed) + + if (network) + network.update = 1 + + return 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index 5ec065f4ebd..65f6c7f2edb 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -9,88 +9,88 @@ var/datum/pipe_network/network - New() - ..() - initialize_directions = dir - air_contents = new +/obj/machinery/atmospherics/unary/New() + ..() + initialize_directions = dir + air_contents = new - air_contents.volume = 200 + air_contents.volume = 200 + +/obj/machinery/atmospherics/unary/Destroy() + loc = null + + if(node) + node.disconnect(src) + qdel(network) + + node = null + + return ..() // Housekeeping and pipe network stuff below - network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - if(reference == node) - network = new_network +/obj/machinery/atmospherics/unary/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) + if(reference == node) + network = new_network - if(new_network.normal_members.Find(src)) - return 0 + if(new_network.normal_members.Find(src)) + return 0 - new_network.normal_members += src + new_network.normal_members += src - return null + return null - Destroy() - loc = null +/obj/machinery/atmospherics/unary/initialize() + if(node) return - if(node) - node.disconnect(src) - qdel(network) + var/node_connect = dir + for(var/obj/machinery/atmospherics/target in get_step(src,node_connect)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node = target + break + + update_icon() + update_underlays() + +/obj/machinery/atmospherics/unary/build_network() + if(!network && node) + network = new /datum/pipe_network() + network.normal_members += src + network.build_network(node, src) + + +/obj/machinery/atmospherics/unary/return_network(obj/machinery/atmospherics/reference) + build_network() + + if(reference == node || reference == src) + return network + + return null + +/obj/machinery/atmospherics/unary/reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) + if(network == old_network) + network = new_network + + return 1 + +/obj/machinery/atmospherics/unary/return_network_air(datum/pipe_network/reference) + var/list/results = list() + + if(network == reference) + results += air_contents + + return results + +/obj/machinery/atmospherics/unary/disconnect(obj/machinery/atmospherics/reference) + if(reference==node) + del(network) node = null - return ..() + update_icon() + update_underlays() - initialize() - if(node) return - - var/node_connect = dir - - for(var/obj/machinery/atmospherics/target in get_step(src,node_connect)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node = target - break - - update_icon() - update_underlays() - - build_network() - if(!network && node) - network = new /datum/pipe_network() - network.normal_members += src - network.build_network(node, src) - - - return_network(obj/machinery/atmospherics/reference) - build_network() - - if(reference == node || reference == src) - return network - - return null - - reassign_network(datum/pipe_network/old_network, datum/pipe_network/new_network) - if(network == old_network) - network = new_network - - return 1 - - return_network_air(datum/pipe_network/reference) - var/list/results = list() - - if(network == reference) - results += air_contents - - return results - - disconnect(obj/machinery/atmospherics/reference) - if(reference==node) - del(network) - node = null - - update_icon() - update_underlays() - - return null \ No newline at end of file + return null \ No newline at end of file diff --git a/code/ATMOSPHERICS/datum_pipe_network.dm b/code/ATMOSPHERICS/datum_pipe_network.dm index 3b4cbb996e4..0b81de0ead0 100644 --- a/code/ATMOSPHERICS/datum_pipe_network.dm +++ b/code/ATMOSPHERICS/datum_pipe_network.dm @@ -1,6 +1,6 @@ var/global/list/datum/pipe_network/pipe_networks = list() -datum/pipe_network +/datum/pipe_network var/list/datum/gas_mixture/gases = list() //All of the gas_mixtures continuously connected in this network var/list/obj/machinery/atmospherics/normal_members = list() @@ -10,134 +10,134 @@ datum/pipe_network var/update = 1 var/datum/gas_mixture/air_transient = null - New() - air_transient = new() +/datum/pipe_network/New() + air_transient = new() - ..() + ..() - proc/process() - //Equalize gases amongst pipe if called for - if(update) - update = 0 - reconcile_air() //equalize_gases(gases) +/datum/pipe_network/proc/process() + //Equalize gases amongst pipe if called for + if(update) + update = 0 + reconcile_air() //equalize_gases(gases) - //Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport - //for(var/datum/pipeline/line_member in line_members) - // line_member.process() + //Give pipelines their process call for pressure checking and what not. Have to remove pressure checks for the time being as pipes dont radiate heat - Mport + //for(var/datum/pipeline/line_member in line_members) + // line_member.process() - proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference) - //Purpose: Generate membership roster - //Notes: Assuming that members will add themselves to appropriate roster in network_expand() +/datum/pipe_network/proc/build_network(obj/machinery/atmospherics/start_normal, obj/machinery/atmospherics/reference) + //Purpose: Generate membership roster + //Notes: Assuming that members will add themselves to appropriate roster in network_expand() - if(!start_normal) - qdel(src) + if(!start_normal) + qdel(src) - start_normal.network_expand(src, reference) + start_normal.network_expand(src, reference) - update_network_gases() + update_network_gases() + + if((normal_members.len>0)||(line_members.len>0)) + pipe_networks += src + else + qdel(src) + +/datum/pipe_network/proc/merge(datum/pipe_network/giver) + if(giver==src) return 0 + + normal_members |= giver.normal_members + + line_members |= giver.line_members + + for(var/obj/machinery/atmospherics/normal_member in giver.normal_members) + normal_member.reassign_network(giver, src) + + for(var/datum/pipeline/line_member in giver.line_members) + line_member.network = src + + update_network_gases() + return 1 + +/datum/pipe_network/proc/update_network_gases() + //Go through membership roster and make sure gases is up to date + + gases = list() + + for(var/obj/machinery/atmospherics/normal_member in normal_members) + var/result = normal_member.return_network_air(src) + if(result) gases += result + + for(var/datum/pipeline/line_member in line_members) + gases += line_member.air + +/datum/pipe_network/proc/reconcile_air() + //Perfectly equalize all gases members instantly + + //Calculate totals from individual components + var/total_thermal_energy = 0 + var/total_heat_capacity = 0 + + air_transient.volume = 0 + + air_transient.oxygen = 0 + air_transient.nitrogen = 0 + air_transient.toxins = 0 + air_transient.carbon_dioxide = 0 + + + air_transient.trace_gases = list() + + for(var/datum/gas_mixture/gas in gases) + air_transient.volume += gas.volume + var/temp_heatcap = gas.heat_capacity() + total_thermal_energy += gas.temperature*temp_heatcap + total_heat_capacity += temp_heatcap + + air_transient.oxygen += gas.oxygen + air_transient.nitrogen += gas.nitrogen + air_transient.toxins += gas.toxins + air_transient.carbon_dioxide += gas.carbon_dioxide + + if(gas.trace_gases.len) + for(var/datum/gas/trace_gas in gas.trace_gases) + var/datum/gas/corresponding = locate(trace_gas.type) in air_transient.trace_gases + if(!corresponding) + corresponding = new trace_gas.type() + air_transient.trace_gases += corresponding + + corresponding.moles += trace_gas.moles + + if(air_transient.volume > 0) + + if(total_heat_capacity > 0) + air_transient.temperature = total_thermal_energy/total_heat_capacity + + //Allow air mixture to react + if(air_transient.react()) + update = 1 - if((normal_members.len>0)||(line_members.len>0)) - pipe_networks += src else - qdel(src) - - proc/merge(datum/pipe_network/giver) - if(giver==src) return 0 - - normal_members |= giver.normal_members - - line_members |= giver.line_members - - for(var/obj/machinery/atmospherics/normal_member in giver.normal_members) - normal_member.reassign_network(giver, src) - - for(var/datum/pipeline/line_member in giver.line_members) - line_member.network = src - - update_network_gases() - return 1 - - proc/update_network_gases() - //Go through membership roster and make sure gases is up to date - - gases = list() - - for(var/obj/machinery/atmospherics/normal_member in normal_members) - var/result = normal_member.return_network_air(src) - if(result) gases += result - - for(var/datum/pipeline/line_member in line_members) - gases += line_member.air - - proc/reconcile_air() - //Perfectly equalize all gases members instantly - - //Calculate totals from individual components - var/total_thermal_energy = 0 - var/total_heat_capacity = 0 - - air_transient.volume = 0 - - air_transient.oxygen = 0 - air_transient.nitrogen = 0 - air_transient.toxins = 0 - air_transient.carbon_dioxide = 0 - - - air_transient.trace_gases = list() + air_transient.temperature = 0 + //Update individual gas_mixtures by volume ratio for(var/datum/gas_mixture/gas in gases) - air_transient.volume += gas.volume - var/temp_heatcap = gas.heat_capacity() - total_thermal_energy += gas.temperature*temp_heatcap - total_heat_capacity += temp_heatcap + gas.oxygen = air_transient.oxygen*gas.volume/air_transient.volume + gas.nitrogen = air_transient.nitrogen*gas.volume/air_transient.volume + gas.toxins = air_transient.toxins*gas.volume/air_transient.volume + gas.carbon_dioxide = air_transient.carbon_dioxide*gas.volume/air_transient.volume - air_transient.oxygen += gas.oxygen - air_transient.nitrogen += gas.nitrogen - air_transient.toxins += gas.toxins - air_transient.carbon_dioxide += gas.carbon_dioxide + gas.temperature = air_transient.temperature - if(gas.trace_gases.len) - for(var/datum/gas/trace_gas in gas.trace_gases) - var/datum/gas/corresponding = locate(trace_gas.type) in air_transient.trace_gases + if(air_transient.trace_gases.len) + for(var/datum/gas/trace_gas in air_transient.trace_gases) + var/datum/gas/corresponding = locate(trace_gas.type) in gas.trace_gases if(!corresponding) corresponding = new trace_gas.type() - air_transient.trace_gases += corresponding + gas.trace_gases += corresponding - corresponding.moles += trace_gas.moles + corresponding.moles = trace_gas.moles*gas.volume/air_transient.volume + return 1 - if(air_transient.volume > 0) - - if(total_heat_capacity > 0) - air_transient.temperature = total_thermal_energy/total_heat_capacity - - //Allow air mixture to react - if(air_transient.react()) - update = 1 - - else - air_transient.temperature = 0 - - //Update individual gas_mixtures by volume ratio - for(var/datum/gas_mixture/gas in gases) - gas.oxygen = air_transient.oxygen*gas.volume/air_transient.volume - gas.nitrogen = air_transient.nitrogen*gas.volume/air_transient.volume - gas.toxins = air_transient.toxins*gas.volume/air_transient.volume - gas.carbon_dioxide = air_transient.carbon_dioxide*gas.volume/air_transient.volume - - gas.temperature = air_transient.temperature - - if(air_transient.trace_gases.len) - for(var/datum/gas/trace_gas in air_transient.trace_gases) - var/datum/gas/corresponding = locate(trace_gas.type) in gas.trace_gases - if(!corresponding) - corresponding = new trace_gas.type() - gas.trace_gases += corresponding - - corresponding.moles = trace_gas.moles*gas.volume/air_transient.volume - return 1 - -proc/equalize_gases(datum/gas_mixture/list/gases) +/proc/equalize_gases(datum/gas_mixture/list/gases) //Perfectly equalize all gases members instantly //Calculate totals from individual components diff --git a/code/ATMOSPHERICS/datum_pipeline.dm b/code/ATMOSPHERICS/datum_pipeline.dm index 4b056c645e4..533633e9e14 100644 --- a/code/ATMOSPHERICS/datum_pipeline.dm +++ b/code/ATMOSPHERICS/datum_pipeline.dm @@ -1,6 +1,6 @@ #define STEFAN_BOLTZMANN_CONSTANT 0.0000000567 -datum/pipeline +/datum/pipeline var/datum/gas_mixture/air var/list/obj/machinery/atmospherics/pipe/members @@ -10,187 +10,187 @@ datum/pipeline var/alert_pressure = 0 - Destroy() - if(network) - qdel(network) +/datum/pipeline/Destroy() + if(network) + qdel(network) - if(air && air.volume) - temporarily_store_air() - qdel(air) + if(air && air.volume) + temporarily_store_air() + qdel(air) - return ..() + return ..() - proc/process()//This use to be called called from the pipe networks - - //Check to see if pressure is within acceptable limits - var/pressure = air.return_pressure() - if(pressure > alert_pressure) - for(var/obj/machinery/atmospherics/pipe/member in members) - if(!member.check_pressure(pressure)) - break //Only delete 1 pipe per process - - //Allow for reactions - //air.react() //Should be handled by pipe_network now - - proc/temporarily_store_air() - //Update individual gas_mixtures by volume ratio +/datum/pipeline/proc/process()//This use to be called called from the pipe networks + //Check to see if pressure is within acceptable limits + var/pressure = air.return_pressure() + if(pressure > alert_pressure) for(var/obj/machinery/atmospherics/pipe/member in members) - member.air_temporary = new - member.air_temporary.volume = member.volume + if(!member.check_pressure(pressure)) + break //Only delete 1 pipe per process - member.air_temporary.oxygen = air.oxygen*member.volume/air.volume - member.air_temporary.nitrogen = air.nitrogen*member.volume/air.volume - member.air_temporary.toxins = air.toxins*member.volume/air.volume - member.air_temporary.carbon_dioxide = air.carbon_dioxide*member.volume/air.volume + //Allow for reactions + //air.react() //Should be handled by pipe_network now - member.air_temporary.temperature = air.temperature +/datum/pipeline/proc/temporarily_store_air() + //Update individual gas_mixtures by volume ratio - if(air.trace_gases.len) - for(var/datum/gas/trace_gas in air.trace_gases) - var/datum/gas/corresponding = new trace_gas.type() - member.air_temporary.trace_gases += corresponding + for(var/obj/machinery/atmospherics/pipe/member in members) + member.air_temporary = new + member.air_temporary.volume = member.volume - corresponding.moles = trace_gas.moles*member.volume/air.volume + member.air_temporary.oxygen = air.oxygen*member.volume/air.volume + member.air_temporary.nitrogen = air.nitrogen*member.volume/air.volume + member.air_temporary.toxins = air.toxins*member.volume/air.volume + member.air_temporary.carbon_dioxide = air.carbon_dioxide*member.volume/air.volume - proc/build_pipeline(obj/machinery/atmospherics/pipe/base) + member.air_temporary.temperature = air.temperature + + if(air.trace_gases.len) + for(var/datum/gas/trace_gas in air.trace_gases) + var/datum/gas/corresponding = new trace_gas.type() + member.air_temporary.trace_gases += corresponding + + corresponding.moles = trace_gas.moles*member.volume/air.volume + +/datum/pipeline/proc/build_pipeline(obj/machinery/atmospherics/pipe/base) + air = new + + var/list/possible_expansions = list(base) + members = list(base) + edges = list() + + var/volume = base.volume + base.parent = src + alert_pressure = base.alert_pressure + + if(base.air_temporary) + air = base.air_temporary + base.air_temporary = null + else air = new - var/list/possible_expansions = list(base) - members = list(base) - edges = list() + while(possible_expansions.len>0) + for(var/obj/machinery/atmospherics/pipe/borderline in possible_expansions) - var/volume = base.volume - base.parent = src - alert_pressure = base.alert_pressure + var/list/result = borderline.pipeline_expansion() + var/edge_check = result.len - if(base.air_temporary) - air = base.air_temporary - base.air_temporary = null - else - air = new + if(result.len>0) + for(var/obj/machinery/atmospherics/pipe/item in result) + if(!members.Find(item)) + members += item + possible_expansions += item - while(possible_expansions.len>0) - for(var/obj/machinery/atmospherics/pipe/borderline in possible_expansions) + volume += item.volume + item.parent = src - var/list/result = borderline.pipeline_expansion() - var/edge_check = result.len + alert_pressure = min(alert_pressure, item.alert_pressure) - if(result.len>0) - for(var/obj/machinery/atmospherics/pipe/item in result) - if(!members.Find(item)) - members += item - possible_expansions += item + if(item.air_temporary) + air.merge(item.air_temporary) - volume += item.volume - item.parent = src + edge_check-- - alert_pressure = min(alert_pressure, item.alert_pressure) + if(edge_check>0) + edges += borderline - if(item.air_temporary) - air.merge(item.air_temporary) + possible_expansions -= borderline - edge_check-- + air.volume = volume - if(edge_check>0) - edges += borderline +/datum/pipeline/proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - possible_expansions -= borderline + if(new_network.line_members.Find(src)) + return 0 - air.volume = volume + new_network.line_members += src - proc/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) + network = new_network - if(new_network.line_members.Find(src)) - return 0 + for(var/obj/machinery/atmospherics/pipe/edge in edges) + for(var/obj/machinery/atmospherics/result in edge.pipeline_expansion()) + if(!istype(result,/obj/machinery/atmospherics/pipe) && (result!=reference)) + result.network_expand(new_network, edge) - new_network.line_members += src + return 1 - network = new_network +/datum/pipeline/proc/return_network(obj/machinery/atmospherics/reference) + if(!network) + network = new /datum/pipe_network() + network.build_network(src, null) + //technically passing these parameters should not be allowed + //however pipe_network.build_network(..) and pipeline.network_extend(...) + // were setup to properly handle this case - for(var/obj/machinery/atmospherics/pipe/edge in edges) - for(var/obj/machinery/atmospherics/result in edge.pipeline_expansion()) - if(!istype(result,/obj/machinery/atmospherics/pipe) && (result!=reference)) - result.network_expand(new_network, edge) + return network - return 1 +/datum/pipeline/proc/mingle_with_turf(turf/simulated/target, mingle_volume) + var/datum/gas_mixture/air_sample = air.remove_ratio(mingle_volume/air.volume) + air_sample.volume = mingle_volume - proc/return_network(obj/machinery/atmospherics/reference) - if(!network) - network = new /datum/pipe_network() - network.build_network(src, null) - //technically passing these parameters should not be allowed - //however pipe_network.build_network(..) and pipeline.network_extend(...) - // were setup to properly handle this case + var/datum/gas_mixture/turf_air = target.return_air() - return network + equalize_gases(list(air_sample, turf_air)) + air.merge(air_sample) + //turf_air already modified by equalize_gases() - proc/mingle_with_turf(turf/simulated/target, mingle_volume) - var/datum/gas_mixture/air_sample = air.remove_ratio(mingle_volume/air.volume) - air_sample.volume = mingle_volume + if(istype(target)) + if(target.air) + if(target.air.check_tile_graphic()) + target.update_visuals(target.air) + if(network) + network.update = 1 - var/datum/gas_mixture/turf_air = target.return_air() +/datum/pipeline/proc/temperature_interact(turf/target, share_volume, thermal_conductivity) + var/total_heat_capacity = air.heat_capacity() + var/partial_heat_capacity = total_heat_capacity*(share_volume/air.volume) - equalize_gases(list(air_sample, turf_air)) - air.merge(air_sample) - //turf_air already modified by equalize_gases() + if(istype(target, /turf/simulated)) + var/turf/simulated/modeled_location = target - if(istype(target)) - if(target.air) - if(target.air.check_tile_graphic()) - target.update_visuals(target.air) - if(network) - network.update = 1 + if(modeled_location.blocks_air) - proc/temperature_interact(turf/target, share_volume, thermal_conductivity) - var/total_heat_capacity = air.heat_capacity() - var/partial_heat_capacity = total_heat_capacity*(share_volume/air.volume) - - if(istype(target, /turf/simulated)) - var/turf/simulated/modeled_location = target - - if(modeled_location.blocks_air) - - if((modeled_location.heat_capacity>0) && (partial_heat_capacity>0)) - var/delta_temperature = air.temperature - modeled_location.temperature - - var/heat = thermal_conductivity*delta_temperature* \ - (partial_heat_capacity*modeled_location.heat_capacity/(partial_heat_capacity+modeled_location.heat_capacity)) - - air.temperature -= heat/total_heat_capacity - modeled_location.temperature += heat/modeled_location.heat_capacity - - else - var/delta_temperature = 0 - var/sharer_heat_capacity = 0 - - delta_temperature = (air.temperature - modeled_location.air.temperature) - sharer_heat_capacity = modeled_location.air.heat_capacity() - - var/self_temperature_delta = 0 - var/sharer_temperature_delta = 0 - - if((sharer_heat_capacity>0) && (partial_heat_capacity>0)) - var/heat = thermal_conductivity*delta_temperature* \ - (partial_heat_capacity*sharer_heat_capacity/(partial_heat_capacity+sharer_heat_capacity)) - - self_temperature_delta = -heat/total_heat_capacity - sharer_temperature_delta = heat/sharer_heat_capacity - else - return 1 - - air.temperature += self_temperature_delta - - modeled_location.air.temperature += sharer_temperature_delta - - - else - if((target.heat_capacity>0) && (partial_heat_capacity>0)) - var/delta_temperature = air.temperature - target.temperature + if((modeled_location.heat_capacity>0) && (partial_heat_capacity>0)) + var/delta_temperature = air.temperature - modeled_location.temperature var/heat = thermal_conductivity*delta_temperature* \ - (partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity)) + (partial_heat_capacity*modeled_location.heat_capacity/(partial_heat_capacity+modeled_location.heat_capacity)) air.temperature -= heat/total_heat_capacity - if(network) - network.update = 1 \ No newline at end of file + modeled_location.temperature += heat/modeled_location.heat_capacity + + else + var/delta_temperature = 0 + var/sharer_heat_capacity = 0 + + delta_temperature = (air.temperature - modeled_location.air.temperature) + sharer_heat_capacity = modeled_location.air.heat_capacity() + + var/self_temperature_delta = 0 + var/sharer_temperature_delta = 0 + + if((sharer_heat_capacity>0) && (partial_heat_capacity>0)) + var/heat = thermal_conductivity*delta_temperature* \ + (partial_heat_capacity*sharer_heat_capacity/(partial_heat_capacity+sharer_heat_capacity)) + + self_temperature_delta = -heat/total_heat_capacity + sharer_temperature_delta = heat/sharer_heat_capacity + else + return 1 + + air.temperature += self_temperature_delta + + modeled_location.air.temperature += sharer_temperature_delta + + + else + if((target.heat_capacity>0) && (partial_heat_capacity>0)) + var/delta_temperature = air.temperature - target.temperature + + var/heat = thermal_conductivity*delta_temperature* \ + (partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity)) + + air.temperature -= heat/total_heat_capacity + if(network) + network.update = 1 \ No newline at end of file diff --git a/code/ATMOSPHERICS/he_pipes.dm b/code/ATMOSPHERICS/he_pipes.dm index ab6e2e2c8eb..e69de29bb2d 100644 --- a/code/ATMOSPHERICS/he_pipes.dm +++ b/code/ATMOSPHERICS/he_pipes.dm @@ -1,119 +0,0 @@ - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging - icon = 'icons/atmos/heat.dmi' - icon_state = "intact" - pipe_icon = "hepipe" - level = 2 - var/initialize_directions_he - var/surface = 2 - - minimum_temperature_difference = 20 - thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process() - if(!parent) - ..() - else - var/environment_temperature = 0 - 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 - var/datum/gas_mixture/pipe_air = return_air() - if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference) - parent.temperature_interact(loc, volume, thermal_conductivity) - - - -// BubbleWrap -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New() - ..() - initialize_directions_he = initialize_directions // The auto-detection from /pipe is good enough for a simple HE pipe - // BubbleWrap END - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/initialize() - normalize_dir() - var/node1_dir - var/node2_dir - - for(var/direction in cardinal) - if(direction&initialize_directions_he) - if (!node1_dir) - node1_dir = direction - else if (!node2_dir) - node2_dir = direction - - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node1_dir)) - if(target.initialize_directions_he & get_dir(target,src)) - node1 = target - break - for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node2_dir)) - if(target.initialize_directions_he & get_dir(target,src)) - node2 = target - break - - if(!node1 && !node2) - del(src) - return - - update_icon() - return - - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/hidden - level=1 - icon_state="intact-f" - -///////////////////////////////// -// JUNCTION -///////////////////////////////// -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction - icon = 'icons/atmos/junction.dmi' - icon_state = "intact" - pipe_icon = "hejunction" - level = 2 - minimum_temperature_difference = 300 - thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT - - // BubbleWrap -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/New() - .. () - 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 - // BubbleWrap END - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/initialize() - 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 - - if(!node1 && !node2) - qdel(src) - return - - update_icon() - return - -/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/hidden - level=1 - icon_state="intact-f" diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm index e01ca491233..7ef76d8dc0e 100644 --- a/code/ATMOSPHERICS/pipes.dm +++ b/code/ATMOSPHERICS/pipes.dm @@ -1,128 +1,3 @@ -/obj/machinery/atmospherics/pipe - - var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke - var/datum/pipeline/parent - - var/volume = 0 - var/frozen = 0 // used by the pipe freezer - force = 20 - - layer = 2.4 //under wires with their 2.44 - use_power = 0 - - var/alert_pressure = 80*ONE_ATMOSPHERE - //minimum pressure before check_pressure(...) should be called -/obj/machinery/atmospherics/pipe/New() - ..() - //so pipes under walls are hidden - 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/proc/pipeline_expansion() - return null - -/obj/machinery/atmospherics/pipe/proc/check_pressure(pressure) - //Return 1 if parent should continue checking other pipes - //Return null if parent should stop checking other pipes. Recall: del(src) will by default return null - - return 1 - -/obj/machinery/atmospherics/pipe/return_air() - if(!parent) - parent = new /datum/pipeline() - parent.build_pipeline(src) - - return parent.air - -/obj/machinery/atmospherics/pipe/build_network() - if(!parent) - parent = new /datum/pipeline() - parent.build_pipeline(src) - - return parent.return_network() - -/obj/machinery/atmospherics/pipe/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) - if(!parent) - parent = new /datum/pipeline() - parent.build_pipeline(src) - - return parent.network_expand(new_network, reference) - -/obj/machinery/atmospherics/pipe/return_network(obj/machinery/atmospherics/reference) - if(!parent) - parent = new /datum/pipeline() - parent.build_pipeline(src) - - return parent.return_network(reference) - - -/obj/machinery/atmospherics/pipe/Destroy() - qdel(parent) - if(air_temporary && loc) - loc.assume_air(air_temporary) - - return ..() - -/obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) - if (istype(src, /obj/machinery/atmospherics/pipe/tank)) - return ..() - if (istype(src, /obj/machinery/atmospherics/pipe/vent)) - return ..() - - if(istype(W,/obj/item/device/pipe_painter)) - return 0 - - if (istype(W, /obj/item/device/pipe_freezer)) - if(!src.frozen) // If the pipe is not already frozen - user << "\red You begin to freeze the [src]" - if (do_after(user, 60)) - user.visible_message( \ - "[user] freezes \the [src].", \ - "\blue You finished freezing \the [src].", \ - "You hear the hiss of gas.") - src.frozen = 1 - spawn (200) - src.frozen = 0 - src.visible_message( \ - "\the ice arounds the [src] melts.", \ - "\blue Your frozen [src] has thawed.", \ - "You hear dripping water.") - - add_fingerprint(user) - return 1 - - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - var/turf/T = src.loc - if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." - return 1 - - var/datum/gas_mixture/int_air = return_air() - var/datum/gas_mixture/env_air = loc.return_air() - if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - if (!src.frozen) // If the pipe is not frozen - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." - add_fingerprint(user) - return 1 - playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." - if (do_after(user, 40)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") - var/obj/item/P = new /obj/item/pipe(loc, make_from=src) - for (var/obj/machinery/meter/meter in T) - if (meter.target == src) - new /obj/item/pipe_meter(T) - del(meter) - if(P) - transfer_fingerprints_to(P) - P.add_fingerprint(user) - qdel(src) - return 1 - /obj/machinery/atmospherics/proc/change_color(var/new_color) //only pass valid pipe colors please ~otherwise your pipe will turn invisible if(!pipe_color_check(new_color)) @@ -146,329 +21,6 @@ return null */ -/obj/machinery/atmospherics/pipe/color_cache_name(var/obj/machinery/atmospherics/node) - if(istype(src, /obj/machinery/atmospherics/pipe/tank)) - return ..() - - if(istype(node, /obj/machinery/atmospherics/pipe/manifold) || istype(node, /obj/machinery/atmospherics/pipe/manifold4w)) - if(pipe_color == node.pipe_color) - return node.pipe_color - else - return null - else if(istype(node, /obj/machinery/atmospherics/pipe/simple)) - return node.pipe_color - else - return pipe_color - -/obj/machinery/atmospherics/pipe/simple - icon = 'icons/atmos/pipes.dmi' - icon_state = "" - var/pipe_icon = "" //what kind of pipe it is and from which dmi is the icon manager getting its icons, "" for simple pipes, "hepipe" for HE pipes, "hejunction" for HE junctions - name = "pipe" - desc = "A one meter section of regular pipe" - - volume = 70 - - dir = SOUTH - initialize_directions = SOUTH|NORTH - - var/obj/machinery/atmospherics/node1 - var/obj/machinery/atmospherics/node2 - - 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 - - level = 1 - -/obj/machinery/atmospherics/pipe/simple/New() - ..() - - // 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. - icon = null - alpha = 255 - - switch(dir) - if(SOUTH || NORTH) - initialize_directions = SOUTH|NORTH - if(EAST || 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/hide(var/i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/atmospherics/pipe/simple/process() - if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle - ..() - else - . = PROCESS_KILL - -/obj/machinery/atmospherics/pipe/simple/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 - -/obj/machinery/atmospherics/pipe/simple/proc/burst() - src.visible_message("\red \bold [src] bursts!"); - playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) - var/datum/effect/effect/system/harmless_smoke_spread/smoke = new - smoke.set_up(1,0, src.loc, 0) - smoke.start() - del(src) - -/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() - if(dir==3) - dir = 1 - else if(dir==12) - dir = 4 - -/obj/machinery/atmospherics/pipe/simple/Destroy() - if(node1) - node1.disconnect(src) - if(node2) - node2.disconnect(src) - - return ..() - -/obj/machinery/atmospherics/pipe/simple/pipeline_expansion() - return list(node1, node2) - -/obj/machinery/atmospherics/pipe/simple/change_color(var/new_color) - ..() - //for updating connected atmos device pipes (i.e. vents, manifolds, etc) - if(node1) - node1.update_underlays() - if(node2) - node2.update_underlays() - -/obj/machinery/atmospherics/pipe/simple/update_icon(var/safety = 0) - if(!check_icon_cache()) - return - - alpha = 255 - - overlays.Cut() - - if(!node1 && !node2) - var/turf/T = get_turf(src) - new /obj/item/pipe(loc, make_from=src) - for (var/obj/machinery/meter/meter in T) - if (meter.target == src) - new /obj/item/pipe_meter(T) - del(meter) - qdel(src) - else if(node1 && node2) - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type) - else - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "exposed[node1?1:0][node2?1:0]" + icon_connect_type) - -/obj/machinery/atmospherics/pipe/simple/update_underlays() - return - -/obj/machinery/atmospherics/pipe/simple/initialize() - normalize_dir() - var/node1_dir - var/node2_dir - - for(var/direction in cardinal) - if(direction&initialize_directions) - if (!node1_dir) - node1_dir = direction - else if (!node2_dir) - node2_dir = direction - - for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node1 = target - break - for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node2 = target - break - - if(!node1 && !node2) - qdel(src) - return - - var/turf/T = get_turf(src) - if(istype(T)) - hide(T.intact) - update_icon() - -/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) - node1 = null - - if(reference == node2) - if(istype(node2, /obj/machinery/atmospherics/pipe)) - del(parent) - node2 = null - - update_icon() - - return null - -/obj/machinery/atmospherics/pipe/simple/visible - icon_state = "intact" - level = 2 - -/obj/machinery/atmospherics/pipe/simple/visible/scrubbers - name = "Scrubbers pipe" - desc = "A one meter section of scrubbers pipe" - icon_state = "intact-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/simple/visible/supply - name = "Air supply pipe" - desc = "A one meter section of supply pipe" - icon_state = "intact-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/simple/visible/yellow - color = PIPE_COLOR_YELLOW - -/obj/machinery/atmospherics/pipe/simple/visible/cyan - color = PIPE_COLOR_CYAN - -/obj/machinery/atmospherics/pipe/simple/visible/green - color = PIPE_COLOR_GREEN - -/obj/machinery/atmospherics/pipe/simple/visible/purple - color = PIPE_COLOR_PURPLE - -/obj/machinery/atmospherics/pipe/simple/hidden - icon_state = "intact" - level = 1 - alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game - -/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers - name = "Scrubbers pipe" - desc = "A one meter section of scrubbers pipe" - icon_state = "intact-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/simple/hidden/supply - name = "Air supply pipe" - desc = "A one meter section of supply pipe" - icon_state = "intact-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/simple/visible/universal - name="Universal pipe adapter" - desc = "An adapter for regular, supply and scrubbers pipes" - connect_types = list(1,2,3) - icon_state = "map_universal" - -/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(var/safety = 0) - if(!check_icon_cache()) - return - - alpha = 255 - - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") - underlays.Cut() - - if (node1) - universal_underlays(node1) - if(node2) - universal_underlays(node2) - else - var/node1_dir = get_dir(node1,src) - universal_underlays(,node1_dir) - else if (node2) - universal_underlays(node2) - else - universal_underlays(,dir) - universal_underlays(,turn(dir, -180)) - -/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays() - ..() - update_icon() - - - -/obj/machinery/atmospherics/pipe/simple/hidden/universal - name="Universal pipe adapter" - desc = "An adapter for regular, supply and scrubbers pipes" - connect_types = list(1,2,3) - icon_state = "map_universal" - -/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(var/safety = 0) - if(!check_icon_cache()) - return - - alpha = 255 - - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") - underlays.Cut() - - if (node1) - universal_underlays(node1) - if(node2) - universal_underlays(node2) - else - var/node2_dir = turn(get_dir(src,node1),-180) - universal_underlays(,node2_dir) - else if (node2) - universal_underlays(node2) - var/node1_dir = turn(get_dir(src,node2),-180) - universal_underlays(,node1_dir) - else - universal_underlays(,dir) - universal_underlays(,turn(dir, -180)) - -/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays() - ..() - update_icon() - /obj/machinery/atmospherics/proc/universal_underlays(var/obj/machinery/atmospherics/node, var/direction) var/turf/T = get_turf(src) if(!istype(T)) return @@ -498,934 +50,4 @@ else underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "intact" + icon_connect_type) else - underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type) - -/obj/machinery/atmospherics/pipe/simple/hidden/yellow - color = PIPE_COLOR_YELLOW - -/obj/machinery/atmospherics/pipe/simple/hidden/cyan - color = PIPE_COLOR_CYAN - -/obj/machinery/atmospherics/pipe/simple/hidden/green - color = PIPE_COLOR_GREEN - -/obj/machinery/atmospherics/pipe/simple/hidden/purple - color = PIPE_COLOR_PURPLE - -/obj/machinery/atmospherics/pipe/simple/insulated - icon = 'icons/obj/atmospherics/red_pipe.dmi' - icon_state = "intact" - - minimum_temperature_difference = 10000 - thermal_conductivity = 0 - maximum_pressure = 1000*ONE_ATMOSPHERE - fatigue_pressure = 900*ONE_ATMOSPHERE - alert_pressure = 900*ONE_ATMOSPHERE - - level = 2 - - -/obj/machinery/atmospherics/pipe/manifold - icon = 'icons/atmos/manifold.dmi' - icon_state = "" - name = "pipe manifold" - desc = "A manifold composed of regular pipes" - - volume = 105 - - 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() - ..() - alpha = 255 - icon = null - - switch(dir) - if(NORTH) - initialize_directions = EAST|SOUTH|WEST - if(SOUTH) - initialize_directions = WEST|NORTH|EAST - if(EAST) - initialize_directions = SOUTH|WEST|NORTH - if(WEST) - initialize_directions = NORTH|EAST|SOUTH - -/obj/machinery/atmospherics/pipe/manifold/hide(var/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/process() - if(!parent) - ..() - else - . = PROCESS_KILL - -/obj/machinery/atmospherics/pipe/manifold/Destroy() - if(node1) - node1.disconnect(src) - if(node2) - node2.disconnect(src) - if(node3) - node3.disconnect(src) - - return ..() - -/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) - node1 = null - - if(reference == node2) - if(istype(node2, /obj/machinery/atmospherics/pipe)) - del(parent) - node2 = null - - if(reference == node3) - if(istype(node3, /obj/machinery/atmospherics/pipe)) - del(parent) - node3 = null - - update_icon() - - ..() - -/obj/machinery/atmospherics/pipe/manifold/change_color(var/new_color) - ..() - //for updating connected atmos device pipes (i.e. vents, manifolds, etc) - if(node1) - node1.update_underlays() - if(node2) - node2.update_underlays() - if(node3) - node3.update_underlays() - -/obj/machinery/atmospherics/pipe/manifold/update_icon(var/safety = 0) - if(!check_icon_cache()) - return - - alpha = 255 - - if(!node1 && !node2 && !node3) - var/turf/T = get_turf(src) - new /obj/item/pipe(loc, make_from=src) - for (var/obj/machinery/meter/meter in T) - if (meter.target == src) - new /obj/item/pipe_meter(T) - del(meter) - qdel(src) - else - overlays.Cut() - overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type) - overlays += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type) - underlays.Cut() - - var/turf/T = get_turf(src) - if(!istype(T)) return - var/list/directions = list(NORTH, SOUTH, EAST, WEST) - var/node1_direction = get_dir(src, node1) - var/node2_direction = get_dir(src, node2) - var/node3_direction = get_dir(src, node3) - - directions -= dir - - directions -= add_underlay(T,node1,node1_direction,icon_connect_type) - directions -= add_underlay(T,node2,node2_direction,icon_connect_type) - directions -= add_underlay(T,node3,node3_direction,icon_connect_type) - - for(var/D in directions) - add_underlay(T,,D,icon_connect_type) - -/obj/machinery/atmospherics/pipe/manifold/update_underlays() - ..() - update_icon() - -/obj/machinery/atmospherics/pipe/manifold/initialize() - var/connect_directions = (NORTH|SOUTH|EAST|WEST)&(~dir) - - for(var/direction in cardinal) - if(direction&connect_directions) - for(var/obj/machinery/atmospherics/target in get_step(src,direction)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node1 = target - connect_directions &= ~direction - break - if (node1) - break - - - for(var/direction in cardinal) - if(direction&connect_directions) - for(var/obj/machinery/atmospherics/target in get_step(src,direction)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node2 = target - connect_directions &= ~direction - break - if (node2) - break - - - for(var/direction in cardinal) - if(direction&connect_directions) - for(var/obj/machinery/atmospherics/target in get_step(src,direction)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node3 = target - connect_directions &= ~direction - break - if (node3) - break - - if(!node1 && !node2 && !node3) - del(src) - return - - var/turf/T = get_turf(src) - if(istype(T)) - hide(T.intact) - update_icon() - -/obj/machinery/atmospherics/pipe/manifold/visible - icon_state = "map" - level = 2 - -/obj/machinery/atmospherics/pipe/manifold/visible/scrubbers - name="Scrubbers pipe manifold" - desc = "A manifold composed of scrubbers pipes" - icon_state = "map-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/manifold/visible/supply - name="Air supply pipe manifold" - desc = "A manifold composed of supply pipes" - icon_state = "map-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/manifold/visible/yellow - color = PIPE_COLOR_YELLOW - -/obj/machinery/atmospherics/pipe/manifold/visible/cyan - color = PIPE_COLOR_CYAN - -/obj/machinery/atmospherics/pipe/manifold/visible/green - color = PIPE_COLOR_GREEN - -/obj/machinery/atmospherics/pipe/manifold/visible/purple - color = PIPE_COLOR_PURPLE - -/obj/machinery/atmospherics/pipe/manifold/hidden - icon_state = "map" - level = 1 - alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game - -/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers - name="Scrubbers pipe manifold" - desc = "A manifold composed of scrubbers pipes" - icon_state = "map-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/manifold/hidden/supply - name="Air supply pipe manifold" - desc = "A manifold composed of supply pipes" - icon_state = "map-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/manifold/hidden/yellow - color = PIPE_COLOR_YELLOW - -/obj/machinery/atmospherics/pipe/manifold/hidden/cyan - color = PIPE_COLOR_CYAN - -/obj/machinery/atmospherics/pipe/manifold/hidden/green - color = PIPE_COLOR_GREEN - -/obj/machinery/atmospherics/pipe/manifold/hidden/purple - color = PIPE_COLOR_PURPLE - -/obj/machinery/atmospherics/pipe/manifold4w - icon = 'icons/atmos/manifold.dmi' - icon_state = "" - name = "4-way pipe manifold" - desc = "A manifold composed of regular pipes" - - volume = 140 - - dir = SOUTH - initialize_directions = NORTH|SOUTH|EAST|WEST - - var/obj/machinery/atmospherics/node1 - var/obj/machinery/atmospherics/node2 - var/obj/machinery/atmospherics/node3 - var/obj/machinery/atmospherics/node4 - - level = 1 - layer = 2.4 //under wires with their 2.44 - -/obj/machinery/atmospherics/pipe/manifold4w/New() - ..() - alpha = 255 - icon = null - -/obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion() - return list(node1, node2, node3, node4) - -/obj/machinery/atmospherics/pipe/manifold4w/process() - if(!parent) - ..() - else - . = PROCESS_KILL - -/obj/machinery/atmospherics/pipe/manifold4w/Destroy() - if(node1) - node1.disconnect(src) - if(node2) - node2.disconnect(src) - if(node3) - node3.disconnect(src) - if(node4) - node4.disconnect(src) - - return ..() - -/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) - node1 = null - - if(reference == node2) - if(istype(node2, /obj/machinery/atmospherics/pipe)) - del(parent) - node2 = null - - if(reference == node3) - if(istype(node3, /obj/machinery/atmospherics/pipe)) - del(parent) - node3 = null - - if(reference == node4) - if(istype(node4, /obj/machinery/atmospherics/pipe)) - del(parent) - node4 = null - - update_icon() - - ..() - -/obj/machinery/atmospherics/pipe/manifold4w/change_color(var/new_color) - ..() - //for updating connected atmos device pipes (i.e. vents, manifolds, etc) - if(node1) - node1.update_underlays() - if(node2) - node2.update_underlays() - if(node3) - node3.update_underlays() - if(node4) - node4.update_underlays() - -/obj/machinery/atmospherics/pipe/manifold4w/update_icon(var/safety = 0) - if(!check_icon_cache()) - return - - alpha = 255 - - if(!node1 && !node2 && !node3 && !node4) - var/turf/T = get_turf(src) - new /obj/item/pipe(loc, make_from=src) - for (var/obj/machinery/meter/meter in T) - if (meter.target == src) - new /obj/item/pipe_meter(T) - del(meter) - qdel(src) - else - overlays.Cut() - overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type) - overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) - underlays.Cut() - - /* - var/list/directions = list(NORTH, SOUTH, EAST, WEST) - - directions -= add_underlay(node1) - directions -= add_underlay(node2) - directions -= add_underlay(node3) - directions -= add_underlay(node4) - - for(var/D in directions) - add_underlay(,D) - */ - - var/turf/T = get_turf(src) - if(!istype(T)) return - var/list/directions = list(NORTH, SOUTH, EAST, WEST) - var/node1_direction = get_dir(src, node1) - var/node2_direction = get_dir(src, node2) - var/node3_direction = get_dir(src, node3) - var/node4_direction = get_dir(src, node4) - - directions -= dir - - directions -= add_underlay(T,node1,node1_direction,icon_connect_type) - directions -= add_underlay(T,node2,node2_direction,icon_connect_type) - directions -= add_underlay(T,node3,node3_direction,icon_connect_type) - directions -= add_underlay(T,node4,node4_direction,icon_connect_type) - - for(var/D in directions) - add_underlay(T,,D,icon_connect_type) - -/obj/machinery/atmospherics/pipe/manifold4w/update_underlays() - ..() - update_icon() - -/obj/machinery/atmospherics/pipe/manifold4w/hide(var/i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/atmospherics/pipe/manifold4w/initialize() - - for(var/obj/machinery/atmospherics/target in get_step(src,1)) - if(target.initialize_directions & 2) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node1 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,2)) - if(target.initialize_directions & 1) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node2 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,4)) - if(target.initialize_directions & 8) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node3 = target - break - - for(var/obj/machinery/atmospherics/target in get_step(src,8)) - if(target.initialize_directions & 4) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node4 = target - break - - if(!node1 && !node2 && !node3&& !node4) - del(src) - return - - var/turf/T = get_turf(src) - if(istype(T)) - hide(T.intact) - update_icon() - -/obj/machinery/atmospherics/pipe/manifold4w/visible - icon_state = "map_4way" - level = 2 - -/obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers - name="4-way scrubbers pipe manifold" - desc = "A manifold composed of scrubbers pipes" - icon_state = "map_4way-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/manifold4w/visible/supply - name="4-way air supply pipe manifold" - desc = "A manifold composed of supply pipes" - icon_state = "map_4way-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/manifold4w/visible/yellow - color = PIPE_COLOR_YELLOW - -/obj/machinery/atmospherics/pipe/manifold4w/visible/cyan - color = PIPE_COLOR_CYAN - -/obj/machinery/atmospherics/pipe/manifold4w/visible/green - color = PIPE_COLOR_GREEN - -/obj/machinery/atmospherics/pipe/manifold4w/visible/purple - color = PIPE_COLOR_PURPLE - -/obj/machinery/atmospherics/pipe/manifold4w/hidden - icon_state = "map_4way" - level = 1 - alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game - -/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers - name="4-way scrubbers pipe manifold" - desc = "A manifold composed of scrubbers pipes" - icon_state = "map_4way-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply - name="4-way air supply pipe manifold" - desc = "A manifold composed of supply pipes" - icon_state = "map_4way-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/manifold4w/hidden/yellow - color = PIPE_COLOR_YELLOW - -/obj/machinery/atmospherics/pipe/manifold4w/hidden/cyan - color = PIPE_COLOR_CYAN - -/obj/machinery/atmospherics/pipe/manifold4w/hidden/green - color = PIPE_COLOR_GREEN - -/obj/machinery/atmospherics/pipe/manifold4w/hidden/purple - color = PIPE_COLOR_PURPLE - -/obj/machinery/atmospherics/pipe/cap - name = "pipe endcap" - desc = "An endcap for pipes" - icon = 'icons/atmos/pipes.dmi' - icon_state = "cap" - level = 2 - layer = 2.4 //under wires with their 2.44 - - volume = 35 - - dir = SOUTH - initialize_directions = SOUTH - - var/obj/machinery/atmospherics/node - -/obj/machinery/atmospherics/pipe/cap/New() - ..() - initialize_directions = dir - -/obj/machinery/atmospherics/pipe/cap/hide(var/i) - if(level == 1 && istype(loc, /turf/simulated)) - invisibility = i ? 101 : 0 - update_icon() - -/obj/machinery/atmospherics/pipe/cap/pipeline_expansion() - return list(node) - -/obj/machinery/atmospherics/pipe/cap/process() - if(!parent) - ..() - else - . = PROCESS_KILL -/obj/machinery/atmospherics/pipe/cap/Destroy() - if(node) - node.disconnect(src) - - return ..() - -/obj/machinery/atmospherics/pipe/cap/disconnect(obj/machinery/atmospherics/reference) - if(reference == node) - if(istype(node, /obj/machinery/atmospherics/pipe)) - del(parent) - node = null - - update_icon() - - ..() - -/obj/machinery/atmospherics/pipe/cap/change_color(var/new_color) - ..() - //for updating connected atmos device pipes (i.e. vents, manifolds, etc) - if(node) - node.update_underlays() - -/obj/machinery/atmospherics/pipe/cap/update_icon(var/safety = 0) - if(!check_icon_cache()) - return - - alpha = 255 - - overlays.Cut() - overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type) - -/obj/machinery/atmospherics/pipe/cap/initialize() - for(var/obj/machinery/atmospherics/target in get_step(src, dir)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node = target - break - - var/turf/T = get_turf(src) // hide if turf is not intact - if(!istype(T)) return - hide(T.intact) - update_icon() - -/obj/machinery/atmospherics/pipe/cap/visible - level = 2 - icon_state = "cap" - -/obj/machinery/atmospherics/pipe/cap/visible/scrubbers - name = "scrubbers pipe endcap" - desc = "An endcap for scrubbers pipes" - icon_state = "cap-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/cap/visible/supply - name = "supply pipe endcap" - desc = "An endcap for supply pipes" - icon_state = "cap-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/obj/machinery/atmospherics/pipe/cap/hidden - level = 1 - icon_state = "cap" - alpha = 128 - -/obj/machinery/atmospherics/pipe/cap/hidden/scrubbers - name = "scrubbers pipe endcap" - desc = "An endcap for scrubbers pipes" - icon_state = "cap-scrubbers" - connect_types = list(3) - layer = 2.38 - icon_connect_type = "-scrubbers" - color = PIPE_COLOR_RED - -/obj/machinery/atmospherics/pipe/cap/hidden/supply - name = "supply pipe endcap" - desc = "An endcap for supply pipes" - icon_state = "cap-supply" - connect_types = list(2) - layer = 2.39 - icon_connect_type = "-supply" - color = PIPE_COLOR_BLUE - -/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 - - level = 1 - dir = SOUTH - initialize_directions = SOUTH - density = 1 - - var/obj/machinery/atmospherics/node1 - -/obj/machinery/atmospherics/pipe/tank/New() - icon_state = "air" - initialize_directions = dir - ..() - -/obj/machinery/atmospherics/pipe/tank/process() - if(!parent) - ..() - else - . = PROCESS_KILL - -/obj/machinery/atmospherics/pipe/tank/Destroy() - if(node1) - node1.disconnect(src) - - return ..() - -/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/initialize() - var/connect_direction = dir - - for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - 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)) - del(parent) - node1 = null - - update_underlays() - - return null - -/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob, params) - if(istype(W, /obj/item/device/pipe_painter)) - return - - if(istype(W, /obj/item/device/analyzer)) - atmosanalyzer_scan(parent.air, user) - return - -/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.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) - air_temporary.nitrogen = (25*ONE_ATMOSPHERE*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.oxygen = (25*ONE_ATMOSPHERE)*(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.nitrogen = (25*ONE_ATMOSPHERE)*(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.carbon_dioxide = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) - - ..() - icon_state = "co2" - -/obj/machinery/atmospherics/pipe/tank/toxins - name = "Pressure Tank (Toxins)" - icon_state = "toxins_map" - -/obj/machinery/atmospherics/pipe/tank/toxins/New() - air_temporary = new - air_temporary.volume = volume - air_temporary.temperature = T20C - - air_temporary.toxins = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) - - ..() - icon_state = "toxins" - -/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 - - var/datum/gas/sleeping_agent/trace_gas = new - trace_gas.moles = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) - - air_temporary.trace_gases += trace_gas - - ..() - icon_state = "n2o" - -/obj/machinery/atmospherics/pipe/vent - icon = 'icons/obj/atmospherics/pipe_vent.dmi' - icon_state = "intact" - - name = "Vent" - desc = "A large air vent" - - level = 1 - - volume = 250 - - dir = SOUTH - initialize_directions = SOUTH - - var/build_killswitch = 1 - - var/obj/machinery/atmospherics/node1 - -/obj/machinery/atmospherics/pipe/vent/New() - initialize_directions = dir - ..() - -/obj/machinery/atmospherics/pipe/vent/high_volume - name = "Larger vent" - volume = 1000 - -/obj/machinery/atmospherics/pipe/vent/process() - if(!parent) - if(build_killswitch <= 0) - . = PROCESS_KILL - else - build_killswitch-- - ..() - return - else - parent.mingle_with_turf(loc, volume) - -/obj/machinery/atmospherics/pipe/vent/Destroy() - if(node1) - node1.disconnect(src) - - return ..() - -/obj/machinery/atmospherics/pipe/vent/pipeline_expansion() - return list(node1) - -/obj/machinery/atmospherics/pipe/vent/update_icon() - if(node1) - icon_state = "intact" - - dir = get_dir(src, node1) - - else - icon_state = "exposed" - -/obj/machinery/atmospherics/pipe/vent/initialize() - var/connect_direction = dir - - for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction)) - if(target.initialize_directions & get_dir(target,src)) - var/c = check_connect_types(target,src) - if (c) - target.connected_to = c - src.connected_to = c - node1 = target - break - - update_icon() - -/obj/machinery/atmospherics/pipe/vent/disconnect(obj/machinery/atmospherics/reference) - if(reference == node1) - if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) - node1 = null - - update_icon() - - return null - -/obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe section invisible, the icon changes. - if(node1) - icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact" - dir = get_dir(src, node1) - else - icon_state = "exposed" - -/obj/machinery/atmospherics/pipe/vent/attackby(var/obj/item/weapon/W, var/mob/user) - if (!istype(W, /obj/item/weapon/wrench)) - return ..() - var/turf/T = get_turf(src) - var/datum/gas_mixture/int_air = return_air() - var/datum/gas_mixture/env_air = T.return_air() - if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." - add_fingerprint(user) - return 1 - playsound(T, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." - if (do_after(user, 40)) - user.visible_message( \ - "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") - new /obj/item/pipe(T, make_from=src) - del(src) + underlays += icon_manager.get_atmos_icon("underlay", direction, color_cache_name(node), "retracted" + icon_connect_type) \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/cap.dm b/code/ATMOSPHERICS/pipes/cap.dm new file mode 100644 index 00000000000..aebf3f951ac --- /dev/null +++ b/code/ATMOSPHERICS/pipes/cap.dm @@ -0,0 +1,122 @@ +/obj/machinery/atmospherics/pipe/cap + name = "pipe endcap" + desc = "An endcap for pipes" + icon = 'icons/atmos/pipes.dmi' + icon_state = "cap" + level = 2 + layer = 2.4 //under wires with their 2.44 + + volume = 35 + + dir = SOUTH + initialize_directions = SOUTH + + var/obj/machinery/atmospherics/node + +/obj/machinery/atmospherics/pipe/cap/New() + ..() + initialize_directions = dir + +/obj/machinery/atmospherics/pipe/cap/hide(var/i) + if(level == 1 && istype(loc, /turf/simulated)) + invisibility = i ? 101 : 0 + update_icon() + +/obj/machinery/atmospherics/pipe/cap/pipeline_expansion() + return list(node) + +/obj/machinery/atmospherics/pipe/cap/process() + if(!parent) + ..() + else + . = PROCESS_KILL +/obj/machinery/atmospherics/pipe/cap/Destroy() + if(node) + node.disconnect(src) + + return ..() + +/obj/machinery/atmospherics/pipe/cap/disconnect(obj/machinery/atmospherics/reference) + if(reference == node) + if(istype(node, /obj/machinery/atmospherics/pipe)) + del(parent) + node = null + + update_icon() + + ..() + +/obj/machinery/atmospherics/pipe/cap/change_color(var/new_color) + ..() + //for updating connected atmos device pipes (i.e. vents, manifolds, etc) + if(node) + node.update_underlays() + +/obj/machinery/atmospherics/pipe/cap/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + overlays.Cut() + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "cap" + icon_connect_type) + +/obj/machinery/atmospherics/pipe/cap/initialize() + for(var/obj/machinery/atmospherics/target in get_step(src, dir)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node = target + break + + var/turf/T = get_turf(src) // hide if turf is not intact + if(!istype(T)) return + hide(T.intact) + update_icon() + +/obj/machinery/atmospherics/pipe/cap/visible + level = 2 + icon_state = "cap" + +/obj/machinery/atmospherics/pipe/cap/visible/scrubbers + name = "scrubbers pipe endcap" + desc = "An endcap for scrubbers pipes" + icon_state = "cap-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/cap/visible/supply + name = "supply pipe endcap" + desc = "An endcap for supply pipes" + icon_state = "cap-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/cap/hidden + level = 1 + icon_state = "cap" + alpha = 128 + +/obj/machinery/atmospherics/pipe/cap/hidden/scrubbers + name = "scrubbers pipe endcap" + desc = "An endcap for scrubbers pipes" + icon_state = "cap-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/cap/hidden/supply + name = "supply pipe endcap" + desc = "An endcap for supply pipes" + icon_state = "cap-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm new file mode 100644 index 00000000000..eb55f3944e1 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -0,0 +1,251 @@ +/obj/machinery/atmospherics/pipe/manifold + icon = 'icons/atmos/manifold.dmi' + icon_state = "" + name = "pipe manifold" + desc = "A manifold composed of regular pipes" + + volume = 105 + + 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() + ..() + alpha = 255 + icon = null + + switch(dir) + if(NORTH) + initialize_directions = EAST|SOUTH|WEST + if(SOUTH) + initialize_directions = WEST|NORTH|EAST + if(EAST) + initialize_directions = SOUTH|WEST|NORTH + if(WEST) + initialize_directions = NORTH|EAST|SOUTH + +/obj/machinery/atmospherics/pipe/manifold/hide(var/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/process() + if(!parent) + ..() + else + . = PROCESS_KILL + +/obj/machinery/atmospherics/pipe/manifold/Destroy() + if(node1) + node1.disconnect(src) + if(node2) + node2.disconnect(src) + if(node3) + node3.disconnect(src) + + return ..() + +/obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference) + if(reference == node1) + if(istype(node1, /obj/machinery/atmospherics/pipe)) + del(parent) + node1 = null + + if(reference == node2) + if(istype(node2, /obj/machinery/atmospherics/pipe)) + del(parent) + node2 = null + + if(reference == node3) + if(istype(node3, /obj/machinery/atmospherics/pipe)) + del(parent) + node3 = null + + update_icon() + + ..() + +/obj/machinery/atmospherics/pipe/manifold/change_color(var/new_color) + ..() + //for updating connected atmos device pipes (i.e. vents, manifolds, etc) + if(node1) + node1.update_underlays() + if(node2) + node2.update_underlays() + if(node3) + node3.update_underlays() + +/obj/machinery/atmospherics/pipe/manifold/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + if(!node1 && !node2 && !node3) + var/turf/T = get_turf(src) + new /obj/item/pipe(loc, make_from=src) + for (var/obj/machinery/meter/meter in T) + if (meter.target == src) + new /obj/item/pipe_meter(T) + del(meter) + qdel(src) + else + overlays.Cut() + overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "core" + icon_connect_type) + overlays += icon_manager.get_atmos_icon("manifold", , , "clamps" + icon_connect_type) + underlays.Cut() + + var/turf/T = get_turf(src) + if(!istype(T)) return + var/list/directions = list(NORTH, SOUTH, EAST, WEST) + var/node1_direction = get_dir(src, node1) + var/node2_direction = get_dir(src, node2) + var/node3_direction = get_dir(src, node3) + + directions -= dir + + directions -= add_underlay(T,node1,node1_direction,icon_connect_type) + directions -= add_underlay(T,node2,node2_direction,icon_connect_type) + directions -= add_underlay(T,node3,node3_direction,icon_connect_type) + + for(var/D in directions) + add_underlay(T,,D,icon_connect_type) + +/obj/machinery/atmospherics/pipe/manifold/update_underlays() + ..() + update_icon() + +/obj/machinery/atmospherics/pipe/manifold/initialize() + var/connect_directions = (NORTH|SOUTH|EAST|WEST)&(~dir) + + for(var/direction in cardinal) + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/target in get_step(src,direction)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node1 = target + connect_directions &= ~direction + break + if (node1) + break + + + for(var/direction in cardinal) + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/target in get_step(src,direction)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node2 = target + connect_directions &= ~direction + break + if (node2) + break + + + for(var/direction in cardinal) + if(direction&connect_directions) + for(var/obj/machinery/atmospherics/target in get_step(src,direction)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node3 = target + connect_directions &= ~direction + break + if (node3) + break + + if(!node1 && !node2 && !node3) + del(src) + return + + var/turf/T = get_turf(src) + if(istype(T)) + hide(T.intact) + update_icon() + +/obj/machinery/atmospherics/pipe/manifold/visible + icon_state = "map" + level = 2 + +/obj/machinery/atmospherics/pipe/manifold/visible/scrubbers + name="Scrubbers pipe manifold" + desc = "A manifold composed of scrubbers pipes" + icon_state = "map-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/manifold/visible/supply + name="Air supply pipe manifold" + desc = "A manifold composed of supply pipes" + icon_state = "map-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/manifold/visible/yellow + color = PIPE_COLOR_YELLOW + +/obj/machinery/atmospherics/pipe/manifold/visible/cyan + color = PIPE_COLOR_CYAN + +/obj/machinery/atmospherics/pipe/manifold/visible/green + color = PIPE_COLOR_GREEN + +/obj/machinery/atmospherics/pipe/manifold/visible/purple + color = PIPE_COLOR_PURPLE + +/obj/machinery/atmospherics/pipe/manifold/hidden + icon_state = "map" + level = 1 + alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game + +/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers + name="Scrubbers pipe manifold" + desc = "A manifold composed of scrubbers pipes" + icon_state = "map-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/manifold/hidden/supply + name="Air supply pipe manifold" + desc = "A manifold composed of supply pipes" + icon_state = "map-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/manifold/hidden/yellow + color = PIPE_COLOR_YELLOW + +/obj/machinery/atmospherics/pipe/manifold/hidden/cyan + color = PIPE_COLOR_CYAN + +/obj/machinery/atmospherics/pipe/manifold/hidden/green + color = PIPE_COLOR_GREEN + +/obj/machinery/atmospherics/pipe/manifold/hidden/purple + color = PIPE_COLOR_PURPLE diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm new file mode 100644 index 00000000000..93a029ac2ca --- /dev/null +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -0,0 +1,256 @@ +/obj/machinery/atmospherics/pipe/manifold4w + icon = 'icons/atmos/manifold.dmi' + icon_state = "" + name = "4-way pipe manifold" + desc = "A manifold composed of regular pipes" + + volume = 140 + + dir = SOUTH + initialize_directions = NORTH|SOUTH|EAST|WEST + + var/obj/machinery/atmospherics/node1 + var/obj/machinery/atmospherics/node2 + var/obj/machinery/atmospherics/node3 + var/obj/machinery/atmospherics/node4 + + level = 1 + layer = 2.4 //under wires with their 2.44 + +/obj/machinery/atmospherics/pipe/manifold4w/New() + ..() + alpha = 255 + icon = null + +/obj/machinery/atmospherics/pipe/manifold4w/pipeline_expansion() + return list(node1, node2, node3, node4) + +/obj/machinery/atmospherics/pipe/manifold4w/process() + if(!parent) + ..() + else + . = PROCESS_KILL + +/obj/machinery/atmospherics/pipe/manifold4w/Destroy() + if(node1) + node1.disconnect(src) + if(node2) + node2.disconnect(src) + if(node3) + node3.disconnect(src) + if(node4) + node4.disconnect(src) + + return ..() + +/obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference) + if(reference == node1) + if(istype(node1, /obj/machinery/atmospherics/pipe)) + del(parent) + node1 = null + + if(reference == node2) + if(istype(node2, /obj/machinery/atmospherics/pipe)) + del(parent) + node2 = null + + if(reference == node3) + if(istype(node3, /obj/machinery/atmospherics/pipe)) + del(parent) + node3 = null + + if(reference == node4) + if(istype(node4, /obj/machinery/atmospherics/pipe)) + del(parent) + node4 = null + + update_icon() + + ..() + +/obj/machinery/atmospherics/pipe/manifold4w/change_color(var/new_color) + ..() + //for updating connected atmos device pipes (i.e. vents, manifolds, etc) + if(node1) + node1.update_underlays() + if(node2) + node2.update_underlays() + if(node3) + node3.update_underlays() + if(node4) + node4.update_underlays() + +/obj/machinery/atmospherics/pipe/manifold4w/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + if(!node1 && !node2 && !node3 && !node4) + var/turf/T = get_turf(src) + new /obj/item/pipe(loc, make_from=src) + for (var/obj/machinery/meter/meter in T) + if (meter.target == src) + new /obj/item/pipe_meter(T) + del(meter) + qdel(src) + else + overlays.Cut() + overlays += icon_manager.get_atmos_icon("manifold", , pipe_color, "4way" + icon_connect_type) + overlays += icon_manager.get_atmos_icon("manifold", , , "clamps_4way" + icon_connect_type) + underlays.Cut() + + /* + var/list/directions = list(NORTH, SOUTH, EAST, WEST) + + directions -= add_underlay(node1) + directions -= add_underlay(node2) + directions -= add_underlay(node3) + directions -= add_underlay(node4) + + for(var/D in directions) + add_underlay(,D) + */ + + var/turf/T = get_turf(src) + if(!istype(T)) return + var/list/directions = list(NORTH, SOUTH, EAST, WEST) + var/node1_direction = get_dir(src, node1) + var/node2_direction = get_dir(src, node2) + var/node3_direction = get_dir(src, node3) + var/node4_direction = get_dir(src, node4) + + directions -= dir + + directions -= add_underlay(T,node1,node1_direction,icon_connect_type) + directions -= add_underlay(T,node2,node2_direction,icon_connect_type) + directions -= add_underlay(T,node3,node3_direction,icon_connect_type) + directions -= add_underlay(T,node4,node4_direction,icon_connect_type) + + for(var/D in directions) + add_underlay(T,,D,icon_connect_type) + +/obj/machinery/atmospherics/pipe/manifold4w/update_underlays() + ..() + update_icon() + +/obj/machinery/atmospherics/pipe/manifold4w/hide(var/i) + if(level == 1 && istype(loc, /turf/simulated)) + invisibility = i ? 101 : 0 + update_icon() + +/obj/machinery/atmospherics/pipe/manifold4w/initialize() + + for(var/obj/machinery/atmospherics/target in get_step(src,1)) + if(target.initialize_directions & 2) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node1 = target + break + + for(var/obj/machinery/atmospherics/target in get_step(src,2)) + if(target.initialize_directions & 1) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node2 = target + break + + for(var/obj/machinery/atmospherics/target in get_step(src,4)) + if(target.initialize_directions & 8) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node3 = target + break + + for(var/obj/machinery/atmospherics/target in get_step(src,8)) + if(target.initialize_directions & 4) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node4 = target + break + + if(!node1 && !node2 && !node3&& !node4) + del(src) + return + + var/turf/T = get_turf(src) + if(istype(T)) + hide(T.intact) + update_icon() + +/obj/machinery/atmospherics/pipe/manifold4w/visible + icon_state = "map_4way" + level = 2 + +/obj/machinery/atmospherics/pipe/manifold4w/visible/scrubbers + name="4-way scrubbers pipe manifold" + desc = "A manifold composed of scrubbers pipes" + icon_state = "map_4way-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/manifold4w/visible/supply + name="4-way air supply pipe manifold" + desc = "A manifold composed of supply pipes" + icon_state = "map_4way-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/manifold4w/visible/yellow + color = PIPE_COLOR_YELLOW + +/obj/machinery/atmospherics/pipe/manifold4w/visible/cyan + color = PIPE_COLOR_CYAN + +/obj/machinery/atmospherics/pipe/manifold4w/visible/green + color = PIPE_COLOR_GREEN + +/obj/machinery/atmospherics/pipe/manifold4w/visible/purple + color = PIPE_COLOR_PURPLE + +/obj/machinery/atmospherics/pipe/manifold4w/hidden + icon_state = "map_4way" + level = 1 + alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game + +/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers + name="4-way scrubbers pipe manifold" + desc = "A manifold composed of scrubbers pipes" + icon_state = "map_4way-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply + name="4-way air supply pipe manifold" + desc = "A manifold composed of supply pipes" + icon_state = "map_4way-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/manifold4w/hidden/yellow + color = PIPE_COLOR_YELLOW + +/obj/machinery/atmospherics/pipe/manifold4w/hidden/cyan + color = PIPE_COLOR_CYAN + +/obj/machinery/atmospherics/pipe/manifold4w/hidden/green + color = PIPE_COLOR_GREEN + +/obj/machinery/atmospherics/pipe/manifold4w/hidden/purple + color = PIPE_COLOR_PURPLE \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/pipe.dm b/code/ATMOSPHERICS/pipes/pipe.dm new file mode 100644 index 00000000000..6ccecd64d11 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/pipe.dm @@ -0,0 +1,138 @@ +/obj/machinery/atmospherics/pipe + + var/datum/gas_mixture/air_temporary //used when reconstructing a pipeline that broke + var/datum/pipeline/parent + + var/volume = 0 + var/frozen = 0 // used by the pipe freezer + force = 20 + + layer = 2.4 //under wires with their 2.44 + use_power = 0 + + var/alert_pressure = 80*ONE_ATMOSPHERE + //minimum pressure before check_pressure(...) should be called +/obj/machinery/atmospherics/pipe/New() + ..() + //so pipes under walls are hidden + 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/proc/pipeline_expansion() + return null + +/obj/machinery/atmospherics/pipe/proc/check_pressure(pressure) + //Return 1 if parent should continue checking other pipes + //Return null if parent should stop checking other pipes. Recall: del(src) will by default return null + + return 1 + +/obj/machinery/atmospherics/pipe/return_air() + if(!parent) + parent = new /datum/pipeline() + parent.build_pipeline(src) + + return parent.air + +/obj/machinery/atmospherics/pipe/build_network() + if(!parent) + parent = new /datum/pipeline() + parent.build_pipeline(src) + + return parent.return_network() + +/obj/machinery/atmospherics/pipe/network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference) + if(!parent) + parent = new /datum/pipeline() + parent.build_pipeline(src) + + return parent.network_expand(new_network, reference) + +/obj/machinery/atmospherics/pipe/return_network(obj/machinery/atmospherics/reference) + if(!parent) + parent = new /datum/pipeline() + parent.build_pipeline(src) + + return parent.return_network(reference) + + +/obj/machinery/atmospherics/pipe/Destroy() + qdel(parent) + if(air_temporary && loc) + loc.assume_air(air_temporary) + + return ..() + +/obj/machinery/atmospherics/pipe/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params) + if (istype(src, /obj/machinery/atmospherics/pipe/tank)) + return ..() + if (istype(src, /obj/machinery/atmospherics/pipe/vent)) + return ..() + + if(istype(W,/obj/item/device/pipe_painter)) + return 0 + + if (istype(W, /obj/item/device/pipe_freezer)) + if(!src.frozen) // If the pipe is not already frozen + user << "\red You begin to freeze the [src]" + if (do_after(user, 60)) + user.visible_message( \ + "[user] freezes \the [src].", \ + "\blue You finished freezing \the [src].", \ + "You hear the hiss of gas.") + src.frozen = 1 + spawn (200) + src.frozen = 0 + src.visible_message( \ + "\the ice arounds the [src] melts.", \ + "\blue Your frozen [src] has thawed.", \ + "You hear dripping water.") + + add_fingerprint(user) + return 1 + + if (!istype(W, /obj/item/weapon/wrench)) + return ..() + var/turf/T = src.loc + if (level==1 && isturf(T) && T.intact) + user << "\red You must remove the plating first." + return 1 + + var/datum/gas_mixture/int_air = return_air() + var/datum/gas_mixture/env_air = loc.return_air() + if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) + if (!src.frozen) // If the pipe is not frozen + user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + add_fingerprint(user) + return 1 + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) + user << "\blue You begin to unfasten \the [src]..." + if (do_after(user, 40)) + user.visible_message( \ + "[user] unfastens \the [src].", \ + "\blue You have unfastened \the [src].", \ + "You hear ratchet.") + var/obj/item/P = new /obj/item/pipe(loc, make_from=src) + for (var/obj/machinery/meter/meter in T) + if (meter.target == src) + new /obj/item/pipe_meter(T) + del(meter) + if(P) + transfer_fingerprints_to(P) + P.add_fingerprint(user) + qdel(src) + return 1 + +/obj/machinery/atmospherics/pipe/color_cache_name(var/obj/machinery/atmospherics/node) + if(istype(src, /obj/machinery/atmospherics/pipe/tank)) + return ..() + + if(istype(node, /obj/machinery/atmospherics/pipe/manifold) || istype(node, /obj/machinery/atmospherics/pipe/manifold4w)) + if(pipe_color == node.pipe_color) + return node.pipe_color + else + return null + else if(istype(node, /obj/machinery/atmospherics/pipe/simple)) + return node.pipe_color + else + return pipe_color \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm new file mode 100644 index 00000000000..be68ec30287 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm @@ -0,0 +1,181 @@ +/obj/machinery/atmospherics/pipe/simple + icon = 'icons/atmos/pipes.dmi' + icon_state = "" + var/pipe_icon = "" //what kind of pipe it is and from which dmi is the icon manager getting its icons, "" for simple pipes, "hepipe" for HE pipes, "hejunction" for HE junctions + name = "pipe" + desc = "A one meter section of regular pipe" + + volume = 70 + + dir = SOUTH + initialize_directions = SOUTH|NORTH + + var/obj/machinery/atmospherics/node1 + var/obj/machinery/atmospherics/node2 + + 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 + + level = 1 + +/obj/machinery/atmospherics/pipe/simple/New() + ..() + + // 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. + icon = null + alpha = 255 + + switch(dir) + if(SOUTH || NORTH) + initialize_directions = SOUTH|NORTH + if(EAST || 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/hide(var/i) + if(level == 1 && istype(loc, /turf/simulated)) + invisibility = i ? 101 : 0 + update_icon() + +/obj/machinery/atmospherics/pipe/simple/process() + if(!parent) //This should cut back on the overhead calling build_network thousands of times per cycle + ..() + else + . = PROCESS_KILL + +/obj/machinery/atmospherics/pipe/simple/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 + +/obj/machinery/atmospherics/pipe/simple/proc/burst() + src.visible_message("\red \bold [src] bursts!"); + playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) + var/datum/effect/effect/system/harmless_smoke_spread/smoke = new + smoke.set_up(1,0, src.loc, 0) + smoke.start() + del(src) + +/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() + if(dir==3) + dir = 1 + else if(dir==12) + dir = 4 + +/obj/machinery/atmospherics/pipe/simple/Destroy() + if(node1) + node1.disconnect(src) + if(node2) + node2.disconnect(src) + + return ..() + +/obj/machinery/atmospherics/pipe/simple/pipeline_expansion() + return list(node1, node2) + +/obj/machinery/atmospherics/pipe/simple/change_color(var/new_color) + ..() + //for updating connected atmos device pipes (i.e. vents, manifolds, etc) + if(node1) + node1.update_underlays() + if(node2) + node2.update_underlays() + +/obj/machinery/atmospherics/pipe/simple/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + overlays.Cut() + + if(!node1 && !node2) + var/turf/T = get_turf(src) + new /obj/item/pipe(loc, make_from=src) + for (var/obj/machinery/meter/meter in T) + if (meter.target == src) + new /obj/item/pipe_meter(T) + del(meter) + qdel(src) + else if(node1 && node2) + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type) + else + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "exposed[node1?1:0][node2?1:0]" + icon_connect_type) + +/obj/machinery/atmospherics/pipe/simple/update_underlays() + return + +/obj/machinery/atmospherics/pipe/simple/initialize() + normalize_dir() + var/node1_dir + var/node2_dir + + for(var/direction in cardinal) + if(direction&initialize_directions) + if (!node1_dir) + node1_dir = direction + else if (!node2_dir) + node2_dir = direction + + for(var/obj/machinery/atmospherics/target in get_step(src,node1_dir)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node1 = target + break + for(var/obj/machinery/atmospherics/target in get_step(src,node2_dir)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node2 = target + break + + if(!node1 && !node2) + qdel(src) + return + + var/turf/T = get_turf(src) + if(istype(T)) + hide(T.intact) + update_icon() + +/obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference) + if(reference == node1) + if(istype(node1, /obj/machinery/atmospherics/pipe)) + del(parent) + node1 = null + + if(reference == node2) + if(istype(node2, /obj/machinery/atmospherics/pipe)) + del(parent) + node2 = null + + update_icon() + + return null \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm new file mode 100644 index 00000000000..e94f8c46aaf --- /dev/null +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm @@ -0,0 +1,118 @@ +/obj/machinery/atmospherics/pipe/simple/heat_exchanging + icon = 'icons/atmos/heat.dmi' + icon_state = "intact" + pipe_icon = "hepipe" + level = 2 + var/initialize_directions_he + var/surface = 2 + + minimum_temperature_difference = 20 + thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT + +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/process() + if(!parent) + ..() + else + var/environment_temperature = 0 + 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 + var/datum/gas_mixture/pipe_air = return_air() + if(abs(environment_temperature-pipe_air.temperature) > minimum_temperature_difference) + parent.temperature_interact(loc, volume, thermal_conductivity) + + + +// BubbleWrap +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/New() + ..() + initialize_directions_he = initialize_directions // The auto-detection from /pipe is good enough for a simple HE pipe + // BubbleWrap END + +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/initialize() + normalize_dir() + var/node1_dir + var/node2_dir + + for(var/direction in cardinal) + if(direction&initialize_directions_he) + if (!node1_dir) + node1_dir = direction + else if (!node2_dir) + node2_dir = direction + + for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node1_dir)) + if(target.initialize_directions_he & get_dir(target,src)) + node1 = target + break + for(var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/target in get_step(src,node2_dir)) + if(target.initialize_directions_he & get_dir(target,src)) + node2 = target + break + + if(!node1 && !node2) + del(src) + return + + update_icon() + return + + +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/hidden + level=1 + icon_state="intact-f" + +///////////////////////////////// +// JUNCTION +///////////////////////////////// +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction + icon = 'icons/atmos/junction.dmi' + icon_state = "intact" + pipe_icon = "hejunction" + level = 2 + minimum_temperature_difference = 300 + thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT + + // BubbleWrap +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/New() + .. () + 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 + // BubbleWrap END + +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/initialize() + 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 + + if(!node1 && !node2) + qdel(src) + return + + update_icon() + return + +/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/hidden + level=1 + icon_state="intact-f" diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm new file mode 100644 index 00000000000..7cf983e0e32 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_hidden.dm @@ -0,0 +1,69 @@ +/obj/machinery/atmospherics/pipe/simple/hidden + icon_state = "intact" + level = 1 + alpha = 128 //set for the benefit of mapping - this is reset to opaque when the pipe is spawned in game + +/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers + name = "Scrubbers pipe" + desc = "A one meter section of scrubbers pipe" + icon_state = "intact-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/simple/hidden/supply + name = "Air supply pipe" + desc = "A one meter section of supply pipe" + icon_state = "intact-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/simple/hidden/universal + name="Universal pipe adapter" + desc = "An adapter for regular, supply and scrubbers pipes" + connect_types = list(1,2,3) + icon_state = "map_universal" + +/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + overlays.Cut() + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + underlays.Cut() + + if (node1) + universal_underlays(node1) + if(node2) + universal_underlays(node2) + else + var/node2_dir = turn(get_dir(src,node1),-180) + universal_underlays(,node2_dir) + else if (node2) + universal_underlays(node2) + var/node1_dir = turn(get_dir(src,node2),-180) + universal_underlays(,node1_dir) + else + universal_underlays(,dir) + universal_underlays(,turn(dir, -180)) + +/obj/machinery/atmospherics/pipe/simple/hidden/universal/update_underlays() + ..() + update_icon() + +/obj/machinery/atmospherics/pipe/simple/hidden/yellow + color = PIPE_COLOR_YELLOW + +/obj/machinery/atmospherics/pipe/simple/hidden/cyan + color = PIPE_COLOR_CYAN + +/obj/machinery/atmospherics/pipe/simple/hidden/green + color = PIPE_COLOR_GREEN + +/obj/machinery/atmospherics/pipe/simple/hidden/purple + color = PIPE_COLOR_PURPLE \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_insulated.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_insulated.dm new file mode 100644 index 00000000000..ce6ff78b2d0 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_insulated.dm @@ -0,0 +1,11 @@ +/obj/machinery/atmospherics/pipe/simple/insulated + icon = 'icons/obj/atmospherics/red_pipe.dmi' + icon_state = "intact" + + minimum_temperature_difference = 10000 + thermal_conductivity = 0 + maximum_pressure = 1000*ONE_ATMOSPHERE + fatigue_pressure = 900*ONE_ATMOSPHERE + alert_pressure = 900*ONE_ATMOSPHERE + + level = 2 \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm new file mode 100644 index 00000000000..a93351b29c7 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_visible.dm @@ -0,0 +1,66 @@ +/obj/machinery/atmospherics/pipe/simple/visible + icon_state = "intact" + level = 2 + +/obj/machinery/atmospherics/pipe/simple/visible/scrubbers + name = "Scrubbers pipe" + desc = "A one meter section of scrubbers pipe" + icon_state = "intact-scrubbers" + connect_types = list(3) + layer = 2.38 + icon_connect_type = "-scrubbers" + color = PIPE_COLOR_RED + +/obj/machinery/atmospherics/pipe/simple/visible/supply + name = "Air supply pipe" + desc = "A one meter section of supply pipe" + icon_state = "intact-supply" + connect_types = list(2) + layer = 2.39 + icon_connect_type = "-supply" + color = PIPE_COLOR_BLUE + +/obj/machinery/atmospherics/pipe/simple/visible/yellow + color = PIPE_COLOR_YELLOW + +/obj/machinery/atmospherics/pipe/simple/visible/cyan + color = PIPE_COLOR_CYAN + +/obj/machinery/atmospherics/pipe/simple/visible/green + color = PIPE_COLOR_GREEN + +/obj/machinery/atmospherics/pipe/simple/visible/purple + color = PIPE_COLOR_PURPLE + +/obj/machinery/atmospherics/pipe/simple/visible/universal + name="Universal pipe adapter" + desc = "An adapter for regular, supply and scrubbers pipes" + connect_types = list(1,2,3) + icon_state = "map_universal" + +/obj/machinery/atmospherics/pipe/simple/visible/universal/update_icon(var/safety = 0) + if(!check_icon_cache()) + return + + alpha = 255 + + overlays.Cut() + overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, "universal") + underlays.Cut() + + if (node1) + universal_underlays(node1) + if(node2) + universal_underlays(node2) + else + var/node1_dir = get_dir(node1,src) + universal_underlays(,node1_dir) + else if (node2) + universal_underlays(node2) + else + universal_underlays(,dir) + universal_underlays(,turn(dir, -180)) + +/obj/machinery/atmospherics/pipe/simple/visible/universal/update_underlays() + ..() + update_icon() \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/tank.dm b/code/ATMOSPHERICS/pipes/tank.dm new file mode 100644 index 00000000000..a5b71068411 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/tank.dm @@ -0,0 +1,166 @@ +/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 + + level = 1 + dir = SOUTH + initialize_directions = SOUTH + density = 1 + + var/obj/machinery/atmospherics/node1 + +/obj/machinery/atmospherics/pipe/tank/New() + icon_state = "air" + initialize_directions = dir + ..() + +/obj/machinery/atmospherics/pipe/tank/process() + if(!parent) + ..() + else + . = PROCESS_KILL + +/obj/machinery/atmospherics/pipe/tank/Destroy() + if(node1) + node1.disconnect(src) + + return ..() + +/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/initialize() + var/connect_direction = dir + + for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + 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)) + del(parent) + node1 = null + + update_underlays() + + return null + +/obj/machinery/atmospherics/pipe/tank/attackby(var/obj/item/W as obj, var/mob/user as mob, params) + if(istype(W, /obj/item/device/pipe_painter)) + return + + if(istype(W, /obj/item/device/analyzer)) + atmosanalyzer_scan(parent.air, user) + return + +/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.oxygen = (25*ONE_ATMOSPHERE*O2STANDARD)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) + air_temporary.nitrogen = (25*ONE_ATMOSPHERE*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.oxygen = (25*ONE_ATMOSPHERE)*(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.nitrogen = (25*ONE_ATMOSPHERE)*(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.carbon_dioxide = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) + + ..() + icon_state = "co2" + +/obj/machinery/atmospherics/pipe/tank/toxins + name = "Pressure Tank (Toxins)" + icon_state = "toxins_map" + +/obj/machinery/atmospherics/pipe/tank/toxins/New() + air_temporary = new + air_temporary.volume = volume + air_temporary.temperature = T20C + + air_temporary.toxins = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) + + ..() + icon_state = "toxins" + +/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 + + var/datum/gas/sleeping_agent/trace_gas = new + trace_gas.moles = (25*ONE_ATMOSPHERE)*(air_temporary.volume)/(R_IDEAL_GAS_EQUATION*air_temporary.temperature) + + air_temporary.trace_gases += trace_gas + + ..() + icon_state = "n2o" \ No newline at end of file diff --git a/code/ATMOSPHERICS/pipes/vent.dm b/code/ATMOSPHERICS/pipes/vent.dm new file mode 100644 index 00000000000..63470bc9aa9 --- /dev/null +++ b/code/ATMOSPHERICS/pipes/vent.dm @@ -0,0 +1,105 @@ +/obj/machinery/atmospherics/pipe/vent + icon = 'icons/obj/atmospherics/pipe_vent.dmi' + icon_state = "intact" + + name = "Vent" + desc = "A large air vent" + + level = 1 + + volume = 250 + + dir = SOUTH + initialize_directions = SOUTH + + var/build_killswitch = 1 + + var/obj/machinery/atmospherics/node1 + +/obj/machinery/atmospherics/pipe/vent/New() + initialize_directions = dir + ..() + +/obj/machinery/atmospherics/pipe/vent/high_volume + name = "Larger vent" + volume = 1000 + +/obj/machinery/atmospherics/pipe/vent/process() + if(!parent) + if(build_killswitch <= 0) + . = PROCESS_KILL + else + build_killswitch-- + ..() + return + else + parent.mingle_with_turf(loc, volume) + +/obj/machinery/atmospherics/pipe/vent/Destroy() + if(node1) + node1.disconnect(src) + + return ..() + +/obj/machinery/atmospherics/pipe/vent/pipeline_expansion() + return list(node1) + +/obj/machinery/atmospherics/pipe/vent/update_icon() + if(node1) + icon_state = "intact" + + dir = get_dir(src, node1) + + else + icon_state = "exposed" + +/obj/machinery/atmospherics/pipe/vent/initialize() + var/connect_direction = dir + + for(var/obj/machinery/atmospherics/target in get_step(src,connect_direction)) + if(target.initialize_directions & get_dir(target,src)) + var/c = check_connect_types(target,src) + if (c) + target.connected_to = c + src.connected_to = c + node1 = target + break + + update_icon() + +/obj/machinery/atmospherics/pipe/vent/disconnect(obj/machinery/atmospherics/reference) + if(reference == node1) + if(istype(node1, /obj/machinery/atmospherics/pipe)) + del(parent) + node1 = null + + update_icon() + + return null + +/obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe section invisible, the icon changes. + if(node1) + icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact" + dir = get_dir(src, node1) + else + icon_state = "exposed" + +/obj/machinery/atmospherics/pipe/vent/attackby(var/obj/item/weapon/W, var/mob/user) + if (!istype(W, /obj/item/weapon/wrench)) + return ..() + var/turf/T = get_turf(src) + var/datum/gas_mixture/int_air = return_air() + var/datum/gas_mixture/env_air = T.return_air() + if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) + user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + add_fingerprint(user) + return 1 + playsound(T, 'sound/items/Ratchet.ogg', 50, 1) + user << "\blue You begin to unfasten \the [src]..." + if (do_after(user, 40)) + user.visible_message( \ + "[user] unfastens \the [src].", \ + "\blue You have unfastened \the [src].", \ + "You hear ratchet.") + new /obj/item/pipe(T, make_from=src) + del(src) \ No newline at end of file diff --git a/paradise.dme b/paradise.dme index 9e9c95e47c4..d0d80f66029 100644 --- a/paradise.dme +++ b/paradise.dme @@ -124,6 +124,17 @@ #include "code\ATMOSPHERICS\components\unary\unary_base.dm" #include "code\ATMOSPHERICS\components\unary\vent_pump.dm" #include "code\ATMOSPHERICS\components\unary\vent_scrubber.dm" +#include "code\ATMOSPHERICS\pipes\cap.dm" +#include "code\ATMOSPHERICS\pipes\manifold.dm" +#include "code\ATMOSPHERICS\pipes\manifold4w.dm" +#include "code\ATMOSPHERICS\pipes\pipe.dm" +#include "code\ATMOSPHERICS\pipes\tank.dm" +#include "code\ATMOSPHERICS\pipes\vent.dm" +#include "code\ATMOSPHERICS\pipes\simple\pipe_simple.dm" +#include "code\ATMOSPHERICS\pipes\simple\pipe_simple_he.dm" +#include "code\ATMOSPHERICS\pipes\simple\pipe_simple_hidden.dm" +#include "code\ATMOSPHERICS\pipes\simple\pipe_simple_insulated.dm" +#include "code\ATMOSPHERICS\pipes\simple\pipe_simple_visible.dm" #include "code\controllers\communications.dm" #include "code\controllers\configuration.dm" #include "code\controllers\emergency_shuttle_controller.dm" From 3725c7cc7d8999f0a4de6dabda91a706bc68da08 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 8 Jul 2015 16:04:51 -0700 Subject: [PATCH 2/4] Change a bunch of del's in pipecode to qdel's --- .../components/binary_devices/binary_atmos_base.dm | 4 ++-- .../components/trinary_devices/trinary_base.dm | 6 +++--- code/ATMOSPHERICS/components/unary/heat_exchanger.dm | 2 +- code/ATMOSPHERICS/components/unary/thermal_plate.dm | 2 +- code/ATMOSPHERICS/components/unary/unary_base.dm | 2 +- code/ATMOSPHERICS/pipes/cap.dm | 2 +- code/ATMOSPHERICS/pipes/manifold.dm | 10 +++++----- code/ATMOSPHERICS/pipes/manifold4w.dm | 12 ++++++------ code/ATMOSPHERICS/pipes/pipe.dm | 2 +- code/ATMOSPHERICS/pipes/simple/pipe_simple.dm | 8 ++++---- code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm | 2 +- code/ATMOSPHERICS/pipes/tank.dm | 2 +- code/ATMOSPHERICS/pipes/vent.dm | 4 ++-- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm index aeb146fe57a..8aabd24722b 100644 --- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm +++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm @@ -129,11 +129,11 @@ /obj/machinery/atmospherics/binary/disconnect(obj/machinery/atmospherics/reference) if(reference==node1) - del(network1) + qdel(network1) node1 = null else if(reference==node2) - del(network2) + qdel(network2) node2 = null update_icon() diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm index 2486f38d45f..8b166799ec0 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm @@ -153,15 +153,15 @@ /obj/machinery/atmospherics/trinary/disconnect(obj/machinery/atmospherics/reference) if(reference==node1) - del(network1) + qdel(network1) node1 = null else if(reference==node2) - del(network2) + qdel(network2) node2 = null else if(reference==node3) - del(network3) + qdel(network3) node3 = null update_underlays() diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index bfa2b08f908..61da39f846b 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -86,4 +86,4 @@ "\blue You have unfastened \the [src].", \ "You hear ratchet.") new /obj/item/pipe(loc, make_from=src) - del(src) \ No newline at end of file + qdel(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm index 60fb9571d53..0e9c72bf16f 100644 --- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -89,7 +89,7 @@ "\blue You have unfastened \the [src].", \ "You hear ratchet.") new /obj/item/pipe(loc, make_from=src) - del(src) + qdel(src) /obj/machinery/atmospherics/unary/thermal_plate/proc/radiate() var/internal_transfer_moles = 0.25 * air_contents.total_moles() diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm index 65f6c7f2edb..b1fbdb29937 100644 --- a/code/ATMOSPHERICS/components/unary/unary_base.dm +++ b/code/ATMOSPHERICS/components/unary/unary_base.dm @@ -87,7 +87,7 @@ /obj/machinery/atmospherics/unary/disconnect(obj/machinery/atmospherics/reference) if(reference==node) - del(network) + qdel(network) node = null update_icon() diff --git a/code/ATMOSPHERICS/pipes/cap.dm b/code/ATMOSPHERICS/pipes/cap.dm index aebf3f951ac..6f70cf52465 100644 --- a/code/ATMOSPHERICS/pipes/cap.dm +++ b/code/ATMOSPHERICS/pipes/cap.dm @@ -39,7 +39,7 @@ /obj/machinery/atmospherics/pipe/cap/disconnect(obj/machinery/atmospherics/reference) if(reference == node) if(istype(node, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node = null update_icon() diff --git a/code/ATMOSPHERICS/pipes/manifold.dm b/code/ATMOSPHERICS/pipes/manifold.dm index eb55f3944e1..2dd6cb1ef7e 100644 --- a/code/ATMOSPHERICS/pipes/manifold.dm +++ b/code/ATMOSPHERICS/pipes/manifold.dm @@ -58,17 +58,17 @@ /obj/machinery/atmospherics/pipe/manifold/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node1 = null if(reference == node2) if(istype(node2, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node2 = null if(reference == node3) if(istype(node3, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node3 = null update_icon() @@ -97,7 +97,7 @@ for (var/obj/machinery/meter/meter in T) if (meter.target == src) new /obj/item/pipe_meter(T) - del(meter) + qdel(meter) qdel(src) else overlays.Cut() @@ -173,7 +173,7 @@ break if(!node1 && !node2 && !node3) - del(src) + qdel(src) return var/turf/T = get_turf(src) diff --git a/code/ATMOSPHERICS/pipes/manifold4w.dm b/code/ATMOSPHERICS/pipes/manifold4w.dm index 93a029ac2ca..a9bbbfc4738 100644 --- a/code/ATMOSPHERICS/pipes/manifold4w.dm +++ b/code/ATMOSPHERICS/pipes/manifold4w.dm @@ -46,22 +46,22 @@ /obj/machinery/atmospherics/pipe/manifold4w/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node1 = null if(reference == node2) if(istype(node2, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node2 = null if(reference == node3) if(istype(node3, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node3 = null if(reference == node4) if(istype(node4, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node4 = null update_icon() @@ -92,7 +92,7 @@ for (var/obj/machinery/meter/meter in T) if (meter.target == src) new /obj/item/pipe_meter(T) - del(meter) + qdel(meter) qdel(src) else overlays.Cut() @@ -178,7 +178,7 @@ break if(!node1 && !node2 && !node3&& !node4) - del(src) + qdel(src) return var/turf/T = get_turf(src) diff --git a/code/ATMOSPHERICS/pipes/pipe.dm b/code/ATMOSPHERICS/pipes/pipe.dm index 6ccecd64d11..8a0fca2ddec 100644 --- a/code/ATMOSPHERICS/pipes/pipe.dm +++ b/code/ATMOSPHERICS/pipes/pipe.dm @@ -116,7 +116,7 @@ for (var/obj/machinery/meter/meter in T) if (meter.target == src) new /obj/item/pipe_meter(T) - del(meter) + qdel(meter) if(P) transfer_fingerprints_to(P) P.add_fingerprint(user) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm index be68ec30287..c8993efb20a 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm @@ -76,7 +76,7 @@ var/datum/effect/effect/system/harmless_smoke_spread/smoke = new smoke.set_up(1,0, src.loc, 0) smoke.start() - del(src) + qdel(src) /obj/machinery/atmospherics/pipe/simple/proc/normalize_dir() if(dir==3) @@ -117,7 +117,7 @@ for (var/obj/machinery/meter/meter in T) if (meter.target == src) new /obj/item/pipe_meter(T) - del(meter) + qdel(meter) qdel(src) else if(node1 && node2) overlays += icon_manager.get_atmos_icon("pipe", , pipe_color, pipe_icon + "intact" + icon_connect_type) @@ -168,12 +168,12 @@ /obj/machinery/atmospherics/pipe/simple/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node1 = null if(reference == node2) if(istype(node2, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node2 = null update_icon() diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm index e94f8c46aaf..d567067ba79 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple_he.dm @@ -56,7 +56,7 @@ break if(!node1 && !node2) - del(src) + qdel(src) return update_icon() diff --git a/code/ATMOSPHERICS/pipes/tank.dm b/code/ATMOSPHERICS/pipes/tank.dm index a5b71068411..4de1c272838 100644 --- a/code/ATMOSPHERICS/pipes/tank.dm +++ b/code/ATMOSPHERICS/pipes/tank.dm @@ -62,7 +62,7 @@ /obj/machinery/atmospherics/pipe/tank/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node1 = null update_underlays() diff --git a/code/ATMOSPHERICS/pipes/vent.dm b/code/ATMOSPHERICS/pipes/vent.dm index 63470bc9aa9..538d97fc048 100644 --- a/code/ATMOSPHERICS/pipes/vent.dm +++ b/code/ATMOSPHERICS/pipes/vent.dm @@ -70,7 +70,7 @@ /obj/machinery/atmospherics/pipe/vent/disconnect(obj/machinery/atmospherics/reference) if(reference == node1) if(istype(node1, /obj/machinery/atmospherics/pipe)) - del(parent) + qdel(parent) node1 = null update_icon() @@ -102,4 +102,4 @@ "\blue You have unfastened \the [src].", \ "You hear ratchet.") new /obj/item/pipe(T, make_from=src) - del(src) \ No newline at end of file + qdel(src) \ No newline at end of file From a78a0323b21cb4ae1acb312190729b68cdf0f690 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 8 Jul 2015 16:35:31 -0700 Subject: [PATCH 3/4] Remove every usage of \red, \blue in code/ATMOSPHERICS/ And one qdel that I missed. --- code/ATMOSPHERICS/chiller.dm | 10 +++++----- .../components/binary_devices/circulator.dm | 2 +- .../components/binary_devices/dp_vent_pump.dm | 18 +++++++++--------- .../components/binary_devices/passive_gate.dm | 12 ++++++------ .../components/binary_devices/pump.dm | 12 ++++++------ .../components/binary_devices/volume_pump.dm | 12 ++++++------ .../components/omni_devices/omni_base.dm | 6 +++--- .../components/portables_connector.dm | 10 +++++----- .../components/trinary_devices/filter.dm | 14 +++++++------- .../components/trinary_devices/mixer.dm | 10 +++++----- code/ATMOSPHERICS/components/tvalve.dm | 14 +++++++------- .../components/unary/heat_exchanger.dm | 10 +++++----- .../components/unary/outlet_injector.dm | 14 +++++++------- .../components/unary/thermal_plate.dm | 10 +++++----- .../ATMOSPHERICS/components/unary/vent_pump.dm | 18 +++++++++--------- .../components/unary/vent_scrubber.dm | 12 ++++++------ code/ATMOSPHERICS/components/valve.dm | 10 +++++----- code/ATMOSPHERICS/mainspipe.dm | 2 +- code/ATMOSPHERICS/pipes/pipe.dm | 18 +++++++++--------- code/ATMOSPHERICS/pipes/simple/pipe_simple.dm | 2 +- code/ATMOSPHERICS/pipes/vent.dm | 8 ++++---- 21 files changed, 112 insertions(+), 112 deletions(-) diff --git a/code/ATMOSPHERICS/chiller.dm b/code/ATMOSPHERICS/chiller.dm index 80b0a06e9c6..e2e4bd471e6 100644 --- a/code/ATMOSPHERICS/chiller.dm +++ b/code/ATMOSPHERICS/chiller.dm @@ -62,13 +62,13 @@ C.loc = src C.add_fingerprint(usr) - user.visible_message("\blue [user] inserts a power cell into [src].", "\blue You insert the power cell into [src].") + user.visible_message("[user] inserts a power cell into [src].", "You insert the power cell into [src].") else user << "The hatch must be open to insert a power cell." return else if(istype(I, /obj/item/weapon/screwdriver)) open = !open - user.visible_message("\blue [user] [open ? "opens" : "closes"] the hatch on the [src].", "\blue You [open ? "open" : "close"] the hatch on the [src].") + user.visible_message("[user] [open ? "opens" : "closes"] the hatch on the [src].", "You [open ? "open" : "close"] the hatch on the [src].") update_icon() if(!open && user.machine == src) user << browse(null, "window=aircond") @@ -106,7 +106,7 @@ onclose(user, "aircond") else on = !on - user.visible_message("\blue [user] switches [on ? "on" : "off"] the [src].","\blue You switch [on ? "on" : "off"] the [src].") + user.visible_message("[user] switches [on ? "on" : "off"] the [src].","You switch [on ? "on" : "off"] the [src].") update_icon() return @@ -131,7 +131,7 @@ usr.put_in_hands(cell) cell.add_fingerprint(usr) cell = null - usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].") + usr.visible_message("[usr] removes the power cell from \the [src].", "You remove the power cell from \the [src].") if("cellinstall") @@ -143,7 +143,7 @@ C.loc = src C.add_fingerprint(usr) - usr.visible_message("\blue [usr] inserts a power cell into \the [src].", "\blue You insert the power cell into \the [src].") + usr.visible_message("[usr] inserts a power cell into \the [src].", "You insert the power cell into \the [src].") src.updateDialog() else diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm index 843b7dc6518..19d9d097936 100644 --- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm +++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm @@ -73,7 +73,7 @@ /obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob, params) if(istype(W, /obj/item/weapon/wrench)) anchored = !anchored - user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor." + user << "You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor." if(anchored) if(dir & (NORTH|SOUTH)) diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index 38f7af1a658..c9b9cd89168 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -265,7 +265,7 @@ if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if (WT.remove_fuel(0,user)) - user << "\blue Now welding the vent." + user << "Now welding the vent." if(do_after(user, 20)) if(!src || !WT.isOn()) return playsound(get_turf(src), 'sound/items/Welder2.ogg', 50, 1) @@ -278,9 +278,9 @@ welded = 0 update_icon() else - user << "\blue The welding tool needs to be on to start this task." + user << "The welding tool needs to be on to start this task." else - user << "\blue You need more welding fuel to complete this task." + user << "You need more welding fuel to complete this task." return 1*/ if(istype(W, /obj/item/device/multitool)) update_multitool_menu(user) @@ -288,24 +288,24 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 9da08d5b117..0056a5666dc 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -134,7 +134,7 @@ return src.add_fingerprint(usr) if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return usr.set_machine(src) interact(user) @@ -156,20 +156,20 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index 6091f7240cc..f8c9a2569cb 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -160,7 +160,7 @@ Thus, the two variables affect pump operation are set in New(): return src.add_fingerprint(usr) if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return usr.set_machine(src) interact(user) @@ -188,20 +188,20 @@ Thus, the two variables affect pump operation are set in New(): if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index cd30bf8cd2f..15e3ee67a3f 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -147,7 +147,7 @@ Thus, the two variables affect pump operation are set in New(): return src.add_fingerprint(usr) if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return usr.set_machine(src) interact(user) @@ -175,20 +175,20 @@ Thus, the two variables affect pump operation are set in New(): if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm index d7756ee51ca..a95186dc7b3 100644 --- a/code/ATMOSPHERICS/components/omni_devices/omni_base.dm +++ b/code/ATMOSPHERICS/components/omni_devices/omni_base.dm @@ -79,15 +79,15 @@ int_pressure += P.air.return_pressure() var/datum/gas_mixture/env_air = loc.return_air() if ((int_pressure - env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench [src], it is too exerted due to internal pressure." + user << "You cannot unwrench [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ + "You have unfastened \the [src].", \ "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index b2d51336007..d2f374262e0 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -137,22 +137,22 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (connected_device) - user << "\red You cannot unwrench this [src], detach [connected_device] first." + user << "You cannot unwrench this [src], detach [connected_device] first." return 1 if (locate(/obj/machinery/portable_atmospherics, src.loc)) return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 24ce446edb7..19740df1e46 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -41,7 +41,7 @@ Filter types: icon_state = "m" else icon_state = "" - + if(!powered()) icon_state += "off" else if(node2 && node3 && node1) @@ -162,16 +162,16 @@ Filter types: var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) @@ -181,7 +181,7 @@ Filter types: return if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return var/dat @@ -272,7 +272,7 @@ obj/machinery/atmospherics/trinary/filter/m_filter/New() /obj/machinery/atmospherics/trinary/filter/m_filter/initialize() set_frequency(frequency) - + if(node1 && node2 && node3) return var/node1_connect = turn(dir, -180) diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 23a44b376e6..73c8de1fd2c 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -120,16 +120,16 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) @@ -138,7 +138,7 @@ return src.add_fingerprint(usr) if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return usr.set_machine(src) var/dat = {"Power: [on?"On":"Off"]
diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index 70be99d73c3..71a77589d20 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -317,7 +317,7 @@ if(!powered()) return if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return ..() @@ -359,21 +359,21 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (istype(src, /obj/machinery/atmospherics/tvalve/digital)) - user << "\red You cannot unwrench this [src], it's too complicated." + user << "You cannot unwrench this [src], it's too complicated." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) @@ -457,7 +457,7 @@ if(!powered()) return if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return ..() diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index 61da39f846b..a3f61f986fb 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -70,20 +70,20 @@ return ..() var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) qdel(src) \ No newline at end of file diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm index 990fba75e02..fb7fa8a0e7f 100644 --- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm @@ -174,27 +174,27 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) - del(src) + qdel(src) /obj/machinery/atmospherics/unary/outlet_injector/interact(mob/user as mob) update_multitool_menu(user) diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm index 0e9c72bf16f..2ab6f24cb2b 100644 --- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -73,21 +73,21 @@ return ..() var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) qdel(src) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 6e8377ab2db..8fa1bd4aaf8 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -324,7 +324,7 @@ if(istype(W, /obj/item/weapon/weldingtool)) var/obj/item/weapon/weldingtool/WT = W if (WT.remove_fuel(0,user)) - user << "\blue Now welding the vent." + user << "Now welding the vent." if(do_after(user, 20)) if(!src || !WT.isOn()) return playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1) @@ -338,9 +338,9 @@ update_icon() else - user << "\blue The welding tool needs to be on to start this task." + user << "The welding tool needs to be on to start this task." else - user << "\blue You need more welding fuel to complete this task." + user << "You need more welding fuel to complete this task." return 1 else if(istype(W, /obj/item/device/multitool)) update_multitool_menu(user) @@ -399,25 +399,25 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/turf/T = src.loc if (node && node.level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) qdel(src) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 2d2f87c7935..86e60a1cfb0 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -348,25 +348,25 @@ if (!istype(W, /obj/item/weapon/wrench)) return ..() if (!(stat & NOPOWER) && on) - user << "\red You cannot unwrench this [src], turn it off first." + user << "You cannot unwrench this [src], turn it off first." return 1 var/turf/T = src.loc if (node && node.level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) qdel(src) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index 88a83d13b13..a57d2254be0 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -250,7 +250,7 @@ if(!powered()) return if(!src.allowed(user)) - user << "\red Access denied." + user << "Access denied." return ..() @@ -319,16 +319,16 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(loc, make_from=src) del(src) diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm index 2c0a7989533..3dea472524d 100644 --- a/code/ATMOSPHERICS/mainspipe.dm +++ b/code/ATMOSPHERICS/mainspipe.dm @@ -649,7 +649,7 @@ obj/machinery/atmospherics/mains_pipe/valve attack_hand(mob/user as mob) if(!src.allowed(user)) - user << "\red Access denied." + user << "You begin to freeze the [src]." if (do_after(user, 60)) user.visible_message( \ "[user] freezes \the [src].", \ - "\blue You finished freezing \the [src].", \ + "You finished freezing \the [src].", \ "You hear the hiss of gas.") src.frozen = 1 spawn (200) src.frozen = 0 src.visible_message( \ - "\the ice arounds the [src] melts.", \ - "\blue Your frozen [src] has thawed.", \ + "\The ice arounds \the [src] melts.", \ + "Your frozen [src] has thawed.", \ "You hear dripping water.") add_fingerprint(user) @@ -95,23 +95,23 @@ return ..() var/turf/T = src.loc if (level==1 && isturf(T) && T.intact) - user << "\red You must remove the plating first." + user << "You must remove the plating first." return 1 var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) if (!src.frozen) // If the pipe is not frozen - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") var/obj/item/P = new /obj/item/pipe(loc, make_from=src) for (var/obj/machinery/meter/meter in T) if (meter.target == src) diff --git a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm index c8993efb20a..daab1dc2d38 100644 --- a/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm +++ b/code/ATMOSPHERICS/pipes/simple/pipe_simple.dm @@ -71,7 +71,7 @@ else return 1 /obj/machinery/atmospherics/pipe/simple/proc/burst() - src.visible_message("\red \bold [src] bursts!"); + src.visible_message("\The [src] bursts!"); playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) var/datum/effect/effect/system/harmless_smoke_spread/smoke = new smoke.set_up(1,0, src.loc, 0) diff --git a/code/ATMOSPHERICS/pipes/vent.dm b/code/ATMOSPHERICS/pipes/vent.dm index 538d97fc048..9a435693de6 100644 --- a/code/ATMOSPHERICS/pipes/vent.dm +++ b/code/ATMOSPHERICS/pipes/vent.dm @@ -91,15 +91,15 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = T.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "\red You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench this [src], it too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(T, 'sound/items/Ratchet.ogg', 50, 1) - user << "\blue You begin to unfasten \the [src]..." + user << "You begin to unfasten \the [src]..." if (do_after(user, 40)) user.visible_message( \ "[user] unfastens \the [src].", \ - "\blue You have unfastened \the [src].", \ - "You hear ratchet.") + "You have unfastened \the [src].", \ + "You hear a ratchet.") new /obj/item/pipe(T, make_from=src) qdel(src) \ No newline at end of file From 5ef171cf48bb955e66e4733deaaa2831aca4db6c Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 8 Jul 2015 16:37:58 -0700 Subject: [PATCH 4/4] Fix horrible message in atmospherics unwrenching stuff You cannot unwrench this [src], it too exerted due to internal pressure. IT TOO EXERTED and this [src] it's now You cannot unwrench \the [src], it is too exerted due to internal pressure. --- code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm | 2 +- code/ATMOSPHERICS/components/binary_devices/passive_gate.dm | 2 +- code/ATMOSPHERICS/components/binary_devices/pump.dm | 2 +- code/ATMOSPHERICS/components/binary_devices/volume_pump.dm | 2 +- code/ATMOSPHERICS/components/portables_connector.dm | 2 +- code/ATMOSPHERICS/components/trinary_devices/filter.dm | 2 +- code/ATMOSPHERICS/components/trinary_devices/mixer.dm | 2 +- code/ATMOSPHERICS/components/tvalve.dm | 2 +- code/ATMOSPHERICS/components/unary/heat_exchanger.dm | 2 +- code/ATMOSPHERICS/components/unary/outlet_injector.dm | 2 +- code/ATMOSPHERICS/components/unary/thermal_plate.dm | 2 +- code/ATMOSPHERICS/components/unary/vent_pump.dm | 2 +- code/ATMOSPHERICS/components/unary/vent_scrubber.dm | 2 +- code/ATMOSPHERICS/components/valve.dm | 2 +- code/ATMOSPHERICS/pipes/pipe.dm | 2 +- code/ATMOSPHERICS/pipes/vent.dm | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm index c9b9cd89168..b71a55644e5 100644 --- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm @@ -297,7 +297,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm index 0056a5666dc..da9f1aba444 100644 --- a/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm +++ b/code/ATMOSPHERICS/components/binary_devices/passive_gate.dm @@ -161,7 +161,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/binary_devices/pump.dm b/code/ATMOSPHERICS/components/binary_devices/pump.dm index f8c9a2569cb..0e6c8ffa345 100644 --- a/code/ATMOSPHERICS/components/binary_devices/pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/pump.dm @@ -193,7 +193,7 @@ Thus, the two variables affect pump operation are set in New(): var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm index 15e3ee67a3f..e26396b08fe 100644 --- a/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm +++ b/code/ATMOSPHERICS/components/binary_devices/volume_pump.dm @@ -180,7 +180,7 @@ Thus, the two variables affect pump operation are set in New(): var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm index d2f374262e0..1ce9130dc71 100644 --- a/code/ATMOSPHERICS/components/portables_connector.dm +++ b/code/ATMOSPHERICS/components/portables_connector.dm @@ -144,7 +144,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm index 19740df1e46..9a66d184612 100755 --- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm @@ -162,7 +162,7 @@ Filter types: var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm index 73c8de1fd2c..bc3440e4589 100644 --- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm +++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm @@ -120,7 +120,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm index 71a77589d20..5b64a2c83bb 100644 --- a/code/ATMOSPHERICS/components/tvalve.dm +++ b/code/ATMOSPHERICS/components/tvalve.dm @@ -364,7 +364,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm index a3f61f986fb..7e3509d2979 100644 --- a/code/ATMOSPHERICS/components/unary/heat_exchanger.dm +++ b/code/ATMOSPHERICS/components/unary/heat_exchanger.dm @@ -75,7 +75,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/unary/outlet_injector.dm b/code/ATMOSPHERICS/components/unary/outlet_injector.dm index fb7fa8a0e7f..43c9a84d988 100644 --- a/code/ATMOSPHERICS/components/unary/outlet_injector.dm +++ b/code/ATMOSPHERICS/components/unary/outlet_injector.dm @@ -183,7 +183,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/unary/thermal_plate.dm b/code/ATMOSPHERICS/components/unary/thermal_plate.dm index 2ab6f24cb2b..65e37feff34 100644 --- a/code/ATMOSPHERICS/components/unary/thermal_plate.dm +++ b/code/ATMOSPHERICS/components/unary/thermal_plate.dm @@ -78,7 +78,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm index 8fa1bd4aaf8..307b98f0ad7 100644 --- a/code/ATMOSPHERICS/components/unary/vent_pump.dm +++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm @@ -408,7 +408,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm index 86e60a1cfb0..5a6220a48ee 100644 --- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm +++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm @@ -357,7 +357,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm index a57d2254be0..1fddc3b4c39 100644 --- a/code/ATMOSPHERICS/components/valve.dm +++ b/code/ATMOSPHERICS/components/valve.dm @@ -319,7 +319,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/pipes/pipe.dm b/code/ATMOSPHERICS/pipes/pipe.dm index d48b2957f5e..07af3328013 100644 --- a/code/ATMOSPHERICS/pipes/pipe.dm +++ b/code/ATMOSPHERICS/pipes/pipe.dm @@ -102,7 +102,7 @@ var/datum/gas_mixture/env_air = loc.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) if (!src.frozen) // If the pipe is not frozen - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) diff --git a/code/ATMOSPHERICS/pipes/vent.dm b/code/ATMOSPHERICS/pipes/vent.dm index 9a435693de6..78813a950dc 100644 --- a/code/ATMOSPHERICS/pipes/vent.dm +++ b/code/ATMOSPHERICS/pipes/vent.dm @@ -91,7 +91,7 @@ var/datum/gas_mixture/int_air = return_air() var/datum/gas_mixture/env_air = T.return_air() if ((int_air.return_pressure()-env_air.return_pressure()) > 2*ONE_ATMOSPHERE) - user << "You cannot unwrench this [src], it too exerted due to internal pressure." + user << "You cannot unwrench \the [src], it is too exerted due to internal pressure." add_fingerprint(user) return 1 playsound(T, 'sound/items/Ratchet.ogg', 50, 1)