more info

chem master and chem analyzer now state who can actually process a chem
This commit is contained in:
DeltaFire
2021-11-12 19:09:14 +01:00
parent 1277df1013
commit 4f8848cfb8
3 changed files with 24 additions and 3 deletions
@@ -398,14 +398,23 @@
state = "Gas"
var/const/P = 3 //The number of seconds between life ticks
var/T = initial(R.metabolization_rate) * (60 / P)
var/processtype
if(CHECK_MULTIPLE_BITFIELDS(R.chemical_flags, (REAGENT_ROBOTIC_PROCESS | REAGENT_ORGANIC_PROCESS)))
processtype = "Both robots and organics"
else if(R.chemical_flags & REAGENT_ROBOTIC_PROCESS)
processtype = "Robots only"
else if(R.chemical_flags & REAGENT_ORGANIC_PROCESS)
processtype = "Organics only"
else
processtype = "Noone?! (Report this to Nanotrasen's spacetime department immediately)"
if(istype(R, /datum/reagent/fermi))
fermianalyze = TRUE
var/datum/chemical_reaction/Rcr = get_chemical_reaction(reagent)
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "processType" = processtype, "purityF" = R.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else
fermianalyze = FALSE
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = R.purity)
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "processType" = processtype, "purityF" = R.purity)
screen = "analyze"
return TRUE
@@ -140,7 +140,16 @@
out_message += "<span class='warning'>A reaction appears to be occuring currently.<span class='notice'>\n"
out_message += "Chemicals found in the beaker:</b>\n"
for(var/datum/reagent/R in cont.reagents.reagent_list)
out_message += "<b>[R.volume]u of [R.name]</b>, <b>Purity:</b> [R.purity], [(scanmode?"[(R.overdose_threshold?"<b>Overdose:</b> [R.overdose_threshold]u, ":"")][(R.addiction_threshold?"<b>Addiction:</b> [R.addiction_threshold]u, ":"")]<b>Base pH:</b> [R.pH].":".")]\n"
var/processtype
if(CHECK_MULTIPLE_BITFIELDS(R.chemical_flags, (REAGENT_ROBOTIC_PROCESS | REAGENT_ORGANIC_PROCESS)))
processtype = "Both robots and organics"
else if(R.chemical_flags & REAGENT_ROBOTIC_PROCESS)
processtype = "Robots only"
else if(R.chemical_flags & REAGENT_ORGANIC_PROCESS)
processtype = "Organics only"
else
processtype = "Noone?! (Report this to Nanotrasen's spacetime department immediately)"
out_message += "<b>[R.volume]u of [R.name]</b>, <b>Purity:</b> [R.purity], [(scanmode?"[(R.overdose_threshold?"<b>Overdose:</b> [R.overdose_threshold]u, ":"")][(R.addiction_threshold?"<b>Addiction:</b> [R.addiction_threshold]u, ":"")]<b>Metabolized by:</b> [processtype], <b>Base pH:</b> [R.pH].":".")]\n"
if(scanmode)
out_message += "<b>Analysis:</b> [R.description]\n"
to_chat(user, "[out_message]</span>")
@@ -400,6 +400,9 @@ const AnalysisResults = (props, context) => {
<LabeledList.Item label="Addiction Threshold">
{analyzeVars.addicD}
</LabeledList.Item>
<LabeledList.Item label="Metabolized by">
{analyzeVars.processType}
</LabeledList.Item>
<LabeledList.Item label="Purity">
{analyzeVars.purityF}
</LabeledList.Item>