diff --git a/code/modules/reagents/chemistry/holder.dm b/code/modules/reagents/chemistry/holder.dm
index 85f1f0ad69..2b3e7e5389 100644
--- a/code/modules/reagents/chemistry/holder.dm
+++ b/code/modules/reagents/chemistry/holder.dm
@@ -543,6 +543,7 @@ im
/datum/reagents/process()
var/datum/chemical_reaction/C = fermiReactID
+
var/list/cached_required_reagents = C.required_reagents//update reagents list
var/list/cached_results = C.results//resultant chemical list
var/multiplier = INFINITY
@@ -559,7 +560,8 @@ im
targetVol = 0
handle_reactions()
update_total()
- C.fermiFinish(src, multiplier)
+ var/datum/reagent/fermi/Ferm = fermiReactID
+ Ferm.FermiFinish(src, multiplier)
//C.on_reaction(src, multiplier, special_react_result)
return
for(var/P in cached_results)
@@ -582,7 +584,8 @@ im
targetVol = 0
handle_reactions()
update_total()
- C.fermiFinish(src, multiplier)
+ var/datum/reagent/fermi/Ferm = fermiReactID
+ Ferm.FermiFinish(src, multiplier)
//C.on_reaction(src, multiplier, special_react_result)
return
else
@@ -593,14 +596,15 @@ im
targetVol = 0
handle_reactions()
update_total()
- C.fermiFinish(src, multiplier)
+ var/datum/reagent/fermi/Ferm = fermiReactID
+ Ferm.FermiFinish(src, multiplier)
//C.on_reaction(src, multiplier, special_react_result)
return
//handle_reactions()
/datum/reagents/proc/FermiReact(selected_reaction, chem_temp, pH, reactedVol, targetVol, cached_required_reagents, cached_results)
- var/datum/chemical_reaction/C = selected_reaction
+ var/datum/chemical_reaction/fermi/C = selected_reaction
var/deltaT = 0
var/deltapH = 0
var/stepChemAmmount = 0
@@ -619,8 +623,8 @@ im
C.FermiExplode(src, (reactedVol+targetVol), chem_temp, pH)
if (pH > 14)
- pH = 14
- else (pH < 0 || )
+ pH = 14
+ else if (pH < 0)
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)
@@ -636,7 +640,7 @@ im
deltapH = 0
return//If outside pH range, no reaction
else
- deltapH = (((pH - (C.OptimalpHMin - C.ReactpHLim))**C.CurveSharppH)/((C.ReactpHLim**C.CurveSharppH))
+ deltapH = (((pH - (C.OptimalpHMin - C.ReactpHLim))**C.CurveSharppH)/((C.ReactpHLim**C.CurveSharppH)))
//Upper range
else if (pH > C.OptimalpHMin)
if (pH > (C.OptimalpHMin + C.ReactpHLim))
@@ -817,11 +821,12 @@ im
return FALSE
if (D.id == "water") //Do like an otter, add acid to water.
- (if pH <= 2)
+ if (pH <= 2)
var/datum/effect_system/smoke_spread/chem/smoke_machine/s = new
- s.set_up(reagents, totalVol, pH*10, src)
+ s.set_up(, total_volume, pH*10, src)
s.start()
remove_any(amount/10)
+ return
if(!pH)
@@ -885,8 +890,8 @@ im
R.data = data
R.on_new(data)
if(istype(D, /datum/reagent/fermi))//Is this a fermichem?
- var/datum/reagent/fermi/FermiTime = D //It's Fermi time!
- FermiTime.fermiCreate(R.holder) //Seriously what is "data" ????
+ var/datum/reagent/fermi/Ferm = D.id //It's Fermi time!
+ Ferm.FermiNew(R.holder) //Seriously what is "data" ????
//This is how I keep myself sane.
diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm
index b952c19d66..9ce2d3169d 100644
--- a/code/modules/surgery/organs/lungs.dm
+++ b/code/modules/surgery/organs/lungs.dm
@@ -55,11 +55,11 @@
var/crit_stabilizing_reagent = "epinephrine"
//health
- var/health = 500
+ var/maxHealth = 500
var/damage = 0
//TODO: lung health affects lung function
-/obj/item/organ/tongue/proc/adjustLungLoss(mob/living/carbon/M, damage_mod)
+/obj/item/organ/lungs/proc/adjustLungLoss(mob/living/carbon/human/M, damage_mod)
if (maxHealth == "plasma")
return
if(damage+damage_mod < 0)
@@ -74,16 +74,15 @@
else if ((damage / maxHealth) > 0.75)
to_chat(M, "It's getting really hard to breathe!!")
M.emote("gasp")
- H.Dizzy(3)
+ M.Dizzy(3)
else if ((damage / maxHealth) > 0.5)
- H.Dizzy(2)
+ M.Dizzy(2)
to_chat(M, "Your chest is really starting to hurt.")
M.emote("cough")
- H.Dizzy(1)
else if ((damage / maxHealth) > 0.2)
to_chat(M, "You feel an ache within your chest.")
M.emote("cough")
-
+ M.Dizzy(1)
/obj/item/organ/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
if((H.status_flags & GODMODE))
@@ -156,7 +155,7 @@
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5*((damage/health)/2)) //More damaged lungs = slower oxy rate up to a factor of half
+ H.adjustOxyLoss(-5*((damage/maxHealth)/2)) //More damaged lungs = slower oxy rate up to a factor of half
gas_breathed = breath_gases[/datum/gas/oxygen][MOLES]
H.clear_alert("not_enough_oxy")
@@ -185,7 +184,7 @@
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5*((damage/health)/2))
+ H.adjustOxyLoss(-5*((damage/maxHealth)/2))
gas_breathed = breath_gases[/datum/gas/nitrogen][MOLES]
H.clear_alert("nitro")
@@ -222,7 +221,7 @@
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5*((damage/health)/2))
+ H.adjustOxyLoss(-5*((damage/maxHealth)/2))
gas_breathed = breath_gases[/datum/gas/carbon_dioxide][MOLES]
H.clear_alert("not_enough_co2")
@@ -252,7 +251,7 @@
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5*((damage/health)/2))
+ H.adjustOxyLoss(-5*((damage/maxHealth)/2))
gas_breathed = breath_gases[/datum/gas/plasma][MOLES]
H.clear_alert("not_enough_tox")
@@ -442,14 +441,14 @@
safe_oxygen_max = 0 // Like, at all.
safe_toxins_min = 16 //We breath THIS!
safe_toxins_max = 0
- health = "plasma"//I don't understand how plamamen work, so I'm not going to try t give them special lungs atm
+ maxHealth = "plasma"//I don't understand how plamamen work, so I'm not going to try t give them special lungs atm
/obj/item/organ/lungs/cybernetic
name = "cybernetic lungs"
desc = "A cybernetic version of the lungs found in traditional humanoid entities. It functions the same as an organic lung and is merely meant as a replacement."
icon_state = "lungs-c"
synthetic = TRUE
- health = 600
+ maxHealth = 600
/obj/item/organ/lungs/cybernetic/emp_act()
. = ..()
@@ -469,7 +468,7 @@
cold_level_1_threshold = 200
cold_level_2_threshold = 140
cold_level_3_threshold = 100
- health = 750
+ maxHealth = 750
/obj/item/organ/lungs/ashwalker
name = "ash lungs"
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 52b086b9c3..7cd851811b 100644
--- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm
@@ -23,7 +23,11 @@
//return ..()
//Called when reaction stops.
-/datum/reagent/fermi/proc/fermiFinish(holder) //You can get holder by reagents.holder WHY DID I LEARN THIS NOW???
+/datum/reagent/fermi/proc/FermiFinish(holder) //You can get holder by reagents.holder WHY DID I LEARN THIS NOW???
+ return
+
+//Called when added to a beaker without the reagent added.
+/datum/reagent/fermi/proc/FermiNew(holder) //You can get holder by reagents.holder WHY DID I LEARN THIS NOW???
return
//This should process fermichems to find out how pure they are and what effect to do.
@@ -579,7 +583,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING
color = "#E60584" // rgb: 96, 0, 255
taste_description = "a milky ice cream like flavour."
overdose_threshold = 12
- metabolization_rate = 0.5qa
+ metabolization_rate = 0.5
ImpureChem = "BEsmaller" //If you make an inpure chem, it stalls growth
InverseChemVal = 0.25
InverseChem = "BEsmaller" //At really impure vols, it just becomes 100% inverse
@@ -1028,7 +1032,7 @@ And as stated earlier, this chem is hard to make, and is punishing on failure. Y
var/creatorName
var/mob/living/creator
-/datum/reagent/fermi/enthrall/fermiCreate()
+/datum/reagent/fermi/enthrall/FermiFinish()
message_admins("On new for enthral proc'd")
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in holder.reagent_list
//var/datum/reagent/fermi/enthrall/E = locate(/datum/reagent/fermi/enthrall) in holder.reagent_list
diff --git a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
index bd17353382..eaac0d6c33 100644
--- a/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
+++ b/modular_citadel/code/modules/reagents/chemistry/recipes/fermi.dm
@@ -30,7 +30,7 @@
FermiChem = TRUE//If the chemical uses the Fermichem reaction mechanics
FermiExplode = FALSE //If the chemical explodes in a special way
-/datum/chemical_reaction/eigenstate/FermiCreate(datum/reagents/holder)
+/datum/chemical_reaction/fermi/eigenstate/FermiCreate(datum/reagents/holder)
var/location = get_turf(holder.my_atom)
var/datum/reagent/fermi/eigenstate/E = locate(/datum/reagent/fermi/eigenstate) in holder.reagent_list
E.location_created = location