[MIRROR] Improve atmos components code + OmegaStation fixes (#2752)

* Improve atmos components code + OmegaStation fixes

* Update circulator.dm

* Update dp_vent_pump.dm

* Update pump.dm

* Update volume_pump.dm

* Update pump.dm

* Update pump.dm

* Update volume_pump.dm

* fixes pumps shows area rather than vague jump

also removes it from admin log, wew

* wew
This commit is contained in:
CitadelStationBot
2017-09-22 20:05:58 -05:00
committed by Poojawa
parent 751e219f4b
commit bf1e4a456f
19 changed files with 356 additions and 424 deletions
@@ -2,7 +2,7 @@
name = "gas filter"
icon_state = "filter_off"
density = FALSE
can_unwrench = 1
can_unwrench = TRUE
var/on = FALSE
var/target_pressure = ONE_ATMOSPHERE
var/filter_type = ""
@@ -11,7 +11,7 @@
/obj/machinery/atmospherics/components/trinary/filter/flipped
icon_state = "filter_off_f"
flipped = 1
flipped = TRUE
// These two filter types have critical_machine flagged to on and thus causes the area they are in to be exempt from the Grid Check event.
@@ -43,27 +43,21 @@
..()
/obj/machinery/atmospherics/components/trinary/filter/update_icon_nopipes()
if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3)
if(on && NODE1 && NODE2 && NODE3 && is_operational())
icon_state = "filter_on[flipped?"_f":""]"
return
icon_state = "filter_off[flipped?"_f":""]"
/obj/machinery/atmospherics/components/trinary/filter/power_change()
var/old_stat = stat
..()
if(stat & NOPOWER)
on = FALSE
if(old_stat != stat)
if(stat != old_stat)
update_icon()
/obj/machinery/atmospherics/components/trinary/filter/process_atmos()
..()
if(!on)
return 0
if(!(NODE1 && NODE2 && NODE3))
return 0
if(!on || !(NODE1 && NODE2 && NODE3) || !is_operational())
return
var/datum/gas_mixture/air1 = AIR1
var/datum/gas_mixture/air2 = AIR2
@@ -73,7 +67,7 @@
if(output_starting_pressure >= target_pressure)
//No need to mix if target is already full!
return 1
return
//Calculate necessary moles to transfer using PV=nRT
@@ -113,8 +107,6 @@
update_parents()
return 1
/obj/machinery/atmospherics/components/trinary/filter/atmosinit()
set_frequency(frequency)
return ..()
@@ -167,3 +159,10 @@
investigate_log("was set to filter [filter_name] by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
update_icon()
/obj/machinery/atmospherics/components/trinary/filter/can_unwrench(mob/user)
. = ..()
if(. && on && is_operational())
to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
return FALSE
@@ -3,7 +3,7 @@
density = FALSE
name = "gas mixer"
can_unwrench = 1
can_unwrench = TRUE
var/on = FALSE
@@ -15,7 +15,7 @@
/obj/machinery/atmospherics/components/trinary/mixer/flipped
icon_state = "mixer_off_f"
flipped = 1
flipped = TRUE
/obj/machinery/atmospherics/components/trinary/mixer/update_icon()
cut_overlays()
@@ -29,18 +29,15 @@
return ..()
/obj/machinery/atmospherics/components/trinary/mixer/update_icon_nopipes()
if(!(stat & NOPOWER) && on && NODE1 && NODE2 && NODE3)
if(on && NODE1 && NODE2 && NODE3 && is_operational())
icon_state = "mixer_on[flipped?"_f":""]"
return
icon_state = "mixer_off[flipped?"_f":""]"
/obj/machinery/atmospherics/components/trinary/mixer/power_change()
var/old_stat = stat
..()
if(stat & NOPOWER)
on = FALSE
if(old_stat != stat)
if(stat != old_stat)
update_icon()
/obj/machinery/atmospherics/components/trinary/mixer/New()
@@ -51,10 +48,8 @@
/obj/machinery/atmospherics/components/trinary/mixer/process_atmos()
..()
if(!on)
return 0
if(!(NODE1 && NODE2 && NODE3))
return 0
if(!on || !(NODE1 && NODE2 && NODE3) && !is_operational())
return
var/datum/gas_mixture/air1 = AIR1
var/datum/gas_mixture/air2 = AIR2
@@ -64,7 +59,7 @@
if(output_starting_pressure >= target_pressure)
//No need to mix if target is already full!
return 1
return
//Calculate necessary moles to transfer using PV=nRT
@@ -114,7 +109,7 @@
var/datum/pipeline/parent3 = PARENT3
parent3.update = TRUE
return TRUE
return
/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
@@ -167,4 +162,12 @@
node1_concentration = max(0, min(1, node1_concentration - value))
investigate_log("was set to [node2_concentration] % on node 2 by [key_name(usr)]", INVESTIGATE_ATMOS)
. = TRUE
update_icon()
update_icon()
/obj/machinery/atmospherics/components/trinary/filter/can_unwrench(mob/user)
. = ..()
if(. && on && is_operational())
to_chat(user, "<span class='warning'>You cannot unwrench [src], turn it off first!</span>")
return FALSE
@@ -6,7 +6,7 @@
device_type = TRINARY
layer = GAS_FILTER_LAYER
var/flipped = 0
var/flipped = FALSE
/obj/machinery/atmospherics/components/trinary/SetInitDirections()
switch(dir)
@@ -44,4 +44,4 @@ Housekeeping and pipe network stuff
node1_connect = turn(node1_connect, 180)
node3_connect = turn(node3_connect, 180)
return list(node1_connect, node2_connect, node3_connect)
return list(node1_connect, node2_connect, node3_connect)