Tests and fixes.
This commit is contained in:
@@ -385,8 +385,8 @@
|
||||
OptimalTempMin = 200 // Lower area of bell curve for determining heat based rate reactions
|
||||
OptimalTempMax = 950 // Upper end for above
|
||||
ExplodeTemp = 999 //Temperature at which reaction explodes
|
||||
OptimalpHMin = 2 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
|
||||
OptimalpHMax = 2.8 // Higest value for above
|
||||
OptimalpHMin = 3 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
|
||||
OptimalpHMax = 3.6 // Higest value for above
|
||||
ReactpHLim = 5 // How far out pH wil react, giving impurity place (Exponential phase)
|
||||
CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst)
|
||||
CurveSharpT = 2 // How sharp the temperature exponential curve is (to the power of value)
|
||||
@@ -405,6 +405,10 @@
|
||||
holder.remove_reagent(src.id, cached_volume)
|
||||
holder.add_reagent("neuroweak", cached_volume)
|
||||
|
||||
/datum/chemical_reaction/neurotoxin/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH)//reduced size
|
||||
volume = volume/10
|
||||
..()
|
||||
|
||||
/datum/chemical_reaction/snowwhite
|
||||
name = "Snow White"
|
||||
id = "snowwhite"
|
||||
|
||||
@@ -391,9 +391,9 @@
|
||||
state = "Gas"
|
||||
var/const/P = 3 //The number of seconds between life ticks
|
||||
var/T = initial(R.metabolization_rate) * (60 / P)
|
||||
if(istype(R, /datum/reagent/fermi))
|
||||
var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id)
|
||||
if(Rcr && Rcr.FermiChem)
|
||||
fermianalyze = TRUE
|
||||
var/datum/chemical_reaction/Rcr = get_chemical_reaction(R.id)
|
||||
var/pHpeakCache = (Rcr.OptimalpHMin + Rcr.OptimalpHMax)/2
|
||||
analyzeVars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "purityF" = initial(R.purity), "inverseRatioF" = initial(R.InverseChemVal), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
|
||||
else
|
||||
|
||||
@@ -33,18 +33,21 @@
|
||||
var/addiction_stage4_end = 40
|
||||
var/overdosed = 0 // You fucked up and this is now triggering its overdose effects, purge that shit quick.
|
||||
var/self_consuming = FALSE
|
||||
var/metabolizing = FALSE
|
||||
var/invisible = FALSE //Set to true if it doesn't appear on handheld health analyzers.
|
||||
//Fermichem vars:
|
||||
var/FermiChem = FALSE //If it's a fermichem
|
||||
var/purity = 1 //How pure a chemical is from 0 - 1.
|
||||
var/addProc = FALSE //If the chemical should force an on_new() call
|
||||
var/turf/loc = null //Should be the creation location!
|
||||
var/turf/loc = null //Should be the creation location!
|
||||
var/pH = 7 //pH of the specific reagent, used for calculating the sum pH of a holder.
|
||||
var/SplitChem = FALSE //If the chem splits on metabolism
|
||||
var/ImpureChem = "fermiTox"// What chemical is metabolised with an inpure reaction
|
||||
var/InverseChemVal = 0.25 // If the impurity is below 0.5, replace ALL of the chem with InverseChem upon metabolising
|
||||
var/InverseChem = "fermiTox"// What chem is metabolised when purity is below InverseChemVal, this shouldn't be made, but if it does, well, I guess I'll know about it.
|
||||
var/DoNotSplit = FALSE // If impurity is handled within the main chem itself
|
||||
var/OnMobMergeCheck = FALSE //Call on_mob_life proc when reagents are merging.
|
||||
var/metabolizing = FALSE
|
||||
var/invisible = FALSE //Set to true if it doesn't appear on handheld health analyzers.
|
||||
|
||||
|
||||
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
|
||||
. = ..()
|
||||
@@ -74,7 +77,27 @@
|
||||
return
|
||||
|
||||
// Called when this reagent is first added to a mob
|
||||
/datum/reagent/proc/on_mob_add(mob/living/L)
|
||||
/datum/reagent/proc/on_mob_add(mob/living/L, amount)
|
||||
if(SplitChem)
|
||||
var/mob/living/carbon/M = L
|
||||
if(!M)
|
||||
return
|
||||
if(purity < 0)
|
||||
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
|
||||
if (purity == 1 || DoNotSplit == TRUE)
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [id]")
|
||||
return
|
||||
else if (InverseChemVal > purity)//Turns all of a added reagent into the inverse chem
|
||||
M.reagents.remove_reagent(id, amount, FALSE)
|
||||
M.reagents.add_reagent(InverseChem, amount, FALSE, other_purity = 1)
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [InverseChem]")
|
||||
return
|
||||
else
|
||||
var/impureVol = amount * (1 - purity) //turns impure ratio into impure chem
|
||||
M.reagents.remove_reagent(id, (impureVol), FALSE)
|
||||
M.reagents.add_reagent(ImpureChem, impureVol, FALSE, other_purity = 1)
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume - impureVol]u of [id]")
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [ImpureChem]")
|
||||
return
|
||||
|
||||
// Called when this reagent is removed while inside a mob
|
||||
@@ -97,7 +120,32 @@
|
||||
return
|
||||
|
||||
// Called when two reagents of the same are mixing.
|
||||
/datum/reagent/proc/on_merge(data)
|
||||
/datum/reagent/proc/on_merge(data, amount, mob/living/carbon/M, purity)
|
||||
if(SplitChem)
|
||||
if(!ishuman(M))
|
||||
return
|
||||
if (purity < 0)
|
||||
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
|
||||
if (purity == 1 || DoNotSplit == TRUE)
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [id] in themselves")
|
||||
return
|
||||
else if (InverseChemVal > purity)
|
||||
M.reagents.remove_reagent(id, amount, FALSE)
|
||||
M.reagents.add_reagent(InverseChem, amount, FALSE, other_purity = 1)
|
||||
for(var/datum/reagent/fermi/R in M.reagents.reagent_list)
|
||||
if(R.name == "")
|
||||
R.name = name//Negative effects are hidden
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [InverseChem]")
|
||||
return
|
||||
else
|
||||
var/impureVol = amount * (1 - purity)
|
||||
M.reagents.remove_reagent(id, impureVol, FALSE)
|
||||
M.reagents.add_reagent(ImpureChem, impureVol, FALSE, other_purity = 1)
|
||||
for(var/datum/reagent/fermi/R in M.reagents.reagent_list)
|
||||
if(R.name == "")
|
||||
R.name = name//Negative effects are hidden
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume - impureVol]u of [id]")
|
||||
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [ImpureChem]")
|
||||
return
|
||||
|
||||
/datum/reagent/proc/on_update(atom/A)
|
||||
|
||||
@@ -1383,6 +1383,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_icon_state = "neurotoxinglass"
|
||||
glass_name = "Neurotoxin"
|
||||
glass_desc = "A drink that is guaranteed to knock you silly."
|
||||
SplitChem = TRUE
|
||||
ImpureChem = "neuroweak"
|
||||
InverseChemVal = 0 //Clear conversion
|
||||
InverseChem = "neuroweak"
|
||||
@@ -1422,14 +1423,18 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/neuroweak
|
||||
name = "Neuroalcohol"
|
||||
name = "Neuro-Smash"
|
||||
id = "neuroweak"
|
||||
description = "A mostly safe alcoholic drink for the true daredevils. Do not mix with Neurotoxin."
|
||||
description = "A mostly safe alcoholic drink for the true daredevils. Counteracts Neurotoxins."
|
||||
boozepwr = 60
|
||||
|
||||
/datum/reagent/consumable/ethanol/neuroweak/on_mob_life(mob/living/carbon/M)
|
||||
if(holder.has_reagent("neurotoxin"))
|
||||
M.adjustBrainLoss(0.5*REM, 150)
|
||||
M.adjustBrainLoss(-1*REM, 150)
|
||||
M.reagents.remove_reagent("neurotoxin", 0.25, FALSE)
|
||||
if(holder.has_reagent("fentanyl"))
|
||||
M.adjustBrainLoss(-1*REM, 150)
|
||||
M.reagents.remove_reagent("fentanyl", 0.25, FALSE)
|
||||
else
|
||||
M.adjustBrainLoss(-0.5*REM, 150)
|
||||
M.dizziness +=2
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
glass_icon_state = "glass_orange"
|
||||
glass_name = "glass of orange juice"
|
||||
glass_desc = "Vitamins! Yay!"
|
||||
pH = 3.3
|
||||
|
||||
/datum/reagent/consumable/orangejuice/on_mob_life(mob/living/carbon/M)
|
||||
if(M.getOxyLoss() && prob(30))
|
||||
@@ -45,6 +46,7 @@
|
||||
glass_icon_state = "glass_green"
|
||||
glass_name = "glass of lime juice"
|
||||
glass_desc = "A glass of sweet-sour lime juice."
|
||||
pH = 2.2
|
||||
|
||||
/datum/reagent/consumable/limejuice/on_mob_life(mob/living/carbon/M)
|
||||
if(M.getToxLoss() && prob(20))
|
||||
@@ -125,6 +127,7 @@
|
||||
glass_icon_state = "lemonglass"
|
||||
glass_name = "glass of lemon juice"
|
||||
glass_desc = "Sour..."
|
||||
pH = 2
|
||||
|
||||
/datum/reagent/consumable/banana
|
||||
name = "Banana Juice"
|
||||
|
||||
Reference in New Issue
Block a user