Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Reactions correctly respect the REACTION_HEAT_ARBITARY flag #1037

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions code/modules/reagents/chemistry/equilibrium.dm
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@
#endif

//Apply thermal output of reaction to beaker
if(reaction.reaction_flags & REACTION_HEAT_ARBITARY)
holder.chem_temp += clamp((reaction.thermic_constant * total_step_added * thermic_mod), 0, CHEMICAL_MAXIMUM_TEMPERATURE) //old method - for every bit added, the whole temperature is adjusted
else //Standard mechanics
var/heat_energy = reaction.thermic_constant * total_step_added * thermic_mod * SPECIFIC_HEAT_DEFAULT
holder.adjust_thermal_energy(heat_energy, 0, CHEMICAL_MAXIMUM_TEMPERATURE) //heat is relative to the beaker conditions
var/heat_energy = reaction.thermic_constant * total_step_added * thermic_mod
if(reaction.reaction_flags & REACTION_HEAT_ARBITARY) //old method - for every bit added, the whole temperature is adjusted
holder.set_temperature(clamp(holder.chem_temp + heat_energy, 0, CHEMICAL_MAXIMUM_TEMPERATURE))
else //Standard mechanics - heat is relative to the beaker conditions
holder.adjust_thermal_energy(heat_energy * SPECIFIC_HEAT_DEFAULT, 0, CHEMICAL_MAXIMUM_TEMPERATURE)

//Give a chance of sounds
if(prob(5))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
var/temp_exponent_factor = 2
/// How sharp the pH exponential curve is (to the power of value)
var/ph_exponent_factor = 2
/// How much the temperature will change (with no intervention) (i.e. for 30u made the temperature will increase by 100, same with 300u. The final temp will always be start + this value, with the exception con beakers with different specific heats)
/// How much the temperature changes per unit of chem used. without REACTION_HEAT_ARBITARY flag the rate of change depends on the holder heat capacity else results are more accurate
var/thermic_constant = 50
/// pH change per 1u reaction
var/H_ion_release = 0.01
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry/recipes/pyrotechnics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
determin_ph_range = 0
temp_exponent_factor = 1
ph_exponent_factor = 1
thermic_constant = -50 //This is the part that cools things down now
thermic_constant = -5 //This is the part that cools things down now
H_ion_release = 0
rate_up_lim = 4
purity_min = 0.15
Expand Down
Loading