From 981c1644c9ae91e6c6cea4ee229a2719e024b7c2 Mon Sep 17 00:00:00 2001 From: Fermi Date: Thu, 13 Jun 2019 02:47:05 +0100 Subject: [PATCH] Holder changes; removed ferminew. --- code/modules/reagents/chemistry/holder.dm | 20 +++++++------------ .../chemistry/reagents/fermi_reagents.dm | 12 ++++------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm index 49a04ca8ef..90bf1d61f0 100644 --- a/code/modules/reagents/chemistry/holder.dm +++ b/code/modules/reagents/chemistry/holder.dm @@ -127,7 +127,6 @@ update_total() handle_reactions() - //pH = REAGENT_NORMAL_PH //Maybe unnessicary? NO incredibly nessicary, blows the beaker up otherwise. YES 100% NOT REQUIRED, THIS IS FOR REAMOVING AN AMMOUNT, NOT ALL. return amount /datum/reagents/proc/get_master_reagent_name() @@ -848,7 +847,7 @@ //add the reagent to the existing if it exists for(var/A in cached_reagents) var/datum/reagent/R = A - if (R.id == reagent) + if (R.id == reagent) //IF MERGING //WIP_TAG //check my maths for purity calculations //Add amount and equalize purity R.volume += amount @@ -860,9 +859,9 @@ my_atom.on_reagent_change(ADD_REAGENT) R.on_merge(data, amount, my_atom, other_purity) if(istype(D, /datum/reagent/fermi))//Is this a fermichem? - var/datum/reagent/fermi/Ferm = D //It's Fermi time! - if(Ferm.OnMobMergeCheck == TRUE) //// Ooooooh fermifermifermi - R.on_mob_add(my_atom, amount) + var/datum/reagent/fermi/Ferm = D //It is a fermichem! + if(Ferm.OnMobMergeCheck == TRUE) //Does this fermichem split? + R.on_mob_add(my_atom, amount) //On mob add processes fermichems, splitting them into their impure and pure products. This allows them to split when merging fermichems in a mob. if(!no_react) handle_reactions() @@ -879,22 +878,17 @@ if(data) R.data = data R.on_new(data) - if(R.addProc == TRUE) + if(R.addProc == TRUE)//Allows on new without data overhead. R.on_new(pH) //Add more as desired. - if(istype(D, /datum/reagent/fermi))//Is this a fermichem? - var/datum/reagent/fermi/Ferm = D //It's Fermi time! - Ferm.FermiNew(my_atom) //Seriously what is "data" ???? - - //This is how I keep myself sane. + if(isliving(my_atom)) + R.on_mob_add(my_atom, amount) update_total() if(my_atom) my_atom.on_reagent_change(ADD_REAGENT) if(!no_react) handle_reactions() - if(isliving(my_atom)) - R.on_mob_add(my_atom, amount) return TRUE 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 a60c2f7549..8e3d29c69c 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -12,21 +12,17 @@ var/OnMobMergeCheck = FALSE //var/addProc = FALSE //When this reagent is added to a new beaker, it does something. Implemented but unused. -//Called when added to a beaker without any of the reagent present. #add_reagent -/datum/reagent/fermi/proc/FermiNew(holder) - return - //This should process fermichems to find out how pure they are and what effect to do. //TODO: add this to the main on_mob_add proc, and check if Fermichem = TRUE /datum/reagent/fermi/on_mob_add(mob/living/carbon/M, amount) . = ..() if(!M) return - if(src.purity < 0) - CRASH("Purity below 0 for chem: [src.id], Please let Fermis Know!") - if (src.purity == 1 || src.DoNotSplit == TRUE) + if(purity < 0) + CRASH("Purity below 0 for chem: [id], Please let Fermis Know!") + if (purity == 1 || DoNotSplit == TRUE) return - else if (src.InverseChemVal > src.purity)//Turns all of a added reagent into the inverse chem + else if (InverseChemVal > purity)//Turns all of a added reagent into the inverse chem M.reagents.remove_reagent(src.id, amount, FALSE) M.reagents.add_reagent(src.InverseChem, amount, FALSE, other_purity = 1) return