@@ -343,6 +343,7 @@
|
|||||||
return PROCESS_KILL
|
return PROCESS_KILL
|
||||||
|
|
||||||
/datum/reagents/proc/handle_reactions(fermi_chem_react = FALSE)//HERE EDIT HERE THE MAIN REACTION FERMICHEMS ASSEMBLE! I hope rp is similar
|
/datum/reagents/proc/handle_reactions(fermi_chem_react = FALSE)//HERE EDIT HERE THE MAIN REACTION FERMICHEMS ASSEMBLE! I hope rp is similar
|
||||||
|
return
|
||||||
if(reagents_holder_flags & REAGENT_NOREACT)
|
if(reagents_holder_flags & REAGENT_NOREACT)
|
||||||
return //don't react
|
return //don't react
|
||||||
//cache things for performance
|
//cache things for performance
|
||||||
@@ -356,48 +357,54 @@
|
|||||||
reaction_occurred = FALSE
|
reaction_occurred = FALSE
|
||||||
for(var/reagent in cached_reagents)
|
for(var/reagent in cached_reagents)
|
||||||
var/datum/reagent/R = reagent
|
var/datum/reagent/R = reagent
|
||||||
check_possible_reaction:
|
for(var/reaction in cached_reactions[R.id])
|
||||||
for(var/reaction in cached_reactions[R.id])
|
if(!reaction)
|
||||||
if(!reaction)
|
continue
|
||||||
|
var/datum/chemical_reaction/C = reaction
|
||||||
|
var/list/cached_required_reagents = C.required_reagents
|
||||||
|
var/list/cached_required_catalysts = C.required_catalysts
|
||||||
|
var/required_temp = C.required_temp
|
||||||
|
var/is_cold_recipe = C.is_cold_recipe
|
||||||
|
var/has_special_react = C.special_react
|
||||||
|
var/fail = FALSE
|
||||||
|
for(var/B in cached_required_reagents)
|
||||||
|
if(!has_reagent(B, cached_required_reagents[B]))
|
||||||
|
fail = TRUE
|
||||||
|
break
|
||||||
|
if(fail)
|
||||||
|
continue
|
||||||
|
for(var/B in cached_required_catalysts)
|
||||||
|
if(!has_reagent(B, cached_required_catalysts[B]))
|
||||||
|
fail = TRUE
|
||||||
|
break
|
||||||
|
if(fail)
|
||||||
|
continue
|
||||||
|
if(cached_my_atom)
|
||||||
|
if(C.required_container && C.required_container != cached_my_atom.type)
|
||||||
continue
|
continue
|
||||||
var/datum/chemical_reaction/C = reaction
|
if (isliving(cached_my_atom) && !C.mob_react) //Makes it so certain chemical reactions don't occur in mobs
|
||||||
var/list/cached_required_reagents = C.required_reagents
|
continue
|
||||||
var/list/cached_required_catalysts = C.required_catalysts
|
if(C.required_other) //Checks for other things required
|
||||||
var/required_temp = C.required_temp
|
if(istype(cached_my_atom, /obj/item/slime_extract))//if the object is a slime_extract. This might be complicated as to not break them via fermichem
|
||||||
var/is_cold_recipe = C.is_cold_recipe
|
var/obj/item/slime_extract/M = cached_my_atom
|
||||||
var/has_special_react = C.special_react
|
if(M.Uses <= 0) // added a limit to slime cores -- Muskets requested this
|
||||||
for(var/B in cached_required_reagents)
|
continue
|
||||||
if(!has_reagent(B, cached_required_reagents[B]))
|
else
|
||||||
continue check_possible_reaction
|
if(C.required_container || C.required_other)
|
||||||
for(var/B in cached_required_catalysts)
|
continue
|
||||||
if(!has_reagent(B, cached_required_catalysts[B]))
|
if(required_temp && (is_cold_recipe? (chem_temp > required_temp) : (chem_temp < required_temp)))
|
||||||
continue check_possible_reaction
|
continue
|
||||||
if(cached_my_atom)
|
if(has_special_react && !C.check_special_react(src))
|
||||||
if(C.required_container && C.required_container != cached_my_atom.type)
|
continue
|
||||||
continue check_possible_reaction
|
if(C.FermiChem) //fermichem checks
|
||||||
if (isliving(cached_my_atom) && !C.mob_react) //Makes it so certain chemical reactions don't occur in mobs
|
if(chem_temp < C.OptimalTempMin) //too low temperature
|
||||||
continue check_possible_reaction
|
continue
|
||||||
if(C.required_other) //Checks for other things required
|
if(LAZYACCESS(fermichem_reacted, C)) //fermichems don't keep reacting instantly
|
||||||
if(istype(cached_my_atom, /obj/item/slime_extract))//if the object is a slime_extract. This might be complicated as to not break them via fermichem
|
continue
|
||||||
var/obj/item/slime_extract/M = cached_my_atom
|
START_PROCESSING(SSchemistry, src) //start processing
|
||||||
if(M.Uses <= 0) // added a limit to slime cores -- Muskets requested this
|
if(!fermi_chem_react) //only react fermichems on process icks
|
||||||
continue check_possible_reaction
|
continue
|
||||||
else
|
LAZYADD(possible_reactions, C)
|
||||||
if(C.required_container || C.required_other)
|
|
||||||
continue check_possible_reaction
|
|
||||||
if(required_temp && (is_cold_recipe? (chem_temp > required_temp) : (chem_temp < required_temp)))
|
|
||||||
continue check_possible_reaction
|
|
||||||
if(has_special_react && !C.check_special_react(src))
|
|
||||||
continue check_possible_reaction
|
|
||||||
if(C.FermiChem) //fermichem checks
|
|
||||||
if(chem_temp < C.OptimalTempMin) //too low temperature
|
|
||||||
continue check_possible_reaction
|
|
||||||
if(LAZYACCESS(fermichem_reacted, C)) //fermichems don't keep reacting instantly
|
|
||||||
continue check_possible_reaction
|
|
||||||
START_PROCESSING(SSchemistry, src) //start processing
|
|
||||||
if(!fermi_chem_react) //only react fermichems on process icks
|
|
||||||
continue check_possible_reaction
|
|
||||||
LAZYADD(possible_reactions, C)
|
|
||||||
if(length(possible_reactions)) //does list exist?
|
if(length(possible_reactions)) //does list exist?
|
||||||
var/datum/chemical_reaction/selected_reaction = possible_reactions[1]
|
var/datum/chemical_reaction/selected_reaction = possible_reactions[1]
|
||||||
for(var/I in possible_reactions)
|
for(var/I in possible_reactions)
|
||||||
|
|||||||
Reference in New Issue
Block a user