Add planetary atmos

This commit is contained in:
Mark van Alphen
2019-04-27 18:52:50 +02:00
parent 4423962a2a
commit 36d251574f
7 changed files with 56 additions and 2 deletions
+16 -1
View File
@@ -49,6 +49,7 @@
var/icy = 0
var/icyoverlay
var/obj/effect/hotspot/active_hotspot
var/planetary_atmos = FALSE //air will revert to its initial mix over time
var/temperature_archived //USED ONLY FOR SOLIDS
@@ -138,13 +139,16 @@
/turf/simulated/proc/process_cell()
if(archived_cycle < SSair.times_fired) //archive self if not already done
archive()
current_cycle = SSair.times_fired
var/remove = 1 //set by non simulated turfs who are sharing with this turf
var/planet_atmos = planetary_atmos
if (planet_atmos)
atmos_adjacent_turfs_amount++
for(var/direction in cardinal)
if(!(atmos_adjacent_turfs & direction))
continue
@@ -205,6 +209,17 @@
if(excited_group)
last_share_check()
if(planet_atmos) //share our air with the "atmosphere" "above" the turf
var/datum/gas_mixture/G = new
G.copy_from_turf(src)
G.archive()
if(air.compare(G))
if(!excited_group)
var/datum/excited_group/EG = new
EG.add_turf(src)
air.share(G, atmos_adjacent_turfs_amount)
last_share_check()
air.react()
update_visuals()
+17
View File
@@ -203,6 +203,10 @@ What are the archived variables for?
/datum/gas_mixture/proc/copy_from(datum/gas_mixture/sample)
//Copies variables from sample
/datum/gas_mixture/proc/copy_from_turf(turf/model)
//Copies all gas info from the turf into the gas list along with temperature
//Returns: 1 if we are mutable, 0 otherwise
/datum/gas_mixture/proc/share(datum/gas_mixture/sharer)
//Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length
//Return: amount of gas exchanged (+ if sharer received)
@@ -343,6 +347,19 @@ What are the archived variables for?
return 1
/datum/gas_mixture/copy_from_turf(turf/model)
oxygen = model.oxygen
carbon_dioxide = model.carbon_dioxide
nitrogen = model.nitrogen
toxins = model.toxins
//acounts for changes in temperature
var/turf/model_parent = model.parent_type
if(model.temperature != initial(model.temperature) || model.temperature != initial(model_parent.temperature))
temperature = model.temperature
return 1
/datum/gas_mixture/check_turf(turf/model, atmos_adjacent_turfs = 4)
var/delta_oxygen = (oxygen_archived - model.oxygen)/(atmos_adjacent_turfs+1)
var/delta_carbon_dioxide = (carbon_dioxide_archived - model.carbon_dioxide)/(atmos_adjacent_turfs+1)
@@ -134,6 +134,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
baseturf = /turf/simulated/floor/plating/lava/smooth/lava_land_surface
/turf/simulated/floor/plating/asteroid/airless
@@ -173,6 +174,7 @@ GLOBAL_LIST_INIT(megafauna_spawn_list, list(/mob/living/simple_animal/hostile/me
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
/turf/simulated/floor/plating/asteroid/airless/cave/volcanic/has_data //subtype for producing a tunnel with given data
has_data = TRUE
+1
View File
@@ -122,6 +122,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
baseturf = /turf/simulated/floor/chasm/straight_down/lava_land_surface
light_range = 1.9 //slightly less range than lava
light_power = 0.65 //less bright, too
@@ -46,6 +46,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
/turf/simulated/floor/indestructible/necropolis/Initialize()
. = ..()
@@ -65,6 +66,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
/turf/simulated/floor/indestructible/boss/air
oxygen = MOLES_O2STANDARD
@@ -76,6 +78,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
desc = "A floor with a square pattern. It's faintly cool to the touch."
/turf/simulated/floor/indestructible/hierophant/two
+2 -1
View File
@@ -115,7 +115,8 @@
temperature = 300
oxygen = 14
nitrogen = 23
//baseturf = /turf/simulated/chasm/straight_down/lava_land_surface TODO: Uncomment
planetary_atmos = TRUE
baseturf = /turf/simulated/floor/chasm/straight_down/lava_land_surface
/turf/simulated/floor/plating/lava/smooth/airless
temperature = TCMB
+15
View File
@@ -181,6 +181,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
mineralSpawnChanceList = list(
/turf/simulated/mineral/uranium/volcanic = 35, /turf/simulated/mineral/diamond/volcanic = 30, /turf/simulated/mineral/gold/volcanic = 45, /turf/simulated/mineral/titanium/volcanic = 45,
@@ -201,6 +202,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
mineralChance = 10
@@ -223,6 +225,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
mineralSpawnChanceList = list(
/turf/simulated/mineral/uranium/volcanic = 2, /turf/simulated/mineral/diamond/volcanic = 1, /turf/simulated/mineral/gold/volcanic = 3, /turf/simulated/mineral/titanium/volcanic = 4,
@@ -243,6 +246,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/uranium
@@ -258,6 +262,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/diamond
@@ -273,6 +278,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/gold
@@ -288,6 +294,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/silver
@@ -303,6 +310,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/titanium
@@ -318,6 +326,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/plasma
@@ -333,6 +342,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/clown
@@ -349,6 +359,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/mime
@@ -364,6 +375,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/bscrystal
@@ -380,6 +392,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/volcanic
@@ -389,6 +402,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
/turf/simulated/mineral/volcanic/lava_land_surface
environment_type = "basalt"
@@ -415,6 +429,7 @@
oxygen = 14
nitrogen = 23
temperature = 300
planetary_atmos = TRUE
defer_change = 1
/turf/simulated/mineral/gibtonite/New()