diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 25c026acfac..15683b4d6f2 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -13,7 +13,7 @@ /// Whether this should auto-eject the beaker once done heating/cooling. var/auto_eject = FALSE /// The higher this number, the faster reagents will heat/cool. - var/speed_increase = 0 + var/speed_increase = 40 /obj/machinery/chem_heater/Initialize(mapload) . = ..() @@ -26,7 +26,7 @@ /obj/machinery/chem_heater/RefreshParts() speed_increase = initial(speed_increase) for(var/obj/item/stock_parts/micro_laser/M in component_parts) - speed_increase += 5 * (M.rating - 1) + speed_increase += 20 * (M.rating - 1) /obj/machinery/chem_heater/process() ..() @@ -37,7 +37,8 @@ if(!beaker.reagents.total_volume) on = FALSE return - beaker.reagents.temperature_reagents(desired_temp, max(1, 35 - speed_increase)) + var/sign = SIGN(desired_temp - beaker.reagents.chem_temp) + beaker.reagents.adjust_reagent_temp(speed_increase * sign, desired_temp) if(round(beaker.reagents.chem_temp) == round(desired_temp)) playsound(loc, 'sound/machines/ding.ogg', 50, 1) on = FALSE diff --git a/code/modules/reagents/chemistry/reagents_holder.dm b/code/modules/reagents/chemistry/reagents_holder.dm index 07f8d48f7bb..53d12d76eef 100644 --- a/code/modules/reagents/chemistry/reagents_holder.dm +++ b/code/modules/reagents/chemistry/reagents_holder.dm @@ -248,6 +248,17 @@ handle_reactions() +/datum/reagents/proc/adjust_reagent_temp(amount, temperature_bound) + if(chem_temp == temperature_bound || !amount) // We don't need to do the mathy math + return + if(!isnull(temperature_bound)) // If we have a target temp, we only go until that temperature + chem_temp = directional_bounded_sum(chem_temp, amount, temperature_bound, temperature_bound) + else + chem_temp += amount + chem_temp = clamp(chem_temp, temperature_min, temperature_max) + temperature_react() + handle_reactions() + /** * Same as [/datum/reagents/proc/trans_to] but only for a specific reagent in * the reagent list. If the specified amount is greater than what is available,