From 0cee082e81fc0c177513763c5f355040e1ddf887 Mon Sep 17 00:00:00 2001 From: Thalpy Date: Sun, 14 Apr 2019 22:57:08 +0100 Subject: [PATCH] Added default fermichemvals to recipies --- code/modules/reagents/chemistry/holder.dm | 28 +++++++++++++++---- code/modules/reagents/chemistry/recipes.dm | 14 +++++++++- .../reagents/chemistry/recipes/medicine.dm | 13 --------- .../chemistry/reagents/fermi_reagents.dm | 5 +++- 4 files changed, 39 insertions(+), 21 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index d5c44315c5..8d6c4cc102 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -370,6 +370,22 @@ var/has_special_react = C.special_react var/can_special_react = 0 + var/datum/chemical_reaction/C/OptimalTempMin = OptimalTempMin // Lower area of bell curve for determining heat based rate reactions + var/OptimalTempMax = C.OptimalTempMax + var/ExplodeTemp = C.ExplodeTemp + var/OptimalpHMin = C.OptimalpHMin + var/OptimalpHMax = C.OptimalpHMax + var/ReactpHLim = C.ReactpHLim + //var/CatalystFact = C.CatalystFact + var/CurveSharpT = C.CurveSharpT + var/CurveSharppH = C.CurveSharppH + var/ThermicConstant = C.ThermicConstant + var/HIonRelease = C.HIonRelease + var/RateUpLim = C.RateUpLim + var/FermiChem = C.FermiChem + var/FermiExplod = C.FermiExplod + var/ImpureChem = C.ImpureChem + //FermiChem var/deltaT = 0 var/deltapH = 0 @@ -407,8 +423,8 @@ matching_other = 1 //FermiChem - if (chem_temp > C.ExplodeTemp)//Check to see if reaction is too hot! - if (C.FermiExplode == TRUE) + if (chem_temp > ExplodeTemp)//Check to see if reaction is too hot! + if (FermiExplode == TRUE) //To be added! else FermiExplode() @@ -455,11 +471,11 @@ //Begin Parse //Check extremes first - if (chem_temp > C.ExplodeTemp) + if (chem_temp > ExplodeTemp) //go to explode proc FermiExplode() - if (pH > 14) OR (pH < 0) + 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) FermiExplode() @@ -467,8 +483,8 @@ //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 < OptimalTempMax) + deltaT = (((OptimalTempMin - chem_temp)**CurveSharpT)/((OptimalTempMax - OptimalTempMax)**CurveSharpT)) else if (chem_temp >= C.OptimalTempMax) deltaT = 1 else diff --git a/code/modules/reagents/chemistry/recipes.dm b/code/modules/reagents/chemistry/recipes.dm index dba07ed875..a3d70efd2d 100644 --- a/code/modules/reagents/chemistry/recipes.dm +++ b/code/modules/reagents/chemistry/recipes.dm @@ -18,9 +18,21 @@ var/mix_sound = 'sound/effects/bubbles.ogg' //The sound played upon mixing, if applicable //FermiChem! + + var/OptimalTempMin = 200 // Lower area of bell curve for determining heat based rate reactions + var/OptimalTempMax = 800 + var/ExplodeTemp = 900 //If any reaction is this hot, it explodes! + var/OptimalpHMin = 5 + var/OptimalpHMax = 10 + var/ReactpHLim = 3 + //var/CatalystFact = C.CatalystFact + var/CurveSharpT = 2 + var/CurveSharppH = 2 + var/ThermicConstant = 1 + var/HIonRelease = 0.1 + var/RateUpLim = 10 var/FermiChem = FALSE //If the chemical uses the Fermichem reaction mechanics var/FermiExplode = FALSE //If the chemical explodes in a special way as a result of - var/ExplodeTemp = 900 //If any reaction is this hot, it explodes! var/ImpureChem = "toxin" //What chemical is produced with an inpure reaction /datum/chemical_reaction/proc/on_reaction(datum/reagents/holder, created_volume, specialreact) diff --git a/code/modules/reagents/chemistry/recipes/medicine.dm b/code/modules/reagents/chemistry/recipes/medicine.dm index deccc47768..dc7c32d925 100644 --- a/code/modules/reagents/chemistry/recipes/medicine.dm +++ b/code/modules/reagents/chemistry/recipes/medicine.dm @@ -208,19 +208,6 @@ id = "bicaridine" results = list("bicaridine" = 3) required_reagents = list("carbon" = 1, "oxygen" = 1, "sugar" = 1) - //FermiChem vars: - OptimalTempMin = 350 // Lower area of bell curve for determining heat based rate reactions - OptimalTempMax = 500 // Upper end for above - ExplodeTemp = 550 //Temperature at which reaction explodes - OptimalpHMin = 4 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase) - OptimalpHMax = 9.5 // Higest value for above - ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase) - CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst) - CurveSharp = 4 // How sharp the 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 - FermiChem = 1 /datum/chemical_reaction/kelotane name = "Kelotane" 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 3d19514334..4dc847150c 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -22,6 +22,7 @@ metabolization_rate = 0.5 * REAGENTS_METABOLISM addiction_stage3_end = 40 addiction_stage4_end = 55 //Incase it's too long + /obj/item/reagent/fermi/eigenstate/Initialize() //. = ..() Unneeded? @@ -29,7 +30,9 @@ ..() /datum/reagent/fermi/eigenstate/on_mob_life(mob/living/carbon/M) //Teleports to chemistry! - if (holder.!has_reagent("eigenstate")) + if (holder.has_reagent("eigenstate")) + do_sparks(5,FALSE,src) + else var/turf/open/T2 = get_turf(src) //sets up return point to_chat(M, "You feel your wavefunction split!") do_sparks(5,FALSE,src)