Merge branch 'master' into Reagents_bitflats
This commit is contained in:
@@ -6,58 +6,17 @@
|
||||
id = "fermi"
|
||||
taste_description = "affection and love!"
|
||||
can_synth = FALSE
|
||||
SplitChem = TRUE
|
||||
|
||||
//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)
|
||||
. = ..()
|
||||
if(!M)
|
||||
return
|
||||
if(purity < 0)
|
||||
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
|
||||
if (purity == 1 || (reagentFlags & REAGENT_DONOTSPLIT))
|
||||
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 if(!(reagentFlags & REAGENT_ONLYINVERSE))
|
||||
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
|
||||
|
||||
|
||||
//When merging two fermichems, see above
|
||||
/datum/reagent/fermi/on_merge(data, amount, mob/living/carbon/M, purity)//basically on_mob_add but for merging
|
||||
. = ..()
|
||||
if(!ishuman(M))
|
||||
return
|
||||
if (purity < 0)
|
||||
CRASH("Purity below 0 for chem: [id], Please let Fermis Know!")
|
||||
if (purity == 1 || (reagentFlags & REAGENT_DONOTSPLIT))
|
||||
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 if(!(reagentFlags & REAGENT_ONLYINVERSE))
|
||||
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
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
mix_sound = 'sound/effects/bubbles.ogg'
|
||||
|
||||
//Called for every reaction step
|
||||
/datum/chemical_reaction/fermi/proc/FermiCreate(holder)
|
||||
/datum/chemical_reaction/proc/FermiCreate(holder)
|
||||
return
|
||||
|
||||
//Called when reaction STOP_PROCESSING
|
||||
/datum/chemical_reaction/fermi/proc/FermiFinish(datum/reagents/holder)
|
||||
/datum/chemical_reaction/proc/FermiFinish(datum/reagents/holder)
|
||||
return
|
||||
|
||||
//Called when temperature is above a certain threshold, or if purity is too low.
|
||||
/datum/chemical_reaction/fermi/proc/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH, Exploding = FALSE)
|
||||
/datum/chemical_reaction/proc/FermiExplode(datum/reagents, var/atom/my_atom, volume, temp, pH, Exploding = FALSE)
|
||||
if (Exploding == TRUE)
|
||||
return
|
||||
|
||||
@@ -101,10 +101,10 @@
|
||||
PurityMin = 0.4 //The minimum purity something has to be above, otherwise it explodes.
|
||||
|
||||
/datum/chemical_reaction/fermi/eigenstate/FermiFinish(datum/reagents/holder, var/atom/my_atom)//Strange how this doesn't work but the other does.
|
||||
if(!locate(/datum/reagent/fermi/eigenstate) in my_atom.reagents.reagent_list)
|
||||
var/datum/reagent/fermi/eigenstate/E = locate(/datum/reagent/fermi/eigenstate) in my_atom.reagents.reagent_list
|
||||
if(!E)
|
||||
return
|
||||
var/turf/open/location = get_turf(my_atom)
|
||||
var/datum/reagent/fermi/eigenstate/E = locate(/datum/reagent/fermi/eigenstate) in my_atom.reagents.reagent_list
|
||||
if(location)
|
||||
E.location_created = location
|
||||
E.data.["location_created"] = location
|
||||
|
||||
Reference in New Issue
Block a user