Error message addition.

This commit is contained in:
Fermi
2019-04-16 23:03:24 +01:00
parent 5a7a068b6e
commit 390f9a635f
4 changed files with 17 additions and 5 deletions
+14 -4
View File
@@ -461,7 +461,6 @@
if(selected_reaction)
var/datum/chemical_reaction/C = selected_reaction
if (C.FermiChem == TRUE)
message_admins("Hee!!!! Someone is doing a Fermi reaction!!! I'm so excited!!")
//FermiReact(C)
//B is Beaker
//P is product
@@ -475,27 +474,32 @@
while (ammoReacted < multiplier)
message_admins("Loop beginning")
//Begin Parse
//Check extremes first
if (chem_temp > C.ExplodeTemp)
//go to explode proc
message_admins("temperature is over limit: [C.ExplodeTemp] Current temperature: [chem_temp]")
FermiExplode()
if (pH > 14 || pH < 0)
//Create chemical sludge eventually(for now just destroy the beaker I guess?)
//TODO Strong acids eat glass, make it so you NEED plastic beakers for superacids(for some reactions)
message_admins("pH is lover limit, cur pH: [pH]")
FermiExplode()
//For now, purity is handled elsewhere
//Calculate DeltaT (Deviation of T from optimal)
if (chem_temp < C.OptimalTempMax)
deltaT = (((C.OptimalTempMin - chem_temp)**C.CurveSharpT)/((C.OptimalTempMax - C.OptimalTempMax)**C.CurveSharpT))
if (chem_temp < C.OptimalTempMax || chem_temp >= C.OptimalTempMin)
deltaT = (((C.OptimalTempMin - chem_temp)**C.CurveSharpT)/((C.OptimalTempMax - C.OptimalTempMin)**C.CurveSharpT))
// 350 300
else if (chem_temp >= C.OptimalTempMax)
deltaT = 1
else
deltaT = 0
message_admins("calculating temperature factor, min: [C.OptimalTempMin], max: [C.OptimalTempMax], Exponential: [C.CurveSharpT], deltaT: [deltaT]")
//Calculate DeltapH (Deviation of pH from optimal)
//Lower range
@@ -518,21 +522,27 @@
message_admins("Fermichem's pH broke!! Please let Fermis know!!")
WARNING("[my_atom] attempted to determine FermiChem pH for '[C.id]' which broke for some reason! ([usr])")
//TODO Add CatalystFact
message_admins("calculating pH factor(purity), pH: [pH], min: [C.OptimalpHMin]-[C.ReactpHLim], max: [C.OptimalpHMax]+[C.ReactpHLim], deltapH: [deltapH]")
stepChemAmmount = multiplier * deltaT
if (ammoReacted > 0)
purity = ((purity * ammoReacted) + (deltapH * stepChemAmmount)) /(2 * (ammoReacted + stepChemAmmount)) //This should add the purity to the product
purity = ((purity * ammoReacted) + (deltapH * stepChemAmmount)) /((ammoReacted + stepChemAmmount)) //This should add the purity to the product
else
purity = deltapH
message_admins("purity: [purity], purity of beaker")
message_admins("Temp before change: [chem_temp], pH after change: [pH]")
//Apply pH changes and thermal output of reaction to beaker
chem_temp += (C.ThermicConstant * stepChemAmmount)
pH += (C.HIonRelease * stepChemAmmount)
message_admins("Temp after change: [chem_temp], pH after change: [pH]")
// End.
selected_reaction.on_reaction(src, multiplier, special_react_result)
message_admins("cached_results: [cached_results], multiplier: [multiplier], stepChemAmmount [stepChemAmmount]")
for(var/B in cached_required_reagents)
message_admins("cached_results: [cached_results], multiplier: [multiplier], stepChemAmmount [stepChemAmmount]")
remove_reagent(B, (stepChemAmmount * cached_required_reagents[B]), safety = 1)//safety? removes reagents from beaker using remove function.
for(var/P in selected_reaction.results)//Not sure how this works, what is selected_reaction.results?
+1
View File
@@ -9,3 +9,4 @@
###############################################################################################
yourckeygoeshere = Host
Useroth = Game Master
@@ -44,6 +44,7 @@
/datum/reagent/fermi/eigenstate/New()
. = ..() //Needed!
location_created = get_turf(src) //Sets up coordinate of where it was created
..()
/datum/reagent/fermi/eigenstate/on_mob_life(mob/living/carbon/M) //Teleports to chemistry!
@@ -17,7 +17,7 @@
CurveSharppH = 2 // How sharp the pH exponential curve is (to the power of value)
ThermicConstant = -2.5 //Temperature change per 1u produced
HIonRelease = 0.01 //pH change per 1u reaction
RateUpLim = 50 //Optimal/max rate possible if all conditions are perfect
RateUpLim = 5 //Optimal/max rate possible if all conditions are perfect
FermiChem = TRUE//If the chemical uses the Fermichem reaction mechanics
FermiExplode = FALSE //If the chemical explodes in a special way
ImpureChem = "toxin" //What chemical is produced with an inpure reaction