Reagent cooled atmo machines (#18178)

* reagent based cooling for heaters and coolers

* UI and wiki

* some adjustments

and fixes coolant tanks lol

* adds coolant tank to cargo

---------

Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
Will
2025-08-07 03:51:02 -04:00
committed by GitHub
parent 90ba1619f4
commit c81f5b697f
18 changed files with 145 additions and 26 deletions
+7
View File
@@ -515,3 +515,10 @@
for(var/datum/reagent/reagent as anything in cached_reagents)
reagent.on_update(A)
update_total()
// Get the cooling power value for machinery that uses reagents for coolant. It's up to the machines themselves to cap and translate this value in a useful way.
/datum/reagents/proc/machine_cooling_power()
var/cooling_power = 0
for(var/datum/reagent/R in reagent_list)
cooling_power += R.coolant_modifier * R.volume
return cooling_power
@@ -86,6 +86,7 @@
// Get internal data
subdata["description"] = R.description
subdata["addictive"] = 0
subdata["cooling_mod"] = R.coolant_modifier
if(R.id in get_addictive_reagents(ADDICT_ALL))
subdata["addictive"] = TRUE
subdata["flavor"] = R.taste_description
@@ -49,6 +49,8 @@
var/supply_conversion_value = null
var/industrial_use = null // unique description for export off station
var/coolant_modifier = -0.5 // this is multiplied by the volume of the reagent. Most things are not good coolant. EX: Water is 1, coolant is 2. -1 would be a bad reagent for cooling.
/datum/reagent/proc/remove_self(var/amount) // Shortcut
if(holder)
holder.remove_reagent(id, amount)
+5
View File
@@ -17,6 +17,7 @@
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_BIOHAZARD
coolant_modifier = 0.25
/datum/reagent/blood/initialize_data(var/newdata)
@@ -188,6 +189,7 @@
id = REAGENT_ID_SYNTHBLOOD
color = "#999966"
volume_mod = 2
coolant_modifier = 0.25
/datum/reagent/blood/synthblood/initialize_data(var/newdata)
..()
@@ -202,6 +204,7 @@
id = REAGENT_ID_SYNTHBLOOD_DILUTE
color = "#cacaaf"
volume_mod = 1.2
coolant_modifier = 0.5
// pure concentrated antibodies
/datum/reagent/antibodies
@@ -238,6 +241,7 @@
supply_conversion_value = REFINERYEXPORT_VALUE_NO
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 1 // Water!
/datum/reagent/water/touch_turf(var/turf/simulated/T)
if(!istype(T))
@@ -336,6 +340,7 @@
supply_conversion_value = REFINERYEXPORT_VALUE_PROCESSED
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 0.15
/datum/reagent/fuel/touch_turf(var/turf/T, var/amount)
..()
@@ -73,6 +73,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 0.15
/datum/reagent/chlorine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.take_organ_damage(1*REM, 0)
@@ -117,6 +118,7 @@
wiki_flag = WIKI_DRINK
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_FOOD
coolant_modifier = 1.15
/datum/reagent/ethanol/touch_mob(var/mob/living/L, var/amount)
..()
@@ -340,6 +342,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_PRECURSOR
coolant_modifier = 0.15
/datum/reagent/lithium/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA)
@@ -375,6 +378,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 0.25
/datum/reagent/oxygen
name = REAGENT_OXYGEN
@@ -385,6 +389,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 0.25
/datum/reagent/oxygen/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_VOX)
@@ -560,6 +565,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 0.25
/datum/reagent/sugar
name = REAGENT_SUGAR
@@ -576,6 +582,7 @@
supply_conversion_value = REFINERYEXPORT_VALUE_RARE
industrial_use = REFINERYEXPORT_REASON_FOOD
coolant_modifier = -0.25
/datum/reagent/sugar/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.adjust_nutrition(removed * 3)
@@ -607,6 +614,7 @@
color = "#BF8C00"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = -0.25
/datum/reagent/tungsten
name = REAGENT_TUNGSTEN
@@ -13,6 +13,7 @@
color = "#664330"
affects_robots = 1 //VOREStation Edit
wiki_flag = WIKI_FOOD
coolant_modifier = -1
supply_conversion_value = REFINERYEXPORT_VALUE_UNWANTED
industrial_use = REFINERYEXPORT_REASON_FOOD
@@ -163,6 +164,7 @@
taste_mult = 0.1
nutriment_factor = 27//The caloric ratio of carb/protein/fat is 4:4:9
color = "#CCCCCC"
coolant_modifier = 1.5
/datum/reagent/nutriment/triglyceride/oil
//Having this base class incase we want to add more variants of oil
@@ -278,6 +280,7 @@
cup_prefix = "sweetened"
injectable = 1
coolant_modifier = 1.25
/datum/reagent/nutriment/protein // Bad for Skrell!
name = REAGENT_PROTEIN
@@ -764,6 +767,7 @@
wiki_flag = WIKI_FOOD
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_FOOD
coolant_modifier = 2.5
/datum/reagent/frostoil/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
@@ -804,6 +808,7 @@
metabolism = REM * 0.5
supply_conversion_value = REFINERYEXPORT_VALUE_PROCESSED
industrial_use = REFINERYEXPORT_REASON_MATSCI
coolant_modifier = 3
/datum/reagent/capsaicin
name = REAGENT_CAPSAICIN
@@ -1013,6 +1018,7 @@
wiki_flag = WIKI_DRINK
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_FOOD
coolant_modifier = 0.8
/datum/reagent/drink/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
var/strength_mod = 1
@@ -4596,6 +4602,7 @@
glass_name = REAGENT_VOXDELIGHT
glass_desc = "Not recommended if you enjoy having organs."
coolant_modifier = 1.25
/datum/reagent/ethanol/voxdelight/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
@@ -4797,6 +4804,7 @@
glass_desc = "Minty, rich, and painfully cold. It's a blizzard in a cup."
allergen_type = ALLERGEN_COFFEE|ALLERGEN_STIMULANT //Made from iced coffee(coffee)
coolant_modifier = 1.15
/datum/reagent/ethanol/mintjulep
name = REAGENT_MINTJULEP
@@ -5017,6 +5025,7 @@
reagent_state = LIQUID
nutriment_factor = 40 //very filling
color = "#d169b2"
coolant_modifier = 3 // HOOH!
/datum/reagent/nutriment/magicdust/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
@@ -1379,6 +1379,7 @@
scannable = 1
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_CLONEDRUG
coolant_modifier = 0.5 // Okay substitute coolant
/datum/reagent/leporazine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
+9
View File
@@ -302,6 +302,7 @@
description = "A isotope of hydrogen. It has one extra neutron, and shares all chemical characteristics with hydrogen."
supply_conversion_value = REFINERYEXPORT_VALUE_RARE
industrial_use = REFINERYEXPORT_REASON_PRECURSOR
coolant_modifier = 1 // It's ALMOST water
/datum/reagent/hydrogen/tritium
name = REAGENT_TRITIUM
@@ -309,6 +310,7 @@
description = "A radioactive isotope of hydrogen. It has two extra neutrons, and shares all other chemical characteristics with hydrogen."
supply_conversion_value = REFINERYEXPORT_VALUE_RARE
industrial_use = REFINERYEXPORT_REASON_PRECURSOR
coolant_modifier = 1 // It's ALMOST water
/datum/reagent/lithium/lithium6
name = REAGENT_LITHIUM6
@@ -326,6 +328,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_RARE
industrial_use = REFINERYEXPORT_REASON_PRECURSOR
coolant_modifier = 2
/datum/reagent/boron/boron11
name = REAGENT_BORON11
@@ -394,6 +397,7 @@
supply_conversion_value = REFINERYEXPORT_VALUE_NO
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 1 // It's water
/datum/reagent/water/holywater/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
..()
@@ -417,6 +421,7 @@
color = "#404030"
supply_conversion_value = REFINERYEXPORT_VALUE_COMMON
industrial_use = REFINERYEXPORT_REASON_RAW
coolant_modifier = 1.25
/datum/reagent/diethylamine
name = REAGENT_DIETHYLAMINE
@@ -621,6 +626,7 @@
color = "#808080"
supply_conversion_value = REFINERYEXPORT_VALUE_PROCESSED
industrial_use = REFINERYEXPORT_REASON_PRECURSOR
coolant_modifier = 0.95
/datum/reagent/nitroglycerin
name = REAGENT_NITROGLYCERIN
@@ -644,6 +650,7 @@
affects_robots = TRUE
supply_conversion_value = REFINERYEXPORT_VALUE_PROCESSED
industrial_use = REFINERYEXPORT_REASON_INDUSTRY
coolant_modifier = 2 // In the name
/datum/reagent/coolant/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(M.isSynthetic() && ishuman(M))
@@ -707,6 +714,7 @@
color = "#DF9FBF"
supply_conversion_value = REFINERYEXPORT_VALUE_PROCESSED
industrial_use = REFINERYEXPORT_REASON_CLONEDRUG
coolant_modifier = -2 //Ew
/datum/reagent/mineralfluid
name = REAGENT_MINERALIZEDFLUID
@@ -717,6 +725,7 @@
color = "#ff205255"
supply_conversion_value = REFINERYEXPORT_VALUE_PROCESSED
industrial_use = REFINERYEXPORT_REASON_MATSCI
coolant_modifier = -2.5
// The opposite to healing nanites, exists to make unidentified hypos implied to have nanites not be 100% safe.
/datum/reagent/defective_nanites
+1
View File
@@ -182,6 +182,7 @@
skin_danger = 1
supply_conversion_value = 5 SHEET_TO_REAGENT_EQUIVILENT // has sheet value
industrial_use = REFINERYEXPORT_REASON_PHORON
coolant_modifier = 0.85
/datum/reagent/toxin/phoron/touch_mob(var/mob/living/L, var/amount)
..()
@@ -1,3 +1,4 @@
#define COOLING_FACTOR 12500 //5000 in a near empty 7x7 room with a heat cap of 478325 drops it by 20.9C. 125000 drops it by 52.25C. This seems appropriate.
/obj/structure/reagent_dispensers/coolanttank
name = "coolant tank"
desc = "A tank of industrial coolant"
@@ -11,8 +12,7 @@
/obj/structure/reagent_dispensers/coolanttank/bullet_act(var/obj/item/projectile/Proj)
if(Proj.get_structure_damage())
if(!istype(Proj ,/obj/item/projectile/beam/lasertag) && !istype(Proj ,/obj/item/projectile/beam/practice) ) // TODO: make this not terrible
explode()
explode()
/obj/structure/reagent_dispensers/coolanttank/ex_act()
explode()
@@ -22,18 +22,13 @@
S.set_up(5, 0, src.loc)
playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)
S.start()
S.start()
var/datum/gas_mixture/env = src.loc.return_air()
if(env)
if (reagents.total_volume > 750)
env.temperature = 0
else if (reagents.total_volume > 500)
env.temperature -= 100
else
env.temperature -= 50
var/cooling_strength = reagents.machine_cooling_power()
if(cooling_strength > 0)
env.add_thermal_energy(-(cooling_strength * COOLING_FACTOR))
sleep(10)
if(src)
qdel(src)
QDEL_IN(src, 10)
#undef COOLING_FACTOR