A preliminary implementation of chem gases

This commit is contained in:
Putnam3145
2021-06-27 07:58:35 -07:00
parent d2dc56123d
commit b213aaec2e
14 changed files with 165 additions and 20 deletions
+6 -7
View File
@@ -794,7 +794,7 @@
pH = REAGENT_NORMAL_PH
return 0
/datum/reagents/proc/reaction(atom/A, method = TOUCH, volume_modifier = 1, show_message = 1)
/datum/reagents/proc/reaction(atom/A, method = TOUCH, volume_modifier = 1, show_message = 1, from_gas = 0)
var/react_type
if(isliving(A))
react_type = "LIVING"
@@ -818,7 +818,7 @@
touch_protection = L.get_permeability_protection()
R.reaction_mob(A, method, R.volume * volume_modifier, show_message, touch_protection)
if("TURF")
R.reaction_turf(A, R.volume * volume_modifier, show_message)
R.reaction_turf(A, R.volume * volume_modifier, show_message, from_gas)
if("OBJ")
R.reaction_obj(A, R.volume * volume_modifier, show_message)
@@ -828,17 +828,16 @@
return FALSE
//Returns the average specific heat for all reagents currently in this holder.
/datum/reagents/proc/specific_heat()
/datum/reagents/proc/heat_capacity()
. = 0
var/cached_amount = total_volume //cache amount
var/list/cached_reagents = reagent_list //cache reagents
for(var/I in cached_reagents)
var/datum/reagent/R = I
. += R.specific_heat * (R.volume / cached_amount)
. += R.specific_heat * R.volume
/datum/reagents/proc/adjust_thermal_energy(J, min_temp = 2.7, max_temp = 1000)
var/S = specific_heat()
chem_temp = clamp(chem_temp + (J / (S * total_volume)), min_temp, max_temp)
var/S = heat_capacity()
chem_temp = clamp(chem_temp + (J / S), min_temp, max_temp)
if(istype(my_atom, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RC = my_atom
RC.temp_check()