Skip to content

Commit 9da7a48

Browse files
Atmos binary device improvements (#6544)
## About The Pull Request Passive gate, pressure valve and temperature gate had their maximum possible setting increased while still maintaining their previous alt-click functionality. Added a cut-off temperature setting to the temperature pump that will stop transfering heat if either input temperature is too low or output temperature is too high. You can change the setting with a multitool similarly to temperature gates. Also added an indicator light to signal if heat is being transferred. ## Why It's Good For The Game None of these devices are actively pushing gas from one side to the other, they are just pass-through valves, so it doesn't makes sense for them to have their settings be so low. New heat pump setting will offer better control over temperature sensitive setups. ## Changelog :cl: EssentialTomato qol: Heat pumps now have a cut-off temperature setting and a heat flow indicator. You can switch between input cooling and output heating modes. balance: Massively increased the maximum settings on passive atmospherics binary devices. /:cl:
1 parent 004aff1 commit 9da7a48

File tree

9 files changed

+118
-20
lines changed

9 files changed

+118
-20
lines changed

code/__DEFINES/atmospherics/atmos_piping.dm

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
//Atmos pipe limits
2121
/// (kPa) What pressure pumps and powered equipment max out at.
2222
#define MAX_OUTPUT_PRESSURE 4500
23+
//Maximum pressure passive devices max out at
24+
#define MAX_PASSIVE_OUTPUT_PRESSURE 1e12
25+
//Maximum temperature setting for devices
26+
#define MAX_TEMPERATURE_SETTING 1e12
2327
/// (L/s) Maximum speed powered equipment can work at.
2428
#define MAX_TRANSFER_RATE 200
2529
/// How many percent of the contents that an overclocked volume pumps leak into the air

code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Passive gate is similar to the regular pump except:
2727
/obj/machinery/atmospherics/components/binary/passive_gate/add_context(atom/source, list/context, obj/item/held_item, mob/user)
2828
. = ..()
2929
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Turn [on ? "off" : "on"]"
30-
context[SCREENTIP_CONTEXT_ALT_LMB] = "Maximize target pressure"
30+
context[SCREENTIP_CONTEXT_ALT_LMB] = "Set to maximum recommended target pressure"
3131
return CONTEXTUAL_SCREENTIP_SET
3232

3333
/obj/machinery/atmospherics/components/binary/passive_gate/CtrlClick(mob/user)
@@ -76,7 +76,7 @@ Passive gate is similar to the regular pump except:
7676
var/data = list()
7777
data["on"] = on
7878
data["pressure"] = round(target_pressure)
79-
data["max_pressure"] = round(MAX_OUTPUT_PRESSURE)
79+
data["max_pressure"] = round(MAX_PASSIVE_OUTPUT_PRESSURE)
8080
return data
8181

8282
/obj/machinery/atmospherics/components/binary/passive_gate/ui_act(action, params)
@@ -91,13 +91,13 @@ Passive gate is similar to the regular pump except:
9191
if("pressure")
9292
var/pressure = params["pressure"]
9393
if(pressure == "max")
94-
pressure = MAX_OUTPUT_PRESSURE
94+
pressure = MAX_PASSIVE_OUTPUT_PRESSURE
9595
. = TRUE
9696
else if(text2num(pressure) != null)
9797
pressure = text2num(pressure)
9898
. = TRUE
9999
if(.)
100-
target_pressure = clamp(pressure, 0, ONE_ATMOSPHERE*100)
100+
target_pressure = clamp(pressure, 0, MAX_PASSIVE_OUTPUT_PRESSURE)
101101
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
102102
update_appearance()
103103

code/modules/atmospherics/machinery/components/binary_devices/pressure_valve.dm

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/obj/machinery/atmospherics/components/binary/pressure_valve/add_context(atom/source, list/context, obj/item/held_item, mob/user)
2020
. = ..()
2121
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Turn [on ? "off" : "on"]"
22-
context[SCREENTIP_CONTEXT_ALT_LMB] = "Maximize target pressure"
22+
context[SCREENTIP_CONTEXT_ALT_LMB] = "Set to maximum recommended target pressure"
2323
return CONTEXTUAL_SCREENTIP_SET
2424

2525
/obj/machinery/atmospherics/components/binary/pressure_valve/CtrlClick(mob/user)
@@ -77,7 +77,7 @@
7777
var/data = list()
7878
data["on"] = on
7979
data["pressure"] = round(target_pressure)
80-
data["max_pressure"] = round(ONE_ATMOSPHERE*100)
80+
data["max_pressure"] = round(MAX_PASSIVE_OUTPUT_PRESSURE)
8181
return data
8282

8383
/obj/machinery/atmospherics/components/binary/pressure_valve/ui_act(action, params)
@@ -92,13 +92,13 @@
9292
if("pressure")
9393
var/pressure = params["pressure"]
9494
if(pressure == "max")
95-
pressure = ONE_ATMOSPHERE*100
95+
pressure = MAX_PASSIVE_OUTPUT_PRESSURE
9696
. = TRUE
9797
else if(text2num(pressure) != null)
9898
pressure = text2num(pressure)
9999
. = TRUE
100100
if(.)
101-
target_pressure = clamp(pressure, 0, ONE_ATMOSPHERE*100)
101+
target_pressure = clamp(pressure, 0, MAX_PASSIVE_OUTPUT_PRESSURE)
102102
investigate_log("was set to [target_pressure] kPa by [key_name(usr)]", INVESTIGATE_ATMOS)
103103
update_appearance()
104104

code/modules/atmospherics/machinery/components/binary_devices/temperature_gate.dm

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
///Minimum allowed temperature
1212
var/minimum_temperature = TCMB
1313
///Maximum allowed temperature to be set
14-
var/max_temperature = 4500
14+
var/max_temperature = MAX_TEMPERATURE_SETTING
15+
//Maximum recommended temperature
16+
var/max_recommended_temperature = 4500
1517
///Check if the sensor should let gas pass if temperature in the mix is less/higher than the target one
1618
var/inverted = FALSE
1719
///Check if the gas is moving from one pipenet to the other
@@ -24,7 +26,7 @@
2426
/obj/machinery/atmospherics/components/binary/temperature_gate/add_context(atom/source, list/context, obj/item/held_item, mob/user)
2527
. = ..()
2628
context[SCREENTIP_CONTEXT_CTRL_LMB] = "Turn [on ? "off" : "on"]"
27-
context[SCREENTIP_CONTEXT_ALT_LMB] = "Maximize target temperature"
29+
context[SCREENTIP_CONTEXT_ALT_LMB] = "Set to maximum recommended target temperature"
2830
return CONTEXTUAL_SCREENTIP_SET
2931

3032
/obj/machinery/atmospherics/components/binary/temperature_gate/CtrlClick(mob/user)
@@ -37,7 +39,7 @@
3739

3840
/obj/machinery/atmospherics/components/binary/temperature_gate/AltClick(mob/user)
3941
if(can_interact(user))
40-
target_temperature = max_temperature
42+
target_temperature = max_recommended_temperature
4143
investigate_log("was set to [target_temperature] K by [key_name(user)]", INVESTIGATE_ATMOS)
4244
balloon_alert(user, "target temperature set to [target_temperature] K")
4345
update_appearance()
@@ -136,7 +138,7 @@
136138
if (istype(I))
137139
inverted = !inverted
138140
if(inverted)
139-
to_chat(user, span_notice("You set the [src]'s sensors to release gases when the temperature is higher than the setted one."))
141+
to_chat(user, span_notice("You set [src]'s sensors to release gases when the temperature is higher than the setted one."))
140142
else
141-
to_chat(user, span_notice("You set the [src]'s sensors to the default settings."))
143+
to_chat(user, span_notice("You set [src]'s sensors to the default settings."))
142144
return TRUE

code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm

+58-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
var/heat_transfer_rate = 0
1212
///Maximum allowed transfer percentage
1313
var/max_heat_transfer_rate = 100
14+
//Desired temperature
15+
var/target_temperature = TCMB
16+
///Minimum allowed temperature
17+
var/minimum_temperature = TCMB
18+
///Maximum allowed temperature to be set
19+
var/max_temperature = MAX_TEMPERATURE_SETTING
20+
// Input cooling / output heating smart mode
21+
var/inverted = FALSE
22+
// Checks if heat is being transfered from input to output
23+
var/is_heat_flowing = FALSE
1424

1525
/obj/machinery/atmospherics/components/binary/temperature_pump/Initialize(mapload)
1626
. = ..()
@@ -38,8 +48,22 @@
3848
update_appearance()
3949
return ..()
4050

51+
/obj/machinery/atmospherics/components/binary/temperature_pump/examine(mob/user)
52+
. = ..()
53+
. += "This device will transfer heat if the temperature of the gas in the [inverted ? "output is lower" : "input is higher"] than the temperature set in the interface."
54+
if(inverted)
55+
. += "The device settings can be restored if a multitool is used on it."
56+
else
57+
. += "The sensor's settings can be changed by using a multitool on the device."
58+
59+
4160
/obj/machinery/atmospherics/components/binary/temperature_pump/update_icon_nopipes()
42-
icon_state = "tpump_[on && is_operational ? "on" : "off"]-[set_overlay_offset(piping_layer)]"
61+
if(on && is_operational && is_heat_flowing)
62+
icon_state = "tpump_flow-[set_overlay_offset(piping_layer)]"
63+
else if(on && is_operational && !is_heat_flowing)
64+
icon_state = "tpump_on-[set_overlay_offset(piping_layer)]"
65+
else
66+
icon_state = "tpump_off-[set_overlay_offset(piping_layer)]"
4367

4468
/obj/machinery/atmospherics/components/binary/temperature_pump/process_atmos()
4569
if(!on || !is_operational)
@@ -48,21 +72,28 @@
4872
var/datum/gas_mixture/air_input = airs[1]
4973
var/datum/gas_mixture/air_output = airs[2]
5074

51-
if(!QUANTIZE(air_input.total_moles()) || !QUANTIZE(air_output.total_moles())) //Don't transfer if there's no gas
75+
if(!QUANTIZE(air_input.total_moles()) || !QUANTIZE(air_output.total_moles()) || (heat_transfer_rate<=0)) //Don't transfer if there's no gas or if the transfer rate is zero
76+
is_heat_flowing = FALSE
77+
update_icon_nopipes()
5278
return
5379
var/datum/gas_mixture/remove_input = air_input.remove_ratio(0.9)
5480
var/datum/gas_mixture/remove_output = air_output.remove_ratio(0.9)
5581

5682
var/coolant_temperature_delta = remove_input.temperature - remove_output.temperature
5783

58-
if(coolant_temperature_delta > 0)
84+
if((coolant_temperature_delta > 0) && ((!inverted && (air_input.temperature>target_temperature)) || (inverted && (air_output.temperature<target_temperature))))
5985
var/input_capacity = remove_input.heat_capacity()
6086
var/output_capacity = remove_output.heat_capacity()
87+
is_heat_flowing = TRUE
6188

6289
var/cooling_heat_amount = (heat_transfer_rate * 0.01) * CALCULATE_CONDUCTION_ENERGY(coolant_temperature_delta, output_capacity, input_capacity)
6390
remove_output.temperature = max(remove_output.temperature + (cooling_heat_amount / output_capacity), TCMB)
6491
remove_input.temperature = max(remove_input.temperature - (cooling_heat_amount / input_capacity), TCMB)
6592
update_parents()
93+
else
94+
is_heat_flowing = FALSE
95+
96+
update_icon_nopipes()
6697

6798
var/power_usage = 200
6899

@@ -83,6 +114,9 @@
83114
data["on"] = on
84115
data["rate"] = round(heat_transfer_rate)
85116
data["max_heat_transfer_rate"] = round(max_heat_transfer_rate)
117+
data["temperature"] = round(target_temperature)
118+
data["min_temperature"] = round(minimum_temperature)
119+
data["max_temperature"] = round(max_temperature)
86120
return data
87121

88122
/obj/machinery/atmospherics/components/binary/temperature_pump/ui_act(action, params)
@@ -105,4 +139,25 @@
105139
if(.)
106140
heat_transfer_rate = clamp(rate, 0, max_heat_transfer_rate)
107141
investigate_log("was set to [heat_transfer_rate]% by [key_name(usr)]", INVESTIGATE_ATMOS)
142+
if("temperature")
143+
var/temperature = params["temperature"]
144+
if(temperature == "tmax")
145+
temperature = max_temperature
146+
. = TRUE
147+
else if(text2num(temperature) != null)
148+
temperature = text2num(temperature)
149+
. = TRUE
150+
if(.)
151+
target_temperature = clamp(minimum_temperature, temperature, max_temperature)
152+
investigate_log("was set to [target_temperature] K by [key_name(usr)]", INVESTIGATE_ATMOS)
108153
update_appearance()
154+
155+
/obj/machinery/atmospherics/components/binary/temperature_pump/multitool_act(mob/living/user, obj/item/multitool/Lorem)
156+
. = ..()
157+
if (istype(Lorem))
158+
inverted = !inverted
159+
if(inverted)
160+
to_chat(user, span_notice("You set [src]'s sensors to transfer heat when the output temperature is lower than the setted one."))
161+
else
162+
to_chat(user, span_notice("You set [src]'s sensors to transfer heat when the input temperature is higher than the setted one."))
163+
return TRUE
Binary file not shown.

tgui/packages/tgui/interfaces/AtmosPump.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const AtmosPump = (props) => {
1616
const { on, max_rate, max_pressure, rate, pressure } = data;
1717

1818
return (
19-
<Window width={335} height={115}>
19+
<Window width={345} height={115}>
2020
<Window.Content>
2121
<Section>
2222
<LabeledList>

tgui/packages/tgui/interfaces/AtmosTempGate.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const AtmosTempGate = (props) => {
1515
const { on, temperature, min_temperature, max_temperature } = data;
1616

1717
return (
18-
<Window width={335} height={115}>
18+
<Window width={345} height={115}>
1919
<Window.Content>
2020
<Section>
2121
<LabeledList>

tgui/packages/tgui/interfaces/AtmosTempPump.tsx

+39-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,24 @@ type Data = {
77
on: BooleanLike;
88
rate: number;
99
max_heat_transfer_rate: number;
10+
temperature: number;
11+
min_temperature: number;
12+
max_temperature: number;
1013
};
1114

1215
export const AtmosTempPump = (props) => {
1316
const { act, data } = useBackend<Data>();
14-
const { on, rate, max_heat_transfer_rate } = data;
17+
const {
18+
on,
19+
rate,
20+
max_heat_transfer_rate,
21+
temperature,
22+
min_temperature,
23+
max_temperature,
24+
} = data;
1525

1626
return (
17-
<Window width={335} height={115}>
27+
<Window width={345} height={140}>
1828
<Window.Content>
1929
<Section>
2030
<LabeledList>
@@ -53,6 +63,33 @@ export const AtmosTempPump = (props) => {
5363
}
5464
/>
5565
</LabeledList.Item>
66+
<LabeledList.Item label="Heat settings">
67+
<NumberInput
68+
animated
69+
value={temperature}
70+
unit="K"
71+
width="75px"
72+
minValue={min_temperature}
73+
maxValue={max_temperature}
74+
step={1}
75+
onChange={(e, value) =>
76+
act('temperature', {
77+
temperature: value,
78+
})
79+
}
80+
/>
81+
<Button
82+
ml={1}
83+
icon="plus"
84+
content="Max"
85+
disabled={temperature === max_temperature}
86+
onClick={() =>
87+
act('temperature', {
88+
temperature: 'tmax',
89+
})
90+
}
91+
/>
92+
</LabeledList.Item>
5693
</LabeledList>
5794
</Section>
5895
</Window.Content>

0 commit comments

Comments
 (0)