Tweaks and fixes. Should be freature complete now.

This commit is contained in:
Fermi
2021-01-04 13:40:26 +00:00
parent c7965d3b4a
commit 57cd698994
5 changed files with 84 additions and 34 deletions
@@ -335,13 +335,13 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
holder.clear_reagents()
/datum/reagent/fermi/acidic_buffer
name = "Potent acidic buffer"
name = "Strong acidic buffer"
description = "This reagent will consume itself and move the pH of a beaker towards acidity when added to another."
color = "#fbc314"
pH = 0
chemical_flags = REAGENT_FORCEONNEW
can_synth = TRUE
var/strength = 2
var/strength = 1
//Consumes self on addition and shifts pH
/datum/reagent/fermi/acidic_buffer/on_new(datapH)
@@ -354,7 +354,11 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
data = datapH
if(LAZYLEN(holder.reagent_list) == 1)
return ..()
holder.pH = ((holder.pH * (holder.total_volume-volume))+(pH * volume*strength))/holder.total_volume //This is BEFORE removal
if(holder.pH < pH)
holder.my_atom.visible_message("<span class='warning'>The beaker fizzes as the buffer is added, to no effect.</b></span>")
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
return ..()
holder.pH = clamp((((holder.pH * (holder.total_volume-(volume*strength)))+(pH * (volume*strength)) )/holder.total_volume), 0, 14) //This is BEFORE removal
holder.my_atom.visible_message("<span class='warning'>The beaker fizzes as the pH changes!</b></span>")
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
holder.remove_reagent(type, volume, ignore_pH = TRUE)
@@ -366,16 +370,16 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
color = "#fbf344"
pH = 4
can_synth = TRUE
strength = 0.4
strength = 0.2
/datum/reagent/fermi/basic_buffer
name = "Potent basic buffer"
name = "Strong basic buffer"
description = "This reagent will consume itself and move the pH of a beaker towards alkalinity when added to another."
color = "#3853a4"
pH = 14
chemical_flags = REAGENT_FORCEONNEW
can_synth = TRUE
var/strength = 2
var/strength = 1
/datum/reagent/fermi/basic_buffer/weak
name = "Basic buffer"
@@ -383,7 +387,7 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
color = "#5873c4"
pH = 10
can_synth = TRUE
strength = 0.4
strength = 0.2
/datum/reagent/fermi/basic_buffer/on_new(datapH)
if(!holder)
@@ -395,7 +399,11 @@ datum/reagent/fermi/nanite_b_gone/reaction_obj(obj/O, reac_volume)
data = datapH
if(LAZYLEN(holder.reagent_list) == 1)
return ..()
holder.pH = ((holder.pH * (holder.total_volume-volume))+(pH * volume*strength))/holder.total_volume //This is BEFORE removal
if(holder.pH > pH)
holder.my_atom.visible_message("<span class='warning'>The beaker froths as the buffer is added, to no effect.</b></span>")
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
return ..()
holder.pH = clamp((((holder.pH * (holder.total_volume-(volume*strength)))+(pH * (volume*strength)) )/holder.total_volume), 0, 14) //This is BEFORE removal
holder.my_atom.visible_message("<span class='warning'>The beaker froths as the pH changes!</b></span>")
playsound(holder.my_atom, 'sound/FermiChem/bufferadd.ogg', 50, 1)
holder.remove_reagent(type, volume, ignore_pH = TRUE)