Final testing. Added pH meter too. Compile safe.

This commit is contained in:
Fermi
2019-05-27 15:00:19 +01:00
parent 4607a2b6c3
commit a1afeb880f
8 changed files with 37 additions and 2 deletions
@@ -1564,6 +1564,10 @@ And as stated earlier, this chem is hard to make, and is punishing on failure. Y
else if (pH >= 7)
pH = 7
holder.pH = ((holder.pH * holder.total_volume)+(pH * src.volume))/(holder.total_volume + src.volume) //Shouldn't be required
var/list/seen = viewers(5, get_turf(my_atom))
for(var/mob/M in seen)
to_chat(M, "<span class='warning'>The beaker fizzes as the buffer's pH changes!</b></span>")
playsound(get_turf(holder), 'modular_citadel/sound/FermiChem/bufferadd.ogg', 50, 1, -1)
holder.remove_reagent(src.id, 1000)
..()
@@ -1586,5 +1590,9 @@ And as stated earlier, this chem is hard to make, and is punishing on failure. Y
else if (pH <= 7)
pH = 7
holder.pH = ((holder.pH * holder.total_volume)+(pH * src.volume))/(holder.total_volume + src.volume) //Shouldn't be required Might be..?
var/list/seen = viewers(5, get_turf(my_atom))
for(var/mob/M in seen)
to_chat(M, "<span class='warning'>The beaker froths as the buffer's pH changes!</b></span>")
playsound(get_turf(holder), 'modular_citadel/sound/FermiChem/bufferadd.ogg', 50, 1, -1)
holder.remove_reagent(src.id, 1000)
..()
@@ -9,6 +9,7 @@
w_class = WEIGHT_CLASS_TINY
//set flammable somehow
//A little janky with pockets
/obj/item/pHbooklet/attack_hand(mob/user)
if(user.get_held_index_of_item(src))
if(numberOfPages >= 1)
@@ -84,3 +85,17 @@
color = "#c6040c"
desc += " The paper looks to be around a pH of [round(cont.reagents.pH, 1)]"
used = TRUE
/obj/item/pHmeter
name = "pH meter"
desc = "A a electrode attached to a small circuit box that will tell you the pH of a solution. The screen currently displays nothing."
icon_state = "pHmeter"
icon = 'modular_citadel/icons/obj/FermiChem.dmi'
resistance_flags = FLAMMABLE
w_class = WEIGHT_CLASS_TINY
/obj/item/pHmeter/afterattack(obj/item/reagent_containers/cont, mob/user, proximity)
if(!istype(cont))
return
to_chat(M, "<span class='notice'><i>gives a beep and displays [round(cont.reagents.pH, 0.1)]</i></span>")
desc = "An electrode attached to a small circuit box that will tell you the pH of a solution. The screen currently displays [round(cont.reagents.pH, 0.1)]."