mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 21:17:44 +01:00
Refactor gasmix mole change into a proc (#95327)
## About The Pull Request Refactor the majority of the current gasmix mole change use cases into a proc called adjust_gas which simply adds the designated mole count of the species into the gas mix while also handling asserting the gas and garbage_collect() I also added adjust_multiple_gases and convert_gas() for modifying multiple gases and within a gasmix ## Why It's Good For The Game Lemon wanted this to be done as part of the air group refactor ## Changelog 🆑 refactor: refactored majority of gas_mix mole change into adjust_gas() proc /🆑
This commit is contained in:
@@ -297,8 +297,8 @@
|
||||
air_contents.temperature = T20C
|
||||
|
||||
air_contents.assert_gases(/datum/gas/oxygen, /datum/gas/nitrogen)
|
||||
air_contents.gases[/datum/gas/oxygen][MOLES] = (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrogen][MOLES] = (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
air_contents.adjust_gas(/datum/gas/oxygen, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
|
||||
air_contents.adjust_gas(/datum/gas/nitrogen, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
||||
|
||||
/obj/structure/closet/body_bag/environmental/nanotrasen
|
||||
name = "elite environmental protection bag"
|
||||
@@ -428,8 +428,8 @@
|
||||
air_contents.temperature = T20C
|
||||
|
||||
air_contents.assert_gases(/datum/gas/oxygen, /datum/gas/nitrous_oxide)
|
||||
air_contents.gases[/datum/gas/oxygen][MOLES] = (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrous_oxide][MOLES] = (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
air_contents.adjust_gas(/datum/gas/oxygen, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
|
||||
air_contents.adjust_gas(/datum/gas/nitrous_oxide, (ONE_ATMOSPHERE*50)/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
|
||||
|
||||
/obj/structure/closet/body_bag/environmental/hardlight
|
||||
name = "hardlight bodybag"
|
||||
@@ -509,11 +509,10 @@
|
||||
var/inner_temp = T0C - 60
|
||||
air_contents = null
|
||||
air_contents = new(mol_count)
|
||||
air_contents.temperature = inner_temp
|
||||
air_contents.set_temperature(inner_temp)
|
||||
|
||||
air_contents.assert_gases(/datum/gas/oxygen, /datum/gas/nitrogen)
|
||||
air_contents.gases[/datum/gas/oxygen][MOLES] = (ONE_ATMOSPHERE * mol_count) / (R_IDEAL_GAS_EQUATION * inner_temp) * O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrogen][MOLES] = (ONE_ATMOSPHERE * mol_count) / (R_IDEAL_GAS_EQUATION * inner_temp) * N2STANDARD
|
||||
air_contents.set_gas(/datum/gas/oxygen, ((ONE_ATMOSPHERE * mol_count) / (R_IDEAL_GAS_EQUATION * inner_temp) * O2STANDARD))
|
||||
air_contents.set_gas(/datum/gas/nitrogen, ((ONE_ATMOSPHERE * mol_count) / (R_IDEAL_GAS_EQUATION * inner_temp) * N2STANDARD))
|
||||
|
||||
/obj/structure/closet/body_bag/environmental/stasis/examine_status(mob/user)
|
||||
switch(100 * get_integrity_percentage())
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
return FALSE
|
||||
new /obj/item/flamethrower(get_turf(src))
|
||||
var/obj/item/tank/internals/plasma/ptank = new /obj/item/tank/internals/plasma(get_turf(src))
|
||||
ptank.air_contents.gases[/datum/gas/plasma][MOLES] = (0)
|
||||
ptank.air_contents.set_gas(/datum/gas/plasma, 0)
|
||||
drop_custom_materials()
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
|
||||
/obj/structure/transit_tube_pod/Initialize(mapload)
|
||||
. = ..()
|
||||
air_contents.add_gases(/datum/gas/oxygen, /datum/gas/nitrogen)
|
||||
air_contents.gases[/datum/gas/oxygen][MOLES] = MOLES_O2STANDARD
|
||||
air_contents.gases[/datum/gas/nitrogen][MOLES] = MOLES_N2STANDARD
|
||||
var/list/new_gases = list(/datum/gas/oxygen = MOLES_O2STANDARD, /datum/gas/nitrogen = MOLES_N2STANDARD)
|
||||
air_contents.adjust_multiple_gases(new_gases)
|
||||
air_contents.temperature = T20C
|
||||
|
||||
/obj/structure/transit_tube_pod/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user