mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
Allows initializing turfs with miscellaneous gases (#32623)
* More support for miscellaneous gases. * Comment. * Simpler way of doing it.
This commit is contained in:
@@ -96,10 +96,10 @@
|
||||
var/turf/portal/port = unsim // Area portal handling.
|
||||
if(port.target_turf)
|
||||
unsim = port.target_turf
|
||||
|
||||
|
||||
if(!unsim) // Above check should be fine, but sanity
|
||||
continue
|
||||
|
||||
|
||||
var/block = unsim.c_airblock(src)
|
||||
if(block & AIR_BLOCKED)
|
||||
|
||||
@@ -212,6 +212,9 @@
|
||||
GM[GAS_CARBON] = carbon_dioxide
|
||||
GM[GAS_NITROGEN] = nitrogen
|
||||
GM[GAS_PLASMA] = toxins
|
||||
if(misc_gases?.len)
|
||||
for(var/G in misc_gases)
|
||||
GM[G] = misc_gases[G]
|
||||
|
||||
GM.temperature = temperature
|
||||
GM.update_values()
|
||||
@@ -221,18 +224,28 @@
|
||||
/turf/remove_air(amount as num)
|
||||
var/datum/gas_mixture/GM = new
|
||||
|
||||
var/sum = oxygen + carbon_dioxide + nitrogen + toxins
|
||||
var/sum = oxygen + carbon_dioxide + nitrogen + toxins + misc_gases_sum()
|
||||
if(sum>0)
|
||||
GM[GAS_OXYGEN] = (oxygen/sum)*amount
|
||||
GM[GAS_CARBON] = (carbon_dioxide/sum)*amount
|
||||
GM[GAS_NITROGEN] = (nitrogen/sum)*amount
|
||||
GM[GAS_PLASMA] = (toxins/sum)*amount
|
||||
if(misc_gases?.len)
|
||||
for(var/G in misc_gases)
|
||||
GM[G] = (misc_gases[G]/sum)*amount
|
||||
|
||||
GM.temperature = temperature
|
||||
GM.update_values()
|
||||
|
||||
return GM
|
||||
|
||||
/turf/proc/misc_gases_sum()
|
||||
var/sum = 0
|
||||
if(misc_gases?.len)
|
||||
for(var/G in misc_gases)
|
||||
sum += misc_gases[G]
|
||||
return sum
|
||||
|
||||
/turf/simulated/assume_air(datum/gas_mixture/giver)
|
||||
var/datum/gas_mixture/my_air = return_air()
|
||||
my_air.merge(giver)
|
||||
@@ -263,6 +276,9 @@
|
||||
GAS_CARBON, carbon_dioxide,
|
||||
GAS_NITROGEN, nitrogen,
|
||||
GAS_PLASMA, toxins)
|
||||
if(misc_gases?.len)
|
||||
for(var/G in misc_gases)
|
||||
air.adjust_gas(G, misc_gases[G])
|
||||
|
||||
/turf/simulated/proc/c_copy_air()
|
||||
if(!air)
|
||||
|
||||
@@ -218,11 +218,9 @@
|
||||
nitrogen = 0.01
|
||||
|
||||
/turf/simulated/floor/engine/n20
|
||||
|
||||
/turf/simulated/floor/engine/n20/New()
|
||||
..()
|
||||
if(src.air)
|
||||
air.adjust_gas(GAS_SLEEPING, 9 * 4000) //NO goddamn idea what those numbers mean, but it's what they were before
|
||||
oxygen = 0
|
||||
nitrogen = 0
|
||||
misc_gases = list(GAS_SLEEPING = 36000)
|
||||
|
||||
/turf/simulated/floor/engine/nitrogen
|
||||
name = "nitrogen floor"
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
var/carbon_dioxide = 0
|
||||
var/nitrogen = 0
|
||||
var/toxins = 0
|
||||
var/list/misc_gases //associative list of gas names and amounts. eg. to add N2O to a turf: misc_gases = list(GAS_SLEEPING = 36000)
|
||||
|
||||
//properties for airtight tiles (/wall)
|
||||
var/thermal_conductivity = 0.05
|
||||
|
||||
Reference in New Issue
Block a user