From c043411b2fbf81dd590196c50f6a6f4d934aa0fc Mon Sep 17 00:00:00 2001 From: KalevTait <107985691+KalevTait@users.noreply.github.com> Date: Wed, 13 Jul 2022 05:57:08 +0100 Subject: [PATCH] Code Readability - Atmospheric Pumps (#18151) * pumps * change pump_direction_releasing to releasing, and fix up maps --- _maps/map_files/Delta/delta.dmm | 14 ++++---- _maps/map_files/MetaStation/MetaStation.dmm | 4 +-- .../map_files/RandomZLevels/terrorspiders.dmm | 10 +++--- .../components/binary_devices/dp_vent_pump.dm | 16 +++++----- .../components/unary_devices/vent_pump.dm | 32 +++++++++---------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/_maps/map_files/Delta/delta.dmm b/_maps/map_files/Delta/delta.dmm index b6b910e73e4..63297b88dfa 100644 --- a/_maps/map_files/Delta/delta.dmm +++ b/_maps/map_files/Delta/delta.dmm @@ -16084,7 +16084,7 @@ internal_pressure_bound = 2000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/air, /area/atmos) @@ -17580,7 +17580,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/co2, /area/atmos) @@ -19224,7 +19224,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/o2, /area/atmos) @@ -20439,7 +20439,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/plasma, /area/atmos) @@ -21800,7 +21800,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/n2, /area/atmos) @@ -22939,7 +22939,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/n20, /area/atmos) @@ -27723,7 +27723,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/vacuum, /area/atmos) diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 8f38a5ec8f4..709b071c5f2 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -32231,7 +32231,7 @@ initialize_directions = 1; internal_pressure_bound = 4000; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/vacuum, /area/maintenance/incinerator) @@ -41597,7 +41597,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/plasteel/airless, /area/atmos) diff --git a/_maps/map_files/RandomZLevels/terrorspiders.dmm b/_maps/map_files/RandomZLevels/terrorspiders.dmm index 26ec104eabf..73acdc4c292 100644 --- a/_maps/map_files/RandomZLevels/terrorspiders.dmm +++ b/_maps/map_files/RandomZLevels/terrorspiders.dmm @@ -7019,7 +7019,7 @@ internal_pressure_bound = 2000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/air, /area/awaymission/UO71/eng) @@ -7277,7 +7277,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/bluegrid{ name = "Server Base"; @@ -8518,7 +8518,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine{ name = "vacuum floor"; @@ -9903,7 +9903,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/n2, /area/awaymission/UO71/eng) @@ -9925,7 +9925,7 @@ internal_pressure_bound = 4000; on = 1; pressure_checks = 2; - pump_direction = 0 + releasing = 0 }, /turf/simulated/floor/engine/o2, /area/awaymission/UO71/eng) diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm index 683a023bf16..1a8e1a9c5fc 100644 --- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm @@ -10,13 +10,13 @@ name = "dual-port air vent" desc = "Has a valve and pump attached to it. There are two ports." - can_unwrench = 1 + can_unwrench = TRUE level = 1 connect_types = list(1,2,3) //connects to regular, supply and scrubbers pipes - var/pump_direction = 1 //0 = siphoning, 1 = releasing + var/releasing = TRUE //FALSE = siphoning, TRUE = releasing var/external_pressure_bound = ONE_ATMOSPHERE var/input_pressure_min = 0 @@ -87,7 +87,7 @@ if(!powered()) vent_icon += "off" else - vent_icon += "[on ? "[pump_direction ? "out" : "in"]" : "off"]" + vent_icon += "[on ? "[releasing ? "out" : "in"]" : "off"]" overlays += SSair.icon_manager.get_atmos_icon("device", , , vent_icon) @@ -119,7 +119,7 @@ var/datum/gas_mixture/environment = loc.return_air() var/environment_pressure = environment.return_pressure() - if(pump_direction) //input -> external + if(releasing) //input -> external var/pressure_delta = 10000 if(pressure_checks&1) @@ -169,7 +169,7 @@ "tag" = id_tag, "device" = "ADVP", "power" = on, - "direction" = pump_direction?("release"):("siphon"), + "direction" = releasing?("release"):("siphon"), "checks" = pressure_checks, "input" = input_pressure_min, "output" = output_pressure_max, @@ -190,18 +190,18 @@ on = !on if(signal.data["direction"] != null) - pump_direction = text2num(signal.data["direction"]) + releasing = text2num(signal.data["direction"]) if(signal.data["checks"] != null) pressure_checks = text2num(signal.data["checks"]) if(signal.data["purge"]) pressure_checks &= ~1 - pump_direction = 0 + releasing = FALSE if(signal.data["stabilize"])//the fact that this was "stabalize" shows how many fucks people give about these wonders, none pressure_checks |= 1 - pump_direction = 1 + releasing = TRUE if(signal.data["set_input_pressure"] != null) input_pressure_min = clamp( diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm index 9f4afef06d1..57dde255b5a 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm @@ -12,15 +12,15 @@ plane = FLOOR_PLANE layer = GAS_SCRUBBER_LAYER - can_unwrench = 1 - var/open = 0 + can_unwrench = TRUE + var/open = FALSE var/area/initial_loc var/area_uid req_one_access_txt = "24;10" - var/pump_direction = 1 //0 = siphoning, 1 = releasing + var/releasing = TRUE //FALSE = siphoning, TRUE = releasing var/external_pressure_bound = EXTERNAL_PRESSURE_BOUND var/internal_pressure_bound = INTERNAL_PRESSURE_BOUND @@ -35,11 +35,11 @@ var/internal_pressure_bound_default = INTERNAL_PRESSURE_BOUND var/pressure_checks_default = PRESSURE_CHECKS - var/welded = 0 // Added for aliens -- TLE + var/welded = FALSE // Added for aliens -- TLE var/weld_burst_pressure = 50 * ONE_ATMOSPHERE //the (internal) pressure at which welded covers will burst off frequency = ATMOS_VENTSCRUB - Mtoollink = 1 + Mtoollink = TRUE var/radio_filter_out var/radio_filter_in @@ -50,14 +50,14 @@ return "This pumps the contents of the attached pipe out into the atmosphere, if needed. It can be controlled from an Air Alarm." /obj/machinery/atmospherics/unary/vent_pump/on - on = 1 + on = TRUE icon_state = "map_vent_out" /obj/machinery/atmospherics/unary/vent_pump/siphon - pump_direction = 0 + releasing = FALSE /obj/machinery/atmospherics/unary/vent_pump/siphon/on - on = 1 + on = TRUE icon_state = "map_vent_in" /obj/machinery/atmospherics/unary/vent_pump/New() @@ -99,7 +99,7 @@ else if(!powered()) vent_icon += "off" else - vent_icon += "[on ? "[pump_direction ? "out" : "in"]" : "off"]" + vent_icon += "[on ? "[releasing ? "out" : "in"]" : "off"]" overlays += SSair.icon_manager.get_atmos_icon("device", state = vent_icon) @@ -149,7 +149,7 @@ var/datum/gas_mixture/environment = loc.return_air() var/environment_pressure = environment.return_pressure() - if(pump_direction) //internal -> external + if(releasing) //internal -> external var/pressure_delta = 10000 if(pressure_checks & 1) pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure)) @@ -208,7 +208,7 @@ "tag" = src.id_tag, "device" = "AVP", "power" = on, - "direction" = pump_direction?("release"):("siphon"), + "direction" = releasing?("release"):("siphon"), "checks" = pressure_checks, "internal" = internal_pressure_bound, "external" = external_pressure_bound, @@ -246,11 +246,11 @@ if("purge" in signal.data) pressure_checks &= ~1 - pump_direction = 0 + releasing = FALSE if("stabalize" in signal.data) pressure_checks |= 1 - pump_direction = 1 + releasing = TRUE if("power" in signal.data) on = text2num(signal.data["power"]) @@ -265,7 +265,7 @@ pressure_checks = (pressure_checks ? 0 : 3) if("direction" in signal.data) - pump_direction = text2num(signal.data["direction"]) + releasing = text2num(signal.data["direction"]) if("set_internal_pressure" in signal.data) internal_pressure_bound = clamp(text2num(signal.data["set_internal_pressure"]), 0, ONE_ATMOSPHERE * 50) @@ -313,13 +313,13 @@ to_chat(user, "Now closing the vent.") if(do_after(user, 20 * W.toolspeed, target = src)) playsound(loc, W.usesound, 100, 1) - open = 0 + open = FALSE user.visible_message("[user] screwdrivers the vent shut.", "You screwdriver the vent shut.", "You hear a screwdriver.") else to_chat(user, "Now opening the vent.") if(do_after(user, 20 * W.toolspeed, target = src)) playsound(loc, W.usesound, 100, 1) - open = 1 + open = TRUE user.visible_message("[user] screwdrivers the vent open.", "You screwdriver the vent open.", "You hear a screwdriver.") return if(istype(W, /obj/item/paper))