From c81f5b697faf10fa759786c89bc3fc623f3f62df Mon Sep 17 00:00:00 2001 From: Will <7099514+Willburd@users.noreply.github.com> Date: Thu, 7 Aug 2025 03:51:02 -0400 Subject: [PATCH] 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. --- .../components/unary/cold_sink.dm | 21 +++++++++++++- .../components/unary/heat_source.dm | 28 +++++++++++++++++-- code/controllers/subsystems/internal_wiki.dm | 2 ++ code/datums/supplypacks/atmospherics.dm | 6 ++++ .../circuitboards/machinery/unary_atmos.dm | 3 +- code/modules/reagents/holder/holder.dm | 7 +++++ code/modules/reagents/machinery/chemalyzer.dm | 1 + code/modules/reagents/reagents/_reagents.dm | 2 ++ code/modules/reagents/reagents/core.dm | 5 ++++ code/modules/reagents/reagents/dispenser.dm | 8 ++++++ code/modules/reagents/reagents/food_drinks.dm | 9 ++++++ code/modules/reagents/reagents/medicine.dm | 1 + code/modules/reagents/reagents/other.dm | 9 ++++++ code/modules/reagents/reagents/toxins.dm | 1 + .../xenoarcheaology/tools/coolant_tank.dm | 23 ++++++--------- .../tgui/interfaces/GasTemperatureSystem.tsx | 24 ++++++++++++++++ .../WikiSubPages/WikiChemistryPage.tsx | 4 +++ .../interfaces/PublicLibraryWiki/types.ts | 17 +++++------ 18 files changed, 145 insertions(+), 26 deletions(-) diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm index bf88cb248d5..60de1751b5f 100644 --- a/code/ATMOSPHERICS/components/unary/cold_sink.dm +++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm @@ -1,9 +1,12 @@ //TODO: Put this under a common parent type with heaters to cut down on the copypasta #define FREEZER_PERF_MULT 2.5 +#define REAGENT_COOLING_CONSUMED 0.1 +#define REAGENT_COOLING_MINMOD 0.15 +#define REAGENT_COOLING_MAXMOD 5 /obj/machinery/atmospherics/unary/freezer name = "gas cooling system" - desc = "Cools gas when connected to pipe network" + desc = "Cools gas when connected to pipe network. Can be filled by hose with coolant to increase efficiency." icon = 'icons/obj/Cryogenic2_vr.dmi' icon_state = "freezer_0" density = TRUE @@ -20,10 +23,14 @@ var/set_temperature = T20C // Thermostat var/cooling = 0 + var/reagent_cooling = 0 /obj/machinery/atmospherics/unary/freezer/Initialize(mapload) . = ..() default_apply_parts() + create_reagents(120) + AddComponent(/datum/component/hose_connector/input) + AddComponent(/datum/component/hose_connector/output) /obj/machinery/atmospherics/unary/freezer/atmos_init() if(node) @@ -75,6 +82,10 @@ data["targetGasTemperature"] = round(set_temperature) data["powerSetting"] = power_setting + data["reagentVolume"] = reagents.total_volume + data["reagentMaximum"] = reagents.maximum_volume + data["reagentPower"] = reagent_cooling + var/temp_class = "good" if(air_contents.temperature > (T0C - 20)) temp_class = "bad" @@ -108,6 +119,7 @@ /obj/machinery/atmospherics/unary/freezer/process() ..() + reagent_cooling = 1 + (reagents.machine_cooling_power(reagents) / reagents.maximum_volume) if(stat & (NOPOWER|BROKEN) || !use_power) cooling = 0 update_icon() @@ -123,6 +135,10 @@ var/cop = FREEZER_PERF_MULT * air_contents.temperature/heatsink_temperature //heatpump coefficient of performance from thermodynamics -> power used = heat_transfer/cop heat_transfer = min(heat_transfer, cop * power_rating) //limit heat transfer by available power + // Process coolant + heat_transfer *= CLAMP(reagent_cooling,REAGENT_COOLING_MINMOD,REAGENT_COOLING_MAXMOD) + reagents.remove_any(REAGENT_COOLING_CONSUMED) + var/removed = -air_contents.add_thermal_energy(-heat_transfer) //remove the heat if(debug) visible_message("[src]: Removing [removed] W.") @@ -174,4 +190,7 @@ if(panel_open) . += "The maintenance hatch is open." +#undef REAGENT_COOLING_MINMOD +#undef REAGENT_COOLING_MAXMOD +#undef REAGENT_COOLING_CONSUMED #undef FREEZER_PERF_MULT diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm index eacfb167292..eae2a6561e3 100644 --- a/code/ATMOSPHERICS/components/unary/heat_source.dm +++ b/code/ATMOSPHERICS/components/unary/heat_source.dm @@ -1,9 +1,12 @@ //TODO: Put this under a common parent type with freezers to cut down on the copypasta #define HEATER_PERF_MULT 2.5 +#define REAGENT_COOLING_CONSUMED 0.1 +#define REAGENT_COOLING_MINMOD 0.15 +#define REAGENT_COOLING_MAXMOD 5 /obj/machinery/atmospherics/unary/heater name = "gas heating system" - desc = "Heats gas when connected to a pipe network" + desc = "Heats gas when connected to a pipe network. Can be filled by hose with coolant to increase efficiency." icon = 'icons/obj/Cryogenic2_vr.dmi' icon_state = "heater_0" density = TRUE @@ -14,16 +17,21 @@ var/max_temperature = T20C + 680 var/internal_volume = 600 //L + var/heating_efficiency = 1 var/max_power_rating = 20000 //power rating when the usage is turned up to 100 var/power_setting = 100 var/set_temperature = T20C //thermostat var/heating = 0 //mainly for icon updates + var/reagent_cooling = 0 /obj/machinery/atmospherics/unary/heater/Initialize(mapload) . = ..() default_apply_parts() + create_reagents(120) + AddComponent(/datum/component/hose_connector/input) + AddComponent(/datum/component/hose_connector/output) /obj/machinery/atmospherics/unary/heater/atmos_init() if(node) @@ -58,15 +66,19 @@ /obj/machinery/atmospherics/unary/heater/process() ..() + reagent_cooling = 1 + (reagents.machine_cooling_power(reagents) / reagents.maximum_volume) if(stat & (NOPOWER|BROKEN) || !use_power) heating = 0 update_icon() return if(network && air_contents.total_moles && air_contents.temperature < set_temperature) - air_contents.add_thermal_energy(power_rating * HEATER_PERF_MULT) + air_contents.add_thermal_energy(power_rating * CLAMP(reagent_cooling,REAGENT_COOLING_MINMOD,REAGENT_COOLING_MAXMOD) * HEATER_PERF_MULT * heating_efficiency) use_power(power_rating) + // Process coolant + reagents.remove_any(REAGENT_COOLING_CONSUMED) + heating = 1 network.update = 1 else @@ -97,6 +109,10 @@ data["targetGasTemperature"] = round(set_temperature) data["powerSetting"] = power_setting + data["reagentVolume"] = reagents.total_volume + data["reagentMaximum"] = reagents.maximum_volume + data["reagentPower"] = reagent_cooling + var/temp_class = "average" if(air_contents.temperature > (T20C+40)) temp_class = "bad" @@ -130,16 +146,21 @@ ..() var/cap_rating = 0 var/bin_rating = 0 + var/laser_rating = 0 for(var/obj/item/stock_parts/P in component_parts) if(istype(P, /obj/item/stock_parts/capacitor)) cap_rating += P.rating if(istype(P, /obj/item/stock_parts/matter_bin)) bin_rating += P.rating + if(istype(P, /obj/item/stock_parts/micro_laser)) + laser_rating += (P.rating * 0.25) + max_power_rating = initial(max_power_rating) * cap_rating / 2 max_temperature = max(initial(max_temperature) - T20C, 0) * ((bin_rating * 4 + cap_rating) / 5) + T20C air_contents.volume = max(initial(internal_volume) - 200, 0) + 200 * bin_rating + heating_efficiency = max(initial(heating_efficiency), (laser_rating-1)) set_power_level(power_setting) /obj/machinery/atmospherics/unary/heater/proc/set_power_level(var/new_power_setting) @@ -161,4 +182,7 @@ if(panel_open) . += "The maintenance hatch is open." +#undef REAGENT_COOLING_MINMOD +#undef REAGENT_COOLING_MAXMOD +#undef REAGENT_COOLING_CONSUMED #undef HEATER_PERF_MULT diff --git a/code/controllers/subsystems/internal_wiki.dm b/code/controllers/subsystems/internal_wiki.dm index bae4349bb5e..d111aefa3c4 100644 --- a/code/controllers/subsystems/internal_wiki.dm +++ b/code/controllers/subsystems/internal_wiki.dm @@ -1157,6 +1157,7 @@ SUBSYSTEM_DEF(internal_wiki) data["addictive"] = TRUE data["industrial_use"] = R.industrial_use data["supply_points"] = R.supply_conversion_value ? R.supply_conversion_value : 0 + data["cooling_mod"] = R.coolant_modifier var/value = R.supply_conversion_value * REAGENTS_PER_SHEET * SSsupply.points_per_money value = FLOOR(value * 100,1) / 100 // Truncate decimals data["market_price"] = value @@ -1191,6 +1192,7 @@ SUBSYSTEM_DEF(internal_wiki) var/datum/material/C = get_material_by_name(data["sintering"]) if(C) body += "Sintering Results: [C.display_name] [C.sheet_plural_name]
" + body += "Coolant Factor: [data["cooling_mod"]]x
" if(data["overdose"] > 0) body += "Overdose: [data["overdose"]]u
" body += "Flavor: [data["flavor"]]
" diff --git a/code/datums/supplypacks/atmospherics.dm b/code/datums/supplypacks/atmospherics.dm index 931fe6062b4..a91ba84d72d 100644 --- a/code/datums/supplypacks/atmospherics.dm +++ b/code/datums/supplypacks/atmospherics.dm @@ -57,6 +57,12 @@ cost = 15 contains = list(/obj/machinery/portable_atmospherics/canister/carbon_dioxide) +/datum/supply_pack/atmos/coolant_tank + name = "Carbon dioxide gas canister" + desc = "A large tank full of liquid coolant." + cost = 15 + contains = list(/obj/structure/reagent_dispensers/coolanttank) + /datum/supply_pack/atmos/air_dispenser contains = list(/obj/machinery/pipedispenser/orderable) name = "Pipe Dispenser" diff --git a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm index 4b99122287b..f9c876cdc70 100644 --- a/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm +++ b/code/game/objects/items/weapons/circuitboards/machinery/unary_atmos.dm @@ -20,7 +20,8 @@ req_components = list( /obj/item/stack/cable_coil = 5, /obj/item/stock_parts/matter_bin = 1, - /obj/item/stock_parts/capacitor = 2) + /obj/item/stock_parts/capacitor = 2, + /obj/item/stock_parts/micro_laser = 4) /obj/item/circuitboard/unary_atmos/cooler name = T_BOARD("gas cooling system") diff --git a/code/modules/reagents/holder/holder.dm b/code/modules/reagents/holder/holder.dm index 1b4b31cb68b..acffe00a5a7 100644 --- a/code/modules/reagents/holder/holder.dm +++ b/code/modules/reagents/holder/holder.dm @@ -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 diff --git a/code/modules/reagents/machinery/chemalyzer.dm b/code/modules/reagents/machinery/chemalyzer.dm index 7786b1d6b4f..20b00ab1ff0 100644 --- a/code/modules/reagents/machinery/chemalyzer.dm +++ b/code/modules/reagents/machinery/chemalyzer.dm @@ -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 diff --git a/code/modules/reagents/reagents/_reagents.dm b/code/modules/reagents/reagents/_reagents.dm index 682cc0c7132..6fe92aef3a2 100644 --- a/code/modules/reagents/reagents/_reagents.dm +++ b/code/modules/reagents/reagents/_reagents.dm @@ -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) diff --git a/code/modules/reagents/reagents/core.dm b/code/modules/reagents/reagents/core.dm index f8083cd90fb..8c0594a7e36 100644 --- a/code/modules/reagents/reagents/core.dm +++ b/code/modules/reagents/reagents/core.dm @@ -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) ..() diff --git a/code/modules/reagents/reagents/dispenser.dm b/code/modules/reagents/reagents/dispenser.dm index a2851948821..c9bc84103f7 100644 --- a/code/modules/reagents/reagents/dispenser.dm +++ b/code/modules/reagents/reagents/dispenser.dm @@ -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 diff --git a/code/modules/reagents/reagents/food_drinks.dm b/code/modules/reagents/reagents/food_drinks.dm index fac8821d2f0..aeeb865cb4e 100644 --- a/code/modules/reagents/reagents/food_drinks.dm +++ b/code/modules/reagents/reagents/food_drinks.dm @@ -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) ..() diff --git a/code/modules/reagents/reagents/medicine.dm b/code/modules/reagents/reagents/medicine.dm index 5b6081704f4..76437de4a5e 100644 --- a/code/modules/reagents/reagents/medicine.dm +++ b/code/modules/reagents/reagents/medicine.dm @@ -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) diff --git a/code/modules/reagents/reagents/other.dm b/code/modules/reagents/reagents/other.dm index d47c8ca92d3..b6f4a29bc20 100644 --- a/code/modules/reagents/reagents/other.dm +++ b/code/modules/reagents/reagents/other.dm @@ -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 diff --git a/code/modules/reagents/reagents/toxins.dm b/code/modules/reagents/reagents/toxins.dm index c4f94be461f..56f817efe96 100644 --- a/code/modules/reagents/reagents/toxins.dm +++ b/code/modules/reagents/reagents/toxins.dm @@ -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) ..() diff --git a/code/modules/xenoarcheaology/tools/coolant_tank.dm b/code/modules/xenoarcheaology/tools/coolant_tank.dm index 23c9253a066..6cb8226d9c3 100644 --- a/code/modules/xenoarcheaology/tools/coolant_tank.dm +++ b/code/modules/xenoarcheaology/tools/coolant_tank.dm @@ -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 diff --git a/tgui/packages/tgui/interfaces/GasTemperatureSystem.tsx b/tgui/packages/tgui/interfaces/GasTemperatureSystem.tsx index f1b933e0681..c2e0ef3fe1c 100644 --- a/tgui/packages/tgui/interfaces/GasTemperatureSystem.tsx +++ b/tgui/packages/tgui/interfaces/GasTemperatureSystem.tsx @@ -7,6 +7,7 @@ import { LabeledControls, LabeledList, Section, + RoundGauge, Slider, } from 'tgui-core/components'; import { toFixed } from 'tgui-core/math'; @@ -21,6 +22,9 @@ type Data = { targetGasTemperature: number; powerSetting: number; gasTemperatureClass: string; + reagentVolume: number; + reagentMaximum: number; + reagentPower: number; }; export const GasTemperatureSystem = (props) => { @@ -35,6 +39,9 @@ export const GasTemperatureSystem = (props) => { targetGasTemperature, gasTemperatureClass, powerSetting, + reagentPower, + reagentMaximum, + reagentVolume, } = data; return ( @@ -66,6 +73,23 @@ export const GasTemperatureSystem = (props) => { {gasPressure} kPa + + {toFixed((reagentVolume / reagentMaximum) * 100)} % + + { + return `${toFixed(value,1)} x`; + }} + minValue={-3} + maxValue={5} + />
diff --git a/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiChemistryPage.tsx b/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiChemistryPage.tsx index 4104aa97a90..c3caf990bb7 100644 --- a/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiChemistryPage.tsx +++ b/tgui/packages/tgui/interfaces/PublicLibraryWiki/WikiPages/WikiSubPages/WikiChemistryPage.tsx @@ -25,6 +25,7 @@ export const WikiChemistryPage = (props: { supply_points, market_price, sintering, + cooling_mod, overdose, flavor, allergen, @@ -88,6 +89,9 @@ export const WikiChemistryPage = (props: { {sintering ? sintering : } + + {cooling_mod}x + {!!allergen && ( ) + Partial<{ + temp_min: number; + temp_max: number; + xgm_min: number; + xgm_max: number; + require_xgm_gas: string; + rejects_xgm_gas: string; + }>) | null; export type ReactionComponent = {