mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 23:58:07 +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:
@@ -44,11 +44,10 @@
|
||||
|
||||
/datum/disease/gastritium/proc/tritium_burp(hot_chance = FALSE)
|
||||
var/datum/gas_mixture/burp = new
|
||||
ADD_GAS(/datum/gas/tritium, burp.gases)
|
||||
burp.gases[/datum/gas/tritium][MOLES] = MOLES_GAS_VISIBLE
|
||||
burp.set_gas(/datum/gas/tritium, MOLES_GAS_VISIBLE)
|
||||
burp.temperature = affected_mob.bodytemperature
|
||||
if(hot_chance && prob(tritium_burp_hot_chance))
|
||||
burp.temperature = TRITIUM_MINIMUM_BURN_TEMPERATURE
|
||||
burp.set_temperature(TRITIUM_MINIMUM_BURN_TEMPERATURE)
|
||||
if(affected_mob.stat == CONSCIOUS)
|
||||
to_chat(affected_mob, span_warning("Your throat feels hot!"))
|
||||
affected_mob.visible_message("burps out green gas.", visible_message_flags = EMOTE_MESSAGE)
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
SIGNAL_HANDLER
|
||||
var/datum/gas_mixture/mix_to_spawn = new()
|
||||
mix_to_spawn.add_gas(gas_type)
|
||||
mix_to_spawn.gases[gas_type][MOLES] = amount_of_gas
|
||||
mix_to_spawn.temperature = T20C
|
||||
mix_to_spawn.set_gas(gas_type, amount_of_gas)
|
||||
mix_to_spawn.set_temperature(T20C)
|
||||
var/turf/open/our_turf = get_turf(target)
|
||||
our_turf.assume_air(mix_to_spawn)
|
||||
|
||||
Reference in New Issue
Block a user