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:
FinancialGoose
2026-04-21 13:43:47 -07:00
committed by GitHub
parent 55366497a3
commit e98cb75c57
30 changed files with 211 additions and 218 deletions
+3 -3
View File
@@ -68,11 +68,11 @@
var/turf/open/our_turf = src.loc
if(!our_turf.air || !our_turf.air.gases[/datum/gas/carbon_dioxide])
return
var/co2 = our_turf.air.gases[/datum/gas/carbon_dioxide][MOLES]
var/datum/gas_mixture/our_air = our_turf.air
var/co2 = our_air.gases[/datum/gas/carbon_dioxide][MOLES]
if(co2 > 0 && SPT_PROB(13, seconds_per_tick))
var/amt = min(co2, 9)
our_turf.air.gases[/datum/gas/carbon_dioxide][MOLES] -= amt
our_air.adjust_gas(/datum/gas/carbon_dioxide, -amt)
our_turf.atmos_spawn_air("[GAS_O2]=[amt]")
/mob/living/basic/tree/melee_attack(atom/target, list/modifiers, ignore_cooldown = FALSE)