Atmospheric Device Changes, Added Volume Pump (#18261)

* Volume Pump added, Can now Connect some devices to the General Atmos Controller and Large Tank Controller

* Corrected Linting Errors. Added the ability to print tank control circuits.

* Undefined some defined as per linter.

* Code style adjustments

* fixes these

* Code Standards

---------

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
Muted Kobold
2025-08-28 01:12:44 +02:00
committed by GitHub
co-authored by Cameron Lennox
parent b4225ec5e7
commit f51a0f4d4d
14 changed files with 764 additions and 30 deletions
@@ -162,6 +162,32 @@
update_icon()
/obj/machinery/atmospherics/unary/outlet_injector/attackby(var/obj/item/W as obj, var/mob/user as mob)
if (W.has_tool_quality(TOOL_MULTITOOL))
var/list/options = list("Frequency", "ID Tag", "-SAVE TO BUFFER-", "Cancel")
var/answer = tgui_alert(user, "[src] has an ID of \"[id]\" and a frequency of [frequency]. What would you like to change?", "Options!", options)
if(!answer || answer == "Cancel" || !Adjacent(user))
return
switch(answer)
if("Frequency")
var/new_frequency = tgui_input_number(user, "[src] has a frequency of [frequency]. What would you like it to be?", "[src] frequency", frequency, RADIO_HIGH_FREQ, RADIO_LOW_FREQ)
if(new_frequency)
new_frequency = sanitize_frequency(new_frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
set_frequency(new_frequency)
to_chat(user, span_notice("You set the [src]'s frequency to [frequency]."))
if("ID Tag")
id = tgui_input_text(user, "Please insert an ID tag for [src], example 'exhaust_port'.", "Set ID Tag", id, MAX_NAME_LEN)
if(id)
to_chat(user, span_notice("You set the [src]'s ID Tag to \"[id]\"."))
if("-SAVE TO BUFFER-")
var/obj/item/multitool/tool = W
tool.connectable = src
to_chat(user, span_notice("You copied the [src] into the [tool]'s buffer!"))
return ..()
if (!W.has_tool_quality(TOOL_WRENCH))
return ..()
@@ -173,3 +199,11 @@
span_notice("You have unfastened \the [src]."), \
"You hear a ratchet.")
deconstruct()
/obj/machinery/atmospherics/unary/outlet_injector/CtrlClick(mob/user)
if (volume_rate == ATMOS_DEFAULT_VOLUME_PUMP + 500 || use_power == USE_POWER_OFF)
return ..()
volume_rate = ATMOS_DEFAULT_VOLUME_PUMP + 500
to_chat(user, span_notice("You have set \the [src] to [volume_rate]"))
update_icon()
+29 -15
View File
@@ -298,13 +298,13 @@
/obj/machinery/atmospherics/unary/vent_pump/atmos_init()
..()
//some vents work his own special way
radio_filter_in = frequency==1439?(RADIO_FROM_AIRALARM):null
radio_filter_out = frequency==1439?(RADIO_TO_AIRALARM):null
if(frequency)
set_frequency(frequency)
/obj/machinery/atmospherics/unary/vent_pump/proc/set_frequency(new_frequency)
//some vents work his own special way
radio_filter_in = new_frequency==1439?(RADIO_FROM_AIRALARM):null
radio_filter_out = new_frequency==1439?(RADIO_TO_AIRALARM):null
radio_connection = register_radio(src, frequency, new_frequency, radio_filter_in)
frequency = new_frequency
broadcast_status()
@@ -404,18 +404,7 @@
to_chat(user, span_warning("You need more welding fuel to complete this task."))
return 1
if(W.has_tool_quality(TOOL_MULTITOOL))
var/choice = tgui_alert(user, "[src] has an ID of \"[id_tag]\" and a frequency of [frequency]. What would you like to change?", "[src] ID", list("ID Tag", "Frequency", "Nothing"))
switch(choice)
if("ID Tag")
var/new_id = tgui_input_text(user, "[src] has an ID of \"[id_tag]\". What would you like it to be?", "[src] ID", id_tag, 30, FALSE, TRUE)
if(new_id)
id_tag = new_id
if("Frequency")
var/new_frequency = tgui_input_number(user, "[src] has a frequency of [frequency]. What would you like it to be?", "[src] frequency", frequency, RADIO_HIGH_FREQ, RADIO_LOW_FREQ)
if(new_frequency)
new_frequency = sanitize_frequency(new_frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
set_frequency(new_frequency)
multitool_act(W, user)
return TRUE
else
..()
@@ -458,6 +447,31 @@
"You hear a ratchet.")
deconstruct()
/obj/machinery/atmospherics/unary/vent_pump/proc/multitool_act(obj/item/W, mob/user)
var/list/options = list(
"ID Tag", "Frequency", "Direction", "-SAVE TO BUFFER-")
var/choice = tgui_input_list(user, "[src] has an ID of \"[id_tag]\" and a frequency of [frequency]. What would you like to change?", "[src] Config", options)
switch(choice)
if("ID Tag")
var/new_id = tgui_input_text(user, "[src] has an ID of \"[id_tag]\". What would you like it to be?", "[src] ID", id_tag, 30)
if(new_id)
id_tag = new_id
if("Frequency")
var/new_frequency = tgui_input_number(user, "[src] has a frequency of [frequency]. What would you like it to be? Note, 1439 will only hail Air Alarms for this device.", "[src] frequency", frequency, RADIO_HIGH_FREQ, RADIO_LOW_FREQ)
if(new_frequency)
new_frequency = sanitize_frequency(new_frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
set_frequency(new_frequency)
if("-SAVE TO BUFFER-")
var/obj/item/multitool/tool = W
tool.connectable = src
if("Direction")
pump_direction = !pump_direction
to_chat(user, span_notice("[src] is now [pump_direction ? "pumping in" : "siphoning out"]."))
update_icon()
#undef DEFAULT_PRESSURE_DELTA
#undef EXTERNAL_PRESSURE_BOUND