From 2bd5ee184d48e62a91093aed643adc1dbc5fdbe2 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Sat, 21 Sep 2019 01:50:39 +0100
Subject: [PATCH 01/13] THIS SHOULDN'T FIND IT'S WAY INTO A PR
---
code/modules/reagents/chem_wiki_render.dm | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index e403e147a6..ed5c223556 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -33,7 +33,7 @@
var/alco = ""
var/grinded = ""
var/blob = ""
- //var/impure
+ var/impure = ""
//Chem_dispencer
var/list/dispensable_reagents = list(
@@ -190,10 +190,10 @@
else if(istype(R, /datum/reagent/blob))
blob += generate_chemwiki_line(R, X, processCR)
- /* when merged
+ // when merged
else if(istype(R, /datum/reagent/impure))
impure += generate_chemwiki_line(R, X, processCR)
- */
+
else
remainder += generate_chemwiki_line(R, X, processCR)
@@ -207,7 +207,7 @@
to_chat(usr, "finished chems")
var/wholeString = ("\n# DISPENCEABLE REAGENTS\n\n[prefix][basic]\n\n# COMPONENT REAGENTS\n\n[prefix][upgraded]\n\n# GRINDABLE REAGENTS\n\n[prefix][grinded]\n")
- wholeString += ("\n# MEDICINE:\n\n[prefix][medicine]\n\n# TOXIN:\n\n[prefix][toxin]\n\n# DRUGS\n\n[prefix][drug]\n\n# FERMI\n\nThese chems lie on the cutting edge of chemical technology, and as such are not recommended for beginners!\n\n[prefix][fermi]\n\n# GENERAL REAGENTS\n\n[prefix][remainder]\n\n# DISPENCEABLE SOFT DRINKS\n\n[prefix][drinks]\n\n# DISPENCEABLE HARD DRINKS\n\n[prefix][alco]\n\n# CONSUMABLE\n\n[prefix][consumable]\n\n# PLANTS\n\n[prefix][plant]\n\n# URANIUM\n\n[prefix][uranium]\n\n# COLOURS\n\n[prefix][colours]\n\n# RACE MUTATIONS\n\n[prefix][muta]\n\n\n# BLOB REAGENTS\n\n[prefix][blob]\n")
+ wholeString += ("\n# MEDICINE:\n\n[prefix][medicine]\n\n# TOXIN:\n\n[prefix][toxin]\n\n# DRUGS\n\n[prefix][drug]\n\n# FERMI\n\nThese chems lie on the cutting edge of chemical technology, and as such are not recommended for beginners!\n\n[prefix][fermi]\n\n# IMPURE REAGENTS\n\n[prefix][impure]\n\n# GENERAL REAGENTS\n\n[prefix][remainder]\n\n# DISPENCEABLE SOFT DRINKS\n\n[prefix][drinks]\n\n# DISPENCEABLE HARD DRINKS\n\n[prefix][alco]\n\n# CONSUMABLE\n\n[prefix][consumable]\n\n# PLANTS\n\n[prefix][plant]\n\n# URANIUM\n\n[prefix][uranium]\n\n# COLOURS\n\n[prefix][colours]\n\n# RACE MUTATIONS\n\n[prefix][muta]\n\n\n# BLOB REAGENTS\n\n[prefix][blob]\n")
prefix = "|Name | Reagents | Reaction vars | Description |\n|---|---|---|----------|\n"
var/CRparse = ""
@@ -290,12 +290,12 @@
//Description, OD, Addict, Meta
outstring += "[R.description] |
- Metabolism_rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
- if(R.ImpureChem != "fermiTox" || !R.ImpureChem)
- R3 = GLOB.chemical_reagents_list[R.ImpureChem]
+ if(R.impure_chem != "fermiTox" || !R.impure_chem)
+ R3 = GLOB.chemical_reagents_list[R.impure_chem]
outstring += "- Impure chem:[R3.name]
"
- if(R.InverseChem != "fermiTox" || !R.InverseChem)
- R3 = GLOB.chemical_reagents_list[R.InverseChem]
+ if(R.inverse_chem != "fermiTox" || !R.inverse_chem)
+ R3 = GLOB.chemical_reagents_list[R.inverse_chem]
outstring += "- Inverse chem:[R3.name]
"
From 491ff293c568ba774b57714300c5fd05aebd4ee5 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Sat, 21 Sep 2019 02:59:06 +0100
Subject: [PATCH 02/13] Tweaks and jazz
---
code/modules/reagents/chem_wiki_render.dm | 9 ++++++---
.../reagents/chemistry/reagents/impure_reagents.dm | 2 +-
.../reagents/chemistry/reagents/other_reagents.dm | 1 +
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index ed5c223556..2daa0f6638 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -133,6 +133,8 @@
for(var/i = 1, i <= 2, i+=1)
for(var/X in GLOB.chemical_reagents_list)
R = GLOB.chemical_reagents_list[X]
+ if(!R.description) //No description? It's not worth my time.
+ continue
for(var/Y in dispensable_reagents) //Why do you have to do this
if(R.id == Y)
@@ -206,7 +208,7 @@
to_chat(usr, "finished chems")
- var/wholeString = ("\n# DISPENCEABLE REAGENTS\n\n[prefix][basic]\n\n# COMPONENT REAGENTS\n\n[prefix][upgraded]\n\n# GRINDABLE REAGENTS\n\n[prefix][grinded]\n")
+ var/wholeString = ("\n# DISPENCEABLE REAGENTS\n\n[prefix][basic]\n\n# COMPONENT REAGENTS\n\n[prefix][upgraded]\n\n# GROUND REAGENTS\n\n[prefix][grinded]\n")
wholeString += ("\n# MEDICINE:\n\n[prefix][medicine]\n\n# TOXIN:\n\n[prefix][toxin]\n\n# DRUGS\n\n[prefix][drug]\n\n# FERMI\n\nThese chems lie on the cutting edge of chemical technology, and as such are not recommended for beginners!\n\n[prefix][fermi]\n\n# IMPURE REAGENTS\n\n[prefix][impure]\n\n# GENERAL REAGENTS\n\n[prefix][remainder]\n\n# DISPENCEABLE SOFT DRINKS\n\n[prefix][drinks]\n\n# DISPENCEABLE HARD DRINKS\n\n[prefix][alco]\n\n# CONSUMABLE\n\n[prefix][consumable]\n\n# PLANTS\n\n[prefix][plant]\n\n# URANIUM\n\n[prefix][uranium]\n\n# COLOURS\n\n[prefix][colours]\n\n# RACE MUTATIONS\n\n[prefix][muta]\n\n\n# BLOB REAGENTS\n\n[prefix][blob]\n")
prefix = "|Name | Reagents | Reaction vars | Description |\n|---|---|---|----------|\n"
@@ -290,11 +292,12 @@
//Description, OD, Addict, Meta
outstring += "[R.description] | - Metabolism_rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
- if(R.impure_chem != "fermiTox" || !R.impure_chem)
+
+ if(R.impure_chem && R.impure_chem != "fermiTox")
R3 = GLOB.chemical_reagents_list[R.impure_chem]
outstring += "- Impure chem:[R3.name]
"
- if(R.inverse_chem != "fermiTox" || !R.inverse_chem)
+ if(R.inverse_chem && R.impure_chem != "fermiTox")
R3 = GLOB.chemical_reagents_list[R.inverse_chem]
outstring += "- Inverse chem:[R3.name]
"
diff --git a/code/modules/reagents/chemistry/reagents/impure_reagents.dm b/code/modules/reagents/chemistry/reagents/impure_reagents.dm
index e24b811131..c96347cda2 100644
--- a/code/modules/reagents/chemistry/reagents/impure_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/impure_reagents.dm
@@ -9,7 +9,7 @@
/datum/reagent/impure/fermiTox
name = "Chemical Isomers"
id = "fermiTox"
- description = "Toxic chemical isomers made from impure reactions. At low volumes will cause light toxin damage, but as the volume increases, it deals larger amounts, damages the liver, then eventually the heart."
+ description = "Toxic chemical isomers made from impure reactions. At low volumes will cause light toxin damage, but as the volume increases, it deals larger amounts, damages the liver, then eventually the heart. This is default impure chem for all chems, and changes only if stated."
data = "merge"
color = "FFFFFF"
can_synth = FALSE
diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm
index 60620af71b..47e9d3cb10 100644
--- a/code/modules/reagents/chemistry/reagents/other_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm
@@ -3,6 +3,7 @@
name = "Blood"
id = "blood"
color = "#C80000" // rgb: 200, 0, 0
+ description = "Blood from a human, or otherwise."
metabolization_rate = 5 //fast rate so it disappears fast.
taste_description = "iron"
taste_mult = 1.3
From 4aca2c1b31de7ee9ac43d82e3daf1d8165e48b42 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Sat, 21 Sep 2019 13:23:28 +0100
Subject: [PATCH 03/13] Breakout
---
code/modules/reagents/chem_wiki_render.dm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index 2daa0f6638..a5558eed41 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -129,7 +129,7 @@
"applejack"
)
-
+ var/breakout = FALSE
for(var/i = 1, i <= 2, i+=1)
for(var/X in GLOB.chemical_reagents_list)
R = GLOB.chemical_reagents_list[X]
@@ -139,28 +139,36 @@
for(var/Y in dispensable_reagents) //Why do you have to do this
if(R.id == Y)
basic += generate_chemwiki_line(R, X, processCR)
+ breakout = TRUE
continue
for(var/Y in components)
if(R.id == Y)
upgraded += generate_chemwiki_line(R, X, processCR)
+ breakout = TRUE
continue
for(var/Y in dispence_drinks)
if(R.id == Y)
drinks += generate_chemwiki_line(R, X, processCR)
+ breakout = TRUE
continue
for(var/Y in dispence_alco)
if(R.id == Y)
alco += generate_chemwiki_line(R, X, processCR)
+ breakout = TRUE
continue
for(var/Y in grind)
if(R.id == Y)
grinded += generate_chemwiki_line(R, X, processCR)
+ breakout = TRUE
continue
+ if(breakout)
+ breakout = FALSE
+ continue
if(istype(R, /datum/reagent/medicine))
medicine += generate_chemwiki_line(R, X, processCR)
From 13c28933c66de6378099c00dae2c44259b727e94 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Sat, 21 Sep 2019 13:51:27 +0100
Subject: [PATCH 04/13] There we are
---
code/modules/reagents/chem_wiki_render.dm | 39 ++++++++++++++++++++---
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index a5558eed41..c4b6f9ff56 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -1,14 +1,45 @@
//Generates a markdown txt file for use with the wiki
+/proc/find_reagent(input)
+ . = FALSE
+ if(GLOB.chemical_reagents_list[input]) //prefer IDs!
+ return input
+ else
+ for(var/X in GLOB.chemical_reagents_list)
+ var/datum/reagent/R = GLOB.chemical_reagents_list[X]
+ if(input == replacetext(lowertext(R.name), " ", ""))
+ return X
+ if(input == replacetext(lowertext(R.id), " ", ""))
+ return X
+
+
+
+
/client/proc/generate_wikichem_list()
set name = "Generate Wikichems"
set category = "Debug"
set desc = "Generate a huge loglist of all the chems. Do not click unless you want lag."
- message_admins("Someone pressed the lag button. (Generate Wikichems)")
- to_chat(usr, "Generating list")
- var/prefix = "|Name | Reagents | Reaction vars | Description | Chem properties |\n|---|---|---|-----------|---|\n"
+
+ var/prefix = "|Name | Reagents | Reaction vars | Description | Chem properties |\n|---|---|---|-----------|---|\n"
+ var/input_reagent = replacetext(lowertext(input("Input the name/id of a reagent to get it's description on it's own, or leave blank to parse every chem.", "Input") as text), " ", "") //95% of the time, the reagent id is a lowercase/no spaces version of the name
+ if(input_reagent)
+ var/input_reagent2 = find_reagent(input_reagent)
+ if(!input_reagent2)
+ to_chat(usr, "Unable to find reagent, stopping proc.")
+ var/single_parse = generate_chemwiki_line(input_reagent2, input_reagent, FALSE)
+ text2file(single_parse, "[GLOB.log_directory]/chem_parse.md")
+ to_chat(usr, "[single_parse].")
+
+ single_parse = generate_chemwiki_line(input_reagent2, input_reagent, FALSE)
+ text2file(single_parse, "[GLOB.log_directory]/chem_parse.md")
+ to_chat(usr, "[single_parse].")
+ to_chat(usr, "Saved line to (wherever your root folder is, i.e. where the DME is)/[GLOB.log_directory]/chem_parse.md OR use the Get Current Logs verb under the Admin tab. (if you click Open, and it does nothing, that's because you've not set a .md default program! Try downloading it instead, and use that file to set a default program! Also have a cute day.)")
+ //Do things here
+ return
+ to_chat(usr, "Generating big list")
+ message_admins("Someone pressed the lag button. (Generate Wikichems)")
///datum/reagent/medicine, /datum/reagent/toxin, /datum/reagent/consumable, /datum/reagent/plantnutriment, /datum/reagent/uranium,
///datum/reagent/colorful_reagent, /datum/reagent/mutationtoxin, /datum/reagent/fermi, /datum/reagent/drug, /datum/reagent/impure
@@ -298,7 +329,7 @@
outstring += " | "
//Description, OD, Addict, Meta
- outstring += "[R.description] | - Metabolism_rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
+ outstring += "[R.description] | - Metabolism rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
if(R.impure_chem && R.impure_chem != "fermiTox")
From b8c87a5f405b8560723af825076ee84ab0e585c2 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Tue, 8 Oct 2019 12:05:06 +0100
Subject: [PATCH 05/13] Spicy
---
code/modules/reagents/chemistry/holder.dm | 108 +++++++++---------
.../reagents/chemistry/recipes/fermi.dm | 56 ++++-----
2 files changed, 81 insertions(+), 83 deletions(-)
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 56cb02293e..beed89b347 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -63,7 +63,7 @@
var/targetVol = 0 //the target volume, i.e. the total amount that can be created during a fermichem reaction.
var/reactedVol = 0 //how much of the reagent is reacted during a fermireaction
var/fermiIsReacting = FALSE //that prevents multiple reactions from occurring (i.e. add_reagent calls to process_reactions(), this stops any extra reactions.)
- var/fermiReactID = null //ID of the chem being made during a fermireaction, kept here so it's cache isn't lost between loops/procs.
+ var/fermiReactID //ID of the chem being made during a fermireaction, kept here so it's cache isn't lost between loops/procs.
/datum/reagents/New(maximum=100, new_flags)
maximum_volume = maximum
@@ -365,7 +365,7 @@
/datum/reagents/proc/handle_reactions()//HERE EDIT HERE THE MAIN REACTION
- if(fermiIsReacting == TRUE)
+ if(fermiIsReacting) //This ARRESTS other reactions. If you don't want this, then remove it.
return
if(reagents_holder_flags & NO_REACT)
@@ -404,7 +404,7 @@
for(var/B in cached_required_reagents)
- if(!has_reagent(B, cached_required_reagents[B]))
+ if(!has_reagent(B, cached_required_reagents[B]*CHEMICAL_QUANTISATION_LEVEL))//Allows vols at less than 1 to react.
break
total_matching_reagents++
for(var/B in cached_required_catalysts)
@@ -464,7 +464,7 @@
//Temperature plays into a larger role too.
var/datum/chemical_reaction/C = selected_reaction
- if (C.FermiChem == TRUE && !continue_reacting)
+ if (C.FermiChem && !continue_reacting)
if (chem_temp > C.ExplodeTemp) //This is first to ensure explosions.
var/datum/chemical_reaction/fermi/Ferm = selected_reaction
fermiIsReacting = FALSE
@@ -472,31 +472,28 @@
Ferm.FermiExplode(src, my_atom, volume = total_volume, temp = chem_temp, pH = pH)
return 0
+ //This is just to calc the on_reaction multiplier, and is a candidate for removal.
for(var/B in cached_required_reagents)
- multiplier = min(multiplier, round((get_reagent_amount(B) / cached_required_reagents[B]), CHEMICAL_QUANTISATION_LEVEL))
+ multiplier = min(multiplier, round((get_reagent_amount(B) / cached_required_reagents[B]), 0.0001))
for(var/P in selected_reaction.results)
targetVol = cached_results[P]*multiplier
- if( (chem_temp <= C.ExplodeTemp) && (chem_temp >= C.OptimalTempMin))
- if( (pH >= (C.OptimalpHMin - C.ReactpHLim)) && (pH <= (C.OptimalpHMax + C.ReactpHLim)) )//To prevent pointless reactions
-
- if (fermiIsReacting == TRUE)
- return 0
- else
- START_PROCESSING(SSprocessing, src)
- selected_reaction.on_reaction(src, my_atom, multiplier)
- fermiIsReacting = TRUE
- fermiReactID = selected_reaction
- reaction_occurred = 1
-
- else //It's a little bit of a confusing nest, but esstentially we check if it's a fermireaction, then temperature, then pH. If this is true, the remainer of this handler is run.
- return 0 //If pH is out of range
+ if(!((chem_temp <= C.ExplodeTemp) && (chem_temp >= C.OptimalTempMin)))
+ return 0 //Not hot enough
+ if(! ((pH >= (C.OptimalpHMin - C.ReactpHLim)) && (pH <= (C.OptimalpHMax + C.ReactpHLim)) ))//To prevent pointless reactions
+ return 0
+ if (fermiIsReacting)
+ return 0
else
- return 0 //If not hot enough
+ START_PROCESSING(SSprocessing, src)
+ selected_reaction.on_reaction(src, my_atom, multiplier)
+ fermiIsReacting = TRUE
+ fermiReactID = selected_reaction
+ reaction_occurred = 1
//Standard reaction mechanics:
else
- if (C.FermiChem == TRUE)//Just to make sure, should only proc when grenades are combining.
+ if (C.FermiChem)//Just to make sure, should only proc when grenades are combining.
if (chem_temp > C.ExplodeTemp) //To allow fermigrenades
var/datum/chemical_reaction/fermi/Ferm = selected_reaction
fermiIsReacting = FALSE
@@ -551,36 +548,37 @@
var/multiplier = INFINITY
for(var/B in cached_required_reagents) //
- multiplier = min(multiplier, round((get_reagent_amount(B) / cached_required_reagents[B]), 0.001))
- if (multiplier == 0)
+ multiplier = min(multiplier, round((get_reagent_amount(B) / cached_required_reagents[B]), 0.0001))
+ if (multiplier == 0)//clarity
fermiEnd()
return
- for(var/P in cached_results)
- targetVol = cached_results[P]*multiplier
- if (fermiIsReacting == FALSE)
+ if (!fermiIsReacting)
CRASH("Fermi has refused to stop reacting even though we asked her nicely.")
- if (chem_temp > C.OptimalTempMin && fermiIsReacting == TRUE)//To prevent pointless reactions
- if( (pH >= (C.OptimalpHMin - C.ReactpHLim)) && (pH <= (C.OptimalpHMax + C.ReactpHLim)) )
- if (reactedVol < targetVol)
- reactedVol = fermiReact(fermiReactID, chem_temp, pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier)
- else//Volume is used up
- fermiEnd()
- return
- else//pH is out of range
- fermiEnd()
- return
- else//Temperature is too low, or reaction has stopped.
+ if (!(chem_temp >= C.OptimalTempMin))//To prevent pointless reactions
fermiEnd()
return
+ if (!( (pH >= (C.OptimalpHMin - C.ReactpHLim)) && (pH <= (C.OptimalpHMax + C.ReactpHLim)) )) //if pH is too far out, (could possibly allow reactions at this point, after the reaction has started, but make purity = 0)
+ fermiEnd()
+ return
+
+ reactedVol = fermiReact(fermiReactID, chem_temp, pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier)
+ if(round(reactedVol, CHEMICAL_QUANTISATION_LEVEL) == round(targetVol, CHEMICAL_QUANTISATION_LEVEL))
+ fermiEnd()
+
+ return
+
/datum/reagents/proc/fermiEnd()
var/datum/chemical_reaction/fermi/C = fermiReactID
STOP_PROCESSING(SSprocessing, src)
fermiIsReacting = FALSE
reactedVol = 0
targetVol = 0
+ //Cap off values
+ for(var/datum/reagent/R in reagent_list)
+ R.volume = round(R.volume, CHEMICAL_QUANTISATION_LEVEL)//To prevent runaways.
//pH check, handled at the end to reduce calls.
if(istype(my_atom, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RC = my_atom
@@ -590,10 +588,8 @@
update_total()
//Reaction sounds and words
playsound(get_turf(my_atom), C.mix_sound, 80, 1)
- var/list/seen = viewers(5, get_turf(my_atom))
- var/iconhtml = icon2html(my_atom, seen)
- for(var/mob/M in seen)
- to_chat(M, "[iconhtml] [C.mix_message]")
+ var/iconhtml = icon2html(my_atom)
+ my_atom.visible_message("[iconhtml] [C.mix_message]")
/datum/reagents/proc/fermiReact(selected_reaction, cached_temp, cached_pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier)
var/datum/chemical_reaction/fermi/C = selected_reaction
@@ -648,8 +644,8 @@
for(var/P in cached_results)
//stepChemAmmount = CLAMP(((deltaT * multiplier), 0, ((targetVol - reactedVol)/cached_results[P])) //used to have multipler, now it does
stepChemAmmount = (multiplier*cached_results[P])
- if (stepChemAmmount >= C.RateUpLim)
- stepChemAmmount = (C.RateUpLim)
+ if (stepChemAmmount > C.RateUpLim)
+ stepChemAmmount = C.RateUpLim
addChemAmmount = deltaT * stepChemAmmount
if (addChemAmmount >= (targetVol - reactedVol))
addChemAmmount = (targetVol - reactedVol)
@@ -657,7 +653,7 @@
addChemAmmount = CHEMICAL_QUANTISATION_LEVEL
removeChemAmmount = (addChemAmmount/cached_results[P])
//This is kept for future bugtesters.
- //message_admins("Reaction vars: PreReacted: [reactedVol] of [targetVol]. deltaT [deltaT], multiplier [multiplier], Step [stepChemAmmount], uncapped Step [deltaT*(multiplier*cached_results[P])], addChemAmmount [addChemAmmount], removeFactor [removeChemAmmount] Pfactor [cached_results[P]], adding [addChemAmmount]")
+ message_admins("Reaction vars: PreReacted: [reactedVol] of [targetVol]. deltaT [deltaT], multiplier [multiplier], Step [stepChemAmmount], uncapped Step [deltaT*(multiplier*cached_results[P])], addChemAmmount [addChemAmmount], removeFactor [removeChemAmmount] Pfactor [cached_results[P]], adding [addChemAmmount]")
//remove reactants
for(var/B in cached_required_reagents)
@@ -668,7 +664,7 @@
for(var/P in cached_results)
SSblackbox.record_feedback("tally", "chemical_reaction", addChemAmmount, P)//log
SSblackbox.record_feedback("tally", "fermi_chem", addChemAmmount, P)
- add_reagent(P, (addChemAmmount), null, cached_temp, purity)//add reagent function!! I THINK I can do this:
+ add_reagent(P, (addChemAmmount), null, cached_temp, purity)
TotalStep += addChemAmmount//for multiple products
//Above should reduce yeild based on holder purity.
//Purity Check
@@ -677,9 +673,9 @@
if (R.purity < C.PurityMin)//If purity is below the min, blow it up.
fermiIsReacting = FALSE
SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[P] explosion"))
- C.FermiExplode(src, my_atom, (reactedVol+targetVol), cached_temp, pH)
+ C.FermiExplode(src, my_atom, (total_volume), cached_temp, pH)
STOP_PROCESSING(SSprocessing, src)
- return 0
+ return
C.FermiCreate(src)//proc that calls when step is done
@@ -694,11 +690,11 @@
//go to explode proc
fermiIsReacting = FALSE
SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[C] explosions"))
- C.FermiExplode(src, my_atom, (reactedVol+targetVol), chem_temp, pH)
+ C.FermiExplode(src, my_atom, (total_volume), chem_temp, pH)
STOP_PROCESSING(SSprocessing, src)
return
- //Make sure things are limited.
+ //Make sure things are limited, but superacids/bases can push forward the reaction
pH = CLAMP(pH, 0, 14)
//return said amount to compare for next step.
@@ -713,6 +709,8 @@
if (R in cached_reagents)
cachedPurity += R.purity
i++
+ if(!i)//I've never seen it get here with 0, but in case
+ CRASH("No reactants found mid reaction for [fermiReactID]/[C], how it got here is beyond me. Beaker: [holder]")
return cachedPurity/i
/datum/reagents/proc/isolate_reagent(reagent)
@@ -746,7 +744,7 @@
total_volume = 0
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- if(R.volume == 0)
+ if(R.volume == 0)//For clarity
del_reagent(R.id)
if((R.volume < 0.01) && !fermiIsReacting)
del_reagent(R.id)
@@ -826,7 +824,7 @@
WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])")
return FALSE
- if (D.id == "water" && no_react == FALSE && !istype(my_atom, /obj/item/reagent_containers/food)) //Do like an otter, add acid to water, but also don't blow up botany.
+ if (D.id == "water" && !no_react && !istype(my_atom, /obj/item/reagent_containers/food)) //Do like an otter, add acid to water, but also don't blow up botany.
if (pH <= 2)
SSblackbox.record_feedback("tally", "fermi_chem", 1, "water-acid explosions")
var/datum/effect_system/smoke_spread/chem/s = new
@@ -869,7 +867,7 @@
chem_temp = thermal_energy / (specific_heat * new_total)
//cacluate reagent based pH shift.
- if(ignore_pH == TRUE)
+ if(ignore_pH)
pH = ((cached_pH * cached_total)+(other_pH * amount))/(cached_total + amount)//should be right
else
pH = ((cached_pH * cached_total)+(D.pH * amount))/(cached_total + amount)//should be right
@@ -889,7 +887,7 @@
if(my_atom)
my_atom.on_reagent_change(ADD_REAGENT)
if(isliving(my_atom))
- if(R.OnMobMergeCheck == TRUE)//Forces on_mob_add proc when a chem is merged
+ if(R.OnMobMergeCheck)//Forces on_mob_add proc when a chem is merged
R.on_mob_add(my_atom, amount)
//else
// R.on_merge(data, amount, my_atom, other_purity)
@@ -910,7 +908,7 @@
if(data)
R.data = data
R.on_new(data)
- if(R.addProc == TRUE)//Allows on new without data overhead.
+ if(R.addProc)//Allows on new without data overhead.
R.on_new(pH) //Add more as desired.
@@ -950,7 +948,7 @@
if((total_volume - amount) <= 0)//Because this can result in 0, I don't want it to crash.
pH = 7
//In practice this is really confusing and players feel like it randomly melts their beakers, but I'm not sure how else to handle it. We'll see how it goes and I can remove this if it confuses people.
- else if (ignore_pH == FALSE)
+ else if (!ignore_pH)
//if (((pH > R.pH) && (pH <= 7)) || ((pH < R.pH) && (pH >= 7)))
pH = (((pH - R.pH) / total_volume) * amount) + pH
if(istype(my_atom, /obj/item/reagent_containers/))
diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
index 43fda5e948..e9ae5b67fa 100644
--- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
@@ -86,8 +86,8 @@
/datum/chemical_reaction/fermi/eigenstate
name = "Eigenstasium"
id = "eigenstate"
- results = list("eigenstate" = 0.1)
- required_reagents = list("bluespace" = 0.1, "stable_plasma" = 0.1, "sugar" = 0.1)
+ results = list("eigenstate" = 1)
+ required_reagents = list("bluespace" = 1, "stable_plasma" = 1, "sugar" = 1)
mix_message = "the reaction zaps suddenly!"
//FermiChem vars:
OptimalTempMin = 350 // Lower area of bell curve for determining heat based rate reactions
@@ -120,8 +120,8 @@
/datum/chemical_reaction/fermi/SDGF
name = "Synthetic-derived growth factor"
id = "SDGF"
- results = list("SDGF" = 0.3)
- required_reagents = list("stable_plasma" = 0.15, "clonexadone" = 0.15, "uranium" = 0.15, "synthflesh" = 0.15)
+ results = list("SDGF" = 3)
+ required_reagents = list("stable_plasma" = 1.5, "clonexadone" = 1.5, "uranium" = 1.5, "synthflesh" = 1.5)
mix_message = "the reaction gives off a blorble!"
required_temp = 1
//FermiChem vars:
@@ -161,8 +161,8 @@
/datum/chemical_reaction/fermi/breast_enlarger
name = "Sucubus milk"
id = "breast_enlarger"
- results = list("breast_enlarger" = 0.8)
- required_reagents = list("salglu_solution" = 0.1, "milk" = 0.1, "synthflesh" = 0.2, "silicon" = 0.3, "aphro" = 0.3)
+ results = list("breast_enlarger" = 8)
+ required_reagents = list("salglu_solution" = 1, "milk" = 1, "synthflesh" = 2, "silicon" = 3, "aphro" = 3)
mix_message = "the reaction gives off a mist of milk."
//FermiChem vars:
OptimalTempMin = 200
@@ -201,8 +201,8 @@
/datum/chemical_reaction/fermi/penis_enlarger
name = "Incubus draft"
id = "penis_enlarger"
- results = list("penis_enlarger" = 0.8)
- required_reagents = list("blood" = 0.5, "synthflesh" = 0.2, "carbon" = 0.2, "aphro" = 0.2, "salglu_solution" = 0.1,)
+ results = list("penis_enlarger" = 8)
+ required_reagents = list("blood" = 5, "synthflesh" = 2, "carbon" = 2, "aphro" = 2, "salglu_solution" = 1)
mix_message = "the reaction gives off a spicy mist."
//FermiChem vars:
OptimalTempMin = 200
@@ -240,8 +240,8 @@
/datum/chemical_reaction/fermi/astral
name = "Astrogen"
id = "astral"
- results = list("astral" = 0.5)
- required_reagents = list("eigenstate" = 0.1, "plasma" = 0.3, "synaptizine" = 0.1, "aluminium" = 0.5)
+ results = list("astral" = 5)
+ required_reagents = list("eigenstate" = 1, "plasma" = 3, "synaptizine" = 1, "aluminium" = 5)
//FermiChem vars:
OptimalTempMin = 700
OptimalTempMax = 800
@@ -263,10 +263,10 @@
/datum/chemical_reaction/fermi/enthrall/ //check this
name = "MKUltra"
id = "enthrall"
- results = list("enthrall" = 0.5)
+ results = list("enthrall" = 5)
//required_reagents = list("iron" = 1, "iodine" = 1) Test vars
- //required_reagents = list("cocoa" = 0.1, "astral" = 0.1, "mindbreaker" = 0.1, "psicodine" = 0.1, "happiness" = 0.1)
- required_reagents = list("cocoa" = 0.1, "bluespace" = 0.1, "mindbreaker" = 0.1, "psicodine" = 0.1, "happiness" = 0.1) //TEMPORARY UNTIL HEADMINS GIVE THE OKAY FOR MK USE.
+ //required_reagents = list("cocoa" = 1, "astral" = 1, "mindbreaker" = 1, "psicodine" = 1, "happiness" = 1)
+ required_reagents = list("cocoa" = 1, "bluespace" = 1, "mindbreaker" = 1, "psicodine" = 1, "happiness" = 1) //TEMPORARY UNTIL HEADMINS GIVE THE OKAY FOR MK USE.
required_catalysts = list("blood" = 1)
mix_message = "the reaction gives off a burgundy plume of smoke!"
//FermiChem vars:
@@ -342,8 +342,8 @@
/datum/chemical_reaction/fermi/hatmium // done
name = "Hat growth serum"
id = "hatmium"
- results = list("hatmium" = 0.5)
- required_reagents = list("ethanol" = 0.1, "nutriment" = 0.3, "cooking_oil" = 0.2, "iron" = 0.1, "gold" = 0.3)
+ results = list("hatmium" = 5)
+ required_reagents = list("ethanol" = 1, "nutriment" = 3, "cooking_oil" = 2, "iron" = 1, "gold" = 3)
//mix_message = ""
//FermiChem vars:
OptimalTempMin = 500
@@ -377,8 +377,8 @@
/datum/chemical_reaction/fermi/furranium
name = "Furranium"
id = "furranium"
- results = list("furranium" = 0.5)
- required_reagents = list("aphro" = 0.1, "moonsugar" = 0.1, "silver" = 0.2, "salglu_solution" = 0.1)
+ results = list("furranium" = 5)
+ required_reagents = list("aphro" = 1, "moonsugar" = 1, "silver" = 2, "salglu_solution" = 1)
mix_message = "You think you can hear a howl come from the beaker."
//FermiChem vars:
OptimalTempMin = 350
@@ -397,7 +397,7 @@
PurityMin = 0.3
/datum/chemical_reaction/fermi/furranium/organic
- required_reagents = list("aphro" = 0.1, "catnip" = 0.1, "silver" = 0.2, "salglu_solution" = 0.1)
+ required_reagents = list("aphro" = 1, "catnip" = 1, "silver" = 2, "salglu_solution" = 1)
//FOR INSTANT REACTIONS - DO NOT MULTIPLY LIMIT BY 10.
//There's a weird rounding error or something ugh.
@@ -428,8 +428,8 @@
/datum/chemical_reaction/fermi/acidic_buffer//done test
name = "Acetic acid buffer"
id = "acidic_buffer"
- results = list("acidic_buffer" = 2) //acetic acid
- required_reagents = list("salglu_solution" = 0.2, "ethanol" = 0.6, "oxygen" = 0.6, "water" = 0.6)
+ results = list("acidic_buffer" = 10) //acetic acid
+ required_reagents = list("salglu_solution" = 1, "ethanol" = 3, "oxygen" = 3, "water" = 3)
//FermiChem vars:
OptimalTempMin = 250
OptimalTempMax = 500
@@ -455,10 +455,10 @@
/datum/chemical_reaction/fermi/basic_buffer//done test
name = "Ethyl Ethanoate buffer"
id = "basic_buffer"
- results = list("basic_buffer" = 1.5)
- required_reagents = list("lye" = 0.3, "ethanol" = 0.6, "water" = 0.6)
+ results = list("basic_buffer" = 5)
+ required_reagents = list("lye" = 1, "ethanol" = 2, "water" = 2)
required_catalysts = list("sacid" = 1) //vagely acetic
- //FermiChem vars:x
+ //FermiChem vars:
OptimalTempMin = 250
OptimalTempMax = 500
ExplodeTemp = 9999 //check to see overflow doesn't happen!
@@ -487,8 +487,8 @@
/datum/chemical_reaction/fermi/secretcatchem //DONE
name = "secretcatchem"
id = "secretcatchem"
- results = list("secretcatchem" = 0.5)
- required_reagents = list("stable_plasma" = 0.1, "sugar" = 0.1, "cream" = 0.1, "clonexadone" = 0.1)//Yes this will make a plushie if you don't lucky guess. It'll eat all your reagents too.
+ results = list("secretcatchem" = 5)
+ required_reagents = list("stable_plasma" = 1, "sugar" = 1, "cream" = 1, "clonexadone" = 1)//Yes this will make a plushie if you don't lucky guess. It'll eat all your reagents too.
required_catalysts = list("SDGF" = 1)
required_temp = 600
mix_message = "the reaction gives off a meow!"
@@ -521,7 +521,7 @@
RateUpLim += (rand(1, 1000)/100)
PurityMin += (rand(-1, 1)/10)
var/additions = list("aluminium", "silver", "gold", "plasma", "silicon", "uranium", "milk")
- required_reagents[pick(additions)] = rand(0.1, 0.5)//weird
+ required_reagents[pick(additions)] = rand(1, 5)//weird
/datum/chemical_reaction/fermi/secretcatchem/FermiFinish(datum/reagents/holder, var/atom/my_atom)
SSblackbox.record_feedback("tally", "catgirlium")//log
@@ -540,8 +540,8 @@
/datum/chemical_reaction/fermi/yamerol//done test
name = "Yamerol"
id = "yamerol"
- results = list("yamerol" = 1.5)
- required_reagents = list("perfluorodecalin" = 0.5, "salbutamol" = 0.5, "water" = 0.5)
+ results = list("yamerol" = 3)
+ required_reagents = list("perfluorodecalin" = 1, "salbutamol" = 1, "water" = 1)
//FermiChem vars:
OptimalTempMin = 300
OptimalTempMax = 500
From 06ad17e53911d6fe5ac458ebe783928424ee257d Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Tue, 8 Oct 2019 12:16:33 +0100
Subject: [PATCH 06/13] More mild
---
code/modules/reagents/chemistry/holder.dm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index beed89b347..0bdae13627 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -567,7 +567,8 @@
reactedVol = fermiReact(fermiReactID, chem_temp, pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier)
if(round(reactedVol, CHEMICAL_QUANTISATION_LEVEL) == round(targetVol, CHEMICAL_QUANTISATION_LEVEL))
fermiEnd()
-
+ if(!reactedVol)
+ fermiEnd()
return
/datum/reagents/proc/fermiEnd()
@@ -587,9 +588,10 @@
handle_reactions()
update_total()
//Reaction sounds and words
- playsound(get_turf(my_atom), C.mix_sound, 80, 1)
- var/iconhtml = icon2html(my_atom)
- my_atom.visible_message("[iconhtml] [C.mix_message]")
+ var/list/seen = viewers(5, get_turf(my_atom))
+ var/iconhtml = icon2html(my_atom, seen)
+ for(var/mob/M in seen)
+ to_chat(M, "[iconhtml] [C.mix_message]")
/datum/reagents/proc/fermiReact(selected_reaction, cached_temp, cached_pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier)
var/datum/chemical_reaction/fermi/C = selected_reaction
@@ -642,7 +644,6 @@
//ONLY WORKS FOR ONE PRODUCT AT THE MOMENT
//Calculate how much product to make and how much reactant to remove factors..
for(var/P in cached_results)
- //stepChemAmmount = CLAMP(((deltaT * multiplier), 0, ((targetVol - reactedVol)/cached_results[P])) //used to have multipler, now it does
stepChemAmmount = (multiplier*cached_results[P])
if (stepChemAmmount > C.RateUpLim)
stepChemAmmount = C.RateUpLim
@@ -653,7 +654,7 @@
addChemAmmount = CHEMICAL_QUANTISATION_LEVEL
removeChemAmmount = (addChemAmmount/cached_results[P])
//This is kept for future bugtesters.
- message_admins("Reaction vars: PreReacted: [reactedVol] of [targetVol]. deltaT [deltaT], multiplier [multiplier], Step [stepChemAmmount], uncapped Step [deltaT*(multiplier*cached_results[P])], addChemAmmount [addChemAmmount], removeFactor [removeChemAmmount] Pfactor [cached_results[P]], adding [addChemAmmount]")
+ //message_admins("Reaction vars: PreReacted: [reactedVol] of [targetVol]. deltaT [deltaT], multiplier [multiplier], Step [stepChemAmmount], uncapped Step [deltaT*(multiplier*cached_results[P])], addChemAmmount [addChemAmmount], removeFactor [removeChemAmmount] Pfactor [cached_results[P]], adding [addChemAmmount]")
//remove reactants
for(var/B in cached_required_reagents)
@@ -816,7 +817,7 @@
if(!isnum(amount) || !amount)
return FALSE
- if(amount <= CHEMICAL_QUANTISATION_LEVEL)//To prevent small ammount problems.
+ if(amount < CHEMICAL_QUANTISATION_LEVEL)//To prevent small ammount problems.
return FALSE
var/datum/reagent/D = GLOB.chemical_reagents_list[reagent]
From 1da86bec1c7e9f559fcb5807b7ebc6d0fd13e86a Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Tue, 8 Oct 2019 12:31:01 +0100
Subject: [PATCH 07/13] Kev pls
---
code/modules/reagents/chem_wiki_render.dm | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index e403e147a6..b3c3a559d7 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -290,12 +290,12 @@
//Description, OD, Addict, Meta
outstring += "[R.description] | - Metabolism_rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
- if(R.ImpureChem != "fermiTox" || !R.ImpureChem)
- R3 = GLOB.chemical_reagents_list[R.ImpureChem]
+ if(R.impure_chem != "fermiTox" || !R.impure_chem)
+ R3 = GLOB.chemical_reagents_list[R.impure_chem]
outstring += "- Impure chem:[R3.name]
"
- if(R.InverseChem != "fermiTox" || !R.InverseChem)
- R3 = GLOB.chemical_reagents_list[R.InverseChem]
+ if(R.inverse_chem != "fermiTox" || !R.inverse_chem)
+ R3 = GLOB.chemical_reagents_list[R.inverse_chem]
outstring += "- Inverse chem:[R3.name]
"
From db416defd6e7af1aeaaa70d4073a2e11c1044c92 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Tue, 8 Oct 2019 13:08:13 +0100
Subject: [PATCH 08/13] Fixes/updates some chems.
---
code/modules/reagents/chem_wiki_render.dm | 7 +++----
code/modules/reagents/chemistry/recipes/medicine.dm | 4 ++--
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index b3c3a559d7..e00f2785b1 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -190,10 +190,9 @@
else if(istype(R, /datum/reagent/blob))
blob += generate_chemwiki_line(R, X, processCR)
- /* when merged
else if(istype(R, /datum/reagent/impure))
impure += generate_chemwiki_line(R, X, processCR)
- */
+
else
remainder += generate_chemwiki_line(R, X, processCR)
@@ -290,11 +289,11 @@
//Description, OD, Addict, Meta
outstring += "[R.description] | - Metabolism_rate: [R.metabolization_rate/2]u/s
[(R.overdose_threshold?"- Overdose: [R.overdose_threshold]u
":"")] [(R.addiction_threshold?"- Addiction: [R.addiction_threshold]u
":"")] "
- if(R.impure_chem != "fermiTox" || !R.impure_chem)
+ if(R.impure_chem != "fermiTox" && R.impure_chem)
R3 = GLOB.chemical_reagents_list[R.impure_chem]
outstring += "- Impure chem:[R3.name]
"
- if(R.inverse_chem != "fermiTox" || !R.inverse_chem)
+ if(R.inverse_chem != "fermiTox" && R.inverse_chem)
R3 = GLOB.chemical_reagents_list[R.inverse_chem]
outstring += "- Inverse chem:[R3.name]
"
diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm
index 11dd8b7475..d49e7a2d3d 100644
--- a/code/modules/reagents/chemistry/recipes/medicine.dm
+++ b/code/modules/reagents/chemistry/recipes/medicine.dm
@@ -71,8 +71,8 @@
/datum/chemical_reaction/synthtissue
name = "Synthtissue"
id = "synthtissue"
- results = list("synthtissue" = 0.05)
- required_reagents = list("synthflesh" = 0.01)
+ results = list("synthtissue" = 5)
+ required_reagents = list("synthflesh" = 1)
required_catalysts = list("nutriment" = 0.1)
//FermiChem vars:
OptimalTempMin = 305 // Lower area of bell curve for determining heat based rate reactions
From b397c4868ff525deb52a0364adeec4bab1452e18 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Tue, 8 Oct 2019 13:23:35 +0100
Subject: [PATCH 09/13] Theres a bit more limits now
---
code/modules/reagents/chemistry/holder.dm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 0f35291124..9d8819c7e5 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -660,6 +660,9 @@
if (addChemAmmount < CHEMICAL_QUANTISATION_LEVEL)
addChemAmmount = CHEMICAL_QUANTISATION_LEVEL
removeChemAmmount = (addChemAmmount/cached_results[P])
+ //keep limited.
+ addChemAmmount = round(addChemAmmount, CHEMICAL_QUANTISATION_LEVEL)
+ removeChemAmmount = round(removeChemAmmount, CHEMICAL_QUANTISATION_LEVEL)
//This is kept for future bugtesters.
//message_admins("Reaction vars: PreReacted: [reactedVol] of [targetVol]. deltaT [deltaT], multiplier [multiplier], Step [stepChemAmmount], uncapped Step [deltaT*(multiplier*cached_results[P])], addChemAmmount [addChemAmmount], removeFactor [removeChemAmmount] Pfactor [cached_results[P]], adding [addChemAmmount]")
From ad0f34cdf8d3d2d075e34835692a1ac15222b70b Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Wed, 9 Oct 2019 06:04:06 +0100
Subject: [PATCH 10/13] Tweaks wiki a lil
---
code/modules/reagents/chem_wiki_render.dm | 8 +++-----
code/modules/reagents/chemistry/holder.dm | 4 ++--
.../modules/reagents/chemistry/reagents/fermi_reagents.dm | 2 +-
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index bcc3b63893..19de39893b 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -296,6 +296,8 @@
//Temp, Explosions and pH
if(CR)
outstring += "[(CR.FermiChem?"- Min react temp: [CR.OptimalTempMin]K
":"[(CR.required_temp?"- Min react temp: [CR.required_temp]K
":"")]")] [(CR.FermiChem?"- Explosion_temp: [CR.ExplodeTemp]K
":"")] [(CR.FermiChem?"- pH range: [max((CR.OptimalpHMin - CR.ReactpHLim), 0)] to [min((CR.OptimalpHMax + CR.ReactpHLim), 14)]
":"")] "
+ if(CR.FermiChem)
+ outstring += "[(CR.PurityMin?"- Min explosive purity: [CR.PurityMin]
":"")] [(CR.FermiExplode?"- Special explosion: Yes
":"")]"
else
outstring += ""
@@ -336,7 +338,7 @@
if(R.inverse_chem && R.impure_chem != "fermiTox")
R3 = GLOB.chemical_reagents_list[R.inverse_chem]
- outstring += "- Inverse chem:[R3.name]
"
+ outstring += "- Inverse chem:[R3.name]
[(R3.inverse_chem_val?"- Inverse purity: [R3.inverse_chem_val]
":"")] "
@@ -347,10 +349,6 @@
outstring += "- Required container: [I.name]
"*/
outstring += "- Required container: [CR.required_container]
"
- if(CR.FermiChem)
- outstring += "- Minimum purity: [CR.PurityMin]
[(CR.FermiExplode?"- Special explosion: Yes
":"")]"
-
-
outstring += "
|\n"
return outstring
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 9d8819c7e5..1abe104142 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -553,8 +553,8 @@
fermiEnd()
return
- for(var/datum/reagent/P in C.required_catalysts)
- if(!has_reagent(P.id))
+ for(var/P in C.required_catalysts)
+ if(!has_reagent(P))
fermiEnd()
return
diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
index b9a79fe228..4acfda0573 100644
--- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
@@ -168,7 +168,7 @@
//Writen by Trilby!! Embellsished a little by me.
/datum/reagent/fermi/nanite_b_gone
- name = "Naninte bane"
+ name = "Nanite bane"
id = "nanite_b_gone"
description = "A stablised EMP that is highly volatile, shocking small nano machines that will kill them off at a rapid rate in a patient's system."
color = "#708f8f"
From 89d3a0534ca903a27c38dd9abed020524faa0e29 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Wed, 9 Oct 2019 07:53:20 +0100
Subject: [PATCH 11/13] Tweaker
---
code/modules/reagents/chem_wiki_render.dm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/code/modules/reagents/chem_wiki_render.dm b/code/modules/reagents/chem_wiki_render.dm
index 19de39893b..8afebebca2 100644
--- a/code/modules/reagents/chem_wiki_render.dm
+++ b/code/modules/reagents/chem_wiki_render.dm
@@ -3,14 +3,15 @@
/proc/find_reagent(input)
. = FALSE
if(GLOB.chemical_reagents_list[input]) //prefer IDs!
- return input
+ var/datum/reagent/R = GLOB.chemical_reagents_list[input]
+ return R
else
for(var/X in GLOB.chemical_reagents_list)
var/datum/reagent/R = GLOB.chemical_reagents_list[X]
if(input == replacetext(lowertext(R.name), " ", ""))
- return X
+ return R
if(input == replacetext(lowertext(R.id), " ", ""))
- return X
+ return R
From e517ece6120122d2318e45a7c1398b428c678f42 Mon Sep 17 00:00:00 2001
From: Thalpy <48600475+ThalpySci@users.noreply.github.com>
Date: Fri, 11 Oct 2019 08:41:08 +0100
Subject: [PATCH 12/13] Darnit beaker
---
code/modules/reagents/chemistry/holder.dm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 1abe104142..1073bc071f 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -769,8 +769,8 @@
del_reagent(R.id)
else
total_volume += R.volume
- if(!reagent_list)
- pH = 7
+ if(!reagent_list || !total_volume)
+ pH = REAGENT_NORMAL_PH
return 0
/datum/reagents/proc/clear_reagents()
From f165b5e813b2c10fac2800a3a8096d76c54b9f17 Mon Sep 17 00:00:00 2001
From: Fermi <>
Date: Fri, 11 Oct 2019 18:58:53 +0100
Subject: [PATCH 13/13] darn nutrients.
---
code/modules/reagents/chemistry/holder.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 1073bc071f..957a2a1a52 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -763,7 +763,7 @@
total_volume = 0
for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent
- if(R.volume == 0)//For clarity
+ if(R.volume <= 0)//For clarity
del_reagent(R.id)
if((R.volume < 0.01) && !fermiIsReacting)
del_reagent(R.id)