Buffs the chem heater (#22676)

* Done!

* Comment

* Almost forgot these!

* Snowball review

* Oops

* Snowball review pt.2

* Adds support for no target temp

* Snowball review

* Snowball review

* Update code/modules/reagents/chemistry/reagents_holder.dm

Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>

* Increases the amount of heating

* Update code/modules/reagents/chemistry/reagents_holder.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

---------

Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
DGamerL
2023-10-14 20:39:01 +02:00
committed by GitHub
co-authored by Nathan Winters Burzah
parent 013d912f15
commit 1a5cdeafd1
2 changed files with 15 additions and 3 deletions
@@ -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
@@ -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,