Buncha fixes and QoL stuff. (pH, hypo, heater and dispencer_
This commit is contained in:
@@ -198,7 +198,7 @@
|
||||
trans_data = copy_data(T)
|
||||
|
||||
|
||||
R.add_reagent(T.id, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE) //we only handle reaction after every reagent has been transfered.
|
||||
R.add_reagent(T.id, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
|
||||
|
||||
remove_reagent(T.id, transfer_amount, ignore_pH = TRUE)
|
||||
|
||||
@@ -805,7 +805,7 @@
|
||||
var/obj/item/reagent_containers/RC = my_atom
|
||||
RC.temp_check()
|
||||
|
||||
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, other_purity = 1, other_pH, no_react = 0)
|
||||
/datum/reagents/proc/add_reagent(reagent, amount, list/data=null, reagtemp = 300, other_purity = 1, other_pH, no_react = 0, ignore_pH = FALSE)
|
||||
|
||||
if(!isnum(amount) || !amount)
|
||||
return FALSE
|
||||
@@ -818,7 +818,7 @@
|
||||
WARNING("[my_atom] attempted to add a reagent called '[reagent]' which doesn't exist. ([usr])")
|
||||
return FALSE
|
||||
|
||||
if (D.id == "water") //Do like an otter, add acid to water.
|
||||
if (D.id == "water" && no_react == FALSE) //Do like an otter, add acid to water.
|
||||
if (pH <= 2)
|
||||
SSblackbox.record_feedback("tally", "fermi_chem", 1, "water-acid explosions")
|
||||
var/datum/effect_system/smoke_spread/chem/s = new
|
||||
@@ -858,10 +858,13 @@
|
||||
chem_temp = thermal_energy / (specific_heat * new_total)
|
||||
|
||||
//cacluate reagent based pH shift.
|
||||
pH = ((cached_pH * cached_total)+(D.pH * amount))/(cached_total + amount)//should be right
|
||||
if(istype(my_atom, /obj/item/reagent_containers/))
|
||||
var/obj/item/reagent_containers/RC = my_atom
|
||||
RC.pH_check()//checks beaker resilience
|
||||
if(ignore_pH == FALSE)
|
||||
pH = ((cached_pH * cached_total)+(D.pH * amount))/(cached_total + amount)//should be right
|
||||
if(istype(my_atom, /obj/item/reagent_containers/))
|
||||
var/obj/item/reagent_containers/RC = my_atom
|
||||
RC.pH_check()//checks beaker resilience
|
||||
else
|
||||
pH = other_pH
|
||||
|
||||
//add the reagent to the existing if it exists
|
||||
for(var/A in cached_reagents)
|
||||
|
||||
@@ -190,6 +190,10 @@
|
||||
data["beakerMaxVolume"] = beaker.volume
|
||||
data["beakerTransferAmounts"] = beaker.possible_transfer_amounts
|
||||
data["beakerCurrentpH"] = beaker.reagents.pH
|
||||
//pH accuracy
|
||||
for(var/obj/item/stock_parts/capacitor/C in component_parts)
|
||||
data["partRating"]= 10**(C.rating-1)
|
||||
|
||||
else
|
||||
data["beakerCurrentVolume"] = null
|
||||
data["beakerMaxVolume"] = null
|
||||
|
||||
@@ -100,11 +100,18 @@
|
||||
data["currentpH"] = beaker ? beaker.reagents.pH : null
|
||||
data["beakerCurrentVolume"] = beaker ? beaker.reagents.total_volume : null
|
||||
data["beakerMaxVolume"] = beaker ? beaker.volume : null
|
||||
//purity and pH accuracy
|
||||
for(var/obj/item/stock_parts/micro_laser/M in component_parts)
|
||||
data["partRating"]= 10**(M.rating-1)
|
||||
if(M.rating == 4)
|
||||
data["showPurity"] = 1
|
||||
else
|
||||
data["showPurity"] = 0
|
||||
|
||||
var beakerContents[0]
|
||||
if(beaker)
|
||||
for(var/datum/reagent/R in beaker.reagents.reagent_list)
|
||||
beakerContents.Add(list(list("name" = R.name, "volume" = R.volume))) // list in a list because Byond merges the first list...
|
||||
beakerContents.Add(list(list("name" = R.name, "volume" = R.volume, "purity" = R.purity))) // list in a list because Byond merges the first list...
|
||||
data["beakerContents"] = beakerContents
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user