Merge branch 'Reagents_bitflats' into Wiki-fermi

This commit is contained in:
Fermi
2019-09-21 01:40:13 +01:00
22 changed files with 287 additions and 149 deletions
+2
View File
@@ -10,6 +10,8 @@
#define CHECK_BITFIELD(variable, flag) (variable & (flag)) #define CHECK_BITFIELD(variable, flag) (variable & (flag))
#define TOGGLE_BITFIELD(variable, flag) (variable ^= (flag)) #define TOGGLE_BITFIELD(variable, flag) (variable ^= (flag))
#define CHECK_MULTIPLE_BITFIELDS(flagvar, flags) (((flagvar) & (flags)) == (flags))
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)) GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
// for /datum/var/datum_flags // for /datum/var/datum_flags
+14
View File
@@ -34,3 +34,17 @@
#define DEL_REAGENT 1 // reagent deleted (fully cleared) #define DEL_REAGENT 1 // reagent deleted (fully cleared)
#define ADD_REAGENT 2 // reagent added #define ADD_REAGENT 2 // reagent added
#define REM_REAGENT 3 // reagent removed (may still exist) #define REM_REAGENT 3 // reagent removed (may still exist)
//reagent bitflags, used for altering how they works
#define REAGENT_DEAD_PROCESS (1<<0) //calls on_mob_dead() if present in a dead body
#define REAGENT_DONOTSPLIT (1<<1) //Do not split the chem at all during processing
#define REAGENT_ONLYINVERSE (1<<2) //Only invert chem, no splitting
#define REAGENT_ONMOBMERGE (1<<3) //Call on_mob_life proc when reagents are merging.
#define REAGENT_INVISIBLE (1<<4) //Doesn't appear on handheld health analyzers.
#define REAGENT_FORCEONNEW (1<<5) //Forces a on_new() call without a data overhead
#define REAGENT_SNEAKYNAME (1<<6) //When inverted, the inverted chem uses the name of the original chem
#define REAGENT_SPLITRETAINVOL (1<<7) //Retains initial volume of chem when splitting
//Chemical reaction flags, for determining reaction specialties
#define REACTION_CLEAR_IMPURE (1<<0) //Convert into impure/pure on reaction completion
#define REACTION_CLEAR_INVERSE (1<<1) //Convert into inverse on reaction completion when purity is low enough
+16 -2
View File
@@ -171,10 +171,24 @@ GLOBAL_LIST_INIT(bitfields, list(
"rad_flags" = list( "rad_flags" = list(
"RAD_PROTECT_CONTENTS" = RAD_PROTECT_CONTENTS, "RAD_PROTECT_CONTENTS" = RAD_PROTECT_CONTENTS,
"RAD_NO_CONTAMINATE" = RAD_NO_CONTAMINATE, "RAD_NO_CONTAMINATE" = RAD_NO_CONTAMINATE,
), ),
"disease_flags" = list( "disease_flags" = list(
"CURABLE" = CURABLE, "CURABLE" = CURABLE,
"CAN_CARRY" = CAN_CARRY, "CAN_CARRY" = CAN_CARRY,
"CAN_RESIST" = CAN_RESIST "CAN_RESIST" = CAN_RESIST
), ),
"chemical_flags" = list(
"REAGENT_DEAD_PROCESS" = REAGENT_DEAD_PROCESS,
"REAGENT_DONOTSPLIT" = REAGENT_DONOTSPLIT,
"REAGENT_ONLYINVERSE" = REAGENT_ONLYINVERSE,
"REAGENT_ONMOBMERGE" = REAGENT_ONMOBMERGE,
"REAGENT_INVISIBLE" = REAGENT_INVISIBLE,
"REAGENT_FORCEONNEW" = REAGENT_FORCEONNEW,
"REAGENT_SNEAKYNAME" = REAGENT_SNEAKYNAME,
"REAGENT_SPLITRETAINVOL" = REAGENT_SPLITRETAINVOL
),
"clear_conversion" = list(
"REACTION_CLEAR_IMPURE" = REACTION_CLEAR_IMPURE,
"REACTION_CLEAR_INVERSE" = REACTION_CLEAR_INVERSE
),
)) ))
+16 -1
View File
@@ -385,7 +385,7 @@ SLIME SCANNER
if(M.reagents.reagent_list.len) if(M.reagents.reagent_list.len)
var/list/datum/reagent/reagents = list() var/list/datum/reagent/reagents = list()
for(var/datum/reagent/R in M.reagents.reagent_list) for(var/datum/reagent/R in M.reagents.reagent_list)
if(R.invisible) if(R.chemical_flags & REAGENT_INVISIBLE)
continue continue
reagents += R reagents += R
@@ -404,6 +404,21 @@ SLIME SCANNER
msg += "<span class='danger'>[R.name]</span>\n" msg += "<span class='danger'>[R.name]</span>\n"
else else
msg += "<span class='notice'>Subject is not addicted to any reagents.</span>\n" msg += "<span class='notice'>Subject is not addicted to any reagents.</span>\n"
if(M.reagents.has_reagent("fermiTox"))
var/datum/reagent/fermiTox = M.reagents.has_reagent("fermiTox")
switch(fermiTox.volume)
if(5 to 10)
msg += "<span class='notice'>Subject contains a low amount of toxic isomers.</span>\n"
if(10 to 25)
msg += "<span class='danger'>Subject contains toxic isomers.</span>\n"
if(25 to 50)
msg += "<span class='danger'>Subject contains a substantial amount of toxic isomers.</span>\n"
if(50 to 95)
msg += "<span class='danger'>Subject contains a high amount of toxic isomers.</span>\n"
if(95 to INFINITY)
msg += "<span class='danger'>Subject contains a extremely dangerous amount of toxic isomers.</span>\n"
msg += "*---------*</span>" msg += "*---------*</span>"
to_chat(user, msg) to_chat(user, msg)
@@ -397,13 +397,16 @@
FermiChem = TRUE//If the chemical uses the Fermichem reaction mechanics FermiChem = TRUE//If the chemical uses the Fermichem reaction mechanics
FermiExplode = FALSE //If the chemical explodes in a special way FermiExplode = FALSE //If the chemical explodes in a special way
PurityMin = 0 //The minimum purity something has to be above, otherwise it explodes. PurityMin = 0 //The minimum purity something has to be above, otherwise it explodes.
clear_conversion = REACTION_CLEAR_INVERSE
/*
/datum/chemical_reaction/neurotoxin/FermiFinish(datum/reagents/holder, var/atom/my_atom) /datum/chemical_reaction/neurotoxin/FermiFinish(datum/reagents/holder, var/atom/my_atom)
var/datum/reagent/consumable/ethanol/neurotoxin/Nt = locate(/datum/reagent/consumable/ethanol/neurotoxin) in my_atom.reagents.reagent_list var/datum/reagent/consumable/ethanol/neurotoxin/Nt = locate(/datum/reagent/consumable/ethanol/neurotoxin) in my_atom.reagents.reagent_list
var/cached_volume = Nt.volume var/cached_volume = Nt.volume
if(Nt.purity < 0.5) if(Nt.purity < 0.5)
holder.remove_reagent(src.id, cached_volume) holder.remove_reagent(src.id, cached_volume)
holder.add_reagent("neuroweak", cached_volume) holder.add_reagent("neuroweak", cached_volume)
*/
/datum/chemical_reaction/neurotoxin/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH)//reduced size /datum/chemical_reaction/neurotoxin/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH)//reduced size
volume = volume/10 volume = volume/10
+7
View File
@@ -33,6 +33,7 @@
if(stat == DEAD) if(stat == DEAD)
stop_sound_channel(CHANNEL_HEARTBEAT) stop_sound_channel(CHANNEL_HEARTBEAT)
handle_death()
rot() rot()
//Updates the number of stored chemicals for powers //Updates the number of stored chemicals for powers
@@ -41,6 +42,12 @@
if(stat != DEAD) if(stat != DEAD)
return 1 return 1
//Procs called while dead
/mob/living/carbon/proc/handle_death()
for(var/datum/reagent/R in reagents.reagent_list)
if(R.chemical_flags & REAGENT_DEAD_PROCESS)
R.on_mob_dead(src)
/////////////// ///////////////
// BREATHING // // BREATHING //
/////////////// ///////////////
@@ -0,0 +1,23 @@
How to code fermichem reactions:
First off, probably read though the readme for standard reagent mechanisms, this builds on top of that.
#bitflags
for `datum/reagent/` you have the following options with `var/chemical_flags`:
```
REAGENT_DEAD_PROCESS calls on_mob_dead() if present in a dead body
REAGENT_DONOTSPLIT Do not split the chem at all during processing
REAGENT_ONLYINVERSE Only invert chem, no splitting
REAGENT_ONMOBMERGE Call on_mob_life proc when reagents are merging.
REAGENT_INVISIBLE Doesn't appear on handheld health analyzers.
REAGENT_FORCEONNEW Forces a on_new() call without a data overhead
REAGENT_SNEAKYNAME When inverted, the inverted chem uses the name of the original chem
REAGENT_SPLITRETAINVOL Retains initial volume of chem when splitting
```
for `datum/chemical_reaction/` under `var/clear_conversion`
```
REACTION_CLEAR_IMPURE Convert into impure/pure on reaction completion
REACTION_CLEAR_INVERSE Convert into inverse on reaction completion when purity is low enough
```
+19 -13
View File
@@ -466,7 +466,7 @@
if (C.FermiChem == TRUE && !continue_reacting) if (C.FermiChem == TRUE && !continue_reacting)
if (chem_temp > C.ExplodeTemp) //This is first to ensure explosions. if (chem_temp > C.ExplodeTemp) //This is first to ensure explosions.
var/datum/chemical_reaction/fermi/Ferm = selected_reaction var/datum/chemical_reaction/Ferm = selected_reaction
fermiIsReacting = FALSE fermiIsReacting = FALSE
SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[Ferm] explosion")) SSblackbox.record_feedback("tally", "fermi_chem", 1, ("[Ferm] explosion"))
Ferm.FermiExplode(src, my_atom, volume = total_volume, temp = chem_temp, pH = pH) Ferm.FermiExplode(src, my_atom, volume = total_volume, temp = chem_temp, pH = pH)
@@ -539,7 +539,7 @@
return 0 return 0
/datum/reagents/process() /datum/reagents/process()
var/datum/chemical_reaction/fermi/C = fermiReactID var/datum/chemical_reaction/C = fermiReactID
var/list/cached_required_reagents = C.required_reagents//update reagents list var/list/cached_required_reagents = C.required_reagents//update reagents list
var/list/cached_results = C.results//resultant chemical list var/list/cached_results = C.results//resultant chemical list
@@ -571,16 +571,16 @@
return return
/datum/reagents/proc/fermiEnd() /datum/reagents/proc/fermiEnd()
var/datum/chemical_reaction/fermi/C = fermiReactID var/datum/chemical_reaction/C = fermiReactID
STOP_PROCESSING(SSprocessing, src) STOP_PROCESSING(SSprocessing, src)
fermiIsReacting = FALSE fermiIsReacting = FALSE
reactedVol = 0
targetVol = 0
//pH check, handled at the end to reduce calls. //pH check, handled at the end to reduce calls.
if(istype(my_atom, /obj/item/reagent_containers)) if(istype(my_atom, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RC = my_atom var/obj/item/reagent_containers/RC = my_atom
RC.pH_check() RC.pH_check()
C.FermiFinish(src, my_atom) C.FermiFinish(src, my_atom, reactedVol)
reactedVol = 0
targetVol = 0
handle_reactions() handle_reactions()
update_total() update_total()
//Reaction sounds and words //Reaction sounds and words
@@ -591,7 +591,7 @@
to_chat(M, "<span class='notice'>[iconhtml] [C.mix_message]</span>") to_chat(M, "<span class='notice'>[iconhtml] [C.mix_message]</span>")
/datum/reagents/proc/fermiReact(selected_reaction, cached_temp, cached_pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier) /datum/reagents/proc/fermiReact(selected_reaction, cached_temp, cached_pH, reactedVol, targetVol, cached_required_reagents, cached_results, multiplier)
var/datum/chemical_reaction/fermi/C = selected_reaction var/datum/chemical_reaction/C = selected_reaction
var/deltaT = 0 var/deltaT = 0
var/deltapH = 0 var/deltapH = 0
var/stepChemAmmount = 0 var/stepChemAmmount = 0
@@ -700,7 +700,7 @@
return (reactedVol) return (reactedVol)
//Currently calculates it irrespective of required reagents at the start //Currently calculates it irrespective of required reagents at the start
/datum/reagents/proc/reactant_purity(var/datum/chemical_reaction/fermi/C, holder) /datum/reagents/proc/reactant_purity(var/datum/chemical_reaction/C, holder)
var/list/cached_reagents = reagent_list var/list/cached_reagents = reagent_list
var/i = 0 var/i = 0
var/cachedPurity var/cachedPurity
@@ -710,6 +710,14 @@
i++ i++
return cachedPurity/i return cachedPurity/i
/datum/reagents/proc/uncache_purity(id)
var/datum/reagent/R = has_reagent("[id]")
if(!R)
return
if(R.cached_purity == 1)
return
R.purity = R.cached_purity
/datum/reagents/proc/isolate_reagent(reagent) /datum/reagents/proc/isolate_reagent(reagent)
var/list/cached_reagents = reagent_list var/list/cached_reagents = reagent_list
for(var/_reagent in cached_reagents) for(var/_reagent in cached_reagents)
@@ -741,7 +749,7 @@
total_volume = 0 total_volume = 0
for(var/reagent in cached_reagents) for(var/reagent in cached_reagents)
var/datum/reagent/R = reagent var/datum/reagent/R = reagent
if(R.volume < CHEMICAL_QUANTISATION_LEVEL) if((R.volume < 0.01) && !fermiIsReacting)
del_reagent(R.id) del_reagent(R.id)
else else
total_volume += R.volume total_volume += R.volume
@@ -880,10 +888,8 @@
if(my_atom) if(my_atom)
my_atom.on_reagent_change(ADD_REAGENT) my_atom.on_reagent_change(ADD_REAGENT)
if(isliving(my_atom)) if(isliving(my_atom))
if(R.OnMobMergeCheck == TRUE)//Forces on_mob_add proc when a chem is merged if(R.chemical_flags & REAGENT_ONMOBMERGE)//Forces on_mob_add proc when a chem is merged
R.on_mob_add(my_atom, amount) R.on_mob_add(my_atom, amount)
//else
// R.on_merge(data, amount, my_atom, other_purity)
R.on_merge(data, amount, my_atom, other_purity) R.on_merge(data, amount, my_atom, other_purity)
if(!no_react) if(!no_react)
handle_reactions() handle_reactions()
@@ -901,7 +907,7 @@
if(data) if(data)
R.data = data R.data = data
R.on_new(data) R.on_new(data)
if(R.addProc == TRUE)//Allows on new without data overhead. if(R.chemical_flags & REAGENT_FORCEONNEW)//Allows on new without data overhead.
R.on_new(pH) //Add more as desired. R.on_new(pH) //Add more as desired.
@@ -405,7 +405,7 @@
if(!targetReagent) if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!") CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
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" = targetReagent.purity, "inverseRatioF" = initial(R.InverseChemVal), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache) 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" = targetReagent.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else else
fermianalyze = FALSE fermianalyze = FALSE
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)) 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))
@@ -432,7 +432,7 @@
if(!targetReagent) if(!targetReagent)
CRASH("Tried to find a reagent that doesn't exist in the chem_master!") CRASH("Tried to find a reagent that doesn't exist in the chem_master!")
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" = targetReagent.purity, "inverseRatioF" = initial(R.InverseChemVal), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache) 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" = targetReagent.purity, "inverseRatioF" = initial(R.inverse_chem_val), "purityE" = initial(Rcr.PurityMin), "minTemp" = initial(Rcr.OptimalTempMin), "maxTemp" = initial(Rcr.OptimalTempMax), "eTemp" = initial(Rcr.ExplodeTemp), "pHpeak" = pHpeakCache)
else else
fermianalyze = FALSE fermianalyze = FALSE
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)) 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))
+75 -55
View File
@@ -32,20 +32,18 @@
var/addiction_stage3_end = 30 var/addiction_stage3_end = 30
var/addiction_stage4_end = 40 var/addiction_stage4_end = 40
var/overdosed = 0 // You fucked up and this is now triggering its overdose effects, purge that shit quick. var/overdosed = 0 // You fucked up and this is now triggering its overdose effects, purge that shit quick.
var/self_consuming = FALSE var/self_consuming = FALSE //I think this uhhh, makes weird stuff happen when metabolising, but... doesn't seem to do what I think, so I'm gonna leave it.
var/metabolizing = FALSE
var/invisible = FALSE //Set to true if it doesn't appear on handheld health analyzers.
//Fermichem vars: //Fermichem vars:
var/purity = 1 //How pure a chemical is from 0 - 1. var/purity = 1 //How pure a chemical is from 0 - 1.
var/addProc = FALSE //If the chemical should force an on_new() call var/cached_purity = 1
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/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/SplitChem = FALSE //If the chem splits on metabolism
var/ImpureChem = "fermiTox"// What chemical is metabolised with an inpure reaction var/impure_chem // 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/inverse_chem_val = 0 // If the impurity is below 0.5, replace ALL of the chem with inverse_chemupon 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/inverse_chem // What chem is metabolised when purity is below inverse_chem_val, 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/metabolizing = FALSE
var/OnMobMergeCheck = FALSE //Call on_mob_life proc when reagents are merging. var/chemical_flags // See fermi/readme.dm REAGENT_DEAD_PROCESS, REAGENT_DONOTSPLIT, REAGENT_ONLYINVERSE, REAGENT_ONMOBMERGE, REAGENT_INVISIBLE, REAGENT_FORCEONNEW, REAGENT_SNEAKYNAME
/datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references /datum/reagent/Destroy() // This should only be called by the holder, so it's already handled clearing its references
@@ -75,28 +73,47 @@
holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
return return
//called when a mob processes chems when dead.
/datum/reagent/proc/on_mob_dead(mob/living/carbon/M)
if(!(chemical_flags & REAGENT_DEAD_PROCESS)) //justincase
return
current_cycle++
if(holder)
holder.remove_reagent(src.id, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears.
return
// Called when this reagent is first added to a mob // Called when this reagent is first added to a mob
/datum/reagent/proc/on_mob_add(mob/living/L, amount) /datum/reagent/proc/on_mob_add(mob/living/L, amount)
if(SplitChem) if(!iscarbon(L))
var/mob/living/carbon/M = L return
if(!M) var/mob/living/carbon/M = L
return if (purity == 1)
if(purity < 0) log_game("CHEM: [L] ckey: [L.key] has ingested [volume]u of [id]")
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!") return
if (purity == 1 || DoNotSplit == TRUE) if(cached_purity == 1)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [id]") cached_purity = purity
return else if(purity < 0)
else if (InverseChemVal > purity)//Turns all of a added reagent into the inverse chem CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
M.reagents.remove_reagent(id, amount, FALSE) if(chemical_flags & REAGENT_DONOTSPLIT)
M.reagents.add_reagent(InverseChem, amount, FALSE, other_purity = 1) return
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [InverseChem]")
return if ((inverse_chem_val > purity) && (inverse_chem))//Turns all of a added reagent into the inverse chem
else M.reagents.remove_reagent(id, amount, FALSE)
var/impureVol = amount * (1 - purity) //turns impure ratio into impure chem M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity)
var/datum/reagent/R = M.reagents.has_reagent("[inverse_chem]")
if(R.chemical_flags & REAGENT_SNEAKYNAME)
R.name = name//Negative effects are hidden
if(R.chemical_flags & REAGENT_INVISIBLE)
R.chemical_flags |= (REAGENT_INVISIBLE)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [inverse_chem]")
return
else if (impure_chem)
var/impureVol = amount * (1 - purity) //turns impure ratio into impure chem
if(!(chemical_flags & REAGENT_SPLITRETAINVOL))
M.reagents.remove_reagent(id, (impureVol), FALSE) M.reagents.remove_reagent(id, (impureVol), FALSE)
M.reagents.add_reagent(ImpureChem, impureVol, FALSE, other_purity = 1) M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity)
log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume - impureVol]u of [id]") 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]") log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [impure_chem]")
return return
// Called when this reagent is removed while inside a mob // Called when this reagent is removed while inside a mob
@@ -120,31 +137,34 @@
// Called when two reagents of the same are mixing. // Called when two reagents of the same are mixing.
/datum/reagent/proc/on_merge(data, amount, mob/living/carbon/M, purity) /datum/reagent/proc/on_merge(data, amount, mob/living/carbon/M, purity)
if(SplitChem) if(!iscarbon(M))
if(!ishuman(M)) return
return if (purity == 1)
if (purity < 0) log_game("FERMICHEM: [M] ckey: [M.key] has ingested [volume]u of [id]")
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!") return
if (purity == 1 || DoNotSplit == TRUE) cached_purity = purity //purity SHOULD be precalculated from the add_reagent, update cache.
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [id] in themselves") if (purity < 0)
return CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
else if (InverseChemVal > purity) if(chemical_flags & REAGENT_DONOTSPLIT)
M.reagents.remove_reagent(id, amount, FALSE) return
M.reagents.add_reagent(InverseChem, amount, FALSE, other_purity = 1)
for(var/datum/reagent/fermi/R in M.reagents.reagent_list) if ((inverse_chem_val > purity) && (inverse_chem)) //INVERT
if(R.name == "") M.reagents.remove_reagent(id, amount, FALSE)
R.name = name//Negative effects are hidden M.reagents.add_reagent(inverse_chem, amount, FALSE, other_purity = 1-cached_purity)
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [InverseChem]") var/datum/reagent/R = M.reagents.has_reagent("[inverse_chem]")
return if(R.chemical_flags & REAGENT_SNEAKYNAME)
else R.name = name//Negative effects are hidden
var/impureVol = amount * (1 - purity) if(R.chemical_flags & REAGENT_INVISIBLE)
R.chemical_flags |= (REAGENT_INVISIBLE)
log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [inverse_chem]")
return
else if (impure_chem) //SPLIT
var/impureVol = amount * (1 - purity)
if(!(chemical_flags & REAGENT_SPLITRETAINVOL))
M.reagents.remove_reagent(id, impureVol, FALSE) M.reagents.remove_reagent(id, impureVol, FALSE)
M.reagents.add_reagent(ImpureChem, impureVol, FALSE, other_purity = 1) M.reagents.add_reagent(impure_chem, impureVol, FALSE, other_purity = 1-cached_purity)
for(var/datum/reagent/fermi/R in M.reagents.reagent_list) log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume - impureVol]u of [id]")
if(R.name == "") log_game("FERMICHEM: [M] ckey: [M.key] has merged [volume]u of [impure_chem]")
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 return
/datum/reagent/proc/on_update(atom/A) /datum/reagent/proc/on_update(atom/A)
@@ -1383,10 +1383,10 @@ All effects don't start immediately, but rather get worse over time; the rate is
glass_icon_state = "neurotoxinglass" glass_icon_state = "neurotoxinglass"
glass_name = "Neurotoxin" glass_name = "Neurotoxin"
glass_desc = "A drink that is guaranteed to knock you silly." glass_desc = "A drink that is guaranteed to knock you silly."
SplitChem = TRUE //SplitChem = TRUE
ImpureChem = "neuroweak" impure_chem = "neuroweak"
InverseChemVal = 0 //Clear conversion inverse_chem_val = 0.5 //Clear conversion
InverseChem = "neuroweak" inverse_chem = "neuroweak"
/datum/reagent/consumable/ethanol/neurotoxin/proc/pickt() /datum/reagent/consumable/ethanol/neurotoxin/proc/pickt()
return (pick(TRAIT_PARALYSIS_L_ARM,TRAIT_PARALYSIS_R_ARM,TRAIT_PARALYSIS_R_LEG,TRAIT_PARALYSIS_L_LEG)) return (pick(TRAIT_PARALYSIS_L_ARM,TRAIT_PARALYSIS_R_ARM,TRAIT_PARALYSIS_R_LEG,TRAIT_PARALYSIS_L_LEG))
@@ -0,0 +1,26 @@
//Reagents produced by metabolising/reacting fermichems inoptimally, i.e. inverse_chems or impure_chems
//Inverse = Splitting
//Invert = Whole conversion
/datum/reagent/impure
chemical_flags = REAGENT_INVISIBLE | REAGENT_SNEAKYNAME //by default, it will stay hidden on splitting, but take the name of the source on inverting
/datum/reagent/impure/fermiTox
name = "Chemical Isomers"
id = "fermiTox"
description = "Toxic chemical isomers made from impure reactions. At low volumes will cause light toxin damage, but as the volume increases, it deals larger amounts, damages the liver, then eventually the heart."
data = "merge"
color = "FFFFFF"
can_synth = FALSE
var/potency = 1 //potency multiplies the volume when added.
//I'm concerned this is too weak, but I also don't want deathmixes.
//TODO: liver damage, 100+ heart
/datum/reagent/impure/fermiTox/on_mob_life(mob/living/carbon/C, method)
if(C.dna && istype(C.dna.species, /datum/species/jelly))
C.adjustToxLoss(-2)
else
C.adjustToxLoss(2)
..()
@@ -2003,7 +2003,7 @@
can_synth = FALSE can_synth = FALSE
var/datum/dna/original_dna var/datum/dna/original_dna
var/reagent_ticks = 0 var/reagent_ticks = 0
invisible = TRUE chemical_flags = REAGENT_INVISIBLE
/datum/reagent/changeling_string/on_mob_metabolize(mob/living/carbon/C) /datum/reagent/changeling_string/on_mob_metabolize(mob/living/carbon/C)
if(C && C.dna && data["desired_dna"]) if(C && C.dna && data["desired_dna"])
@@ -32,6 +32,7 @@
var/RateUpLim = 10 // Optimal/max rate possible if all conditions are perfect var/RateUpLim = 10 // Optimal/max rate possible if all conditions are perfect
var/FermiChem = FALSE // If the chemical uses the Fermichem reaction mechanics//If the chemical uses the Fermichem reaction mechanics var/FermiChem = FALSE // If the chemical uses the Fermichem reaction mechanics//If the chemical uses the Fermichem reaction mechanics
var/FermiExplode = FALSE // If the chemical explodes in a special way var/FermiExplode = FALSE // If the chemical explodes in a special way
var/clear_conversion //bitflags for clear conversions; REACTION_CLEAR_IMPURE or REACTION_CLEAR_INVERSE
var/PurityMin = 0.15 //If purity is below 0.15, it explodes too. Set to 0 to disable this. var/PurityMin = 0.15 //If purity is below 0.15, it explodes too. Set to 0 to disable this.
@@ -136,7 +136,6 @@ Creating a chem with a low purity will make you permanently fall in love with so
color = "#660015" // rgb: , 0, 255 color = "#660015" // rgb: , 0, 255
taste_description = "synthetic chocolate, a base tone of alcohol, and high notes of roses" taste_description = "synthetic chocolate, a base tone of alcohol, and high notes of roses"
overdose_threshold = 100 //If this is too easy to get 100u of this, then double it please. overdose_threshold = 100 //If this is too easy to get 100u of this, then double it please.
DoNotSplit = TRUE
metabolization_rate = 0.1//It has to be slow, so there's time for the effect. metabolization_rate = 0.1//It has to be slow, so there's time for the effect.
data = list("creatorID" = null, "creatorGender" = null, "creatorName" = null) data = list("creatorID" = null, "creatorGender" = null, "creatorName" = null)
var/creatorID //ckey var/creatorID //ckey
@@ -144,20 +143,19 @@ Creating a chem with a low purity will make you permanently fall in love with so
var/creatorName var/creatorName
var/mob/living/creator var/mob/living/creator
pH = 10 pH = 10
OnMobMergeCheck = TRUE //Procs on_mob_add when merging into a human chemical_flags = REAGENT_ONMOBMERGE | REAGENT_DONOTSPLIT //Procs on_mob_add when merging into a human
can_synth = FALSE can_synth = FALSE
/datum/reagent/fermi/enthrall/test /datum/reagent/fermi/enthrall/test
name = "MKUltraTest" name = "MKUltraTest"
id = "enthrallTest" id = "enthrallTest"
description = "A forbidden deep red mixture that overwhelms a foreign body with waves of joy, intoxicating them into servitude. When taken by the creator, it will enhance the draw of their voice to those affected by it." description = "A forbidden deep red mixture that makes you like Fermis a little too much. Unobtainable and due to be removed from the wiki."
data = list("creatorID" = "honkatonkbramblesnatch", "creatorGender" = "Mistress", "creatorName" = "Fermis Yakumo") data = list("creatorID" = "honkatonkbramblesnatch", "creatorGender" = "Mistress", "creatorName" = "Fermis Yakumo")
creatorID = "honkatonkbramblesnatch"//ckey creatorID = "honkatonkbramblesnatch"//ckey
creatorGender = "Mistress" creatorGender = "Mistress"
creatorName = "Fermis Yakumo" creatorName = "Fermis Yakumo"
purity = 1 purity = 1
DoNotSplit = TRUE
/datum/reagent/fermi/enthrall/test/on_new() /datum/reagent/fermi/enthrall/test/on_new()
id = "enthrall" id = "enthrall"
@@ -300,13 +298,13 @@ Creating a chem with a low purity will make you permanently fall in love with so
//Creates a gas cloud when the reaction blows up, causing everyone in it to fall in love with someone/something while it's in their system. //Creates a gas cloud when the reaction blows up, causing everyone in it to fall in love with someone/something while it's in their system.
/datum/reagent/fermi/enthrallExplo//Created in a gas cloud when it explodes /datum/reagent/fermi/enthrallExplo//Created in a gas cloud when it explodes
name = "MKUltra" name = "Gaseous MKUltra"
id = "enthrallExplo" id = "enthrallExplo"
description = "A forbidden deep red mixture that overwhelms a foreign body with waves of desire, inducing a chemial love for another. Also, how the HECC did you get this?" description = "A forbidden deep red gas that overwhelms a foreign body, causing the person they next lay their eyes on to become more interesting. Studies have shown that people are 66% more likely to make friends with this in the air. Produced when MKUltra explodes."
color = "#2C051A" // rgb: , 0, 255 color = "#2C051A" // rgb: , 0, 255
metabolization_rate = 0.1 metabolization_rate = 0.1
taste_description = "synthetic chocolate, a base tone of alcohol, and high notes of roses." taste_description = "synthetic chocolate, a base tone of alcohol, and high notes of roses."
DoNotSplit = TRUE chemical_flags = REAGENT_DONOTSPLIT
can_synth = FALSE can_synth = FALSE
var/mob/living/carbon/love var/mob/living/carbon/love
@@ -54,9 +54,9 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING
var/pollStarted = FALSE var/pollStarted = FALSE
var/location_created var/location_created
var/startHunger var/startHunger
ImpureChem = "SDGFtox" impure_chem = "SDGFtox"
InverseChemVal = 0.5 inverse_chem_val = 0.5
InverseChem = "SDZF" inverse_chem = "SDZF"
can_synth = TRUE can_synth = TRUE
@@ -280,8 +280,9 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING
//Unobtainable, used in clone spawn. //Unobtainable, used in clone spawn.
/datum/reagent/fermi/SDGFheal /datum/reagent/fermi/SDGFheal
name = "synthetic-derived growth factor" name = "synthetic-derived healing factor"
id = "SDGFheal" id = "SDGFheal"
description = "Leftover SDGF is transferred into the resulting clone, which quickly heals up the stresses from suddenly splitting. Restores blood, nutrition, and repaires brain and clone damage quickly. Only obtainable from using excess SDGF, and only enters the cloned body."
metabolization_rate = 1 metabolization_rate = 1
can_synth = FALSE can_synth = FALSE
@@ -294,29 +295,30 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING
..() ..()
//Unobtainable, used if SDGF is impure but not too impure //Unobtainable, used if SDGF is impure but not too impure
/datum/reagent/fermi/SDGFtox /datum/reagent/impure/SDGFtox
name = "synthetic-derived growth factor" name = "Synthetic-derived apoptosis factor"
id = "SDGFtox" id = "SDGFtox"
description = "A chem that makes a certain chemcat angry at you if you're reading this, how did you get this???"//i.e. tell me please, figure it's a good way to get pinged for bugfixes. description = "Impure synthetic-derived growth factor causes certain cells to undergo cell death, causing clone damage, and damaging blood cells."//i.e. tell me please, figure it's a good way to get pinged for bugfixes.
metabolization_rate = 1 metabolization_rate = 1
can_synth = FALSE can_synth = FALSE
/datum/reagent/fermi/SDGFtox/on_mob_life(mob/living/carbon/M)//Damages the taker if their purity is low. Extended use of impure chemicals will make the original die. (thus can't be spammed unless you've very good) /datum/reagent/impure/SDGFtox/on_mob_life(mob/living/carbon/M)//Damages the taker if their purity is low. Extended use of impure chemicals will make the original die. (thus can't be spammed unless you've very good)
M.blood_volume -= 10 M.blood_volume -= 10
M.adjustCloneLoss(2, 0) M.adjustCloneLoss(2, 0)
..() ..()
//Fail state of SDGF //Fail state of SDGF
/datum/reagent/fermi/SDZF /datum/reagent/impure/SDZF
name = "synthetic-derived growth factor" name = "synthetic-derived zombie factor"
id = "SDZF" id = "SDZF"
description = "A horribly peverse mass of Embryonic stem cells made real by the hands of a failed chemist. This message should never appear, how did you manage to get a hold of this?" description = "A horribly peverse mass of Embryonic stem cells made real by the hands of a failed chemist. Emulates normal synthetic-derived growth factor, but produces a hostile zombie at the end of it."
color = "#a502e0" // rgb: 96, 0, 255 color = "#a502e0" // rgb: 96, 0, 255
metabolization_rate = 0.5 * REAGENTS_METABOLISM metabolization_rate = 0.5 * REAGENTS_METABOLISM
var/startHunger var/startHunger
can_synth = TRUE can_synth = TRUE
chemical_flags = REAGENT_SNEAKYNAME
/datum/reagent/fermi/SDZF/on_mob_life(mob/living/carbon/M) //If you're bad at fermichem, turns your clone into a zombie instead. /datum/reagent/impure/SDZF/on_mob_life(mob/living/carbon/M) //If you're bad at fermichem, turns your clone into a zombie instead.
switch(current_cycle)//Pretends to be normal switch(current_cycle)//Pretends to be normal
if(20) if(20)
to_chat(M, "<span class='notice'>You feel the synethic cells rest uncomfortably within your body as they start to pulse and grow rapidly.</span>") to_chat(M, "<span class='notice'>You feel the synethic cells rest uncomfortably within your body as they start to pulse and grow rapidly.</span>")
@@ -28,7 +28,7 @@ I'd like to point out from my calculations it'll take about 60-80 minutes to die
var/datum/mind/originalmind var/datum/mind/originalmind
var/antiGenetics = 255 var/antiGenetics = 255
var/sleepytime = 0 var/sleepytime = 0
InverseChemVal = 0.25 inverse_chem_val = 0.25
can_synth = FALSE can_synth = FALSE
/datum/action/chem/astral /datum/action/chem/astral
@@ -26,9 +26,9 @@
taste_description = "a milky ice cream like flavour." taste_description = "a milky ice cream like flavour."
overdose_threshold = 17 overdose_threshold = 17
metabolization_rate = 0.25 metabolization_rate = 0.25
ImpureChem = "BEsmaller" //If you make an inpure chem, it stalls growth impure_chem = "BEsmaller" //If you make an inpure chem, it stalls growth
InverseChemVal = 0.35 inverse_chem_val = 0.35
InverseChem = "BEsmaller" //At really impure vols, it just becomes 100% inverse inverse_chem = "BEsmaller" //At really impure vols, it just becomes 100% inverse
can_synth = FALSE can_synth = FALSE
/datum/reagent/fermi/breast_enlarger/on_mob_add(mob/living/carbon/M) /datum/reagent/fermi/breast_enlarger/on_mob_add(mob/living/carbon/M)
@@ -140,7 +140,7 @@
/datum/reagent/fermi/BEsmaller /datum/reagent/fermi/BEsmaller
name = "Modesty milk" name = "Modesty milk"
id = "BEsmaller" id = "BEsmaller"
description = "A volatile collodial mixture derived from milk that encourages mammary reduction via a potent estrogen mix." description = "A volatile collodial mixture derived from milk that encourages mammary reduction via a potent estrogen mix. Produced by reacting impure Succubus milk."
color = "#E60584" // rgb: 96, 0, 255 color = "#E60584" // rgb: 96, 0, 255
taste_description = "a milky ice cream like flavour." taste_description = "a milky ice cream like flavour."
metabolization_rate = 0.25 metabolization_rate = 0.25
@@ -211,9 +211,9 @@
taste_description = "chinese dragon powder" taste_description = "chinese dragon powder"
overdose_threshold = 17 //ODing makes you male and removes female genitals overdose_threshold = 17 //ODing makes you male and removes female genitals
metabolization_rate = 0.5 metabolization_rate = 0.5
ImpureChem = "PEsmaller" //If you make an inpure chem, it stalls growth impure_chem = "PEsmaller" //If you make an inpure chem, it stalls growth
InverseChemVal = 0.35 inverse_chem_val = 0.35
InverseChem = "PEsmaller" //At really impure vols, it just becomes 100% inverse and shrinks instead. inverse_chem = "PEsmaller" //At really impure vols, it just becomes 100% inverse and shrinks instead.
can_synth = FALSE can_synth = FALSE
/datum/reagent/fermi/penis_enlarger/on_mob_add(mob/living/carbon/M) /datum/reagent/fermi/penis_enlarger/on_mob_add(mob/living/carbon/M)
@@ -311,7 +311,7 @@
/datum/reagent/fermi/PEsmaller // Due to cozmo's request...! /datum/reagent/fermi/PEsmaller // Due to cozmo's request...!
name = "Chastity draft" name = "Chastity draft"
id = "PEsmaller" id = "PEsmaller"
description = "A volatile collodial mixture derived from various masculine solutions that encourages a smaller gentleman's package via a potent testosterone mix, formula derived from a collaboration from Fermichem and Doctor Ronald Hyatt, who is well known for his phallus palace." description = "A volatile collodial mixture derived from various masculine solutions that encourages a smaller gentleman's package via a potent testosterone mix. Produced by reacting impure Incubus draft."
color = "#888888" // This is greyish..? color = "#888888" // This is greyish..?
taste_description = "chinese dragon powder" taste_description = "chinese dragon powder"
metabolization_rate = 0.5 metabolization_rate = 0.5
@@ -6,7 +6,10 @@
id = "fermi" id = "fermi"
taste_description = "affection and love!" taste_description = "affection and love!"
can_synth = FALSE can_synth = FALSE
SplitChem = TRUE //SplitChem = TRUE
impure_chem = "fermiTox"// What chemical is metabolised with an inpure reaction
inverse_chem_val = 0.25 // If the impurity is below 0.5, replace ALL of the chem with inverse_chemupon metabolising
inverse_chem = "fermiTox"
//This should process fermichems to find out how pure they are and what effect to do. //This should process fermichems to find out how pure they are and what effect to do.
/datum/reagent/fermi/on_mob_add(mob/living/carbon/M, amount) /datum/reagent/fermi/on_mob_add(mob/living/carbon/M, amount)
@@ -36,7 +39,7 @@
taste_description = "like jerky, whiskey and an off aftertaste of a crypt." taste_description = "like jerky, whiskey and an off aftertaste of a crypt."
metabolization_rate = 0.2 metabolization_rate = 0.2
overdose_threshold = 25 overdose_threshold = 25
DoNotSplit = TRUE chemical_flags = REAGENT_DONOTSPLIT
pH = 4 pH = 4
can_synth = TRUE can_synth = TRUE
@@ -81,9 +84,9 @@
color = "#f9b9bc" // rgb: , 0, 255 color = "#f9b9bc" // rgb: , 0, 255
taste_description = "dewicious degenyewacy" taste_description = "dewicious degenyewacy"
metabolization_rate = 0.5 * REAGENTS_METABOLISM metabolization_rate = 0.5 * REAGENTS_METABOLISM
InverseChemVal = 0 inverse_chem_val = 0
var/obj/item/organ/tongue/nT var/obj/item/organ/tongue/nT
DoNotSplit = TRUE chemical_flags = REAGENT_DONOTSPLIT
pH = 5 pH = 5
var/obj/item/organ/tongue/T var/obj/item/organ/tongue/T
can_synth = TRUE can_synth = TRUE
@@ -170,9 +173,9 @@
description = "A stablised EMP that is highly volatile, shocking small nano machines that will kill them off at a rapid rate in a patient's system." description = "A stablised EMP that is highly volatile, shocking small nano machines that will kill them off at a rapid rate in a patient's system."
color = "#708f8f" color = "#708f8f"
overdose_threshold = 15 overdose_threshold = 15
ImpureChem = "nanite_b_goneTox" //If you make an inpure chem, it stalls growth impure_chem = "nanite_b_goneTox" //If you make an inpure chem, it stalls growth
InverseChemVal = 0.25 inverse_chem_val = 0.25
InverseChem = "nanite_b_goneTox" //At really impure vols, it just becomes 100% inverse inverse_chem = "nanite_b_goneTox" //At really impure vols, it just becomes 100% inverse
taste_description = "what can only be described as licking a battery." taste_description = "what can only be described as licking a battery."
pH = 9 pH = 9
can_synth = FALSE can_synth = FALSE
@@ -195,7 +198,7 @@
//empulse((get_turf(C)), 3, 2)//So the nanites randomize //empulse((get_turf(C)), 3, 2)//So the nanites randomize
var/atom/T = C var/atom/T = C
T.emp_act(EMP_HEAVY) T.emp_act(EMP_HEAVY)
to_chat(C, "<span class='warning'>The nanites short circuit within your system!</b></span>") to_chat(C, "<span class='warning'>You feel a strange tingling sensation come from your core.</b></span>")
if(isnull(N)) if(isnull(N))
return ..() return ..()
N.nanite_volume = -2 N.nanite_volume = -2
@@ -205,10 +208,11 @@
O.emp_act(EMP_HEAVY) O.emp_act(EMP_HEAVY)
/datum/reagent/fermi/nanite_b_goneTox /datum/reagent/fermi/nanite_b_goneTox
name = "Naninte bain" name = "Electromagnetic crystals"
id = "nanite_b_goneTox" id = "nanite_b_goneTox"
description = "Poorly made, and shocks you!" description = "Causes items upon the patient to sometimes short out, as well as causing a shock in the patient, if the residual charge between the crystals builds up to sufficient quantities"
metabolization_rate = 1 metabolization_rate = 0.5
chemical_flags = REAGENT_INVISIBLE
//Increases shock events. //Increases shock events.
/datum/reagent/fermi/nanite_b_goneTox/on_mob_life(mob/living/carbon/C)//Damages the taker if their purity is low. Extended use of impure chemicals will make the original die. (thus can't be spammed unless you've very good) /datum/reagent/fermi/nanite_b_goneTox/on_mob_life(mob/living/carbon/C)//Damages the taker if their purity is low. Extended use of impure chemicals will make the original die. (thus can't be spammed unless you've very good)
@@ -274,7 +278,7 @@
name = "Fermis Test Reagent" name = "Fermis Test Reagent"
id = "fermiTest" id = "fermiTest"
description = "You should be really careful with this...! Also, how did you get this?" description = "You should be really careful with this...! Also, how did you get this?"
addProc = TRUE chemical_flags = REAGENT_FORCEONNEW
can_synth = FALSE can_synth = FALSE
/datum/reagent/fermi/fermiTest/on_new(datum/reagents/holder) /datum/reagent/fermi/fermiTest/on_new(datum/reagents/holder)
@@ -305,22 +309,6 @@
playsound(get_turf(M), 'modular_citadel/sound/voice/merowr.ogg', 50, 1) playsound(get_turf(M), 'modular_citadel/sound/voice/merowr.ogg', 50, 1)
holder.clear_reagents() holder.clear_reagents()
/datum/reagent/fermi/fermiTox
name = "FermiTox"
id = "fermiTox"
description = "You should be really careful with this...! Also, how did you get this? You shouldn't have this!"
data = "merge"
color = "FFFFFF"
can_synth = FALSE
//I'm concerned this is too weak, but I also don't want deathmixes.
/datum/reagent/fermi/fermiTox/on_mob_life(mob/living/carbon/C, method)
if(C.dna && istype(C.dna.species, /datum/species/jelly))
C.adjustToxLoss(-2)
else
C.adjustToxLoss(2)
..()
/datum/reagent/fermi/acidic_buffer /datum/reagent/fermi/acidic_buffer
name = "Acidic buffer" name = "Acidic buffer"
id = "acidic_buffer" id = "acidic_buffer"
@@ -6,9 +6,9 @@
color = "#68e83a" color = "#68e83a"
pH = 8.6 pH = 8.6
overdose_threshold = 35 overdose_threshold = 35
ImpureChem = "yamerol_tox" impure_chem = "yamerol_tox"
InverseChemVal = 0.4 inverse_chem_val = 0.4
InverseChem = "yamerol_tox" inverse_chem = "yamerol_tox"
can_synth = TRUE can_synth = TRUE
/datum/reagent/fermi/yamerol/on_mob_life(mob/living/carbon/C) /datum/reagent/fermi/yamerol/on_mob_life(mob/living/carbon/C)
@@ -73,15 +73,15 @@
C.adjustOxyLoss(-3) C.adjustOxyLoss(-3)
..() ..()
/datum/reagent/fermi/yamerol_tox /datum/reagent/impure/yamerol_tox
name = "Yamerol" name = "Yamer oh no"
id = "yamerol_tox" id = "yamerol_tox"
description = "For when you've trouble speaking or breathing, just yell YAMEROL! A chem that helps soothe any congestion problems and at high concentrations restores damaged lungs and tongues!" description = "A dangerous, cloying toxin that stucks to a patients respiratory system, damaging their tongue, lungs and causing suffocation."
taste_description = "a weird, syrupy flavour, yamero" taste_description = "a weird, syrupy flavour, yamero"
color = "#68e83a" color = "#68e83a"
pH = 8.6 pH = 8.6
/datum/reagent/fermi/yamerol_tox/on_mob_life(mob/living/carbon/C) /datum/reagent/impure/yamerol_tox/on_mob_life(mob/living/carbon/C)
var/obj/item/organ/tongue/T = C.getorganslot(ORGAN_SLOT_TONGUE) var/obj/item/organ/tongue/T = C.getorganslot(ORGAN_SLOT_TONGUE)
var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS) var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS)
@@ -6,7 +6,25 @@
return return
//Called when reaction STOP_PROCESSING //Called when reaction STOP_PROCESSING
/datum/chemical_reaction/proc/FermiFinish(datum/reagents/holder) /datum/chemical_reaction/proc/FermiFinish(datum/reagents/holder, var/atom/my_atom, reactVol)
if(clear_conversion == REACTION_CLEAR_IMPURE | REACTION_CLEAR_INVERSE)
for(var/id in results)
var/datum/reagent/R = my_atom.reagents.has_reagent("[id]")
if(R.purity == 1)
continue
var/cached_volume = R.volume
if(clear_conversion == REACTION_CLEAR_INVERSE && R.inverse_chem)
if(R.inverse_chem_val > R.purity)
my_atom.reagents.remove_reagent(R.id, cached_volume, FALSE)
my_atom.reagents.add_reagent(R.inverse_chem, cached_volume, FALSE, other_purity = 1)
else if (clear_conversion == REACTION_CLEAR_IMPURE && R.impure_chem)
var/impureVol = cached_volume * (1 - R.purity)
my_atom.reagents.remove_reagent(R.id, (impureVol), FALSE)
my_atom.reagents.add_reagent(R.impure_chem, impureVol, FALSE, other_purity = 1)
R.cached_purity = R.purity
R.purity = 1
return return
//Called when temperature is above a certain threshold, or if purity is too low. //Called when temperature is above a certain threshold, or if purity is too low.
+1
View File
@@ -2532,6 +2532,7 @@
#include "code\modules\reagents\chemistry\reagents\drink_reagents.dm" #include "code\modules\reagents\chemistry\reagents\drink_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\drug_reagents.dm" #include "code\modules\reagents\chemistry\reagents\drug_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\food_reagents.dm" #include "code\modules\reagents\chemistry\reagents\food_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\impure_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\medicine_reagents.dm" #include "code\modules\reagents\chemistry\reagents\medicine_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\other_reagents.dm" #include "code\modules\reagents\chemistry\reagents\other_reagents.dm"
#include "code\modules\reagents\chemistry\reagents\pyrotechnic_reagents.dm" #include "code\modules\reagents\chemistry\reagents\pyrotechnic_reagents.dm"