mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
Adds support for inverse required temp reactions.
Ie. Cooling a mixture to cause a reaction, instead of heating it. Just set 'is_cold_recipe' to 1 in the reaction.
This commit is contained in:
@@ -344,6 +344,7 @@ var/const/INJECT = 5 //injection
|
||||
var/matching_other = 0
|
||||
var/list/multipliers = new/list()
|
||||
var/required_temp = C.required_temp
|
||||
var/is_cold_recipe = C.is_cold_recipe
|
||||
|
||||
for(var/B in C.required_reagents)
|
||||
if(!has_reagent(B, C.required_reagents[B]))
|
||||
@@ -377,7 +378,7 @@ var/const/INJECT = 5 //injection
|
||||
required_temp = chem_temp
|
||||
|
||||
|
||||
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other && chem_temp >= required_temp)
|
||||
if(total_matching_reagents == total_required_reagents && total_matching_catalysts == total_required_catalysts && matching_container && matching_other && (is_cold_recipe ? chem_temp <= required_temp : chem_temp >= required_temp))
|
||||
var/multiplier = min(multipliers)
|
||||
for(var/B in C.required_reagents)
|
||||
remove_reagent(B, (multiplier * C.required_reagents[B]), safety = 1)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
var/mob_react = 0 //Determines if a chemical reaction can occur inside a mob
|
||||
|
||||
var/required_temp = 0
|
||||
var/is_cold_recipe = 0 // Set to 1 if you want the recipe to only react when it's BELOW the required temp.
|
||||
var/mix_message = "The solution begins to bubble." //The message shown to nearby people upon mixing, if applicable
|
||||
var/mix_sound = 'sound/effects/bubbles.ogg' //The sound played upon mixing, if applicable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user