mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +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:
@@ -113,10 +113,10 @@ GLOBAL_LIST_INIT(sm_gas_behavior, init_sm_gas())
|
||||
)
|
||||
if(!consumed_co2)
|
||||
return
|
||||
sm.absorbed_gasmix.gases[/datum/gas/carbon_dioxide][MOLES] -= consumed_co2
|
||||
sm.absorbed_gasmix.gases[/datum/gas/oxygen][MOLES] -= consumed_co2
|
||||
ASSERT_GAS(/datum/gas/pluoxium, sm.absorbed_gasmix)
|
||||
sm.absorbed_gasmix.gases[/datum/gas/pluoxium][MOLES] += consumed_co2
|
||||
sm.absorbed_gasmix.adjust_gas(/datum/gas/carbon_dioxide, -consumed_co2)
|
||||
sm.absorbed_gasmix.adjust_gas(/datum/gas/oxygen, -consumed_co2)
|
||||
|
||||
sm.absorbed_gasmix.adjust_gas(/datum/gas/pluoxium, consumed_co2)
|
||||
|
||||
/datum/sm_gas/plasma
|
||||
gas_path = /datum/gas/plasma
|
||||
@@ -178,7 +178,7 @@ GLOBAL_LIST_INIT(sm_gas_behavior, init_sm_gas())
|
||||
var/consumed_miasma = sm.absorbed_gasmix.gases[/datum/gas/miasma][MOLES] * miasma_ratio
|
||||
if(!consumed_miasma)
|
||||
return
|
||||
sm.absorbed_gasmix.gases[/datum/gas/miasma][MOLES] -= consumed_miasma
|
||||
sm.absorbed_gasmix.adjust_gas(/datum/gas/miasma, -consumed_miasma)
|
||||
sm.external_power_trickle += consumed_miasma * MIASMA_POWER_GAIN
|
||||
sm.log_activation("miasma absorption")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user