diff --git a/_maps/RandomZLevels/VR/snowdin_VR.dmm b/_maps/RandomZLevels/VR/snowdin_VR.dmm
index 08bb1e8c5566..32c0e076f323 100644
--- a/_maps/RandomZLevels/VR/snowdin_VR.dmm
+++ b/_maps/RandomZLevels/VR/snowdin_VR.dmm
@@ -2671,14 +2671,14 @@
"gc" = (
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gd" = (
/obj/effect/spawner/lootdrop/crate_spawner,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"ge" = (
@@ -2689,7 +2689,7 @@
/obj/effect/spawner/lootdrop/snowdin/dungeonheavy,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gg" = (
@@ -3046,14 +3046,14 @@
/obj/effect/decal/remains/human,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gV" = (
/obj/effect/decal/cleanable/blood/old,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gW" = (
@@ -3372,7 +3372,7 @@
/obj/structure/destructible/cult/pylon,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"hG" = (
@@ -3637,7 +3637,7 @@
/obj/effect/spawner/lootdrop/snowdin/dungeonmid,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"im" = (
@@ -3647,7 +3647,7 @@
},
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"in" = (
@@ -3657,7 +3657,7 @@
},
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"io" = (
@@ -4458,7 +4458,7 @@
},
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"jP" = (
@@ -5553,7 +5553,7 @@
/obj/effect/spawner/lootdrop/snowdin/dungeonlite,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"lU" = (
@@ -7439,7 +7439,7 @@
/obj/structure/flora/rock/pile/icy,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"qh" = (
@@ -13071,7 +13071,7 @@
/turf/open/floor/mineral/plastitanium{
initial_gas_mix = "o2=22;n2=82;TEMP=180";
planetary_atmos = 1;
- temperature = 180
+ initial_temperature = 180
},
/area/awaymission/snowdin/cave)
"EF" = (
@@ -13083,7 +13083,7 @@
/turf/open/floor/mineral/plastitanium{
initial_gas_mix = "o2=22;n2=82;TEMP=180";
planetary_atmos = 1;
- temperature = 180
+ initial_temperature = 180
},
/area/awaymission/snowdin/cave)
"EG" = (
@@ -13097,7 +13097,7 @@
/turf/open/floor/mineral/plastitanium{
initial_gas_mix = "o2=22;n2=82;TEMP=180";
planetary_atmos = 1;
- temperature = 180
+ initial_temperature = 180
},
/area/awaymission/snowdin/cave)
"EH" = (
diff --git a/_maps/RandomZLevels/moonoutpost19.dmm b/_maps/RandomZLevels/moonoutpost19.dmm
index 8971737f2c1e..d2a935c6128d 100644
--- a/_maps/RandomZLevels/moonoutpost19.dmm
+++ b/_maps/RandomZLevels/moonoutpost19.dmm
@@ -954,7 +954,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"bY" = (
@@ -981,7 +981,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"ca" = (
@@ -989,7 +989,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cb" = (
@@ -1002,7 +1002,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cc" = (
@@ -1016,7 +1016,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cd" = (
@@ -1030,7 +1030,7 @@
heat_capacity = 1e+006;
icon_state = "floorscorched2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"ce" = (
@@ -1044,7 +1044,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cf" = (
@@ -1058,7 +1058,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cg" = (
@@ -1071,7 +1071,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"ch" = (
@@ -1086,7 +1086,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"ci" = (
@@ -1164,7 +1164,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cp" = (
@@ -1181,7 +1181,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cr" = (
@@ -1211,7 +1211,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"ct" = (
@@ -1234,7 +1234,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cv" = (
@@ -1248,7 +1248,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cw" = (
@@ -1324,7 +1324,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cD" = (
@@ -1341,7 +1341,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cF" = (
@@ -1353,7 +1353,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cG" = (
@@ -1378,7 +1378,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cI" = (
@@ -1390,7 +1390,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cJ" = (
@@ -1401,7 +1401,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cK" = (
@@ -1422,7 +1422,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cL" = (
@@ -1437,7 +1437,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cM" = (
@@ -1498,7 +1498,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cR" = (
@@ -1507,7 +1507,7 @@
heat_capacity = 1e+006;
icon_state = "damaged4";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cS" = (
@@ -1527,7 +1527,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cT" = (
@@ -1563,7 +1563,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cW" = (
@@ -1572,7 +1572,7 @@
heat_capacity = 1e+006;
icon_state = "damaged2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cX" = (
@@ -1581,7 +1581,7 @@
heat_capacity = 1e+006;
icon_state = "damaged3";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cY" = (
@@ -1598,7 +1598,7 @@
dir = 1;
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"cZ" = (
@@ -1664,7 +1664,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"df" = (
@@ -1686,7 +1686,7 @@
dir = 1;
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dh" = (
@@ -1738,7 +1738,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dm" = (
@@ -1749,7 +1749,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dn" = (
@@ -1759,7 +1759,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"do" = (
@@ -1768,7 +1768,7 @@
heat_capacity = 1e+006;
icon_state = "damaged1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dp" = (
@@ -1782,7 +1782,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg3";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dq" = (
@@ -1870,7 +1870,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dx" = (
@@ -1892,7 +1892,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dz" = (
@@ -1921,7 +1921,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dC" = (
@@ -1929,7 +1929,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dD" = (
@@ -1941,7 +1941,7 @@
/turf/open/floor/plating{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dE" = (
@@ -2005,7 +2005,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dJ" = (
@@ -2031,7 +2031,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/syndicate)
"dM" = (
@@ -2040,7 +2040,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/main)
"dN" = (
@@ -4936,7 +4936,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"jB" = (
@@ -5188,7 +5188,7 @@
heat_capacity = 1e+006;
icon_state = "floorscorched2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kd" = (
@@ -5200,7 +5200,7 @@
heat_capacity = 1e+006;
icon_state = "damaged1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"ke" = (
@@ -5212,7 +5212,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kf" = (
@@ -5226,7 +5226,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kg" = (
@@ -5238,7 +5238,7 @@
heat_capacity = 1e+006;
icon_state = "floorscorched1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kh" = (
@@ -5249,7 +5249,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"ki" = (
@@ -5261,7 +5261,7 @@
heat_capacity = 1e+006;
icon_state = "damaged3";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kj" = (
@@ -5448,7 +5448,7 @@
heat_capacity = 1e+006;
icon_state = "damaged2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kC" = (
@@ -5467,7 +5467,7 @@
heat_capacity = 1e+006;
icon_state = "damaged4";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kE" = (
@@ -5475,7 +5475,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kF" = (
@@ -5484,7 +5484,7 @@
heat_capacity = 1e+006;
icon_state = "damaged5";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kG" = (
@@ -5493,7 +5493,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kH" = (
@@ -5591,7 +5591,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg3";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"kR" = (
@@ -5779,7 +5779,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"ll" = (
@@ -5791,7 +5791,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"lm" = (
@@ -5901,7 +5901,7 @@
"lv" = (
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"lw" = (
@@ -5912,7 +5912,7 @@
},
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"lx" = (
@@ -5924,7 +5924,7 @@
/obj/item/clothing/under/waiter,
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"lA" = (
@@ -5940,7 +5940,7 @@
},
/turf/open/floor/plating{
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"lE" = (
@@ -5983,7 +5983,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"lJ" = (
@@ -5993,7 +5993,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"lK" = (
@@ -6067,7 +6067,7 @@
/obj/item/gun/ballistic/shotgun/sc_pump,
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"lW" = (
@@ -6141,7 +6141,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"mi" = (
@@ -6192,7 +6192,7 @@
/obj/effect/decal/cleanable/dirt,
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"mn" = (
@@ -6207,7 +6207,7 @@
/obj/item/reagent_containers/food/snacks/meat/slab/monkey,
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"mo" = (
@@ -6222,7 +6222,7 @@
/obj/item/storage/box/fancy/egg_box,
/turf/open/floor/plasteel/showroomfloor{
heat_capacity = 1e+006;
- temperature = 273.15
+ initial_temperature = 273.15
},
/area/awaymission/moonoutpost19/arrivals)
"mp" = (
@@ -6289,7 +6289,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"my" = (
@@ -6457,7 +6457,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"mQ" = (
@@ -6471,7 +6471,7 @@
heat_capacity = 1e+006;
icon_state = "floorscorched2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"mR" = (
@@ -6548,7 +6548,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"na" = (
@@ -6601,7 +6601,7 @@
heat_capacity = 1e+006;
icon_state = "floorscorched2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nj" = (
@@ -6614,7 +6614,7 @@
heat_capacity = 1e+006;
icon_state = "damaged2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nk" = (
@@ -6673,7 +6673,7 @@
heat_capacity = 1e+006;
icon_state = "damaged1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nr" = (
@@ -6704,7 +6704,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nw" = (
@@ -6718,7 +6718,7 @@
/turf/open/floor/plasteel/cafeteria{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nx" = (
@@ -6742,7 +6742,7 @@
/turf/open/floor/plasteel/cafeteria{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"ny" = (
@@ -6757,7 +6757,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nz" = (
@@ -6810,7 +6810,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nE" = (
@@ -6823,7 +6823,7 @@
heat_capacity = 1e+006;
icon_state = "platingdmg3";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nF" = (
@@ -6836,7 +6836,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nG" = (
@@ -6849,7 +6849,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nH" = (
@@ -6911,7 +6911,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nN" = (
@@ -6922,7 +6922,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nO" = (
@@ -6966,7 +6966,7 @@
heat_capacity = 1e+006;
icon_state = "damaged1";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nT" = (
@@ -7003,7 +7003,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nX" = (
@@ -7015,7 +7015,7 @@
heat_capacity = 1e+006;
icon_state = "floorscorched2";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nY" = (
@@ -7029,7 +7029,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"nZ" = (
@@ -7039,7 +7039,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/main)
"oa" = (
@@ -7061,7 +7061,7 @@
/turf/open/floor/plasteel{
heat_capacity = 1e+006;
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/arrivals)
"oc" = (
@@ -7074,7 +7074,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=48.7;n2=13.2;o2=32.4;TEMP=251";
- temperature = 251
+ initial_temperature = 251
},
/area/awaymission/moonoutpost19/main)
"od" = (
diff --git a/_maps/RandomZLevels/snowdin.dmm b/_maps/RandomZLevels/snowdin.dmm
index 89f7750cd8e1..96531e28da76 100644
--- a/_maps/RandomZLevels/snowdin.dmm
+++ b/_maps/RandomZLevels/snowdin.dmm
@@ -2688,14 +2688,14 @@
"gc" = (
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gd" = (
/obj/effect/spawner/lootdrop/crate_spawner,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"ge" = (
@@ -2706,7 +2706,7 @@
/obj/effect/spawner/lootdrop/snowdin/dungeonheavy,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gg" = (
@@ -3077,14 +3077,14 @@
/obj/effect/decal/remains/human,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gV" = (
/obj/effect/decal/cleanable/blood/old,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"gW" = (
@@ -3391,7 +3391,7 @@
/obj/structure/destructible/cult/pylon,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"hG" = (
@@ -3652,7 +3652,7 @@
/obj/effect/spawner/lootdrop/snowdin/dungeonmid,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"im" = (
@@ -3662,7 +3662,7 @@
},
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"in" = (
@@ -3672,7 +3672,7 @@
},
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"io" = (
@@ -4489,7 +4489,7 @@
},
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"jP" = (
@@ -5615,7 +5615,7 @@
/obj/effect/spawner/lootdrop/snowdin/dungeonlite,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"lU" = (
@@ -7509,7 +7509,7 @@
/obj/structure/flora/rock/pile/icy,
/turf/open/floor/engine/cult{
initial_gas_mix = "o2=0;n2=82;plasma=24;TEMP=120";
- temperature = 120
+ initial_temperature = 120
},
/area/awaymission/snowdin/cave/cavern)
"qh" = (
@@ -13210,7 +13210,7 @@
/turf/open/floor/mineral/plastitanium{
initial_gas_mix = "o2=22;n2=82;TEMP=180";
planetary_atmos = 1;
- temperature = 180
+ initial_temperature = 180
},
/area/awaymission/snowdin/cave)
"EF" = (
@@ -13222,7 +13222,7 @@
/turf/open/floor/mineral/plastitanium{
initial_gas_mix = "o2=22;n2=82;TEMP=180";
planetary_atmos = 1;
- temperature = 180
+ initial_temperature = 180
},
/area/awaymission/snowdin/cave)
"EG" = (
@@ -13236,7 +13236,7 @@
/turf/open/floor/mineral/plastitanium{
initial_gas_mix = "o2=22;n2=82;TEMP=180";
planetary_atmos = 1;
- temperature = 180
+ initial_temperature = 180
},
/area/awaymission/snowdin/cave)
"EH" = (
diff --git a/_maps/RandomZLevels/undergroundoutpost45.dmm b/_maps/RandomZLevels/undergroundoutpost45.dmm
index c887b018a1c6..b6c9c65e01ea 100644
--- a/_maps/RandomZLevels/undergroundoutpost45.dmm
+++ b/_maps/RandomZLevels/undergroundoutpost45.dmm
@@ -807,7 +807,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 351.9
+ initial_temperature = 351.9
},
/area/awaymission/undergroundoutpost45/caves)
"bX" = (
@@ -815,7 +815,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 351.9
+ initial_temperature = 351.9
},
/area/awaymission/undergroundoutpost45/caves)
"bY" = (
@@ -2112,7 +2112,7 @@
icon_plating = "asteroidplating";
icon_state = "asteroidplating";
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"ev" = (
@@ -2247,7 +2247,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"eK" = (
@@ -2625,7 +2625,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/central)
"fo" = (
@@ -2861,7 +2861,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/central)
"fK" = (
@@ -3042,7 +3042,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"gg" = (
@@ -3190,7 +3190,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/crew_quarters)
"gC" = (
@@ -3462,7 +3462,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/research)
"he" = (
@@ -3473,7 +3473,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/crew_quarters)
"hf" = (
@@ -3505,7 +3505,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/crew_quarters)
"hi" = (
@@ -4904,7 +4904,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/gateway)
"jM" = (
@@ -4938,7 +4938,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/research)
"jR" = (
@@ -6754,7 +6754,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/gateway)
"mJ" = (
@@ -8519,7 +8519,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"pv" = (
@@ -8530,7 +8530,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"pw" = (
@@ -8542,7 +8542,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/engineering)
"px" = (
@@ -8835,7 +8835,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"qb" = (
@@ -9069,7 +9069,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"qA" = (
@@ -9080,7 +9080,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"qB" = (
@@ -9091,7 +9091,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"qC" = (
@@ -11292,7 +11292,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/crew_quarters)
"uc" = (
@@ -11946,7 +11946,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"vm" = (
@@ -12172,7 +12172,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/research)
"vI" = (
@@ -12469,7 +12469,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/mining)
"wk" = (
@@ -13692,7 +13692,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/mining)
"yh" = (
@@ -13701,7 +13701,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yi" = (
@@ -13710,7 +13710,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yj" = (
@@ -13721,7 +13721,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yk" = (
@@ -13731,7 +13731,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yl" = (
@@ -13742,7 +13742,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"ym" = (
@@ -13752,7 +13752,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yn" = (
@@ -13761,7 +13761,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yo" = (
@@ -13771,7 +13771,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yp" = (
@@ -13781,7 +13781,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yq" = (
@@ -13790,7 +13790,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yr" = (
@@ -13799,7 +13799,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yt" = (
@@ -13809,7 +13809,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yu" = (
@@ -13819,7 +13819,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yw" = (
@@ -13829,7 +13829,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yz" = (
@@ -13838,7 +13838,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yA" = (
@@ -13848,7 +13848,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yB" = (
@@ -13857,7 +13857,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yC" = (
@@ -13867,7 +13867,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yD" = (
@@ -13878,7 +13878,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"yH" = (
@@ -13889,7 +13889,7 @@
heat_capacity = 1e+006;
initial_gas_mix = "co2=173.4;n2=135.1;plasma=229.8;TEMP=351.9";
name = "Cave Floor";
- temperature = 363.9
+ initial_temperature = 363.9
},
/area/awaymission/undergroundoutpost45/caves)
"zi" = (
diff --git a/_maps/map_files/YogsDelta/YogsDelta.dmm b/_maps/map_files/YogsDelta/YogsDelta.dmm
index c71c3cfc3800..407e55b58f57 100644
--- a/_maps/map_files/YogsDelta/YogsDelta.dmm
+++ b/_maps/map_files/YogsDelta/YogsDelta.dmm
@@ -31975,7 +31975,7 @@
/turf/open/floor/plating{
initial_gas_mix = "o2=0.01;n2=0.01";
luminosity = 2;
- temperature = 2.7
+ initial_temperature = 2.7
},
/area/security/prison)
"aZN" = (
@@ -34050,7 +34050,7 @@
/turf/open/floor/plating{
initial_gas_mix = "o2=0.01;n2=0.01";
luminosity = 2;
- temperature = 2.7
+ initial_temperature = 2.7
},
/area/security/prison)
"bcX" = (
diff --git a/auxmos.dll b/auxmos.dll
new file mode 100644
index 000000000000..83f85fb76103
Binary files /dev/null and b/auxmos.dll differ
diff --git a/auxmos.pdb b/auxmos.pdb
new file mode 100644
index 000000000000..f74a518c6dba
Binary files /dev/null and b/auxmos.pdb differ
diff --git a/byond-extools.dll b/byond-extools.dll
deleted file mode 100644
index 821dad2a080d..000000000000
Binary files a/byond-extools.dll and /dev/null differ
diff --git a/byond-extools.pdb b/byond-extools.pdb
deleted file mode 100644
index 0bed2a153180..000000000000
Binary files a/byond-extools.pdb and /dev/null differ
diff --git a/code/__DEFINES/MC.dm b/code/__DEFINES/MC.dm
index 161bb21d038a..7e5a034b9511 100644
--- a/code/__DEFINES/MC.dm
+++ b/code/__DEFINES/MC.dm
@@ -9,6 +9,8 @@
Master.current_ticklimit = original_tick_limit;\
}
+#define MC_TICK_REMAINING_MS ((Master.current_ticklimit - TICK_USAGE) * world.tick_lag)
+
// Used to smooth out costs to try and avoid oscillation.
#define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current))
#define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current))
diff --git a/code/__DEFINES/_auxtools.dm b/code/__DEFINES/_auxtools.dm
new file mode 100644
index 000000000000..23926f285010
--- /dev/null
+++ b/code/__DEFINES/_auxtools.dm
@@ -0,0 +1,12 @@
+#define AUXMOS (world.system_type == MS_WINDOWS ? "auxmos.dll" : __detect_auxmos())
+
+/proc/__detect_auxmos()
+ if (fexists("./libauxmos.so"))
+ return "./libauxmos.so"
+ else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/libauxmos.so"))
+ return "[world.GetConfig("env", "HOME")]/.byond/bin/libauxmos.so"
+ else
+ CRASH("Could not find libauxmos.so")
+
+/proc/enable_debugging()
+ CRASH("Auxtools not found")
diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm
index 812ff5d9503d..660766fc742f 100644
--- a/code/__DEFINES/atmospherics.dm
+++ b/code/__DEFINES/atmospherics.dm
@@ -1,15 +1,3 @@
-//LISTMOS
-//indices of values in gas lists.
-#define MOLES 1
-#define ARCHIVE 2
-#define GAS_META 3
-#define META_GAS_SPECIFIC_HEAT 1
-#define META_GAS_NAME 2
-#define META_GAS_MOLES_VISIBLE 3
-#define META_GAS_OVERLAY 4
-#define META_GAS_DANGER 5
-#define META_GAS_ID 6
-#define META_GAS_FUSION_POWER 7
//ATMOS
//stuff you should probably leave well alone!
/// kPa*L/(K*mol)
@@ -438,6 +426,32 @@
/// north/south east/west doesn't matter, auto normalize on build.
#define PIPING_CARDINAL_AUTONORMALIZE (1<<3)
+// Gas defines because i hate typepaths
+#define GAS_O2 "o2"
+#define GAS_N2 "n2"
+#define GAS_CO2 "co2"
+#define GAS_PLASMA "plasma"
+#define GAS_H2O "water_vapor"
+#define GAS_HYPERNOB "nob"
+#define GAS_NITROUS "n2o"
+#define GAS_NITRYL "no2"
+#define GAS_TRITIUM "tritium"
+#define GAS_BZ "bz"
+#define GAS_STIMULUM "stim"
+#define GAS_PLUOXIUM "pluox"
+#define GAS_MIASMA "miasma"
+#define GAS_H2 "hydrogen"
+#define GAS_FREON "freon"
+#define GAS_HEALIUM "healium"
+#define GAS_PLUONIUM "pluonium"
+#define GAS_HALON "halon"
+#define GAS_ZAUKER "zauker"
+#define GAS_HEXANE "hexane"
+#define GAS_DILITHIUM "dilithium"
+
+#define GAS_FLAG_DANGEROUS (1<<0)
+#define GAS_FLAG_BREATH_PROC (1<<1)
+
//HELPERS
#define PIPING_LAYER_SHIFT(T, PipingLayer) \
if(T.dir & (NORTH|SOUTH)) { \
@@ -459,24 +473,6 @@
T.pixel_x = (PipingLayer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_X;\
T.pixel_y = (PipingLayer - PIPING_LAYER_DEFAULT) * PIPING_LAYER_P_Y;
-#ifdef TESTING
-GLOBAL_LIST_INIT(atmos_adjacent_savings, list(0,0))
-#define CALCULATE_ADJACENT_TURFS(T) if (SSadjacent_air.queue[T]) { GLOB.atmos_adjacent_savings[1] += 1 } else { GLOB.atmos_adjacent_savings[2] += 1; SSadjacent_air.queue[T] = 1 }
-#else
-#define CALCULATE_ADJACENT_TURFS(T) SSadjacent_air.queue[T] = 1
-#endif
-
-GLOBAL_VAR(atmos_extools_initialized) // this must be an uninitialized (null) one or init_monstermos will be called twice because reasons
-#define ATMOS_EXTOOLS_CHECK if(!GLOB.atmos_extools_initialized){\
- GLOB.atmos_extools_initialized=TRUE;\
- if(fexists(EXTOOLS)){\
- var/result = call(EXTOOLS,"init_monstermos")();\
- if(result != "ok") {CRASH(result);}\
- } else {\
- CRASH("byond-extools.dll does not exist!");\
- }\
-}
-
GLOBAL_LIST_INIT(pipe_paint_colors, list(
"amethyst" = rgb(130,43,255), //supplymain
"blue" = rgb(0,0,255),
@@ -494,3 +490,8 @@ GLOBAL_LIST_INIT(pipe_paint_colors, list(
#define MIASMA_CORPSE_MOLES 0.02
#define MIASMA_GIBS_MOLES 0.005
+
+//PIPENET UPDATE STATUS
+#define PIPENET_UPDATE_STATUS_DORMANT 0
+#define PIPENET_UPDATE_STATUS_REACT_NEEDED 1
+#define PIPENET_UPDATE_STATUS_RECONCILE_NEEDED 2
diff --git a/code/__DEFINES/extools.dm b/code/__DEFINES/extools.dm
deleted file mode 100644
index cb2bd56ee8d9..000000000000
--- a/code/__DEFINES/extools.dm
+++ /dev/null
@@ -1,143 +0,0 @@
-#define EXTOOLS_SUCCESS "SUCCESS"
-#define EXTOOLS_FAILED "FAIL"
-
-/*
- Core - Provides necessary functionality for other modules.
- Initializing any other modules also initializes this so it shouldn't be necessary to call this.
-*/
-
-/proc/extools_initialize()
- return call(EXTOOLS, "core_initialize")() == EXTOOLS_SUCCESS
-
-/*
- TFFI - Threaded FFI
- All DLL calls are automatically threaded off.
- Black magic is used to suspend (sleep) the currently executing proc, allowing non-blocking FFI.
- You may call a DLL function and sleep until it returns, pass a callback to be called with the result,
- or call resolve() on the /datum/promise to receive the return value at any time.
- Example:
- var/x = call_wait("sample.dll", "do_work", "arg1", "arg2", "arg3")
- - Calls the do_work function from sample.dll with 3 arguments. The proc sleeps until do_work returns.
- var/datum/promise/P = call_async("sample.dll", "do_work", "arg1")
- ... do something else ...
- var/result = P.resolve()
- - Calls do_work with 1 argument. Returns a promise object. Runs some other code before calling P.resolve() to obtain the result.
- /proc/print_result(result)
- world << result
- call_cb("sample.dll", "do_work", /proc/print_result, "arg1", "arg2")
- - Calls do_work with 2 arguments. The callback is invoked with the result as the single argument. Execution resumes immediately.
-*/
-
-#if 0
-
-/proc/tffi_initialize()
- return call(EXTOOLS, "tffi_initialize")() == EXTOOLS_SUCCESS
-
-GLOBAL_VAR_INIT(fallback_alerted, FALSE)
-GLOBAL_VAR_INIT(next_promise_id, 0)
-
-/datum/promise
- var/completed = FALSE
- var/result = ""
- var/callback_context = GLOBAL_PROC
- var/callback_proc = null
- var/__id = 0
-
-/datum/promise/New()
- __id = next_promise_id++ //please don't create more than 10^38 promises in a single tick
-
-//This proc's bytecode is overwritten to allow suspending and resuming on demand.
-//None of the code here should run.
-/datum/promise/proc/__internal_resolve(ref, id)
- if(!fallback_alerted && world.system_type != UNIX) // the rewriting is currently broken on Linux.
- world << "TFFI: __internal_resolve has not been rewritten, the TFFI DLL was not loaded correctly."
- world.log << "TFFI: __internal_resolve has not been rewritten, the TFFI DLL was not loaded correctly."
- fallback_alerted = TRUE
- while(!completed)
- sleep(1)
- //It might be better to just fail and notify the user that something went wrong.
-
-/datum/promise/proc/__resolve_callback()
- __internal_resolve("\ref[src]", __id)
- if(callback_context == GLOBAL_PROC)
- call(callback_proc)(result)
- else
- call(callback_context, callback_proc)(result)
-
-/datum/promise/proc/resolve()
- __internal_resolve("\ref[src]", __id)
- return result
-
-/proc/call_async()
- var/list/arguments = args.Copy()
- var/datum/promise/P = new
- arguments.Insert(1, "\ref[P]")
- call(EXTOOLS, "call_async")(arglist(arguments))
- return P
-
-/proc/call_cb()
- var/list/arguments = args.Copy()
- var/context = arguments[3]
- var/callback = arguments[4]
- arguments.Cut(3, 5)
- var/datum/promise/P = new
- P.callback_context = context
- P.callback_proc = callback
- arguments.Insert(1, "\ref[P]")
- call(EXTOOLS, "call_async")(arglist(arguments))
- spawn(0)
- P.__resolve_callback()
-
-/proc/call_wait()
- return call_async(arglist(args)).resolve()
-
-#endif
-
-/*
- Extended Profiling - High precision in-depth performance profiling.
- Turning on extended profiling for a proc will cause each execution of it to generate a file in the ./profiles directory
- containing a breakdown of time spent executing the proc and each sub-proc it calls. Import the file into https://www.speedscope.app/ to
- view a good visual representation.
- Be aware that sleeping counts as stopping and restarting the execution of the proc, which will generate multiple files, one between each sleep.
- For large procs the profiles may become unusably large. Optimizations pending.
- Example:
- start_profiling(/datum/explosion/New)
- - Enables profiling for /datum/explosion/New(), which will produce a detailed breakdown of each explosion that occurs afterwards.
- stop_profiling(/datum/explosion/New)
- - Disables profiling for explosions. Any currently running profiles will stop when the proc finishes executing or enters a sleep.
-*/
-
-/proc/profiling_initialize()
- return call(EXTOOLS, "extended_profiling_initialize")() == EXTOOLS_SUCCESS
-
-/proc/start_profiling(procpath)
- call(EXTOOLS, "enable_extended_profiling")("[procpath]")
-
-/proc/stop_profiling(procpath)
- call(EXTOOLS, "disable_extended_profiling")("[procpath]")
-
-/*
- Debug Server - High and low level debugging of DM code.
- Calling debugger_initialize will start a debug server that allows connections from frontends,
- such as SpaceManiac's VSCode extension for line-by-line debugging (and more), or Steamport's
- Somnium for bytecode inspection.
- Call with pause = TRUE to wait until the debugger connected and immediately break on the next instruction after the call.
-*/
-
-/proc/debugger_initialize(pause = FALSE)
- return call(EXTOOLS, "debug_initialize")(pause ? "pause" : "") == EXTOOLS_SUCCESS
-
-/*
- Misc
-*/
-
-//Programatically enable and disable the built-in byond profiler. Useful if you want to, for example, profile subsystem initializations.
-/proc/enable_profiling()
- return call(EXTOOLS, "enable_profiling")() == EXTOOLS_SUCCESS
-
-/proc/disable_profiling()
- return call(EXTOOLS, "disable_profiling")() == EXTOOLS_SUCCESS
-
-// Will dump the server's in-depth memory profile into the file specified.
-/proc/dump_memory_profile(file_name)
- return call(EXTOOLS, "dump_memory_usage")(file_name) == EXTOOLS_SUCCESS
diff --git a/code/__DEFINES/maths.dm b/code/__DEFINES/maths.dm
index ff280936a047..434cb738b976 100644
--- a/code/__DEFINES/maths.dm
+++ b/code/__DEFINES/maths.dm
@@ -207,3 +207,20 @@
#define RULE_OF_THREE(a, b, x) ((a*x)/b)
// )
+
+/// Taxicab distance--gets you the **actual** time it takes to get from one turf to another due to how we calculate diagonal movement
+#define MANHATTAN_DISTANCE(a, b) (abs(a.x - b.x) + abs(a.y - b.y))
+// )
+
+/// A function that exponentially approaches a maximum value of L
+/// k is the rate at which is approaches L, x_0 is the point where the function = 0
+#define LOGISTIC_FUNCTION(L,k,x,x_0) (L/(1+(NUM_E**(-k*(x-x_0)))))
+
+// )
+/// Make sure something is a boolean TRUE/FALSE 1/0 value, since things like bitfield & bitflag doesn't always give 1s and 0s.
+#define FORCE_BOOLEAN(x) ((x)? TRUE : FALSE)
+
+// )
+/// Gives the number of pixels in an orthogonal line of tiles.
+#define TILES_TO_PIXELS(tiles) (tiles * PIXELS)
+// )
diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm
index 87b661bad3e1..6b68b5783364 100644
--- a/code/__DEFINES/subsystems.dm
+++ b/code/__DEFINES/subsystems.dm
@@ -165,6 +165,7 @@
#define FIRE_PRIORITY_DEFAULT 50
#define FIRE_PRIORITY_PARALLAX 65
#define FIRE_PRIORITY_INSTRUMENTS 80
+#define FIRE_PRIORITY_CALLBACKS 90
#define FIRE_PRIORITY_EXPLOSIONS 96
#define FIRE_PRIORITY_MOBS 100
#define FIRE_PRIORITY_TGUI 110
@@ -185,6 +186,20 @@
#define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME)
+// SSair run section
+#define SSAIR_PIPENETS 1
+#define SSAIR_ATMOSMACHINERY 2
+#define SSAIR_EXCITEDGROUPS 3
+#define SSAIR_HIGHPRESSURE 4
+#define SSAIR_HOTSPOTS 5
+#define SSAIR_TURF_CONDUCTION 6
+#define SSAIR_REBUILD_PIPENETS 7
+#define SSAIR_EQUALIZE 8
+#define SSAIR_ACTIVETURFS 9
+#define SSAIR_TURF_POST_PROCESS 10
+#define SSAIR_FINALIZE_TURFS 11
+#define SSAIR_ATMOSMACHINERY_AIR 12
+#define SSAIR_DEFERRED_AIRS 13
// Truly disgusting, TG. Truly disgusting.
//! ## Overlays subsystem
@@ -218,18 +233,6 @@
} while (FALSE)
-// Air subsystem subtasks
-#define SSAIR_PIPENETS 1
-#define SSAIR_ATMOSMACHINERY 2
-#define SSAIR_EQUALIZE 3
-#define SSAIR_ACTIVETURFS 4
-#define SSAIR_EXCITEDGROUPS 5
-#define SSAIR_HIGHPRESSURE 6
-#define SSAIR_HOTSPOTS 7
-#define SSAIR_SUPERCONDUCTIVITY 8
-#define SSAIR_REBUILD_PIPENETS 9
-
-
// Explosion Subsystem subtasks
#define SSEXPLOSIONS_MOVABLES 1
#define SSEXPLOSIONS_TURFS 2
diff --git a/code/__HELPERS/_extools_api.dm b/code/__HELPERS/_extools_api.dm
new file mode 100644
index 000000000000..64acc03f9a00
--- /dev/null
+++ b/code/__HELPERS/_extools_api.dm
@@ -0,0 +1,30 @@
+//#define AUXOOLS_LOGGING // rust_g is used as a fallback if this is undefined
+
+/proc/extools_log_write()
+
+/proc/extools_finalize_logging()
+
+/proc/auxtools_stack_trace(msg)
+ CRASH(msg)
+
+GLOBAL_LIST_EMPTY(auxtools_initialized)
+
+#define AUXTOOLS_CHECK(LIB)\
+ if (!GLOB.auxtools_initialized[LIB]) {\
+ if (fexists(LIB)) {\
+ var/string = call(LIB,"auxtools_init")();\
+ if(findtext(string, "SUCCESS")) {\
+ GLOB.auxtools_initialized[LIB] = TRUE;\
+ } else {\
+ CRASH(string);\
+ }\
+ } else {\
+ CRASH("No file named [LIB] found!")\
+ }\
+ }\
+
+#define AUXTOOLS_SHUTDOWN(LIB)\
+ if (GLOB.auxtools_initialized[LIB] && fexists(LIB)){\
+ call(LIB,"auxtools_shutdown")();\
+ GLOB.auxtools_initialized[LIB] = FALSE;\
+ }\
diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm
index 2338c3380280..95cea6d08d99 100644
--- a/code/__HELPERS/_logging.dm
+++ b/code/__HELPERS/_logging.dm
@@ -7,8 +7,13 @@
#define WRITE_FILE(file, text) DIRECT_OUTPUT(file, text)
#define READ_FILE(file, text) DIRECT_INPUT(file, text)
//This is an external call, "true" and "false" are how rust parses out booleans
+#ifdef EXTOOLS_LOGGING
+#define WRITE_LOG(log, text) extools_log_write(log, text, TRUE)
+#define WRITE_LOG_NO_FORMAT(log, text) extools_log_write(log, text, FALSE)
+#else
#define WRITE_LOG(log, text) rustg_log_write(log, text, "true")
#define WRITE_LOG_NO_FORMAT(log, text) rustg_log_write(log, text, "false")
+#endif
//print a warning message to world.log
#define WARNING(MSG) warning("[MSG] in [__FILE__] at line [__LINE__] src: [UNLINT(src)] usr: [usr].")
@@ -236,7 +241,12 @@
/* Close open log handles. This should be called as late as possible, and no logging should hapen after. */
/proc/shutdown_logging()
+#ifdef EXTOOLS_LOGGING
+ extools_finalize_logging()
+#else
rustg_log_close_all()
+#endif
+
/* Helper procs for building detailed log lines */
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 7f43f58ebcf7..4bb7a216c1ca 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -41,6 +41,9 @@
else if(x<0)
.+=360
+//Better performant than an artisanal proc and more reliable than Turn(). From TGMC.
+#define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )
+
//Returns location. Returns null if no location was found.
/proc/get_teleport_loc(turf/location,mob/target,distance = 1, density = FALSE, errorx = 0, errory = 0, eoffsetx = 0, eoffsety = 0)
/*
diff --git a/code/_compile_options.dm b/code/_compile_options.dm
index 1201a0aca9ff..3f30ba22ab2e 100644
--- a/code/_compile_options.dm
+++ b/code/_compile_options.dm
@@ -56,8 +56,6 @@
#define TESTING
#endif
-#define EXTOOLS (world.system_type == MS_WINDOWS ? "byond-extools.dll" : "libbyond-extools.so")
-
//If you update these values, update the message in the #error
#define MAX_BYOND_MAJOR 514
#define MAX_BYOND_MINOR 1569
diff --git a/code/controllers/subsystem/adjacent_air.dm b/code/controllers/subsystem/adjacent_air.dm
deleted file mode 100644
index e93db07775e5..000000000000
--- a/code/controllers/subsystem/adjacent_air.dm
+++ /dev/null
@@ -1,36 +0,0 @@
-SUBSYSTEM_DEF(adjacent_air)
- name = "Atmos Adjacency"
- flags = SS_BACKGROUND
- runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
- wait = 10
- priority = FIRE_PRIORITY_ATMOS_ADJACENCY
- var/list/queue = list()
-
-/datum/controller/subsystem/adjacent_air/stat_entry(msg)
-#ifdef TESTING
- msg = "P:[length(queue)], S:[GLOB.atmos_adjacent_savings[1]], T:[GLOB.atmos_adjacent_savings[2]]"
-#else
- msg = "P:[length(queue)]"
-#endif
- return ..()
-
-/datum/controller/subsystem/adjacent_air/Initialize()
- while(length(queue))
- fire(mc_check = FALSE)
- return ..()
-
-/datum/controller/subsystem/adjacent_air/fire(resumed = FALSE, mc_check = TRUE)
-
- var/list/queue = src.queue
-
- while (length(queue))
- var/turf/currT = queue[1]
- queue.Cut(1,2)
-
- currT.ImmediateCalculateAdjacentTurfs()
-
- if(mc_check)
- if(MC_TICK_CHECK)
- break
- else
- CHECK_TICK
diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm
index af1b5fc55645..0678209ba4e5 100644
--- a/code/controllers/subsystem/air.dm
+++ b/code/controllers/subsystem/air.dm
@@ -2,33 +2,43 @@ SUBSYSTEM_DEF(air)
name = "Atmospherics"
init_order = INIT_ORDER_AIR
priority = FIRE_PRIORITY_AIR
- wait = 5
+ wait = 0.5 SECONDS
flags = SS_BACKGROUND
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
- var/cached_cost = 0
var/cost_turfs = 0
var/cost_groups = 0
var/cost_highpressure = 0
+ var/cost_deferred_airs
var/cost_hotspots = 0
+ var/cost_post_process = 0
var/cost_superconductivity = 0
var/cost_pipenets = 0
var/cost_rebuilds = 0
var/cost_atmos_machinery = 0
var/cost_equalize = 0
+ var/thread_wait_ticks = 0
+ var/cur_thread_wait_ticks = 0
+
+ var/low_pressure_turfs = 0
+ var/high_pressure_turfs = 0
+
+ var/num_group_turfs_processed = 0
+ var/num_equalize_processed = 0
- var/list/active_turfs = list()
var/list/hotspots = list()
var/list/networks = list()
var/list/pipenets_needing_rebuilt = list()
+ var/list/deferred_airs = list()
+ var/max_deferred_airs = 0
var/list/obj/machinery/atmos_machinery = list()
+ var/list/obj/machinery/atmos_air_machinery = list()
var/list/pipe_init_dirs_cache = list()
//atmos singletons
var/list/gas_reactions = list()
//Special functions lists
- var/list/turf/active_super_conductivity = list()
var/list/turf/open/high_pressure_delta = list()
@@ -36,49 +46,96 @@ SUBSYSTEM_DEF(air)
var/currentpart = SSAIR_REBUILD_PIPENETS
var/map_loading = TRUE
- var/list/queued_for_activation
var/log_explosive_decompression = TRUE // If things get spammy, admemes can turn this off.
+ // Max number of turfs equalization will grab.
+ var/equalize_turf_limit = 10
+ // Max number of turfs to look for a space turf, and max number of turfs that will be decompressed.
+ var/equalize_hard_turf_limit = 2000
+ // Whether equalization should be enabled at all.
+ var/equalize_enabled = TRUE
+ // Whether turf-to-turf heat exchanging should be enabled.
+ var/heat_enabled = FALSE
+ // Max number of times process_turfs will share in a tick.
+ var/share_max_steps = 3
+ // Excited group processing will try to equalize groups with total pressure difference less than this amount.
+ var/excited_group_pressure_goal = 1
+
+ var/list/paused_z_levels //Paused z-levels will not add turfs to active
+
/datum/controller/subsystem/air/stat_entry(msg)
msg += "C:{"
- msg += "EQ:[round(cost_equalize,1)]|"
- msg += "AT:[round(cost_turfs,1)]|"
- msg += "EG:[round(cost_groups,1)]|"
msg += "HP:[round(cost_highpressure,1)]|"
msg += "HS:[round(cost_hotspots,1)]|"
+ msg += "HE:[round(heat_process_time(),1)]|"
msg += "SC:[round(cost_superconductivity,1)]|"
msg += "PN:[round(cost_pipenets,1)]|"
- msg += "RB:[round(cost_rebuilds,1)]|"
msg += "AM:[round(cost_atmos_machinery,1)]"
msg += "} "
- msg += "AT:[active_turfs.len]|"
- msg += "EG:[get_amt_excited_groups()]|"
+ msg += "TC:{"
+ msg += "AT:[round(cost_turfs,1)]|"
+ msg += "EG:[round(cost_groups,1)]|"
+ msg += "EQ:[round(cost_equalize,1)]|"
+ msg += "PO:[round(cost_post_process,1)]"
+ msg += "}"
+ msg += "TH:[round(thread_wait_ticks,1)]|"
msg += "HS:[hotspots.len]|"
msg += "PN:[networks.len]|"
msg += "HP:[high_pressure_delta.len]|"
- msg += "AS:[active_super_conductivity.len]|"
- msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]"
+ msg += "HT:[high_pressure_turfs]|"
+ msg += "LT:[low_pressure_turfs]|"
+ msg += "ET:[num_equalize_processed]|"
+ msg += "GT:[num_group_turfs_processed]|"
+ msg += "DF:[max_deferred_airs]|"
+ msg += "GA:[get_amt_gas_mixes()]|"
+ msg += "MG:[get_max_gas_mixes()]"
return ..()
-
/datum/controller/subsystem/air/Initialize(timeofday)
- extools_update_ssair()
map_loading = FALSE
setup_allturfs()
setup_atmos_machinery()
setup_pipenets()
gas_reactions = init_gas_reactions()
+ auxtools_update_reactions()
return ..()
/datum/controller/subsystem/air/proc/extools_update_ssair()
+/datum/controller/subsystem/air/proc/auxtools_update_reactions()
+
+/proc/reset_all_air()
+ SSair.can_fire = 0
+ message_admins("Air reset begun.")
+ for(var/turf/open/T in world)
+ T.Initalize_Atmos(0)
+ CHECK_TICK
+ message_admins("Air reset done.")
+ SSair.can_fire = 1
+
+/datum/controller/subsystem/air/proc/thread_running()
+ return FALSE
+
+/proc/fix_corrupted_atmos()
+
+/client/proc/fixcorruption()
+ set category = "Debug"
+ set desc="Fixes air that has weird NaNs (-1.#IND and such). Hopefully."
+ set name="Fix Infinite Air"
+ fix_corrupted_atmos()
+
/datum/controller/subsystem/air/fire(resumed = 0)
+
var/timer = TICK_USAGE_REAL
+
if(currentpart == SSAIR_REBUILD_PIPENETS)
+ timer = TICK_USAGE_REAL
var/list/pipenet_rebuilds = pipenets_needing_rebuilt
for(var/thing in pipenet_rebuilds)
var/obj/machinery/atmospherics/AT = thing
+ if(!istype(AT))
+ continue
AT.build_network()
cost_rebuilds = MC_AVERAGE(cost_rebuilds, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
pipenets_needing_rebuilt.Cut()
@@ -86,99 +143,122 @@ SUBSYSTEM_DEF(air)
return
resumed = FALSE
currentpart = SSAIR_PIPENETS
+
if(currentpart == SSAIR_PIPENETS || !resumed)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
process_pipenets(resumed)
- cached_cost += TICK_USAGE_REAL - timer
+ cost_pipenets = MC_AVERAGE(cost_pipenets, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_pipenets = MC_AVERAGE(cost_pipenets, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
+ resumed = 0
currentpart = SSAIR_ATMOSMACHINERY
-
+ // This is only machinery like filters, mixers that don't interact with air
if(currentpart == SSAIR_ATMOSMACHINERY)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
process_atmos_machinery(resumed)
- cached_cost += TICK_USAGE_REAL - timer
+ cost_atmos_machinery = MC_AVERAGE(cost_atmos_machinery, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_atmos_machinery = MC_AVERAGE(cost_atmos_machinery, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
- currentpart = SSAIR_EQUALIZE
+ resumed = 0
+ currentpart = SSAIR_HIGHPRESSURE
- if(currentpart == SSAIR_EQUALIZE)
+ if(currentpart == SSAIR_HIGHPRESSURE)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
- process_turf_equalize(resumed)
+ process_high_pressure_delta(resumed)
+ cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_equalize = MC_AVERAGE(cost_equalize, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
- currentpart = SSAIR_ACTIVETURFS
-
- if(currentpart == SSAIR_ACTIVETURFS)
- timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
- process_active_turfs(resumed)
+ resumed = 0
+ currentpart = SSAIR_FINALIZE_TURFS
+ // This literally just waits for the turf processing thread to finish, doesn't do anything else.
+ // this is necessary cause the next step after this interacts with the air--we get consistency
+ // issues if we don't wait for it, disappearing gases etc.
+ if(currentpart == SSAIR_FINALIZE_TURFS)
+ finish_turf_processing(resumed)
if(state != SS_RUNNING)
+ cur_thread_wait_ticks++
return
- cost_turfs = MC_AVERAGE(cost_turfs, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
- currentpart = SSAIR_EXCITEDGROUPS
-
- if(currentpart == SSAIR_EXCITEDGROUPS)
+ resumed = 0
+ thread_wait_ticks = MC_AVERAGE(thread_wait_ticks, cur_thread_wait_ticks)
+ cur_thread_wait_ticks = 0
+ currentpart = SSAIR_DEFERRED_AIRS
+ if(currentpart == SSAIR_DEFERRED_AIRS)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
- process_excited_groups(resumed)
+ process_deferred_airs(resumed)
+ cost_deferred_airs = MC_AVERAGE(cost_deferred_airs, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_groups = MC_AVERAGE(cost_groups, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
- currentpart = SSAIR_HIGHPRESSURE
-
- if(currentpart == SSAIR_HIGHPRESSURE)
+ resumed = 0
+ if(currentpart == SSAIR_ATMOSMACHINERY_AIR)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
- process_high_pressure_delta(resumed)
+ process_atmos_air_machinery(resumed)
+ cost_atmos_machinery = MC_AVERAGE(cost_atmos_machinery, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
+ resumed = 0
currentpart = SSAIR_HOTSPOTS
if(currentpart == SSAIR_HOTSPOTS)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
process_hotspots(resumed)
+ cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
- currentpart = SSAIR_SUPERCONDUCTIVITY
-
- if(currentpart == SSAIR_SUPERCONDUCTIVITY)
+ resumed = 0
+ currentpart = heat_enabled ? SSAIR_TURF_CONDUCTION : SSAIR_ACTIVETURFS
+ // Heat -- slow and of questionable usefulness. Off by default for this reason. Pretty cool, though.
+ if(currentpart == SSAIR_TURF_CONDUCTION)
timer = TICK_USAGE_REAL
- if(!resumed)
- cached_cost = 0
- process_super_conductivity(resumed)
+ if(process_turf_heat(MC_TICK_REMAINING_MS))
+ pause()
+ cost_superconductivity = MC_AVERAGE(cost_superconductivity, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
if(state != SS_RUNNING)
return
- cost_superconductivity = MC_AVERAGE(cost_superconductivity, TICK_DELTA_TO_MS(cached_cost))
- resumed = FALSE
+ resumed = 0
+ currentpart = SSAIR_ACTIVETURFS
+ // This simply starts the turf thread. It runs in the background until the FINALIZE_TURFS step, at which point it's waited for.
+ // This also happens to do all the commented out stuff below, all in a single separate thread. This is mostly so that the
+ // waiting is consistent.
+ if(currentpart == SSAIR_ACTIVETURFS)
+ timer = TICK_USAGE_REAL
+ process_turfs(resumed)
+ cost_turfs = MC_AVERAGE(cost_turfs, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
+ if(state != SS_RUNNING)
+ return
+ resumed = 0
+ /*
+ // Monstermos and/or Putnamos--making large pressure deltas move faster
+ if(currentpart == SSAIR_EQUALIZE)
+ timer = TICK_USAGE_REAL
+ process_turf_equalize(resumed)
+ cost_equalize = MC_AVERAGE(cost_equalize, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
+ if(state != SS_RUNNING)
+ return
+ resumed = 0
+ currentpart = SSAIR_EXCITEDGROUPS
+ // Making small pressure deltas equalize immediately so they don't process anymore
+ if(currentpart == SSAIR_EXCITEDGROUPS)
+ timer = TICK_USAGE_REAL
+ process_excited_groups(resumed)
+ cost_groups = MC_AVERAGE(cost_groups, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
+ if(state != SS_RUNNING)
+ return
+ resumed = 0
+ currentpart = SSAIR_TURF_POST_PROCESS
+ // Quick multithreaded "should we display/react?" checks followed by finishing those up before the next step
+ if(currentpart == SSAIR_TURF_POST_PROCESS)
+ timer = TICK_USAGE_REAL
+ post_process_turfs(resumed)
+ cost_post_process = MC_AVERAGE(cost_post_process, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
+ if(state != SS_RUNNING)
+ return
+ resumed = 0
+ currentpart = SSAIR_HOTSPOTS
+ */
currentpart = SSAIR_REBUILD_PIPENETS
-
-/datum/controller/subsystem/air/proc/process_pipenets(resumed = 0)
+/datum/controller/subsystem/air/proc/process_pipenets(resumed = FALSE)
if (!resumed)
src.currentrun = networks.Copy()
//cache for sanic speed (lists are references anyways)
@@ -197,8 +277,32 @@ SUBSYSTEM_DEF(air)
if(istype(atmos_machine, /obj/machinery/atmospherics))
pipenets_needing_rebuilt += atmos_machine
+/datum/controller/subsystem/air/proc/process_deferred_airs(resumed = 0)
+ max_deferred_airs = max(deferred_airs.len,max_deferred_airs)
+ while(deferred_airs.len)
+ var/list/cur_op = deferred_airs[deferred_airs.len]
+ deferred_airs.len--
+ var/datum/gas_mixture/air1
+ var/datum/gas_mixture/air2
+ if(isopenturf(cur_op[1]))
+ var/turf/open/T = cur_op[1]
+ air1 = T.return_air()
+ else
+ air1 = cur_op[1]
+ if(isopenturf(cur_op[2]))
+ var/turf/open/T = cur_op[2]
+ air2 = T.return_air()
+ else
+ air2 = cur_op[2]
+ if(istype(cur_op[3], /datum/callback))
+ var/datum/callback/cb = cur_op[3]
+ cb.Invoke(air1, air2)
+ else
+ air1.transfer_ratio_to(air2, cur_op[3])
+ if(MC_TICK_CHECK)
+ return
+
/datum/controller/subsystem/air/proc/process_atmos_machinery(resumed = 0)
- var/seconds = wait * 0.1
if (!resumed)
src.currentrun = atmos_machinery.Copy()
//cache for sanic speed (lists are references anyways)
@@ -206,25 +310,30 @@ SUBSYSTEM_DEF(air)
while(currentrun.len)
var/obj/machinery/M = currentrun[currentrun.len]
currentrun.len--
- if(!M || (M.process_atmos(seconds) == PROCESS_KILL))
+ if(M == null)
+ atmos_machinery.Remove(M)
+ if(!M || (M.process_atmos() == PROCESS_KILL))
atmos_machinery.Remove(M)
if(MC_TICK_CHECK)
return
-
-/datum/controller/subsystem/air/proc/process_super_conductivity(resumed = 0)
+/datum/controller/subsystem/air/proc/process_atmos_air_machinery(resumed = 0)
+ var/seconds = wait * 0.1
if (!resumed)
- src.currentrun = active_super_conductivity.Copy()
+ src.currentrun = atmos_air_machinery.Copy()
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
while(currentrun.len)
- var/turf/T = currentrun[currentrun.len]
+ var/obj/machinery/M = currentrun[currentrun.len]
currentrun.len--
- T.super_conduct()
+ if(!M || (M.process_atmos(seconds) == PROCESS_KILL))
+ atmos_air_machinery.Remove(M)
if(MC_TICK_CHECK)
return
-/datum/controller/subsystem/air/proc/process_hotspots(resumed = 0)
+/datum/controller/subsystem/air/proc/process_turf_heat()
+
+/datum/controller/subsystem/air/proc/process_hotspots(resumed = FALSE)
if (!resumed)
src.currentrun = hotspots.Copy()
//cache for sanic speed (lists are references anyways)
@@ -251,6 +360,9 @@ SUBSYSTEM_DEF(air)
return
/datum/controller/subsystem/air/proc/process_turf_equalize(resumed = 0)
+ if(process_turf_equalize_auxtools(resumed,MC_TICK_REMAINING_MS))
+ pause()
+ /*
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
@@ -261,13 +373,16 @@ SUBSYSTEM_DEF(air)
var/turf/open/T = currentrun[currentrun.len]
currentrun.len--
if (T)
- if(istype(T))
- T.equalize_pressure_in_zone(fire_count)
+ T.equalize_pressure_in_zone(fire_count)
//equalize_pressure_in_zone(T, fire_count)
if (MC_TICK_CHECK)
return
+ */
-/datum/controller/subsystem/air/proc/process_active_turfs(resumed = 0)
+/datum/controller/subsystem/air/proc/process_turfs(resumed = 0)
+ if(process_turfs_auxtools(resumed,MC_TICK_REMAINING_MS))
+ pause()
+ /*
//cache for sanic speed
var/fire_count = times_fired
if (!resumed)
@@ -281,81 +396,48 @@ SUBSYSTEM_DEF(air)
T.process_cell(fire_count)
if (MC_TICK_CHECK)
return
-
-/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
- if(process_excited_groups_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag))
- sleep()
- /*
- if (!resumed)
- src.currentrun = excited_groups.Copy()
- //cache for sanic speed (lists are references anyways)
- var/list/currentrun = src.currentrun
- while(currentrun.len)
- var/datum/excited_group/EG = currentrun[currentrun.len]
- currentrun.len--
- EG.breakdown_cooldown++
- EG.dismantle_cooldown++
- if(EG.breakdown_cooldown >= EXCITED_GROUP_BREAKDOWN_CYCLES)
- EG.self_breakdown()
- else if(EG.dismantle_cooldown >= EXCITED_GROUP_DISMANTLE_CYCLES)
- EG.dismantle()
- if (MC_TICK_CHECK)
- return
*/
-/datum/controller/subsystem/air/proc/process_excited_groups_extools()
-/datum/controller/subsystem/air/proc/get_amt_excited_groups()
-
-/datum/controller/subsystem/air/proc/remove_from_active(turf/open/T)
- active_turfs -= T
- if(currentpart == SSAIR_ACTIVETURFS)
- currentrun -= T
- #ifdef VISUALIZE_ACTIVE_TURFS
- T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#00ff00")
- #endif
- if(istype(T))
- T.set_excited(FALSE)
- T.eg_garbage_collect()
-
-/datum/controller/subsystem/air/proc/add_to_active(turf/open/T, blockchanges = 1)
- if(istype(T) && T.air)
- #ifdef VISUALIZE_ACTIVE_TURFS
- T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
- #endif
- T.set_excited(TRUE)
- active_turfs |= T
- if(currentpart == SSAIR_ACTIVETURFS)
- currentrun |= T
- if(blockchanges)
- T.eg_garbage_collect()
- else if(T.flags_1 & INITIALIZED_1)
- for(var/turf/S in T.atmos_adjacent_turfs)
- add_to_active(S)
- else if(map_loading)
- if(queued_for_activation)
- queued_for_activation[T] = T
- return
- else
- T.requires_activation = TRUE
+/datum/controller/subsystem/air/proc/process_excited_groups(resumed = 0)
+ if(process_excited_groups_auxtools(resumed,MC_TICK_REMAINING_MS))
+ pause()
+
+/datum/controller/subsystem/air/proc/finish_turf_processing(resumed = 0)
+ if(finish_turf_processing_auxtools(MC_TICK_REMAINING_MS))
+ pause()
+
+/datum/controller/subsystem/air/proc/post_process_turfs(resumed = 0)
+ if(post_process_turfs_auxtools(resumed,MC_TICK_REMAINING_MS))
+ pause()
+
+/datum/controller/subsystem/air/proc/finish_turf_processing_auxtools()
+/datum/controller/subsystem/air/proc/process_turfs_auxtools()
+/datum/controller/subsystem/air/proc/post_process_turfs_auxtools()
+/datum/controller/subsystem/air/proc/process_turf_equalize_auxtools()
+/datum/controller/subsystem/air/proc/process_excited_groups_auxtools()
+/datum/controller/subsystem/air/proc/get_amt_gas_mixes()
+/datum/controller/subsystem/air/proc/get_max_gas_mixes()
+/datum/controller/subsystem/air/proc/turf_process_time()
+/datum/controller/subsystem/air/proc/heat_process_time()
/datum/controller/subsystem/air/StartLoadingMap()
- LAZYINITLIST(queued_for_activation)
map_loading = TRUE
/datum/controller/subsystem/air/StopLoadingMap()
map_loading = FALSE
- for(var/T in queued_for_activation)
- add_to_active(T)
- queued_for_activation.Cut()
+
+/datum/controller/subsystem/air/proc/pause_z(z_level)
+ can_fire = FALSE
+
+/datum/controller/subsystem/air/proc/unpause_z(z_level)
+ can_fire = TRUE
/datum/controller/subsystem/air/proc/setup_allturfs()
var/list/turfs_to_init = block(locate(1, 1, 1), locate(world.maxx, world.maxy, world.maxz))
- var/list/active_turfs = src.active_turfs
var/times_fired = ++src.times_fired
// Clear active turfs - faster than removing every single turf in the world
// one-by-one, and Initalize_Atmos only ever adds `src` back in.
- active_turfs.Cut()
for(var/thing in turfs_to_init)
var/turf/T = thing
@@ -364,67 +446,8 @@ SUBSYSTEM_DEF(air)
T.Initalize_Atmos(times_fired)
CHECK_TICK
- if(active_turfs.len)
- var/starting_ats = active_turfs.len
- sleep(world.tick_lag)
- var/timer = world.timeofday
- log_mapping("There are [starting_ats] active turfs at roundstart caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required).")
- for(var/turf/T in active_turfs)
- GLOB.active_turfs_startlist += T
-
- //now lets clear out these active turfs
- var/list/turfs_to_check = active_turfs.Copy()
- do
- var/list/new_turfs_to_check = list()
- for(var/turf/open/T in turfs_to_check)
- new_turfs_to_check += T.resolve_active_graph()
- CHECK_TICK
-
- active_turfs += new_turfs_to_check
- turfs_to_check = new_turfs_to_check
-
- while (turfs_to_check.len)
- var/ending_ats = active_turfs.len
- /*for(var/thing in excited_groups)
- var/datum/excited_group/EG = thing
- //EG.self_breakdown(space_is_all_consuming = 1)
- //EG.dismantle()
- CHECK_TICK*/
-
- var/msg = "HEY! LISTEN! [DisplayTimeText(world.timeofday - timer)] were wasted processing [starting_ats] turf(s) (connected to [ending_ats] other turfs) with atmos differences at round start."
- to_chat(world, span_boldannounce("[msg]"))
- warning(msg)
-
-/turf/open/proc/resolve_active_graph()
- . = list()
- /*
- var/datum/excited_group/EG = excited_group
- if (blocks_air || !air)
- return
- if (!EG)
- EG = new
- EG.add_turf(src)
-
- for (var/turf/open/ET in atmos_adjacent_turfs)
- if ( ET.blocks_air || !ET.air)
- continue
-
- var/ET_EG = ET.excited_group
- if (ET_EG)
- if (ET_EG != EG)
- EG.merge_groups(ET_EG)
- EG = excited_group //merge_groups() may decide to replace our current EG
- else
- EG.add_turf(ET)
- if (!ET.excited)
- ET.excited = 1
- . += ET*/
-
-/turf/open/space/resolve_active_graph()
- return list()
-
/datum/controller/subsystem/air/proc/setup_atmos_machinery()
- for (var/obj/machinery/atmospherics/AM in atmos_machinery)
+ for (var/obj/machinery/atmospherics/AM in atmos_machinery + atmos_air_machinery)
AM.atmosinit()
CHECK_TICK
@@ -432,7 +455,7 @@ SUBSYSTEM_DEF(air)
// all atmos machinery has to initalize before the first
// pipenet can be built.
/datum/controller/subsystem/air/proc/setup_pipenets()
- for (var/obj/machinery/atmospherics/AM in atmos_machinery)
+ for (var/obj/machinery/atmospherics/AM in atmos_machinery + atmos_air_machinery)
AM.build_network()
CHECK_TICK
diff --git a/code/controllers/subsystem/callback.dm b/code/controllers/subsystem/callback.dm
new file mode 100644
index 000000000000..ecc65760f4e8
--- /dev/null
+++ b/code/controllers/subsystem/callback.dm
@@ -0,0 +1,14 @@
+SUBSYSTEM_DEF(callbacks)
+ name = "Auxtools Callbacks"
+ flags = SS_TICKER | SS_NO_INIT
+ wait = 1
+ priority = FIRE_PRIORITY_CALLBACKS
+
+/proc/process_atmos_callbacks()
+ SScallbacks.can_fire = 0
+ SScallbacks.flags |= SS_NO_FIRE
+ CRASH("Auxtools not found! Callback subsystem shutting itself off.")
+
+/datum/controller/subsystem/callbacks/fire()
+ if(process_atmos_callbacks(MC_TICK_REMAINING_MS))
+ pause()
diff --git a/code/controllers/subsystem/explosions.dm b/code/controllers/subsystem/explosions.dm
index be9b7e28db0d..3694eaa506cf 100644
--- a/code/controllers/subsystem/explosions.dm
+++ b/code/controllers/subsystem/explosions.dm
@@ -562,3 +562,5 @@ SUBSYSTEM_DEF(explosions)
cost_throwturf = MC_AVERAGE(cost_throwturf, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer))
currentpart = SSEXPLOSIONS_TURFS
+
+#undef SSAIR_REBUILD_PIPENETS
diff --git a/code/datums/components/rot.dm b/code/datums/components/rot.dm
index 7b7450167b94..6e187e56f726 100644
--- a/code/datums/components/rot.dm
+++ b/code/datums/components/rot.dm
@@ -25,14 +25,14 @@
if(!stank_breath)
return
stank_breath.set_volume(1)
- var/oxygen_pp = stank_breath.get_moles(/datum/gas/oxygen) * R_IDEAL_GAS_EQUATION * stank_breath.return_temperature() / stank_breath.return_volume()
+ var/oxygen_pp = stank_breath.get_moles(GAS_O2) * R_IDEAL_GAS_EQUATION * stank_breath.return_temperature() / stank_breath.return_volume()
if(oxygen_pp > 18)
var/this_amount = min((oxygen_pp - 8) * stank_breath.return_volume() / stank_breath.return_temperature() / R_IDEAL_GAS_EQUATION, amount)
- stank_breath.adjust_moles(/datum/gas/oxygen, -this_amount)
+ stank_breath.adjust_moles(GAS_O2, -this_amount)
var/datum/gas_mixture/stank = new
- stank.set_moles(/datum/gas/miasma, this_amount)
+ stank.set_moles(GAS_MIASMA, this_amount)
stank.set_temperature(BODYTEMP_NORMAL) // otherwise we have gas below 2.7K which will break our lag generator
stank_breath.merge(stank)
T.assume_air(stank_breath)
diff --git a/code/datums/diseases/advance/symptoms/heal.dm b/code/datums/diseases/advance/symptoms/heal.dm
index bd8b4ff37956..0535265d02b2 100644
--- a/code/datums/diseases/advance/symptoms/heal.dm
+++ b/code/datums/diseases/advance/symptoms/heal.dm
@@ -396,7 +396,7 @@
if(M.loc)
environment = M.loc.return_air()
if(environment)
- if(environment.get_moles(/datum/gas/plasma) > GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_MOLES_VISIBLE]) //if there's enough plasma in the air to see
+ if(environment.get_moles(GAS_PLASMA) > GLOB.gas_data.visibility[GAS_PLASMA]) //if there's enough plasma in the air to see
. += power * 0.5
if(M.reagents.has_reagent(/datum/reagent/toxin/plasma, needs_metabolizing = TRUE))
. += power * 0.75
diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm
index 0c2d036dd48f..787ddeb12b38 100644
--- a/code/datums/helper_datums/teleport.dm
+++ b/code/datums/helper_datums/teleport.dm
@@ -153,11 +153,11 @@
// Can most things breathe?
if(trace_gases)
continue
- if(A.get_moles(/datum/gas/oxygen) < 16)
+ if(A.get_moles(GAS_O2) < 16)
continue
- if(A.get_moles(/datum/gas/plasma))
+ if(A.get_moles(GAS_PLASMA))
continue
- if(A.get_moles(/datum/gas/carbon_dioxide) >= 10)
+ if(A.get_moles(GAS_CO2) >= 10)
continue
// Aim for goldilocks temperatures and pressure
diff --git a/code/datums/mutations/actions.dm b/code/datums/mutations/actions.dm
index 36c019e6e618..1b3380c719cb 100644
--- a/code/datums/mutations/actions.dm
+++ b/code/datums/mutations/actions.dm
@@ -43,7 +43,7 @@
/obj/effect/proc_holder/spell/targeted/olfaction/cast(list/targets, mob/living/user = usr)
//can we sniff? is there miasma in the air?
var/datum/gas_mixture/air = user.loc.return_air()
- if(air.get_moles(/datum/gas/miasma) >= 0.1)
+ if(air.get_moles(GAS_MIASMA) >= 0.1)
user.adjust_disgust(sensitivity * 45)
to_chat(user, span_warning("With your overly sensitive nose, you get a whiff of stench and feel sick! Try moving to a cleaner area!"))
return
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index e0a02c9fe4f6..f68414baf356 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -349,13 +349,27 @@
///Take air from the passed in gas mixture datum
/atom/proc/assume_air(datum/gas_mixture/giver)
- qdel(giver)
+ return null
+
+/atom/proc/assume_air_moles(datum/gas_mixture/giver, moles)
+ return null
+
+/atom/proc/assume_air_ratio(datum/gas_mixture/giver, ratio)
return null
///Remove air from this atom
/atom/proc/remove_air(amount)
return null
+/atom/proc/remove_air_ratio(ratio)
+ return null
+
+/atom/proc/transfer_air(datum/gas_mixture/taker, amount)
+ return null
+
+/atom/proc/transfer_air_ratio(datum/gas_mixture/taker, ratio)
+ return null
+
///Return the current air environment in this atom
/atom/proc/return_air()
if(loc)
@@ -363,6 +377,11 @@
else
return null
+///Return the air if we can analyze it
+/atom/proc/return_analyzable_air()
+ return null
+
+
///Return the air if we can analyze it
///Check if this atoms eye is still alive (probably)
/atom/proc/check_eye(mob/user)
diff --git a/code/game/gamemodes/objective_items.dm b/code/game/gamemodes/objective_items.dm
index 4f7d4c43b3ee..195299146712 100644
--- a/code/game/gamemodes/objective_items.dm
+++ b/code/game/gamemodes/objective_items.dm
@@ -134,12 +134,12 @@
if(!istype(o, /obj/item/tank))
continue
var/obj/item/tank/T = o
- found_amount += T.air_contents.get_moles(/datum/gas/plasma)
+ found_amount += T.air_contents.get_moles(GAS_PLASMA)
if (istype(objective.team, /datum/team/infiltrator))
for (var/area/A in world)
if (is_type_in_typecache(A, GLOB.infiltrator_objective_areas))
for (var/obj/item/tank/T in A.GetAllContents()) //Check for items
- found_amount += T.air_contents.get_moles(/datum/gas/plasma)
+ found_amount += T.air_contents.get_moles(GAS_PLASMA)
CHECK_TICK
CHECK_TICK
CHECK_TICK
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index 7cabc9b4c943..8afda0b011aa 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -60,7 +60,7 @@
var/total_moles = air_sample.total_moles()
if(total_moles)
for(var/gas_id in air_sample.get_gases())
- var/gas_name = GLOB.meta_gas_info[gas_id][META_GAS_NAME]
+ var/gas_name = GLOB.gas_data.names[gas_id]
signal.data["gases"][gas_name] = air_sample.get_moles(gas_id) / total_moles * 100
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
@@ -73,11 +73,11 @@
/obj/machinery/air_sensor/Initialize()
. = ..()
- SSair.atmos_machinery += src
+ SSair.atmos_air_machinery += src
set_frequency(frequency)
/obj/machinery/air_sensor/Destroy()
- SSair.atmos_machinery -= src
+ SSair.atmos_air_machinery -= src
SSradio.remove_object(src, frequency)
return ..()
diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm
index d9452836de4e..f3b857d12593 100644
--- a/code/game/machinery/doors/airlock_types.dm
+++ b/code/game/machinery/doors/airlock_types.dm
@@ -230,8 +230,8 @@
DA.update_name()
qdel(src)
-/obj/machinery/door/airlock/plasma/BlockSuperconductivity() //we don't stop the heat~
- return 0
+/obj/machinery/door/airlock/plasma/BlockThermalConductivity() //we don't stop the heat~
+ return FALSE
/obj/machinery/door/airlock/plasma/attackby(obj/item/C, mob/user, params)
if(C.is_hot() > 300)//If the temperature of the object is over 300, then ignite
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 4abd3b29a4c1..8d6959f16448 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -411,7 +411,7 @@
if(!glass && GLOB.cameranet)
GLOB.cameranet.updateVisibility(src, 0)
-/obj/machinery/door/BlockSuperconductivity() // All non-glass airlocks block heat, this is intended.
+/obj/machinery/door/BlockThermalConductivity() // All non-glass airlocks block heat, this is intended.
if(opacity || heat_proof)
return TRUE
return FALSE
diff --git a/code/game/machinery/electrolyzer.dm b/code/game/machinery/electrolyzer.dm
index d18fba7d8929..e199df1bd480 100644
--- a/code/game/machinery/electrolyzer.dm
+++ b/code/game/machinery/electrolyzer.dm
@@ -92,10 +92,10 @@
if(!removed)
return
- var/proportion = min(removed.get_moles(/datum/gas/water_vapor), (1.5 * delta_time * workingPower))//Works to max 12 moles at a time.
- removed.adjust_moles(/datum/gas/water_vapor, -(proportion * 2 * workingPower))
- removed.adjust_moles(/datum/gas/oxygen, (proportion * workingPower))
- removed.adjust_moles(/datum/gas/hydrogen, (proportion * 2 * workingPower))
+ var/proportion = min(removed.get_moles(GAS_H2O), (1.5 * delta_time * workingPower))//Works to max 12 moles at a time.
+ removed.adjust_moles(GAS_H2O, -(proportion * 2 * workingPower))
+ removed.adjust_moles(GAS_O2, (proportion * workingPower))
+ removed.adjust_moles(GAS_H2, (proportion * 2 * workingPower))
env.merge(removed) //put back the new gases in the turf
air_update_turf()
cell.use((5 * proportion * workingPower) / (efficiency + workingPower))
diff --git a/code/game/machinery/shuttle/shuttle_heater.dm b/code/game/machinery/shuttle/shuttle_heater.dm
index 80c46fde7374..f6b28d06ab3b 100644
--- a/code/game/machinery/shuttle/shuttle_heater.dm
+++ b/code/game/machinery/shuttle/shuttle_heater.dm
@@ -28,7 +28,7 @@
pipe_flags = PIPING_ONE_PER_TURF | PIPING_DEFAULT_LAYER_ONLY
- var/gas_type = /datum/gas/plasma
+ var/gas_type = GAS_PLASMA
var/efficiency_multiplier = 1
var/gas_capacity = 0
@@ -91,8 +91,6 @@
return
air_contents.set_volume(gas_capacity)
air_contents.set_temperature(T20C)
- if(gas_type)
- air_contents.set_moles(gas_type)
/obj/machinery/atmospherics/components/unary/shuttle/heater/proc/hasFuel(var/required)
var/datum/gas_mixture/air_contents = airs[1]
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index a5c28d67a8b5..d0a87f36d4a0 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -66,7 +66,7 @@
if(panel_open)
add_overlay("sheater-open")
-/obj/machinery/space_heater/process()
+/obj/machinery/space_heater/process_atmos()
if(!on || !is_operational())
if (on) // If it's broken, turn it off too
on = FALSE
@@ -241,7 +241,7 @@
usr.visible_message("[usr] switches [on ? "on" : "off"] \the [src].", span_notice("You switch [on ? "on" : "off"] \the [src]."))
update_icon()
if (on)
- START_PROCESSING(SSmachines, src)
+ SSair.atmos_air_machinery += src
/obj/machinery/space_heater/AltClick(mob/user)
if(!user.canUseTopic(src, !issilicon(user)))
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 4044d55fc169..f2bde2e92ec5 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -199,11 +199,7 @@
scanmod = null
capacitor = null
internal_tank = null
- if(loc)
- loc.assume_air(cabin_air)
- air_update_turf()
- else
- qdel(cabin_air)
+ assume_air(cabin_air)
cabin_air = null
qdel(spark_system)
spark_system = null
@@ -277,8 +273,8 @@
cabin_air = new
cabin_air.set_temperature(T20C)
cabin_air.set_volume(200)
- cabin_air.set_moles(/datum/gas/oxygen, O2STANDARD*cabin_air.return_volume()/(R_IDEAL_GAS_EQUATION*cabin_air.return_temperature()))
- cabin_air.set_moles(/datum/gas/nitrogen, N2STANDARD*cabin_air.return_volume()/(R_IDEAL_GAS_EQUATION*cabin_air.return_temperature()))
+ cabin_air.set_moles(GAS_O2, O2STANDARD*cabin_air.return_volume()/(R_IDEAL_GAS_EQUATION*cabin_air.return_temperature()))
+ cabin_air.set_moles(GAS_N2, N2STANDARD*cabin_air.return_volume()/(R_IDEAL_GAS_EQUATION*cabin_air.return_temperature()))
return cabin_air
/obj/mecha/proc/add_radio()
@@ -355,13 +351,7 @@
if(internal_damage & MECHA_INT_TANK_BREACH) //remove some air from internal tank
if(internal_tank)
- var/datum/gas_mixture/int_tank_air = internal_tank.return_air()
- var/datum/gas_mixture/leaked_gas = int_tank_air.remove_ratio(0.1)
- if(loc)
- loc.assume_air(leaked_gas)
- air_update_turf()
- else
- qdel(leaked_gas)
+ assume_air_ratio(internal_tank.return_air(), 0.1)
if(internal_damage & MECHA_INT_SHORT_CIRCUIT)
if(get_charge())
@@ -384,8 +374,7 @@
if(pressure_delta > 0) //cabin pressure lower than release pressure
if(tank_air.return_temperature() > 0)
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = tank_air.remove(transfer_moles)
- cabin_air.merge(removed)
+ tank_air.transfer_to(cabin_air,transfer_moles)
else if(pressure_delta < 0) //cabin pressure higher than release pressure
var/datum/gas_mixture/t_air = return_air()
pressure_delta = cabin_pressure - release_pressure
@@ -393,11 +382,7 @@
pressure_delta = min(cabin_pressure - t_air.return_pressure(), pressure_delta)
if(pressure_delta > 0) //if location pressure is lower than cabin pressure
transfer_moles = pressure_delta*cabin_air.return_volume()/(cabin_air.return_temperature() * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = cabin_air.remove(transfer_moles)
- if(t_air)
- t_air.merge(removed)
- else //just delete the cabin gas, we're in space or some shit
- qdel(removed)
+ cabin_air.transfer_to(t_air, transfer_moles)
if(occupant)
if(cell)
@@ -876,6 +861,11 @@
return cabin_air.remove(amount)
return ..()
+/obj/mecha/remove_air_ratio(ratio)
+ if(use_internal_tank)
+ return cabin_air.remove_ratio(ratio)
+ return ..()
+
/obj/mecha/return_air()
if(use_internal_tank)
return cabin_air
@@ -893,6 +883,9 @@
. = t_air.return_temperature()
return
+/obj/mecha/portableConnectorReturnAir()
+ return internal_tank.return_air()
+
/obj/mecha/MouseDrop_T(mob/M, mob/user)
if (!user.canUseTopic(src) || (user != M))
return
diff --git a/code/game/objects/effects/effect_system/effects_foam.dm b/code/game/objects/effects/effect_system/effects_foam.dm
index 97bd11510ef8..886ad41421e7 100644
--- a/code/game/objects/effects/effect_system/effects_foam.dm
+++ b/code/game/objects/effects/effect_system/effects_foam.dm
@@ -39,8 +39,8 @@
if(hotspot && istype(T) && T.air)
qdel(hotspot)
var/datum/gas_mixture/G = T.air
- var/plas_amt = min(30,G.get_moles(/datum/gas/plasma)) //Absorb some plasma
- G.adjust_moles(/datum/gas/plasma, -plas_amt)
+ var/plas_amt = min(30,G.get_moles(GAS_PLASMA)) //Absorb some plasma
+ G.adjust_moles(GAS_PLASMA, -plas_amt)
absorbed_plasma += plas_amt
if(G.return_temperature() > T20C)
G.set_temperature(max(G.return_temperature()/2,T20C))
@@ -315,7 +315,7 @@
for(var/obj/effect/hotspot/H in O)
qdel(H)
for(var/I in G.get_gases())
- if(I == /datum/gas/oxygen || I == /datum/gas/nitrogen)
+ if(I == GAS_O2 || I == GAS_N2)
continue
G.set_moles(I, 0)
O.air_update_turf()
diff --git a/code/game/objects/effects/effect_system/effects_smoke.dm b/code/game/objects/effects/effect_system/effects_smoke.dm
index e83f4da302a0..f1f5dc76b99b 100644
--- a/code/game/objects/effects/effect_system/effects_smoke.dm
+++ b/code/game/objects/effects/effect_system/effects_smoke.dm
@@ -168,9 +168,9 @@
T.air_update_turf()
for(var/obj/effect/hotspot/H in T)
qdel(H)
- if(G.get_moles(/datum/gas/plasma))
- G.adjust_moles(/datum/gas/nitrogen, G.get_moles(/datum/gas/plasma))
- G.set_moles(/datum/gas/plasma, 0)
+ if(G.get_moles(GAS_PLASMA))
+ G.adjust_moles(GAS_N2, G.get_moles(GAS_PLASMA))
+ G.set_moles(GAS_PLASMA, 0)
if (weldvents)
for(var/obj/machinery/atmospherics/components/unary/U in T)
if(!isnull(U.welded) && !U.welded) //must be an unwelded vent pump or vent scrubber.
diff --git a/code/game/objects/effects/spawners/bombspawner.dm b/code/game/objects/effects/spawners/bombspawner.dm
index c520c27d0e97..fb92e31f1e9a 100644
--- a/code/game/objects/effects/spawners/bombspawner.dm
+++ b/code/game/objects/effects/spawners/bombspawner.dm
@@ -1,6 +1,6 @@
#define CELSIUS_TO_KELVIN(T_K) ((T_K) + T0C)
-#define OPTIMAL_TEMP_K_PLA_BURN_SCALE(PRESSURE_P,PRESSURE_O,TEMP_O) (((PRESSURE_P) * GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_SPECIFIC_HEAT]) / (((PRESSURE_P) * GLOB.meta_gas_info[/datum/gas/plasma][META_GAS_SPECIFIC_HEAT] + (PRESSURE_O) * GLOB.meta_gas_info[/datum/gas/oxygen][META_GAS_SPECIFIC_HEAT]) / PLASMA_UPPER_TEMPERATURE - (PRESSURE_O) * GLOB.meta_gas_info[/datum/gas/oxygen][META_GAS_SPECIFIC_HEAT] / CELSIUS_TO_KELVIN(TEMP_O)))
+#define OPTIMAL_TEMP_K_PLA_BURN_SCALE(PRESSURE_P,PRESSURE_O,TEMP_O) (((PRESSURE_P) * GLOB.gas_data.specific_heats[GAS_PLASMA]) / (((PRESSURE_P) * GLOB.gas_data.specific_heats[GAS_PLASMA] + (PRESSURE_O) * GLOB.gas_data.specific_heats[GAS_O2]) / PLASMA_UPPER_TEMPERATURE - (PRESSURE_O) * GLOB.gas_data.specific_heats[GAS_O2] / CELSIUS_TO_KELVIN(TEMP_O)))
#define OPTIMAL_TEMP_K_PLA_BURN_RATIO(PRESSURE_P,PRESSURE_O,TEMP_O) (CELSIUS_TO_KELVIN(TEMP_O) * PLASMA_OXYGEN_FULLBURN * (PRESSURE_P) / (PRESSURE_O))
/obj/effect/spawner/newbomb
@@ -19,10 +19,10 @@
var/obj/item/tank/internals/plasma/PT = new(V)
var/obj/item/tank/internals/oxygen/OT = new(V)
- PT.air_contents.set_moles(/datum/gas/plasma, pressure_p*PT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_p)))
+ PT.air_contents.set_moles(GAS_PLASMA, pressure_p*PT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_p)))
PT.air_contents.set_temperature(CELSIUS_TO_KELVIN(temp_p))
- OT.air_contents.set_moles(/datum/gas/oxygen, pressure_o*OT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_o)))
+ OT.air_contents.set_moles(GAS_O2, pressure_o*OT.volume/(R_IDEAL_GAS_EQUATION*CELSIUS_TO_KELVIN(temp_o)))
OT.air_contents.set_temperature(CELSIUS_TO_KELVIN(temp_o))
V.tank_one = PT
diff --git a/code/game/objects/items/chrono_eraser.dm b/code/game/objects/items/chrono_eraser.dm
index 2c22780d1265..61118224a509 100644
--- a/code/game/objects/items/chrono_eraser.dm
+++ b/code/game/objects/items/chrono_eraser.dm
@@ -248,12 +248,18 @@
return BULLET_ACT_HIT
/obj/structure/chrono_field/assume_air()
- return 0
+ return null
+
+/obj/effect/chrono_field/assume_air_moles()
+ return null
+
+/obj/effect/chrono_field/assume_air_ratio()
+ return null
/obj/structure/chrono_field/return_air() //we always have nominal air and temperature
var/datum/gas_mixture/GM = new
- GM.set_moles(/datum/gas/oxygen, MOLES_O2STANDARD)
- GM.set_moles(/datum/gas/nitrogen, MOLES_N2STANDARD)
+ GM.set_moles(GAS_O2, MOLES_O2STANDARD)
+ GM.set_moles(GAS_N2, MOLES_N2STANDARD)
GM.set_temperature(T20C)
return GM
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index cba668cf85e4..be6e99e9cb06 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -400,7 +400,7 @@ GLOBAL_LIST_EMPTY(PDAs)
for(var/id in environment.get_gases())
var/gas_level = environment.get_moles(id)/total_moles
if(gas_level > 0)
- dat += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_level*100, 0.01)]%
"
+ dat += "[GLOB.gas_data.names[id]]: [round(gas_level*100, 0.01)]%
"
dat += "Temperature: [round(environment.return_temperature()-T0C)]°C
"
dat += "
"
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 79ad35cbe424..8b504d35be99 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -605,36 +605,36 @@ GENE SCANNER
else
to_chat(user, span_alert("Pressure: [round(pressure, 0.01)] kPa"))
if(total_moles)
- var/o2_concentration = environment.get_moles(/datum/gas/oxygen)/total_moles
- var/n2_concentration = environment.get_moles(/datum/gas/nitrogen)/total_moles
- var/co2_concentration = environment.get_moles(/datum/gas/carbon_dioxide)/total_moles
- var/plasma_concentration = environment.get_moles(/datum/gas/plasma)/total_moles
+ var/o2_concentration = environment.get_moles(GAS_O2)/total_moles
+ var/n2_concentration = environment.get_moles(GAS_N2)/total_moles
+ var/co2_concentration = environment.get_moles(GAS_CO2)/total_moles
+ var/plasma_concentration = environment.get_moles(GAS_PLASMA)/total_moles
if(abs(n2_concentration - N2STANDARD) < 20)
- to_chat(user, span_info("Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/nitrogen), 0.01)] mol)"))
+ to_chat(user, span_info("Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_N2), 0.01)] mol)"))
else
- to_chat(user, span_alert("Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/nitrogen), 0.01)] mol)"))
+ to_chat(user, span_alert("Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_N2), 0.01)] mol)"))
if(abs(o2_concentration - O2STANDARD) < 2)
- to_chat(user, span_info("Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/oxygen), 0.01)] mol)"))
+ to_chat(user, span_info("Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_O2), 0.01)] mol)"))
else
- to_chat(user, span_alert("Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/oxygen), 0.01)] mol)"))
+ to_chat(user, span_alert("Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_O2), 0.01)] mol)"))
if(co2_concentration > 0.01)
- to_chat(user, span_alert("CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/carbon_dioxide), 0.01)] mol)"))
+ to_chat(user, span_alert("CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_CO2), 0.01)] mol)"))
else
- to_chat(user, span_info("CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/carbon_dioxide), 0.01)] mol)"))
+ to_chat(user, span_info("CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_CO2), 0.01)] mol)"))
if(plasma_concentration > 0.005)
- to_chat(user, span_alert("Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/plasma), 0.01)] mol)"))
+ to_chat(user, span_alert("Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_PLASMA), 0.01)] mol)"))
else
- to_chat(user, span_info("Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(/datum/gas/plasma), 0.01)] mol)"))
+ to_chat(user, span_info("Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_PLASMA), 0.01)] mol)"))
for(var/id in environment.get_gases())
if(id in GLOB.hardcoded_gases)
continue
var/gas_concentration = environment.get_moles(id)/total_moles
- to_chat(user, span_alert("[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] % ([round(environment.get_moles(id), 0.01)] mol)"))
+ to_chat(user, span_alert("[GLOB.gas_data.names[id]]: [round(gas_concentration*100, 0.01)] % ([round(environment.get_moles(id), 0.01)] mol)"))
to_chat(user, span_info("Temperature: [round(environment.return_temperature()-T0C, 0.01)] °C ([round(environment.return_temperature(), 0.01)] K)"))
/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens
@@ -724,7 +724,7 @@ GENE SCANNER
for(var/id in air_contents.get_gases())
var/gas_concentration = air_contents.get_moles(id)/total_moles
- to_chat(user, span_notice("[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_concentration*100, 0.01)] % ([round(air_contents.get_moles(id), 0.01)] mol)"))
+ to_chat(user, span_notice("[GLOB.gas_data.names[id]]: [round(gas_concentration*100, 0.01)] % ([round(air_contents.get_moles(id), 0.01)] mol)"))
to_chat(user, span_notice("Temperature: [round(temperature - T0C,0.01)] °C ([round(temperature, 0.01)] K)"))
else
diff --git a/code/game/objects/items/flamethrower.dm b/code/game/objects/items/flamethrower.dm
index 62d9edb8fe81..2ccf49aa4cdc 100644
--- a/code/game/objects/items/flamethrower.dm
+++ b/code/game/objects/items/flamethrower.dm
@@ -204,12 +204,11 @@
//TODO: DEFERRED Consider checking to make sure tank pressure is high enough before doing this...
//Transfer 5% of current tank air contents to turf
var/datum/gas_mixture/air_transfer = ptank.air_contents.remove_ratio(release_amount)
- air_transfer.set_moles(/datum/gas/plasma, air_transfer.get_moles(/datum/gas/plasma) * 5)
+ air_transfer.set_moles(GAS_PLASMA, air_transfer.get_moles(GAS_PLASMA) * 5)
target.assume_air(air_transfer)
//Burn it based on transfered gas
target.hotspot_expose((ptank.air_contents.return_temperature()*2) + 380,500)
//location.hotspot_expose(1000,500,1)
- SSair.add_to_active(target, 0)
/obj/item/flamethrower/Initialize(mapload)
diff --git a/code/game/objects/items/grenades/atmos_grenades.dm b/code/game/objects/items/grenades/atmos_grenades.dm
index 5c626d8397d1..23f444991020 100644
--- a/code/game/objects/items/grenades/atmos_grenades.dm
+++ b/code/game/objects/items/grenades/atmos_grenades.dm
@@ -43,8 +43,8 @@
if(floor_loc.air.return_temperature() > 370)
floor_loc.atmos_spawn_air("n2=[gas_amount / distance_from_center];TEMP=30")
floor_loc.MakeSlippery(TURF_WET_PERMAFROST, (5 / distance_from_center) MINUTES)
- if(floor_loc.air.get_gases(/datum/gas/plasma))
- floor_loc.air.adjust_moles(/datum/gas/plasma, -(floor_loc.air.get_moles(/datum/gas/plasma) * 0.5 / distance_from_center))
+ if(floor_loc.air.get_gases(GAS_PLASMA))
+ floor_loc.air.adjust_moles(GAS_PLASMA, -(floor_loc.air.get_moles(GAS_PLASMA) * 0.5 / distance_from_center))
floor_loc.air_update_turf()
for(var/mob/living/carbon/live_mob in turf_loc)
live_mob.adjustStaminaLoss(stamina_damage / distance_from_center)
diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm
index 331575a3a292..ac9e1072a1a6 100644
--- a/code/game/objects/items/melee/misc.dm
+++ b/code/game/objects/items/melee/misc.dm
@@ -511,7 +511,6 @@
T.visible_message(span_danger("[T] smacks into [src] and rapidly flashes to ash."),\
span_italics("You hear a loud crack as you are washed with a wave of heat."))
shard.Consume()
- CALCULATE_ADJACENT_TURFS(T)
/obj/item/melee/supermatter_sword/add_blood_DNA(list/blood_dna)
return FALSE
diff --git a/code/game/objects/items/tanks/jetpack.dm b/code/game/objects/items/tanks/jetpack.dm
index 67a96f94365b..d7eaccc1a04d 100644
--- a/code/game/objects/items/tanks/jetpack.dm
+++ b/code/game/objects/items/tanks/jetpack.dm
@@ -8,7 +8,7 @@
w_class = WEIGHT_CLASS_BULKY
distribute_pressure = ONE_ATMOSPHERE * O2STANDARD
actions_types = list(/datum/action/item_action/set_internals, /datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
- var/gas_type = /datum/gas/oxygen
+ var/gas_type = GAS_O2
var/on = FALSE
var/stabilizers = FALSE
var/full_speed = TRUE // If the jetpack will have a speedboost in space/nograv or not
@@ -86,13 +86,7 @@
turn_off(user)
return
- var/datum/gas_mixture/removed = air_contents.remove(num)
- if(removed.total_moles() < 0.005)
- turn_off(user)
- return
-
- var/turf/T = get_turf(user)
- T.assume_air(removed)
+ assume_air_moles(air_contents, num)
return TRUE
@@ -125,13 +119,7 @@
turn_off(user)
return
- var/datum/gas_mixture/removed = air_contents.remove(num)
- if(removed.total_moles() < 0.005)
- turn_off(user)
- return
-
- var/turf/T = get_turf(user)
- T.assume_air(removed)
+ assume_air_moles(air_contents, num)
return TRUE
@@ -181,7 +169,7 @@
icon_state = "jetpack-black"
item_state = "jetpack-black"
distribute_pressure = 0
- gas_type = /datum/gas/carbon_dioxide
+ gas_type = GAS_CO2
/obj/item/tank/jetpack/suit
diff --git a/code/game/objects/items/tanks/tank_types.dm b/code/game/objects/items/tanks/tank_types.dm
index 3042cc3d5adf..6ab9d19ad7c4 100644
--- a/code/game/objects/items/tanks/tank_types.dm
+++ b/code/game/objects/items/tanks/tank_types.dm
@@ -20,7 +20,7 @@
/obj/item/tank/internals/oxygen/populate_gas()
- air_contents.set_moles(/datum/gas/oxygen, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_O2, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/oxygen/yellow
@@ -52,8 +52,8 @@
force = 10
/obj/item/tank/internals/anesthetic/populate_gas()
- air_contents.set_moles(/datum/gas/oxygen, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
- air_contents.set_moles(/datum/gas/nitrous_oxide, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
+ air_contents.set_moles(GAS_O2, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
+ air_contents.set_moles(GAS_NITROUS, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
/*
* Air
@@ -67,8 +67,8 @@
dog_fashion = /datum/dog_fashion/back
/obj/item/tank/internals/air/populate_gas()
- air_contents.set_moles(/datum/gas/oxygen, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
- air_contents.set_moles(/datum/gas/nitrogen, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
+ air_contents.set_moles(GAS_O2, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD)
+ air_contents.set_moles(GAS_N2, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD)
/*
* Plasma
@@ -83,7 +83,7 @@
/obj/item/tank/internals/plasma/populate_gas()
- air_contents.set_moles(/datum/gas/plasma, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_PLASMA, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/plasma/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/flamethrower))
@@ -99,7 +99,7 @@
return ..()
/obj/item/tank/internals/plasma/full/populate_gas()
- air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_PLASMA, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/plasma/empty/populate_gas()
return
@@ -117,10 +117,10 @@
distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
/obj/item/tank/internals/plasmaman/populate_gas()
- air_contents.set_moles(/datum/gas/plasma, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_PLASMA, (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/plasmaman/full/populate_gas()
- air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_PLASMA, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/plasmaman/belt
@@ -132,7 +132,7 @@
w_class = WEIGHT_CLASS_SMALL //thanks i forgot this
/obj/item/tank/internals/plasmaman/belt/full/populate_gas()
- air_contents.set_moles(/datum/gas/plasma, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_PLASMA, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/plasmaman/belt/empty/populate_gas()
return
@@ -155,7 +155,7 @@
/obj/item/tank/internals/emergency_oxygen/populate_gas()
- air_contents.set_moles(/datum/gas/oxygen, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
+ air_contents.set_moles(GAS_O2, (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
/obj/item/tank/internals/emergency_oxygen/empty/populate_gas()
diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm
index 1b8228d58d3b..ca2168e50e73 100644
--- a/code/game/objects/items/tanks/tanks.dm
+++ b/code/game/objects/items/tanks/tanks.dm
@@ -209,6 +209,9 @@
/obj/item/tank/remove_air(amount)
return air_contents.remove(amount)
+/obj/item/tank/remove_air_ratio(ratio)
+ return air_contents.remove_ratio(ratio)
+
/obj/item/tank/return_air()
return air_contents
@@ -218,6 +221,18 @@
check_status()
return 1
+/obj/item/tank/assume_air_moles(datum/gas_mixture/giver, moles)
+ giver.transfer_to(air_contents, moles)
+
+ check_status()
+ return 1
+
+/obj/item/tank/assume_air_ratio(datum/gas_mixture/giver, ratio)
+ giver.transfer_ratio_to(air_contents, ratio)
+
+ check_status()
+ return 1
+
/obj/item/tank/proc/remove_air_volume(volume_to_return)
if(!air_contents)
return null
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 2db54d2e6416..b0afb6dba3c8 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -98,12 +98,42 @@
else
return null
+/obj/assume_air_moles(datum/gas_mixture/giver, moles)
+ if(loc)
+ return loc.assume_air_moles(giver, moles)
+ else
+ return null
+
+/obj/assume_air_ratio(datum/gas_mixture/giver, ratio)
+ if(loc)
+ return loc.assume_air_ratio(giver, ratio)
+ else
+ return null
+
+/obj/transfer_air(datum/gas_mixture/taker, moles)
+ if(loc)
+ return loc.transfer_air(taker, moles)
+ else
+ return null
+
+/obj/transfer_air_ratio(datum/gas_mixture/taker, ratio)
+ if(loc)
+ return loc.transfer_air_ratio(taker, ratio)
+ else
+ return null
+
/obj/remove_air(amount)
if(loc)
return loc.remove_air(amount)
else
return null
+/obj/remove_air_ratio(ratio)
+ if(loc)
+ return loc.remove_air_ratio(ratio)
+ else
+ return null
+
/obj/return_air()
if(loc)
return loc.return_air()
@@ -118,8 +148,7 @@
if(breath_request>0)
var/datum/gas_mixture/environment = return_air()
- var/breath_percentage = BREATH_VOLUME / environment.return_volume()
- return remove_air(environment.total_moles() * breath_percentage)
+ return remove_air_ratio(BREATH_VOLUME / environment.return_volume())
else
return null
diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm
index c30bbdde7faa..43a207dd76d3 100644
--- a/code/game/objects/structures/aliens.dm
+++ b/code/game/objects/structures/aliens.dm
@@ -81,7 +81,7 @@
resintype = "wall"
canSmoothWith = list(/obj/structure/alien/resin/wall, /obj/structure/alien/resin/membrane)
-/obj/structure/alien/resin/wall/BlockSuperconductivity()
+/obj/structure/alien/resin/wall/BlockThermalConductivity()
return 1
/obj/structure/alien/resin/membrane
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index 4e73ff46e6f0..6e464968e5f6 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -178,9 +178,7 @@
pod_moving = FALSE
if(!QDELETED(pod))
var/datum/gas_mixture/floor_mixture = loc.return_air()
- floor_mixture.archive()
- pod.air_contents.archive()
- pod.air_contents.share(floor_mixture, 1) //mix the pod's gas mixture with the tile it's on
+ equalize_all_gases_in_list(list(pod.air_contents,floor_mixture))
air_update_turf()
/obj/structure/transit_tube/station/init_tube_dirs()
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index 2543eee2fad7..46ab1996c484 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -10,8 +10,8 @@
/obj/structure/transit_tube_pod/Initialize()
. = ..()
- air_contents.set_moles(/datum/gas/oxygen, MOLES_O2STANDARD)
- air_contents.set_moles(/datum/gas/nitrogen, MOLES_N2STANDARD)
+ air_contents.set_moles(GAS_O2, MOLES_O2STANDARD)
+ air_contents.set_moles(GAS_N2, MOLES_N2STANDARD)
air_contents.set_temperature(T20C)
@@ -162,9 +162,24 @@
/obj/structure/transit_tube_pod/assume_air(datum/gas_mixture/giver)
return air_contents.merge(giver)
+/obj/structure/transit_tube_pod/assume_air_moles(datum/gas_mixture/giver, moles)
+ return giver.transfer_to(air_contents, moles)
+
+/obj/structure/transit_tube_pod/assume_air_ratio(datum/gas_mixture/giver, ratio)
+ return giver.transfer_ratio_to(air_contents, ratio)
+
/obj/structure/transit_tube_pod/remove_air(amount)
return air_contents.remove(amount)
+/obj/structure/transit_tube_pod/remove_air_ratio(ratio)
+ return air_contents.remove_ratio(ratio)
+
+/obj/structure/transit_tube_pod/transfer_air(datum/gas_mixture/taker, moles)
+ return air_contents.transfer_to(taker, moles)
+
+/obj/structure/transit_tube_pod/transfer_air_ratio(datum/gas_mixture/taker, ratio)
+ return air_contents.transfer_ratio_to(taker, ratio)
+
/obj/structure/transit_tube_pod/relaymove(mob/mob, direction)
if(istype(mob) && mob.client)
if(!moving)
diff --git a/code/game/turfs/change_turf.dm b/code/game/turfs/change_turf.dm
index 4c363ca06b0c..ae48935dca5a 100644
--- a/code/game/turfs/change_turf.dm
+++ b/code/game/turfs/change_turf.dm
@@ -14,18 +14,15 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
qdel(thing, force=TRUE)
if(turf_type)
- var/turf/newT = ChangeTurf(turf_type, baseturf_type, flags)
- SSair.remove_from_active(newT)
- CALCULATE_ADJACENT_TURFS(newT)
- SSair.add_to_active(newT,1)
+ ChangeTurf(turf_type, baseturf_type, flags)
-/turf/proc/copyTurf(turf/T)
+/turf/proc/copyTurf(turf/T, copy_air, flags)
if(T.type != type)
var/obj/O
if(underlays.len) //we have underlays, which implies some sort of transparency, so we want to a snapshot of the previous turf as an underlay
O = new()
O.underlays.Add(T)
- T.ChangeTurf(type)
+ T.ChangeTurf(type, null, flags)
if(underlays.len)
T.underlays = O.underlays
if(T.icon_state != icon_state)
@@ -54,6 +51,14 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
/turf/proc/TerraformTurf(path, new_baseturf, flags)
return ChangeTurf(path, new_baseturf, flags)
+/turf/proc/get_z_base_turf()
+ . = SSmapping.level_trait(z, ZTRAIT_BASETURF) || /turf/open/space
+ if (!ispath(.))
+ . = text2path(.)
+ if (!ispath(.))
+ warning("Z-level [z] has invalid baseturf '[SSmapping.level_trait(z, ZTRAIT_BASETURF)]'")
+ . = /turf/open/space
+
// Creates a new turf
// new_baseturfs can be either a single type or list of types, formated the same as baseturfs. see turf.dm
/turf/proc/ChangeTurf(path, list/new_baseturfs, flags)
@@ -138,7 +143,6 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
/turf/open/ChangeTurf(path, list/new_baseturfs, flags)
if ((flags & CHANGETURF_INHERIT_AIR) && ispath(path, /turf/open))
- SSair.remove_from_active(src)
var/datum/gas_mixture/stashed_air = new()
stashed_air.copy_from(air)
. = ..()
@@ -149,12 +153,16 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
if (!istype(newTurf.air, /datum/gas_mixture/immutable/space))
QDEL_NULL(newTurf.air)
newTurf.air = stashed_air
- update_air_ref()
- SSair.add_to_active(newTurf)
+ update_air_ref(planetary_atmos ? 1 : 2)
else
if(ispath(path,/turf/closed))
flags |= CHANGETURF_RECALC_ADJACENT
- return ..()
+ update_air_ref(-1)
+ . = ..()
+ else
+ . = ..()
+ if(!istype(air,/datum/gas_mixture))
+ Initalize_Atmos(0)
// Take off the top layer turf and replace it with the next baseturf down
/turf/proc/ScrapeAway(amount=1, flags)
@@ -252,7 +260,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
// Copy an existing turf and put it on top
// Returns the new turf
-/turf/proc/CopyOnTop(turf/copytarget, ignore_bottom=1, depth=INFINITY, copy_air = FALSE)
+/turf/proc/CopyOnTop(turf/copytarget, ignore_bottom=1, depth=INFINITY, copy_air = FALSE, flags)
var/list/new_baseturfs = list()
new_baseturfs += baseturfs
new_baseturfs += type
@@ -269,7 +277,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
target_baseturfs -= new_baseturfs & GLOB.blacklisted_automated_baseturfs
new_baseturfs += target_baseturfs
- var/turf/newT = copytarget.copyTurf(src, copy_air)
+ var/turf/newT = copytarget.copyTurf(src, copy_air, flags)
newT.baseturfs = new_baseturfs
return newT
@@ -277,11 +285,7 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
//If you modify this function, ensure it works correctly with lateloaded map templates.
/turf/proc/AfterChange(flags) //called after a turf has been replaced in ChangeTurf()
levelupdate()
- if(flags & CHANGETURF_RECALC_ADJACENT)
- ImmediateCalculateAdjacentTurfs()
- else
- CALCULATE_ADJACENT_TURFS(src)
- SSair.add_to_active(src)
+ ImmediateCalculateAdjacentTurfs()
//update firedoor adjacency
var/list/turfs_to_check = get_adjacent_open_turfs(src) | src
@@ -315,7 +319,6 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
total.merge(S.air)
air.copy_from(total.remove_ratio(1/turf_count))
- SSair.add_to_active(src)
/turf/proc/ReplaceWithLattice()
ScrapeAway(flags = CHANGETURF_INHERIT_AIR)
diff --git a/code/game/turfs/closed.dm b/code/game/turfs/closed.dm
index 4c4195f54a78..40288502c752 100644
--- a/code/game/turfs/closed.dm
+++ b/code/game/turfs/closed.dm
@@ -6,14 +6,9 @@
flags_1 = RAD_PROTECT_CONTENTS_1 | RAD_NO_CONTAMINATE_1
rad_insulation = RAD_MEDIUM_INSULATION
-/turf/closed/Initialize()
- . = ..()
- update_air_ref()
-
/turf/closed/AfterChange()
. = ..()
SSair.high_pressure_delta -= src
- update_air_ref()
/turf/closed/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir)
return FALSE
diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm
index 6749a507f4ca..26ac953b4653 100644
--- a/code/game/turfs/open.dm
+++ b/code/game/turfs/open.dm
@@ -365,18 +365,12 @@
return FALSE //don't forget, you're here forever
/turf/open/Initalize_Atmos(times_fired)
- set_excited(FALSE)
- update_visuals()
-
- current_cycle = times_fired
+ if(!blocks_air)
+ if(!istype(air,/datum/gas_mixture/turf))
+ air = new(2500,src)
+ air.copy_from_turf(src)
+ update_air_ref(planetary_atmos ? 1 : 2)
ImmediateCalculateAdjacentTurfs()
- for(var/i in atmos_adjacent_turfs)
- var/turf/open/enemy_tile = i
- var/datum/gas_mixture/enemy_air = enemy_tile.return_air()
- if(!get_excited() && air.compare(enemy_air))
- //testing("Active turf found. Return value of compare(): [is_active]")
- set_excited(TRUE)
- SSair.active_turfs |= src
/turf/open/proc/GetHeatCapacity()
. = air.heat_capacity()
@@ -472,14 +466,14 @@
/turf/open/rad_act(pulse_strength)
. = ..()
- if (air.get_moles(/datum/gas/carbon_dioxide) && air.get_moles(/datum/gas/oxygen))
- pulse_strength = min(pulse_strength,air.get_moles(/datum/gas/carbon_dioxide)*1000,air.get_moles(/datum/gas/oxygen)*2000) //Ensures matter is conserved properly
- air.set_moles(/datum/gas/carbon_dioxide, max(air.get_moles(/datum/gas/carbon_dioxide)-(pulse_strength * 0.001),0))
- air.set_moles(/datum/gas/oxygen, max(air.get_moles(/datum/gas/oxygen)-(pulse_strength * 0.002),0))
- air.adjust_moles(/datum/gas/pluoxium, pulse_strength * 0.004)
+ if (air.get_moles(GAS_CO2) && air.get_moles(GAS_O2))
+ pulse_strength = min(pulse_strength,air.get_moles(GAS_CO2)*1000,air.get_moles(GAS_O2)*2000) //Ensures matter is conserved properly
+ air.set_moles(GAS_CO2, max(air.get_moles(GAS_CO2)-(pulse_strength * 0.001),0))
+ air.set_moles(GAS_O2, max(air.get_moles(GAS_O2)-(pulse_strength * 0.002),0))
+ air.adjust_moles(GAS_PLUOXIUM, pulse_strength * 0.004)
air_update_turf()
- if (air.get_moles(/datum/gas/hydrogen))
- pulse_strength = min(pulse_strength, air.get_moles(/datum/gas/hydrogen) * 1000)
- air.set_moles(/datum/gas/hydrogen, max(air.get_moles(/datum/gas/hydrogen) - (pulse_strength * 0.001), 0))
- air.adjust_moles(/datum/gas/tritium, pulse_strength * 0.001)
+ if (air.get_moles(GAS_H2))
+ pulse_strength = min(pulse_strength, air.get_moles(GAS_H2) * 1000)
+ air.set_moles(GAS_H2, max(air.get_moles(GAS_H2) - (pulse_strength * 0.001), 0))
+ air.adjust_moles(GAS_TRITIUM, pulse_strength * 0.001)
air_update_turf()
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index b6332ba0936d..5b20d30f26a4 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -116,7 +116,6 @@
return
/turf/open/floor/proc/update_icon()
- update_visuals()
return 1
/turf/open/floor/attack_paw(mob/user)
diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm
index b4c30434778c..4a257b6f4c02 100644
--- a/code/game/turfs/simulated/floor/fancy_floor.dm
+++ b/code/game/turfs/simulated/floor/fancy_floor.dm
@@ -62,7 +62,7 @@
return make_plating()
/turf/open/floor/wood/cold
- temperature = 255.37
+ initial_temperature = 255.37
/turf/open/floor/wood/airless
initial_gas_mix = AIRLESS_ATMOS
diff --git a/code/game/turfs/simulated/floor/plating/asteroid.dm b/code/game/turfs/simulated/floor/plating/asteroid.dm
index fda8a60a03e9..89e5cdb827fa 100644
--- a/code/game/turfs/simulated/floor/plating/asteroid.dm
+++ b/code/game/turfs/simulated/floor/plating/asteroid.dm
@@ -134,6 +134,10 @@
#define SPAWN_MEGAFAUNA "bluh bluh huge boss"
#define SPAWN_BUBBLEGUM 6
+// / Breathing types. Lungs can access either by these or by a string, which will be considered a gas ID.
+#define BREATH_OXY /datum/breathing_class/oxygen
+#define BREATH_PLASMA /datum/breathing_class/plasma
+
/turf/open/floor/plating/asteroid/airless/cave
var/length = 100
var/list/mob_spawn_list
diff --git a/code/game/turfs/simulated/floor/plating/misc_plating.dm b/code/game/turfs/simulated/floor/plating/misc_plating.dm
index 831299b8f600..b5af142f16d7 100644
--- a/code/game/turfs/simulated/floor/plating/misc_plating.dm
+++ b/code/game/turfs/simulated/floor/plating/misc_plating.dm
@@ -173,7 +173,7 @@
icon = 'icons/turf/floors/ice_turf.dmi'
icon_state = "unsmooth"
initial_gas_mix = FROZEN_ATMOS
- temperature = 180
+ initial_temperature = 180
planetary_atmos = TRUE
baseturfs = /turf/open/floor/plating/ice
slowdown = 1
@@ -197,10 +197,10 @@
canSmoothWith = list(/turf/open/floor/plating/ice/smooth, /turf/open/floor/plating/ice)
/turf/open/floor/plating/ice/colder
- temperature = 140
+ initial_temperature = 140
/turf/open/floor/plating/ice/temperate
- temperature = 255.37
+ initial_temperature = 255.37
/turf/open/floor/plating/ice/break_tile()
return
@@ -218,7 +218,7 @@
icon = 'icons/turf/snow.dmi'
icon_state = "snowplating"
initial_gas_mix = FROZEN_ATMOS
- temperature = 180
+ initial_temperature = 180
attachment_holes = FALSE
planetary_atmos = TRUE
footstep = FOOTSTEP_SAND
@@ -237,10 +237,10 @@
icon_state = "smooth"
/turf/open/floor/plating/snowed/colder
- temperature = 140
+ initial_temperature = 140
/turf/open/floor/plating/snowed/temperatre
- temperature = 255.37
+ initial_temperature = 255.37
/turf/open/floor/plating/snowed/smoothed/icemoon
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
diff --git a/code/game/turfs/simulated/minerals.dm b/code/game/turfs/simulated/minerals.dm
index 1a9549e123fa..1106743aa06f 100644
--- a/code/game/turfs/simulated/minerals.dm
+++ b/code/game/turfs/simulated/minerals.dm
@@ -12,7 +12,7 @@
opacity = 1
density = TRUE
layer = EDGED_TURF_LAYER
- temperature = TCMB
+ initial_temperature = TCMB
var/environment_type = "asteroid"
var/turf/open/floor/plating/turf_type = /turf/open/floor/plating/asteroid/airless
var/mineralType = null
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 537bf53e53ba..df318ebb5653 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -4,8 +4,8 @@
name = "\proper space"
intact = 0
- temperature = TCMB
- thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
+ initial_temperature = TCMB
+ thermal_conductivity = 0
heat_capacity = 700000
FASTDMM_PROP(\
@@ -16,7 +16,7 @@
var/destination_x
var/destination_y
- var/global/datum/gas_mixture/immutable/space/space_gas = new
+ var/global/datum/gas_mixture/immutable/space/space_gas
plane = PLANE_SPACE
layer = SPACE_LAYER
light_power = 0.25
@@ -30,8 +30,10 @@
/turf/open/space/Initialize()
SHOULD_CALL_PARENT(FALSE)
icon_state = SPACE_ICON_STATE
+ if(!space_gas)
+ space_gas = new
air = space_gas
- update_air_ref()
+ update_air_ref(0)
vis_contents.Cut() //removes inherited overlays
visibilityChanged()
@@ -43,9 +45,6 @@
if(!IS_DYNAMIC_LIGHTING(src) && IS_DYNAMIC_LIGHTING(A))
add_overlay(/obj/effect/fullbright)
- if(requires_activation)
- SSair.add_to_active(src)
-
if (light_power && light_range)
update_light()
@@ -81,6 +80,13 @@
/turf/open/space/remove_air(amount)
return null
+/turf/open/space/remove_air_ratio(amount)
+ return null
+
+//IT SHOULD RETURN NULL YOU MONKEY, WHY IN TARNATION WHAT THE FUCKING FUCK
+/turf/open/space/remove_air(amount)
+ return null
+
/turf/open/space/proc/update_starlight()
if(CONFIG_GET(flag/starlight))
for(var/t in RANGE_TURFS(1,src)) //RANGE_TURFS is in code\__HELPERS\game.dm
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 8aadd86a4e91..68ba9fd4e3fa 100755
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -13,7 +13,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
// This shouldn't be modified directly, use the helper procs.
var/list/baseturfs = /turf/baseturf_bottom
- var/temperature = T20C
+ var/initial_temperature = T20C
var/to_be_destroyed = 0 //Used for fire, if a melting temperature was reached, it will be destroyed
var/max_fire_temperature_sustained = 0 //The max temperature of the fire which it was subjected to
@@ -66,8 +66,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
add_overlay(/obj/effect/fullbright)
if(requires_activation)
- CALCULATE_ADJACENT_TURFS(src)
- SSair.add_to_active(src)
+ ImmediateCalculateAdjacentTurfs()
if (light_power && light_range)
update_light()
@@ -85,11 +84,25 @@ GLOBAL_LIST_EMPTY(station_turfs)
has_opaque_atom = TRUE
ComponentInitialize()
+ if(isopenturf(src))
+ var/turf/open/O = src
+ __auxtools_update_turf_temp_info(isspaceturf(get_z_base_turf()) && !O.planetary_atmos)
+ else
+ update_air_ref(-1)
+ __auxtools_update_turf_temp_info(isspaceturf(get_z_base_turf()))
return INITIALIZE_HINT_NORMAL
+/turf/proc/__auxtools_update_turf_temp_info()
+
+/turf/proc/__auxtools_update_turf_infos(immediate)
+
+/turf/return_temperature()
+
+/turf/proc/set_temperature()
+
/turf/proc/Initalize_Atmos(times_fired)
- CALCULATE_ADJACENT_TURFS(src)
+ ImmediateCalculateAdjacentTurfs()
/turf/Destroy(force)
. = QDEL_HINT_IWILLGC
@@ -111,7 +124,6 @@ GLOBAL_LIST_EMPTY(station_turfs)
for(var/I in B.vars)
B.vars[I] = null
return
- SSair.remove_from_active(src)
visibilityChanged()
QDEL_LIST(blueprint_data)
flags_1 &= ~INITIALIZED_1
diff --git a/code/game/world.dm b/code/game/world.dm
index eea4f359adf7..3290fbc3bf4f 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -19,6 +19,8 @@ GLOBAL_VAR(restart_counter)
*
*/
/world/New()
+ //Keep the auxtools stuff at the top
+ AUXTOOLS_CHECK(AUXMOS)
//Early profile for auto-profiler - will be stopped on profiler init if necessary.
#if DM_VERSION >= 513 && DM_BUILD >= 1506
world.Profile(PROFILE_START)
@@ -261,17 +263,15 @@ GLOBAL_VAR(restart_counter)
log_world("World rebooted at [time_stamp()]")
shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
+ AUXTOOLS_SHUTDOWN(AUXMOS)
..()
/world/Del()
- // memory leaks bad
- var/num_deleted = 0
- for(var/datum/gas_mixture/GM)
- GM.__gasmixture_unregister()
- num_deleted++
- log_world("Deallocated [num_deleted] gas mixtures")
- if(fexists(EXTOOLS))
- call(EXTOOLS, "cleanup")()
+ shutdown_logging() // makes sure the thread is closed before end, else we terminate
+ AUXTOOLS_SHUTDOWN(AUXMOS)
+ var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL")
+ if (debug_server)
+ call(debug_server, "auxtools_shutdown")()
..()
/world/proc/update_status() //yogs -- Mirrored in the Yogs folder in March 2019. Do not edit, swallow, or submerge in acid
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index 58fbb2f874ab..b53b5d771753 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -173,6 +173,7 @@ GLOBAL_PROTECT(admin_verbs_debug)
/client/proc/callproc,
/client/proc/callproc_datum,
/client/proc/cmd_admin_list_open_jobs,
+ /client/proc/fixcorruption,
#ifdef TESTING //Xoxeyos 3/14/2021
/client/proc/export_dynamic_json,
/client/proc/run_dynamic_simulations,
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index db9da7e4ba93..fb5aae346743 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -873,7 +873,7 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
if(Rad.anchored)
if(!Rad.loaded_tank)
var/obj/item/tank/internals/plasma/Plasma = new/obj/item/tank/internals/plasma(Rad)
- Plasma.air_contents.set_moles(/datum/gas/plasma, 70)
+ Plasma.air_contents.set_moles(GAS_PLASMA, 70)
Rad.drainratio = 0
Rad.loaded_tank = Plasma
Plasma.forceMove(Rad)
diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm
index 950bf0ff96c6..880c155b19cf 100644
--- a/code/modules/admin/verbs/diagnostics.dm
+++ b/code/modules/admin/verbs/diagnostics.dm
@@ -10,7 +10,7 @@
for(var/id in env.get_gases())
var/moles = env.get_moles(id)
if (abs(moles) >= 0.00001)
- lines += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [moles] mol"
+ lines += "[GLOB.gas_data.names[id]]: [moles] mol"
to_chat(usr, lines.Join("\n"))
/client/proc/air_status(turf/target)
diff --git a/code/modules/antagonists/blob/structures/_blob.dm b/code/modules/antagonists/blob/structures/_blob.dm
index a89241db2c5a..143b60d8b2ab 100644
--- a/code/modules/antagonists/blob/structures/_blob.dm
+++ b/code/modules/antagonists/blob/structures/_blob.dm
@@ -64,7 +64,7 @@
result++
. -= result - 1
-/obj/structure/blob/BlockSuperconductivity()
+/obj/structure/blob/BlockThermalConductivity()
return atmosblock
/obj/structure/blob/CanAllowThrough(atom/movable/mover, turf/target)
diff --git a/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm b/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm
index 7b7c3174fd3d..118e4826e73f 100644
--- a/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm
+++ b/code/modules/antagonists/clockcult/clock_effects/servant_blocker.dm
@@ -30,7 +30,7 @@
return FALSE
return TRUE
-/obj/effect/clockwork/servant_blocker/BlockSuperconductivity()
+/obj/effect/clockwork/servant_blocker/BlockThermalConductivity()
return TRUE
/obj/effect/clockwork/servant_blocker/singularity_act()
diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm
index aa3b41cefa0a..cbd28060c210 100644
--- a/code/modules/antagonists/cult/runes.dm
+++ b/code/modules/antagonists/cult/runes.dm
@@ -679,7 +679,7 @@ structure_check() searches for nearby cultist structures required for the invoca
GLOB.wall_runes -= src
return ..()
-/obj/effect/rune/wall/BlockSuperconductivity()
+/obj/effect/rune/wall/BlockThermalConductivity()
return density
/obj/effect/rune/wall/invoke(var/list/invokers)
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index be8708ffcd23..7662d03c8ec2 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -142,7 +142,7 @@
return
/obj/item/tank/proc/ignite() //This happens when a bomb is told to explode
- var/fuel_moles = air_contents.get_moles(/datum/gas/plasma) + air_contents.get_moles(/datum/gas/oxygen)/6
+ var/fuel_moles = air_contents.get_moles(GAS_PLASMA) + air_contents.get_moles(GAS_O2)/6
var/datum/gas_mixture/bomb_mixture = air_contents.copy()
var/strength = 1
@@ -192,9 +192,8 @@
ground_zero.air_update_turf()
/obj/item/tank/proc/release() //This happens when the bomb is not welded. Tank contents are just spat out.
- var/datum/gas_mixture/removed = air_contents.remove(air_contents.total_moles())
var/turf/T = get_turf(src)
if(!T)
return
- T.assume_air(removed)
+ T.assume_air(air_contents)
air_update_turf()
diff --git a/code/modules/atmospherics/auxgm/breathing_classes.dm b/code/modules/atmospherics/auxgm/breathing_classes.dm
new file mode 100644
index 000000000000..f04f89a4195f
--- /dev/null
+++ b/code/modules/atmospherics/auxgm/breathing_classes.dm
@@ -0,0 +1,37 @@
+// Breathing classes are, yes, just a list of gases, associated with numbers.
+// But they're very simple: pluoxium's status as O2 * 8 is represented here,
+// with a single line of code, no hardcoding and special-casing across the codebase.
+// Not only that, but they're very general: you could have a negative value
+// to simulate asphyxiants, e.g. if I add krypton it could go into the oxygen
+// breathing class at -7, simulating krypton narcosis.
+
+/datum/breathing_class
+ var/list/gases = null
+ var/list/products = null
+ var/danger_reagent = null
+ var/low_alert_category = "not_enough_oxy"
+ var/low_alert_datum = /obj/screen/alert/not_enough_oxy
+ var/high_alert_category = "too_much_oxy"
+ var/high_alert_datum = /obj/screen/alert/too_much_oxy
+
+/datum/breathing_class/oxygen
+ gases = list(
+ GAS_O2 = 1,
+ GAS_PLUOXIUM = 8,
+ GAS_CO2 = -0.7, // CO2 isn't actually toxic, just an asphyxiant
+ )
+ products = list(
+ GAS_CO2 = 1,
+ )
+
+/datum/breathing_class/plasma
+ gases = list(
+ GAS_PLASMA = 1
+ )
+ products = list(
+ GAS_CO2 = 1
+ )
+ low_alert_category = "not_enough_tox"
+ low_alert_datum = /obj/screen/alert/not_enough_tox
+ high_alert_category = "too_much_tox"
+ high_alert_datum = /obj/screen/alert/too_much_tox
diff --git a/code/modules/atmospherics/auxgm/gas_types.dm b/code/modules/atmospherics/auxgm/gas_types.dm
new file mode 100644
index 000000000000..ea89c1550e66
--- /dev/null
+++ b/code/modules/atmospherics/auxgm/gas_types.dm
@@ -0,0 +1,200 @@
+/datum/gas/oxygen
+ id = GAS_O2
+ specific_heat = 20
+ name = "Oxygen"
+ oxidation_temperature = T0C - 100 // it checks max of this and fire temperature, so rarely will things spontaneously combust
+
+/datum/gas/nitrogen
+ id = GAS_N2
+ specific_heat = 20
+ breath_alert_info = list(
+ not_enough_alert = list(
+ alert_category = "not_enough_nitro",
+ alert_type = /obj/screen/alert/not_enough_nitro
+ ),
+ too_much_alert = list(
+ alert_category = "too_much_nitro",
+ alert_type = /obj/screen/alert/too_much_nitro
+ )
+ )
+ name = "Nitrogen"
+
+/datum/gas/carbon_dioxide //what the fuck is this?
+ id = GAS_CO2
+ specific_heat = 30
+ name = "Carbon Dioxide"
+ breath_results = GAS_O2
+ breath_alert_info = list(
+ not_enough_alert = list(
+ alert_category = "not_enough_co2",
+ alert_type = /obj/screen/alert/not_enough_co2
+ ),
+ too_much_alert = list(
+ alert_category = "too_much_co2",
+ alert_type = /obj/screen/alert/too_much_co2
+ )
+ )
+ fusion_power = 3
+ enthalpy = -393500
+
+/datum/gas/plasma
+ id = GAS_PLASMA
+ specific_heat = 200
+ name = "Plasma"
+ gas_overlay = "plasma"
+ moles_visible = MOLES_GAS_VISIBLE
+ flags = GAS_FLAG_DANGEROUS
+ fire_burn_rate = OXYGEN_BURN_RATE_BASE // named when plasma fires were the only fires, surely
+ fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
+ fire_products = "plasma_fire"
+ enthalpy = FIRE_PLASMA_ENERGY_RELEASED // 3000000, 3 megajoules, 3000 kj
+
+/datum/gas/water_vapor
+ id = GAS_H2O
+ specific_heat = 40
+ name = "Water Vapor"
+ gas_overlay = "water_vapor"
+ moles_visible = MOLES_GAS_VISIBLE
+ fusion_power = 8
+ breath_reagent = /datum/reagent/water
+ enthalpy = -241800 // FIRE_HYDROGEN_ENERGY_RELEASED is actually what this was supposed to be
+
+/datum/gas/hypernoblium
+ id = GAS_HYPERNOB
+ specific_heat = 2000
+ name = "Hyper-noblium"
+ gas_overlay = "freon"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/nitrous_oxide
+ id = GAS_NITROUS
+ specific_heat = 40
+ name = "Nitrous Oxide"
+ gas_overlay = "nitrous_oxide"
+ moles_visible = MOLES_GAS_VISIBLE * 2
+ flags = GAS_FLAG_DANGEROUS
+ fire_products = list(GAS_N2 = 1)
+ oxidation_rate = 0.5
+ oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 100
+ enthalpy = 81600
+
+/datum/gas/nitryl
+ id = GAS_NITRYL
+ specific_heat = 20
+ name = "Nitryl"
+ gas_overlay = "nitryl"
+ moles_visible = MOLES_GAS_VISIBLE
+ flags = GAS_FLAG_DANGEROUS
+ fusion_power = 15
+ fire_products = list(GAS_N2 = 0.5)
+ enthalpy = 33200
+ oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
+
+/datum/gas/tritium
+ id = GAS_TRITIUM
+ specific_heat = 10
+ name = "Tritium"
+ gas_overlay = "tritium"
+ moles_visible = MOLES_GAS_VISIBLE
+ flags = GAS_FLAG_DANGEROUS
+ fusion_power = 1
+ fire_products = list(GAS_H2O = 1)
+ enthalpy = 40000
+ fire_burn_rate = 2
+ fire_radiation_released = 50 // arbitrary number, basically 60 moles of trit burning will just barely start to harm you
+ fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
+
+/datum/gas/bz
+ id = GAS_BZ
+ specific_heat = 20
+ name = "BZ"
+ flags = GAS_FLAG_DANGEROUS
+ fusion_power = 8
+ enthalpy = FIRE_CARBON_ENERGY_RELEASED // it is a mystery
+
+/datum/gas/stimulum
+ id = GAS_STIMULUM
+ specific_heat = 5
+ name = "Stimulum"
+ fusion_power = 7
+
+/datum/gas/pluoxium
+ id = GAS_PLUOXIUM
+ specific_heat = 80
+ name = "Pluoxium"
+ fusion_power = 10
+ oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 1000 // it is VERY stable
+ oxidation_rate = 8
+ enthalpy = -50000 // but it reduces the heat output a bit
+
+/datum/gas/miasma
+ id = GAS_MIASMA
+ specific_heat = 20
+ fusion_power = 50
+ name = "Miasma"
+ gas_overlay = "miasma"
+ moles_visible = MOLES_GAS_VISIBLE * 60
+
+/datum/gas/hydrogen
+ id = GAS_H2
+ specific_heat = 10
+ name = "Hydrogen"
+ flags = GAS_FLAG_DANGEROUS
+ fusion_power = 0
+ fire_products = list(GAS_H2O = 1)
+ fire_burn_rate = 2
+ fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
+
+/datum/gas/freon
+ id = GAS_FREON
+ specific_heat = 600
+ moles_visible = MOLES_GAS_VISIBLE *30
+ fusion_power = -5
+ name = "Hyper-noblium"
+ gas_overlay = "freon"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/healium
+ id = GAS_HEALIUM
+ specific_heat = 10
+ name = "Healium"
+ gas_overlay = "healium"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/pluonium
+ id = GAS_PLUONIUM
+ specific_heat = 30
+ name = "Pluonium"
+ flags = GAS_FLAG_DANGEROUS
+ gas_overlay = "pluonium"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/halon
+ id = GAS_HALON
+ specific_heat = 175
+ name = "Halon"
+ flags = GAS_FLAG_DANGEROUS
+ gas_overlay = "halon"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/zauker
+ id = GAS_ZAUKER
+ specific_heat = 350
+ name = "Zauker"
+ flags = GAS_FLAG_DANGEROUS
+ gas_overlay = "zauker"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/hexane
+ id = GAS_HEXANE
+ specific_heat = 5
+ name = "Hexane"
+ flags = GAS_FLAG_DANGEROUS
+ gas_overlay = "hexane"
+ moles_visible = MOLES_GAS_VISIBLE
+
+/datum/gas/dilithium // Main point is that this helps fusion occur at a significantly lower temperature than normal
+ id = GAS_DILITHIUM
+ specific_heat = 55
+ name = "Dilithium"
+ fusion_power = 1
diff --git a/code/modules/atmospherics/environmental/LINDA_fire.dm b/code/modules/atmospherics/environmental/LINDA_fire.dm
index e1fbf5f2c2bf..3db06eea9a9d 100644
--- a/code/modules/atmospherics/environmental/LINDA_fire.dm
+++ b/code/modules/atmospherics/environmental/LINDA_fire.dm
@@ -13,30 +13,21 @@
if(!air)
return
- var/oxy = air.get_moles(/datum/gas/oxygen)
- if (oxy < 0.5)
+ if (air.get_oxidation_power(exposed_temperature) < 0.5)
return
- var/tox = air.get_moles(/datum/gas/plasma)
- var/trit = air.get_moles(/datum/gas/tritium)
- var/h2 = air.get_moles(/datum/gas/hydrogen)
-
+ var/has_fuel = air.get_moles(GAS_PLASMA) > 0.5 || air.get_moles(GAS_TRITIUM) > 0.5 || air.get_fuel_amount(exposed_temperature) > 0.5
if(active_hotspot)
if(soh)
- if(tox > 0.5 || trit > 0.5 || h2 > 0.5)
+ if(has_fuel)
if(active_hotspot.temperature < exposed_temperature)
active_hotspot.temperature = exposed_temperature
if(active_hotspot.volume < exposed_volume)
active_hotspot.volume = exposed_volume
return
- if((exposed_temperature > PLASMA_MINIMUM_BURN_TEMPERATURE) && (tox > 0.5 || trit > 0.5 || h2 > 0.5))
-
+ if((exposed_temperature > PLASMA_MINIMUM_BURN_TEMPERATURE) && has_fuel)
active_hotspot = new /obj/effect/hotspot(src, exposed_volume*25, exposed_temperature)
- active_hotspot.just_spawned = (current_cycle < SSair.times_fired)
- //remove just_spawned protection if no longer processing this cell
- SSair.add_to_active(src, 0)
-
//This is the icon for fire on turfs, also helps for nurturing small fires until they are full tile
/obj/effect/hotspot
anchored = TRUE
@@ -168,7 +159,7 @@
return
//Not enough / nothing to burn
- if(!location.air || (INSUFFICIENT(/datum/gas/plasma) && INSUFFICIENT(/datum/gas/tritium)) && INSUFFICIENT(/datum/gas/hydrogen) || INSUFFICIENT(/datum/gas/oxygen))
+ if(!location.air || location.air.get_oxidation_power() < 0.5 || (INSUFFICIENT(GAS_PLASMA) && INSUFFICIENT(GAS_TRITIUM) && location.air.get_fuel_amount() < 0.5))
qdel(src)
return
diff --git a/code/modules/atmospherics/environmental/LINDA_system.dm b/code/modules/atmospherics/environmental/LINDA_system.dm
index 21dc6069a6c2..3bb447496b6a 100644
--- a/code/modules/atmospherics/environmental/LINDA_system.dm
+++ b/code/modules/atmospherics/environmental/LINDA_system.dm
@@ -18,58 +18,54 @@
/turf/open/CanAtmosPass(turf/T, vertical = FALSE)
var/dir = vertical? get_dir_multiz(src, T) : get_dir(src, T)
- var/opp = dir_inverse_multiz(dir)
- var/R = FALSE
+ var/opp = REVERSE_DIR(dir)
+ . = TRUE
if(vertical && !(zAirOut(dir, T) && T.zAirIn(dir, src)))
- R = TRUE
+ . = FALSE
if(blocks_air || T.blocks_air)
- R = TRUE
+ . = FALSE
if (T == src)
- return !R
+ return .
for(var/obj/O in contents+T.contents)
var/turf/other = (O.loc == src ? T : src)
if(!(vertical? (CANVERTICALATMOSPASS(O, other)) : (CANATMOSPASS(O, other))))
- R = TRUE
- if(O.BlockSuperconductivity()) //the direction and open/closed are already checked on CanAtmosPass() so there are no arguments
- atmos_supeconductivity |= dir
- T.atmos_supeconductivity |= opp
- return FALSE //no need to keep going, we got all we asked
-
- atmos_supeconductivity &= ~dir
- T.atmos_supeconductivity &= ~opp
-
- return !R
-
-/atom/movable/proc/BlockSuperconductivity() // objects that block air and don't let superconductivity act. Only firelocks atm.
+ . = FALSE
+ if(O.BlockThermalConductivity()) //the direction and open/closed are already checked on CanAtmosPass() so there are no arguments
+ conductivity_blocked_directions |= dir
+ T.conductivity_blocked_directions |= opp
+ if(!.)
+ return .
+
+/atom/movable/proc/BlockThermalConductivity() // Objects that don't let heat through.
return FALSE
/turf/proc/ImmediateCalculateAdjacentTurfs()
- var/canpass = CANATMOSPASS(src, src)
+ var/canpass = CANATMOSPASS(src, src)
var/canvpass = CANVERTICALATMOSPASS(src, src)
for(var/direction in GLOB.cardinals_multiz)
var/turf/T = get_step_multiz(src, direction)
- var/opp_dir = dir_inverse_multiz(direction)
- if(!isopenturf(T))
+ if(!istype(T))
continue
- if(!(blocks_air || T.blocks_air) && ((direction & (UP|DOWN))? (canvpass && CANVERTICALATMOSPASS(T, src)) : (canpass && CANATMOSPASS(T, src))) )
+ var/opp_dir = REVERSE_DIR(direction)
+ if(isopenturf(T) && !(blocks_air || T.blocks_air) && ((direction & (UP|DOWN))? (canvpass && CANVERTICALATMOSPASS(T, src)) : (canpass && CANATMOSPASS(T, src))) )
LAZYINITLIST(atmos_adjacent_turfs)
LAZYINITLIST(T.atmos_adjacent_turfs)
atmos_adjacent_turfs[T] = direction
T.atmos_adjacent_turfs[src] = opp_dir
- T.__update_extools_adjacent_turfs()
else
if (atmos_adjacent_turfs)
atmos_adjacent_turfs -= T
if (T.atmos_adjacent_turfs)
T.atmos_adjacent_turfs -= src
- T.__update_extools_adjacent_turfs()
UNSETEMPTY(T.atmos_adjacent_turfs)
+ T.__update_auxtools_turf_adjacency_info(isspaceturf(T.get_z_base_turf()))
UNSETEMPTY(atmos_adjacent_turfs)
src.atmos_adjacent_turfs = atmos_adjacent_turfs
- __update_extools_adjacent_turfs()
+ __update_auxtools_turf_adjacency_info(isspaceturf(get_z_base_turf()))
-/turf/proc/__update_extools_adjacent_turfs()
+/turf/proc/set_sleeping(should_sleep)
+/turf/proc/__update_auxtools_turf_adjacency_info()
//returns a list of adjacent turfs that can share air with this one.
//alldir includes adjacent diagonal tiles that can share
@@ -115,7 +111,6 @@
/turf/air_update_turf(command = 0)
if(command)
ImmediateCalculateAdjacentTurfs()
- SSair.add_to_active(src,command)
/atom/movable/proc/move_update_air(turf/T)
if(isturf(T))
@@ -134,7 +129,4 @@
var/datum/gas_mixture/G = new
G.parse_gas_string(text)
-
- air.merge(G)
- archive()
- SSair.add_to_active(src, 0)
+ assume_air(G)
diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm
index 9469bd9121a9..fc1499397d49 100644
--- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm
+++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm
@@ -1,18 +1,12 @@
/turf
- //used for temperature calculations
+ //conductivity is divided by 10 when interacting with air for balance purposes
var/thermal_conductivity = 0.05
var/heat_capacity = 1
- var/temperature_archived
//list of open turfs adjacent to us
var/list/atmos_adjacent_turfs
- //bitfield of dirs in which we are superconducitng
- var/atmos_supeconductivity = NONE
- var/is_openturf = FALSE // used by extools shizz.
-
- //used to determine whether we should archive
- var/archived_cycle = 0
- var/current_cycle = 0
+ //bitfield of dirs in which we thermal conductivity is blocked
+ var/conductivity_blocked_directions = NONE
//used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...)
//string parsed by /datum/gas/proc/copy_from_turf
@@ -32,21 +26,17 @@
var/planetary_atmos = FALSE //air will revert to initial_gas_mix over time
var/list/atmos_overlay_types //gas IDs of current active gas overlays
- is_openturf = TRUE
/turf/open/Initialize()
if(!blocks_air)
- air = new
+ air = new(2500,src)
air.copy_from_turf(src)
- update_air_ref()
+ update_air_ref(planetary_atmos ? 1 : 2)
. = ..()
/turf/open/Destroy()
if(active_hotspot)
QDEL_NULL(active_hotspot)
- // Adds the adjacent turfs to the current atmos processing
- for(var/T in atmos_adjacent_turfs)
- SSair.add_to_active(T)
return ..()
/turf/proc/update_air_ref()
@@ -54,16 +44,52 @@
/////////////////GAS MIXTURE PROCS///////////////////
/turf/open/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air
+ return assume_air_ratio(giver, 1)
+
+/turf/open/assume_air_moles(datum/gas_mixture/giver, moles)
if(!giver)
return FALSE
- air.merge(giver)
- update_visuals()
+ if(SSair.thread_running())
+ SSair.deferred_airs += list(list(giver, air, moles / giver.total_moles()))
+ else
+ giver.transfer_to(air, moles)
+ return TRUE
+
+/turf/open/assume_air_ratio(datum/gas_mixture/giver, ratio)
+ if(!giver)
+ return FALSE
+ if(SSair.thread_running())
+ SSair.deferred_airs += list(list(giver, air, ratio))
+ else
+ giver.transfer_ratio_to(air, ratio)
+ return TRUE
+
+/turf/open/transfer_air(datum/gas_mixture/taker, moles)
+ if(!taker || !return_air()) // shouldn't transfer from space
+ return FALSE
+ if(SSair.thread_running())
+ SSair.deferred_airs += list(list(air, taker, moles / air.total_moles()))
+ else
+ air.transfer_to(taker, moles)
+ return TRUE
+
+/turf/open/transfer_air_ratio(datum/gas_mixture/taker, ratio)
+ if(!taker || !return_air())
+ return FALSE
+ if(SSair.thread_running())
+ SSair.deferred_airs += list(list(air, taker, ratio))
+ else
+ air.transfer_ratio_to(taker, ratio)
return TRUE
/turf/open/remove_air(amount)
var/datum/gas_mixture/ours = return_air()
var/datum/gas_mixture/removed = ours.remove(amount)
- update_visuals()
+ return removed
+
+/turf/open/remove_air_ratio(ratio)
+ var/datum/gas_mixture/ours = return_air()
+ var/datum/gas_mixture/removed = ours.remove_ratio(ratio)
return removed
/turf/open/proc/copy_air_with_tile(turf/open/T)
@@ -84,17 +110,13 @@
RETURN_TYPE(/datum/gas_mixture)
return air
+/turf/open/return_analyzable_air()
+ return return_air()
+
/turf/temperature_expose()
- if(temperature > heat_capacity)
+ if(return_temperature() > heat_capacity)
to_be_destroyed = TRUE
-/turf/proc/archive()
- temperature_archived = temperature
-
-/turf/open/archive()
- air.archive()
- archived_cycle = SSair.times_fired
- temperature_archived = temperature
/turf/open/proc/eg_reset_cooldowns()
/turf/open/proc/eg_garbage_collect()
@@ -117,12 +139,12 @@
src.atmos_overlay_types = null
return
+
for(var/id in air.get_gases())
- if(nonoverlaying_gases[id])
+ if (nonoverlaying_gases[id])
continue
- var/gas_meta = GLOB.meta_gas_info[id]
- var/gas_overlay = gas_meta[META_GAS_OVERLAY]
- if(gas_overlay && air.get_moles(id) > gas_meta[META_GAS_MOLES_VISIBLE])
+ var/gas_overlay = GLOB.gas_data.overlays[id]
+ if(gas_overlay && air.get_moles(id) > GLOB.gas_data.visibility[id])
new_overlay_types += gas_overlay[min(FACTOR_GAS_VISIBLE_MAX, CEILING(air.get_moles(id) / MOLES_GAS_VISIBLE_STEP, 1))]
if (atmos_overlay_types)
@@ -156,34 +178,27 @@
for (var/gastype in subtypesof(/datum/gas))
var/datum/gas/gasvar = gastype
if (!initial(gasvar.gas_overlay))
- .[gastype] = TRUE
+ .[initial(gasvar.id)] = TRUE
/////////////////////////////SIMULATION///////////////////////////////////
-/*#define LAST_SHARE_CHECK \
- var/last_share = our_air.get_last_share();\
- if(last_share > MINIMUM_AIR_TO_SUSPEND){\
- our_excited_group.reset_cooldowns();\
- cached_atmos_cooldown = 0;\
- } else if(last_share > MINIMUM_MOLES_DELTA_TO_MOVE) {\
- our_excited_group.dismantle_cooldown = 0;\
- cached_atmos_cooldown = 0;\
- }
-*/
/turf/proc/process_cell(fire_count)
- SSair.remove_from_active(src)
/turf/open/proc/equalize_pressure_in_zone(cyclenum)
/turf/open/proc/consider_firelocks(turf/T2)
var/reconsider_adj = FALSE
+ for(var/obj/machinery/atmospherics/components/unary/vent_pump/stopped in T2)
+ stopped.on = FALSE
+ for(var/obj/machinery/atmospherics/components/unary/vent_pump/stopped in src)
+ stopped.on = FALSE
for(var/obj/machinery/door/firedoor/FD in T2)
- if((FD.flags_1 & ON_BORDER_1) && get_dir(T2, src) != FD.dir)
- continue
+ /*if((FD.flags_1 & ON_BORDER_1) && get_dir(T2, src) != FD.dir)
+ continue*/
FD.emergency_pressure_stop()
reconsider_adj = TRUE
for(var/obj/machinery/door/firedoor/FD in src)
- if((FD.flags_1 & ON_BORDER_1) && get_dir(src, T2) != FD.dir)
- continue
+ /*if((FD.flags_1 & ON_BORDER_1) && get_dir(src, T2) != FD.dir)
+ continue*/
FD.emergency_pressure_stop()
reconsider_adj = TRUE
if(reconsider_adj)
@@ -191,14 +206,25 @@
/turf/proc/handle_decompression_floor_rip()
/turf/open/floor/handle_decompression_floor_rip(sum)
- if(sum > 20 && prob(clamp(sum / 10, 0, 30)))
- remove_tile()
+ if(sum > 20 && prob(clamp(sum / 20, 0, 15)))
+ if(floor_tile)
+ new floor_tile(src)
+ make_plating()
+
+/turf/open/floor/plating/handle_decompression_floor_rip()
+ return
+
+/turf/open/floor/engine/handle_decompression_floor_rip()
+ return
/turf/open/process_cell(fire_count)
//////////////////////////SPACEWIND/////////////////////////////
-/turf/open/proc/consider_pressure_difference(turf/T, difference)
+/turf/proc/consider_pressure_difference()
+ return
+
+/turf/open/consider_pressure_difference(turf/T, difference)
SSair.high_pressure_delta |= src
if(difference > pressure_difference)
pressure_direction = get_dir(src, T)
@@ -215,14 +241,12 @@
M = thing
if (!M.anchored && !M.pulledby && M.last_high_pressure_movement_air_cycle < SSair.times_fired)
M.experience_pressure_difference(pressure_difference * multiplier, pressure_direction, 0, pressure_specific_target)
- if(pressure_difference > 100)
- new /obj/effect/temp_visual/dir_setting/space_wind(src, pressure_direction, clamp(round(sqrt(pressure_difference) * 2), 10, 255))
/atom/movable/var/pressure_resistance = 10
/atom/movable/var/last_high_pressure_movement_air_cycle = 0
/atom/movable/proc/experience_pressure_difference(pressure_difference, direction, pressure_resistance_prob_delta = 0, throw_target)
- var/const/PROBABILITY_OFFSET = 25
+ var/const/PROBABILITY_OFFSET = 40
var/const/PROBABILITY_BASE_PRECENT = 10
var/max_force = sqrt(pressure_difference)*(MOVE_FORCE_DEFAULT / 5)
set waitfor = 0
@@ -232,124 +256,13 @@
move_prob += pressure_resistance_prob_delta
if (move_prob > PROBABILITY_OFFSET && prob(move_prob) && (move_resist != INFINITY) && (!anchored && (max_force >= (move_resist * MOVE_FORCE_PUSH_RATIO))) || (anchored && (max_force >= (move_resist * MOVE_FORCE_FORCEPUSH_RATIO))))
var/move_force = max_force * clamp(move_prob, 0, 100) / 100
- if(move_force > 4000)
+ if(move_force > 6000)
// WALLSLAM HELL TIME OH BOY
var/turf/throw_turf = get_ranged_target_turf(get_turf(src), direction, round(move_force / 2000))
if(throw_target && (get_dir(src, throw_target) & direction))
throw_turf = get_turf(throw_target)
- var/throw_speed = clamp(round(move_force / 2000), 1, 10)
- if(iscarbon(src))
- throw_speed = min(throw_speed, 4)
- throw_at(throw_turf, move_force / 2000, throw_speed)
+ var/throw_speed = clamp(round(move_force / 3000), 1, 10)
+ throw_at(throw_turf, move_force / 3000, throw_speed)
else
step(src, direction)
last_high_pressure_movement_air_cycle = SSair.times_fired
-
-////////////////////////SUPERCONDUCTIVITY/////////////////////////////
-/turf/proc/conductivity_directions()
- if(archived_cycle < SSair.times_fired)
- archive()
- return NORTH|SOUTH|EAST|WEST
-
-/turf/open/conductivity_directions()
- if(blocks_air)
- return ..()
- for(var/direction in GLOB.cardinals)
- var/turf/T = get_step(src, direction)
- if(!(T in atmos_adjacent_turfs) && !(atmos_supeconductivity & direction))
- . |= direction
-
-/turf/proc/neighbor_conduct_with_src(turf/open/other)
- if(!other.blocks_air) //Open but neighbor is solid
- other.temperature_share_open_to_solid(src)
- else //Both tiles are solid
- other.share_temperature_mutual_solid(src, thermal_conductivity)
- temperature_expose(null, temperature, null)
-
-/turf/open/neighbor_conduct_with_src(turf/other)
- if(blocks_air)
- ..()
- return
-
- if(!other.blocks_air) //Both tiles are open
- var/turf/open/T = other
- T.air.temperature_share(air, WINDOW_HEAT_TRANSFER_COEFFICIENT)
- else //Solid but neighbor is open
- temperature_share_open_to_solid(other)
- SSair.add_to_active(src, 0)
-
-/turf/proc/super_conduct()
- var/conductivity_directions = conductivity_directions()
-
- if(conductivity_directions)
- //Conduct with tiles around me
- for(var/direction in GLOB.cardinals)
- if(conductivity_directions & direction)
- var/turf/neighbor = get_step(src,direction)
-
- if(!neighbor.thermal_conductivity)
- continue
-
- if(neighbor.archived_cycle < SSair.times_fired)
- neighbor.archive()
-
- neighbor.neighbor_conduct_with_src(src)
-
- neighbor.consider_superconductivity()
-
- radiate_to_spess()
-
- finish_superconduction()
-
-/turf/proc/finish_superconduction(temp = temperature)
- //Make sure still hot enough to continue conducting heat
- if(temp < MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION)
- SSair.active_super_conductivity -= src
- return FALSE
-
-/turf/open/finish_superconduction()
- //Conduct with air on my tile if I have it
- if(!blocks_air)
- temperature = air.temperature_share(null, thermal_conductivity, temperature, heat_capacity)
- ..((blocks_air ? temperature : air.return_temperature()))
-
-/turf/proc/consider_superconductivity()
- if(!thermal_conductivity)
- return FALSE
-
- SSair.active_super_conductivity |= src
- return TRUE
-
-/turf/open/consider_superconductivity(starting)
- if(air.return_temperature() < (starting?MINIMUM_TEMPERATURE_START_SUPERCONDUCTION:MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION))
- return FALSE
- if(air.heat_capacity() < M_CELL_WITH_RATIO) // Was: MOLES_CELLSTANDARD*0.1*0.05 Since there are no variables here we can make this a constant.
- return FALSE
- return ..()
-
-/turf/closed/consider_superconductivity(starting)
- if(temperature < (starting?MINIMUM_TEMPERATURE_START_SUPERCONDUCTION:MINIMUM_TEMPERATURE_FOR_SUPERCONDUCTION))
- return FALSE
- return ..()
-
-/turf/proc/radiate_to_spess() //Radiate excess tile heat to space
- if(temperature > T0C) //Considering 0 degC as te break even point for radiation in and out
- var/delta_temperature = (temperature_archived - TCMB) //hardcoded space temperature
- if((heat_capacity > 0) && (abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER))
-
- var/heat = thermal_conductivity*delta_temperature* \
- (heat_capacity*HEAT_CAPACITY_VACUUM/(heat_capacity+HEAT_CAPACITY_VACUUM))
- temperature -= heat/heat_capacity
-
-/turf/open/proc/temperature_share_open_to_solid(turf/sharer)
- sharer.temperature = air.temperature_share(null, sharer.thermal_conductivity, sharer.temperature, sharer.heat_capacity)
-
-/turf/proc/share_temperature_mutual_solid(turf/sharer, conduction_coefficient) //to be understood
- var/delta_temperature = (temperature_archived - sharer.temperature_archived)
- if(abs(delta_temperature) > MINIMUM_TEMPERATURE_DELTA_TO_CONSIDER && heat_capacity && sharer.heat_capacity)
-
- var/heat = conduction_coefficient*delta_temperature* \
- (heat_capacity*sharer.heat_capacity/(heat_capacity+sharer.heat_capacity))
-
- temperature -= heat/heat_capacity
- sharer.temperature += heat/sharer.heat_capacity
diff --git a/code/modules/atmospherics/gasmixtures/auxgm.dm b/code/modules/atmospherics/gasmixtures/auxgm.dm
new file mode 100644
index 000000000000..b14e2582edc6
--- /dev/null
+++ b/code/modules/atmospherics/gasmixtures/auxgm.dm
@@ -0,0 +1,128 @@
+GLOBAL_LIST_INIT(hardcoded_gases, list(GAS_O2, GAS_N2, GAS_CO2, GAS_PLASMA)) //the main four gases, which were at one time hardcoded
+GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GAS_PLUOXIUM, GAS_STIMULUM, GAS_NITRYL))) //unable to react amongst themselves
+
+// Auxgm
+// It's a send-up of XGM, like what baystation got.
+// It's got the same architecture as XGM, but it's structured
+// differently to make it more convenient for auxmos.
+
+// Most important compared to TG is that it does away with hardcoded typepaths,
+// which lead to problems on the auxmos end anyway. We cache the string value
+// references on the Rust end, so no performance is lost here.
+
+// Also allows you to add new gases at runtime
+
+/proc/_auxtools_register_gas(datum/gas/gas) // makes sure auxtools knows stuff about this gas
+
+/datum/auxgm
+ var/list/datums = list()
+ var/list/specific_heats = list()
+ var/list/names = list()
+ var/list/visibility = list()
+ var/list/overlays = list()
+ var/list/flags = list()
+ var/list/ids = list()
+ var/list/typepaths = list()
+ var/list/fusion_powers = list()
+ var/list/breathing_classes = list()
+ var/list/breath_results = list()
+ var/list/breath_reagents = list()
+ var/list/breath_reagents_dangerous = list()
+ var/list/breath_alert_info = list()
+ var/list/oxidation_temperatures = list()
+ var/list/oxidation_rates = list()
+ var/list/fire_temperatures = list()
+ var/list/enthalpies = list()
+ var/list/fire_products = list()
+ var/list/fire_burn_rates = list()
+
+/datum/gas
+ var/id = ""
+ var/specific_heat = 0
+ var/name = ""
+ var/gas_overlay = "" //icon_state in icons/effects/atmospherics.dmi
+ var/moles_visible = null
+ var/flags = NONE //currently used by canisters
+ var/fusion_power = 0 // How much the gas destabilizes a fusion reaction
+ var/breath_results = GAS_CO2 // what breathing this breathes out
+ var/breath_reagent = null // what breathing this adds to your reagents
+ var/breath_reagent_dangerous = null // what breathing this adds to your reagents IF it's above a danger threshold
+ var/list/breath_alert_info = null // list for alerts that pop up when you have too much/not enough of something
+ var/oxidation_temperature = null // temperature above which this gas is an oxidizer; null for none
+ var/oxidation_rate = 1 // how many moles of this can oxidize how many moles of material
+ var/fire_temperature = null // temperature above which gas may catch fire; null for none
+ var/list/fire_products = null // what results when this gas is burned (oxidizer or fuel); null for none
+ var/enthalpy = 0 // Standard enthalpy of formation in joules, used for fires
+ var/fire_burn_rate = 1 // how many moles are burned per product released
+ var/fire_radiation_released = 0 // How much radiation is released when this gas burns
+
+/datum/gas/proc/breath(partial_pressure, light_threshold, heavy_threshold, moles, mob/living/carbon/C, obj/item/organ/lungs/lungs)
+ // This is only called on gases with the GAS_FLAG_BREATH_PROC flag. When possible, do NOT use this--
+ // greatly prefer just adding a reagent. This is mostly around for legacy reasons.
+ return null
+
+/datum/auxgm/proc/add_gas(datum/gas/gas)
+ var/g = gas.id
+ if(g)
+ datums[g] = gas
+ specific_heats[g] = gas.specific_heat
+ names[g] = gas.name
+ if(gas.moles_visible)
+ visibility[g] = gas.moles_visible
+ overlays[g] = new /list(FACTOR_GAS_VISIBLE_MAX)
+ for(var/i in 1 to FACTOR_GAS_VISIBLE_MAX)
+ overlays[g][i] = new /obj/effect/overlay/gas(gas.gas_overlay, i * 255 / FACTOR_GAS_VISIBLE_MAX)
+ else
+ visibility[g] = 0
+ overlays[g] = 0
+ flags[g] = gas.flags
+ ids[g] = g
+ typepaths[g] = gas.type
+ fusion_powers[g] = gas.fusion_power
+
+ if(gas.breath_alert_info)
+ breath_alert_info[g] = gas.breath_alert_info
+ breath_results[g] = gas.breath_results
+ if(gas.breath_reagent)
+ breath_reagents[g] = gas.breath_reagent
+ if(gas.breath_reagent_dangerous)
+ breath_reagents_dangerous[g] = gas.breath_reagent_dangerous
+ if(gas.oxidation_temperature)
+ oxidation_temperatures[g] = gas.oxidation_temperature
+ oxidation_rates[g] = gas.oxidation_rate
+ if(gas.fire_products)
+ fire_products[g] = gas.fire_products
+ enthalpies[g] = gas.enthalpy
+ else if(gas.fire_temperature)
+ fire_temperatures[g] = gas.fire_temperature
+ fire_burn_rates[g] = gas.fire_burn_rate
+ if(gas.fire_products)
+ fire_products[g] = gas.fire_products
+ enthalpies[g] = gas.enthalpy
+ _auxtools_register_gas(gas)
+
+/proc/finalize_gas_refs()
+
+/datum/auxgm/New()
+ for(var/gas_path in subtypesof(/datum/gas))
+ var/datum/gas/gas = new gas_path
+ add_gas(gas)
+ for(var/breathing_class_path in subtypesof(/datum/breathing_class))
+ var/datum/breathing_class/class = new breathing_class_path
+ breathing_classes[breathing_class_path] = class
+ finalize_gas_refs()
+
+GLOBAL_DATUM_INIT(gas_data, /datum/auxgm, new)
+
+/obj/effect/overlay/gas
+ icon = 'icons/effects/atmospherics.dmi'
+ mouse_opacity = MOUSE_OPACITY_TRANSPARENT
+ anchored = TRUE // should only appear in vis_contents, but to be safe
+ layer = FLY_LAYER
+ appearance_flags = TILE_BOUND
+ vis_flags = NONE
+
+/obj/effect/overlay/gas/New(state, alph)
+ . = ..()
+ icon_state = state
+ alpha = alph
diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm
index 96a72f312475..aa0d770f29dc 100644
--- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm
+++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm
@@ -7,41 +7,112 @@ What are the archived variables for?
#define MINIMUM_MOLE_COUNT 0.01
#define QUANTIZE(variable) (round(variable,0.0000001))/*I feel the need to document what happens here. Basically this is used to catch most rounding errors, however it's previous value made it so that
once gases got hot enough, most procedures wouldnt occur due to the fact that the mole counts would get rounded away. Thus, we lowered it a few orders of magnititude */
-GLOBAL_LIST_INIT(meta_gas_info, meta_gas_list()) //see ATMOSPHERICS/gas_types.dm
-GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
-
-/proc/init_gaslist_cache()
- . = list()
- for(var/id in GLOB.meta_gas_info)
- var/list/cached_gas = new(3)
-
- .[id] = cached_gas
-
- cached_gas[MOLES] = 0
- cached_gas[ARCHIVE] = 0
- cached_gas[GAS_META] = GLOB.meta_gas_info[id]
/datum/gas_mixture
+ /// Never ever set this variable, hooked into vv_get_var for view variables viewing.
+ var/gas_list_view_only
var/initial_volume = CELL_VOLUME //liters
var/list/reaction_results
var/list/analyzer_results //used for analyzer feedback - not initialized until its used
- var/_extools_pointer_gasmixture = 0 // Contains the memory address of the shared_ptr object for this gas mixture in c++ land. Don't. Touch. This. Var.
+ var/_extools_pointer_gasmixture // Contains the index in the gas vector for this gas mixture in rust land. Don't. Touch. This. Var.
+
+GLOBAL_LIST_INIT(auxtools_atmos_initialized, FALSE)
+
+/proc/auxtools_atmos_init()
/datum/gas_mixture/New(volume)
if (!isnull(volume))
initial_volume = volume
- ATMOS_EXTOOLS_CHECK
+ AUXTOOLS_CHECK(AUXMOS)
+ if(!GLOB.auxtools_atmos_initialized && auxtools_atmos_init())
+ GLOB.auxtools_atmos_initialized = TRUE
__gasmixture_register()
reaction_results = new
+/*
+we use a hook instead
+/datum/gas_mixture/Del()
+ __gasmixture_unregister()
+ . = ..()
+*/
+
/datum/gas_mixture/vv_edit_var(var_name, var_value)
if(var_name == "_extools_pointer_gasmixture")
return FALSE // please no. segfaults bad.
+ if(var_name == "gas_list_view_only")
+ return FALSE
return ..()
+
+/datum/gas_mixture/vv_get_var(var_name)
+ . = ..()
+ if(var_name == "gas_list_view_only")
+ var/list/dummy = get_gases()
+ for(var/gas in dummy)
+ dummy[gas] = get_moles(gas)
+ dummy["CAP [gas]"] = partial_heat_capacity(gas)
+ dummy["TEMP"] = return_temperature()
+ dummy["PRESSURE"] = return_pressure()
+ dummy["HEAT CAPACITY"] = heat_capacity()
+ dummy["TOTAL MOLES"] = total_moles()
+ dummy["VOLUME"] = return_volume()
+ dummy["THERMAL ENERGY"] = thermal_energy()
+ return debug_variable("gases (READ ONLY)", dummy, 0, src)
+
/*
-/datum/gas_mixture/Del()
- __gasmixture_unregister()
- . = ..()*/
+/datum/gas_mixture/vv_get_dropdown()
+ . = ..()
+ VV_DROPDOWN_OPTION("", "---")
+ VV_DROPDOWN_OPTION(VV_HK_PARSE_GASSTRING, "Parse Gas String")
+ VV_DROPDOWN_OPTION(VV_HK_EMPTY, "Empty")
+ VV_DROPDOWN_OPTION(VV_HK_SET_MOLES, "Set Moles")
+ VV_DROPDOWN_OPTION(VV_HK_SET_TEMPERATURE, "Set Temperature")
+ VV_DROPDOWN_OPTION(VV_HK_SET_VOLUME, "Set Volume")
+
+/datum/gas_mixture/vv_do_topic(list/href_list)
+ . = ..()
+ if(!.)
+ return
+ if(href_list[VV_HK_PARSE_GASSTRING])
+ var/gasstring = input(usr, "Input Gas String (WARNING: Advanced. Don't use this unless you know how these work.", "Gas String Parse") as text|null
+ if(!istext(gasstring))
+ return
+ log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set to gas string [gasstring].")
+ message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set to gas string [gasstring].")
+ parse_gas_string(gasstring)
+ if(href_list[VV_HK_EMPTY])
+ log_admin("[key_name(usr)] emptied gas mixture [REF(src)].")
+ message_admins("[key_name(usr)] emptied gas mixture [REF(src)].")
+ clear()
+ if(href_list[VV_HK_SET_MOLES])
+ var/list/gases = get_gases()
+ for(var/gas in gases)
+ gases[gas] = get_moles(gas)
+ var/gasid = input(usr, "What kind of gas?", "Set Gas") as null|anything in GLOB.gas_data.ids
+ if(!gasid)
+ return
+ var/amount = input(usr, "Input amount", "Set Gas", gases[gasid] || 0) as num|null
+ if(!isnum(amount))
+ return
+ amount = max(0, amount)
+ log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Set gas [gasid] to [amount] moles.")
+ message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Set gas [gasid] to [amount] moles.")
+ set_moles(gasid, amount)
+ if(href_list[VV_HK_SET_TEMPERATURE])
+ var/temp = input(usr, "Set the temperature of this mixture to?", "Set Temperature", return_temperature()) as num|null
+ if(!isnum(temp))
+ return
+ temp = max(2.7, temp)
+ log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Changed temperature to [temp].")
+ message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Changed temperature to [temp].")
+ set_temperature(temp)
+ if(href_list[VV_HK_SET_VOLUME])
+ var/volume = input(usr, "Set the volume of this mixture to?", "Set Volume", return_volume()) as num|null
+ if(!isnum(volume))
+ return
+ volume = max(0, volume)
+ log_admin("[key_name(usr)] modified gas mixture [REF(src)]: Changed volume to [volume].")
+ message_admins("[key_name(usr)] modified gas mixture [REF(src)]: Changed volume to [volume].")
+ set_volume(volume)*/
/datum/gas_mixture/proc/__gasmixture_unregister()
/datum/gas_mixture/proc/__gasmixture_register()
@@ -53,7 +124,9 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
L[gt] = initial(G.specific_heat)
return L
-/datum/gas_mixture/proc/heat_capacity(data = MOLES) //joules per kelvin
+/datum/gas_mixture/proc/heat_capacity() //joules per kelvin
+
+/datum/gas_mixture/proc/partial_heat_capacity(gas_type)
/datum/gas_mixture/proc/total_moles()
@@ -66,7 +139,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
/datum/gas_mixture/proc/set_volume(new_volume)
/datum/gas_mixture/proc/get_moles(gas_type)
/datum/gas_mixture/proc/set_moles(gas_type, moles)
-/datum/gas_mixture/proc/scrub_into(datum/gas_mixture/target, list/gases)
+/datum/gas_mixture/proc/scrub_into(datum/gas_mixture/target, ratio, list/gases)
/datum/gas_mixture/proc/mark_immutable()
/datum/gas_mixture/proc/get_gases()
/datum/gas_mixture/proc/multiply(factor)
@@ -74,9 +147,7 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
/datum/gas_mixture/proc/clear()
/datum/gas_mixture/proc/adjust_moles(gas_type, amt = 0)
- if((get_moles(gas_type) + amt) < 0)
- amt = 0
- set_moles(gas_type, get_moles(gas_type) + amt)
+ set_moles(gas_type, clamp(get_moles(gas_type) + amt,0,INFINITY))
/datum/gas_mixture/proc/return_volume() //liters
@@ -87,16 +158,17 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
//Returns: 1 in all cases
/datum/gas_mixture/proc/merge(datum/gas_mixture/giver)
- //Merges all air from giver into self. giver is untouched.
+ //Merges all air from giver into self. Does NOT delete the giver.
//Returns: 1 if we are mutable, 0 otherwise
/datum/gas_mixture/proc/remove(amount)
- //Removes amount of gas from the gas_mixture
+ //Proportionally removes amount of gas from the gas_mixture
//Returns: gas_mixture with the gases removed
/datum/gas_mixture/proc/transfer_to(datum/gas_mixture/target, amount)
- //Transfers amount of gas to target. Equivalent to target.merge(remove(amount)) but faster.
- //Removes amount of gas from the gas_mixture
+
+/datum/gas_mixture/proc/transfer_ratio_to(datum/gas_mixture/target, ratio)
+ //Transfers ratio of gas to target. Equivalent to target.merge(remove_ratio(amount)) but faster.
/datum/gas_mixture/proc/remove_ratio(ratio)
//Proportionally removes amount of gas from the gas_mixture
@@ -134,6 +206,23 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
//Performs various reactions such as combustion or fusion (LOL)
//Returns: 1 if any reaction took place; 0 otherwise
+/datum/gas_mixture/proc/adjust_heat(amt)
+ //Adjusts the thermal energy of the gas mixture, rather than having to do the full calculation.
+ //Returns: null
+
+/datum/gas_mixture/proc/equalize_with(datum/gas_mixture/giver)
+ //Makes this mix have the same temperature and gas ratios as the giver, but with the same pressure, accounting for volume.
+ //Returns: null
+
+/datum/gas_mixture/proc/get_oxidation_power(temp)
+ //Gets how much oxidation this gas can do, optionally at a given temperature.
+
+/datum/gas_mixture/proc/get_fuel_amount(temp)
+ //Gets how much fuel for fires (not counting trit/plasma!) this gas has, optionally at a given temperature.
+
+/proc/equalize_all_gases_in_list(list/L)
+ //Makes every gas in the given list have the same pressure, temperature and gas proportions.
+ //Returns: null
/datum/gas_mixture/proc/__remove()
/datum/gas_mixture/remove(amount)
@@ -156,73 +245,27 @@ GLOBAL_LIST_INIT(gaslist_cache, init_gaslist_cache())
return copy
/datum/gas_mixture/copy_from_turf(turf/model)
+ set_temperature(initial(model.initial_temperature))
parse_gas_string(model.initial_gas_mix)
-
- //acounts for changes in temperature
- var/turf/model_parent = model.parent_type
- if(model.temperature != initial(model.temperature) || model.temperature != initial(model_parent.temperature))
- set_temperature(model.temperature)
-
return 1
/datum/gas_mixture/parse_gas_string(gas_string)
var/list/gas = params2list(gas_string)
if(gas["TEMP"])
- set_temperature(text2num(gas["TEMP"]))
+ var/temp = text2num(gas["TEMP"])
gas -= "TEMP"
+ if(!isnum(temp) || temp < 2.7)
+ temp = 2.7
+ set_temperature(temp)
clear()
for(var/id in gas)
- var/path = id
- if(!ispath(path))
- path = gas_id2path(path) //a lot of these strings can't have embedded expressions (especially for mappers), so support for IDs needs to stick around
- set_moles(path, text2num(gas[id]))
+ set_moles(id, text2num(gas[id]))
return 1
-
-/datum/gas_mixture/react(datum/holder)
- . = NO_REACTION
- var/list/reactions = list()
- for(var/I in get_gases())
- reactions += SSair.gas_reactions[I]
- if(!length(reactions))
- return
- reaction_results = new
- var/temp = return_temperature()
- var/ener = thermal_energy()
-
- reaction_loop:
- for(var/r in reactions)
- var/datum/gas_reaction/reaction = r
-
- var/list/min_reqs = reaction.min_requirements
- if( (min_reqs["TEMP"] && temp < min_reqs["TEMP"]) || \
- (min_reqs["ENER"] && ener < min_reqs["ENER"]) || \
- (min_reqs["MAX_TEMP"] && temp > min_reqs["MAX_TEMP"])
- )
- continue
-
- for(var/id in min_reqs)
- if (id == "TEMP" || id == "ENER" || id == "MAX_TEMP")
- continue
- if(get_moles(id) < min_reqs[id])
- continue reaction_loop
-
- //at this point, all requirements for the reaction are satisfied. we can now react()
-
- . |= reaction.react(src, holder)
- if (. & STOP_REACTIONS)
- break
-
-//Takes the amount of the gas you want to PP as an argument
-//So I don't have to do some hacky switches/defines/magic strings
-//eg:
-//Tox_PP = get_partial_pressure(gas_mixture.toxins)
-//O2_PP = get_partial_pressure(gas_mixture.oxygen)
-
-/datum/gas_mixture/proc/get_breath_partial_pressure(gas_pressure)
- return (gas_pressure * R_IDEAL_GAS_EQUATION * return_temperature()) / BREATH_VOLUME
-//inverse
-/datum/gas_mixture/proc/get_true_breath_pressure(partial_pressure)
- return (partial_pressure * BREATH_VOLUME) / (R_IDEAL_GAS_EQUATION * return_temperature())
+
+/datum/gas_mixture/proc/set_analyzer_results(instability)
+ if(!analyzer_results)
+ analyzer_results = new
+ analyzer_results["fusion"] = instability
//Mathematical proofs:
/*
@@ -235,59 +278,6 @@ get_true_breath_pressure(pp) --> gas_pp = pp/breath_pp*total_moles()
/datum/gas_mixture/turf
-/*
-/mob/verb/profile_atmos()
- /world{loop_checks = 0;}
- var/datum/gas_mixture/A = new
- var/datum/gas_mixture/B = new
- A.parse_gas_string("o2=200;n2=800;TEMP=50")
- B.parse_gas_string("co2=500;plasma=500;TEMP=5000")
- var/pa
- var/pb
- pa = world.tick_usage
- for(var/I in 1 to 100000)
- B.transfer_to(A, 1)
- A.transfer_to(B, 1)
- pb = world.tick_usage
- var/total_time = (pb-pa) * world.tick_lag
- to_chat(src, "Total time (gas transfer): [total_time]ms")
- to_chat(src, "Operations per second: [100000 / (total_time/1000)]")
- pa = world.tick_usage
- for(var/I in 1 to 100000)
- B.total_moles();
- pb = world.tick_usage
- total_time = (pb-pa) * world.tick_lag
- to_chat(src, "Total time (total_moles): [total_time]ms")
- to_chat(src, "Operations per second: [100000 / (total_time/1000)]")
- pa = world.tick_usage
- for(var/I in 1 to 100000)
- new /datum/gas_mixture
- pb = world.tick_usage
- total_time = (pb-pa) * world.tick_lag
- to_chat(src, "Total time (new gas mixture): [total_time]ms")
- to_chat(src, "Operations per second: [100000 / (total_time/1000)]")
-*/
-
-
-/// Pumps gas from src to output_air. The amount depends on target_pressure
-/datum/gas_mixture/proc/pump_gas_to(datum/gas_mixture/output_air, target_pressure)
- var/output_starting_pressure = output_air.return_pressure()
-
- if((target_pressure - output_starting_pressure) < 0.01)
- //No need to pump gas if target is already reached!
- return FALSE
-
- //Calculate necessary moles to transfer using PV=nRT
- if((total_moles() > 0) && (return_temperature()>0))
- var/pressure_delta = target_pressure - output_starting_pressure
- var/transfer_moles = pressure_delta*output_air.return_volume()/(return_temperature() * R_IDEAL_GAS_EQUATION)
-
- //Actually transfer the gas
- var/datum/gas_mixture/removed = remove(transfer_moles)
- output_air.merge(removed)
- return TRUE
- return FALSE
-
/// Releases gas from src to output air. This means that it can not transfer air to gas mixture with higher pressure.
/datum/gas_mixture/proc/release_gas_to(datum/gas_mixture/output_air, target_pressure)
var/output_starting_pressure = output_air.return_pressure()
@@ -295,7 +285,7 @@ get_true_breath_pressure(pp) --> gas_pp = pp/breath_pp*total_moles()
if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10))
//No need to pump gas if target is already reached or input pressure is too low
- //Need at least 10 KPa difference to overcome friction in the mechanism
+ //Need at least 10 kPa difference to overcome friction in the mechanism
return FALSE
//Calculate necessary moles to transfer using PV = nRT
@@ -308,6 +298,8 @@ get_true_breath_pressure(pp) --> gas_pp = pp/breath_pp*total_moles()
//Actually transfer the gas
var/datum/gas_mixture/removed = remove(transfer_moles)
output_air.merge(removed)
-
return TRUE
return FALSE
+
+/datum/gas_mixture/proc/vv_react(datum/holder)
+ return react(holder)
diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm
deleted file mode 100644
index de54c2ae36e1..000000000000
--- a/code/modules/atmospherics/gasmixtures/gas_types.dm
+++ /dev/null
@@ -1,230 +0,0 @@
-GLOBAL_LIST_INIT(hardcoded_gases, list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide, /datum/gas/plasma)) //the main four gases, which were at one time hardcoded
-GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/gas/nitrogen, /datum/gas/carbon_dioxide, /datum/gas/pluoxium, /datum/gas/stimulum, /datum/gas/nitryl))) //unable to react amongst themselves
-
-/proc/meta_gas_list()
- . = subtypesof(/datum/gas)
- for(var/gas_path in .)
- var/list/gas_info = new(7)
- var/datum/gas/gas = gas_path
-
- gas_info[META_GAS_SPECIFIC_HEAT] = initial(gas.specific_heat)
- gas_info[META_GAS_NAME] = initial(gas.name)
-
- gas_info[META_GAS_MOLES_VISIBLE] = initial(gas.moles_visible)
- if(initial(gas.moles_visible) != null)
- gas_info[META_GAS_OVERLAY] = new /list(FACTOR_GAS_VISIBLE_MAX)
- for(var/i in 1 to FACTOR_GAS_VISIBLE_MAX)
- gas_info[META_GAS_OVERLAY][i] = new /obj/effect/overlay/gas(initial(gas.gas_overlay), i * 255 / FACTOR_GAS_VISIBLE_MAX)
-
- gas_info[META_GAS_FUSION_POWER] = initial(gas.fusion_power)
- gas_info[META_GAS_DANGER] = initial(gas.dangerous)
- gas_info[META_GAS_ID] = initial(gas.id)
- .[gas_path] = gas_info
-
-/proc/gas_id2path(id)
- var/list/meta_gas = GLOB.meta_gas_info
- if(id in meta_gas)
- return id
- for(var/path in meta_gas)
- if(meta_gas[path][META_GAS_ID] == id)
- return path
- return ""
-
-/*||||||||||||||/----------\||||||||||||||*\
-||||||||||||||||[GAS DATUMS]||||||||||||||||
-||||||||||||||||\__________/||||||||||||||||
-||||These should never be instantiated. ||||
-||||They exist only to make it easier ||||
-||||to add a new gas. They are accessed ||||
-||||only by meta_gas_list(). ||||
-\*||||||||||||||||||||||||||||||||||||||||*/
-
-/datum/gas
- var/id = ""
- var/specific_heat = 0
- var/name = ""
- var/gas_overlay = "" //icon_state in icons/effects/atmospherics.dmi
- var/moles_visible = null
- var/dangerous = FALSE //currently used by canisters
- var/fusion_power = 0 //How much the gas accelerates a fusion reaction
- var/rarity = 0 // relative rarity compared to other gases, used when setting up the reactions list.
-
-// If you add or remove gases, update TOTAL_NUM_GASES in the extools code to match!
-// (dont forget to count shizz in the yogstation folder)
-
-/datum/gas/oxygen
- id = "o2"
- specific_heat = 20
- name = "Oxygen"
- rarity = 900
-
-/datum/gas/nitrogen
- id = "n2"
- specific_heat = 20
- name = "Nitrogen"
- rarity = 1000
-
-/datum/gas/carbon_dioxide //what the fuck is this?
- id = "co2"
- specific_heat = 30
- name = "Carbon Dioxide"
- rarity = 700
-
-/datum/gas/plasma
- id = "plasma"
- specific_heat = 200
- name = "Plasma"
- gas_overlay = "plasma"
- moles_visible = MOLES_GAS_VISIBLE
- dangerous = TRUE
- rarity = 800
-
-/datum/gas/water_vapor
- id = "water_vapor"
- specific_heat = 40
- name = "Water Vapor"
- gas_overlay = "water_vapor"
- moles_visible = MOLES_GAS_VISIBLE
- fusion_power = 8
- rarity = 500
-
-/datum/gas/hypernoblium
- id = "nob"
- specific_heat = 2000
- name = "Hyper-noblium"
- gas_overlay = "freon"
- moles_visible = MOLES_GAS_VISIBLE
- dangerous = TRUE
- rarity = 50
-
-/datum/gas/nitrous_oxide
- id = "n2o"
- specific_heat = 40
- name = "Nitrous Oxide"
- gas_overlay = "nitrous_oxide"
- moles_visible = MOLES_GAS_VISIBLE * 2
- fusion_power = 10
- dangerous = TRUE
- rarity = 600
-
-/datum/gas/nitryl
- id = "no2"
- specific_heat = 20
- name = "Nitryl"
- gas_overlay = "nitryl"
- moles_visible = MOLES_GAS_VISIBLE
- dangerous = TRUE
- fusion_power = 16
- rarity = 100
-
-/datum/gas/tritium
- id = "tritium"
- specific_heat = 10
- name = "Tritium"
- gas_overlay = "tritium"
- moles_visible = MOLES_GAS_VISIBLE
- dangerous = TRUE
- fusion_power = 1
- rarity = 300
-
-/datum/gas/bz
- id = "bz"
- specific_heat = 20
- name = "BZ"
- dangerous = TRUE
- fusion_power = 8
- rarity = 400
-
-/datum/gas/stimulum
- id = "stim"
- specific_heat = 5
- name = "Stimulum"
- fusion_power = 7
- rarity = 1
-
-/datum/gas/pluoxium
- id = "pluox"
- specific_heat = 80
- name = "Pluoxium"
- fusion_power = -10
- rarity = 200
-
-/datum/gas/miasma
- id = "miasma"
- specific_heat = 20
- name = "Miasma"
- gas_overlay = "miasma"
- moles_visible = MOLES_GAS_VISIBLE * 60
- rarity = 250
-
-/datum/gas/freon
- id = "freon"
- specific_heat = 600
- name = "Freon"
- gas_overlay = "freon"
- moles_visible = MOLES_GAS_VISIBLE *30
- fusion_power = -5
- rarity = 10
-
-/datum/gas/hydrogen
- id = "hydrogen"
- specific_heat = 15
- name = "Hydrogen"
- dangerous = TRUE
- rarity = 700
-
-/datum/gas/healium
- id = "healium"
- specific_heat = 10
- name = "Healium"
- dangerous = TRUE
- gas_overlay = "healium"
- moles_visible = MOLES_GAS_VISIBLE
- rarity = 100
-
-/datum/gas/pluonium
- id = "pluonium"
- specific_heat = 30
- name = "Pluonium"
- dangerous = TRUE
- gas_overlay = "pluonium"
- moles_visible = MOLES_GAS_VISIBLE
- rarity = 100
-
-/datum/gas/halon
- id = "halon"
- specific_heat = 175
- name = "Halon"
- dangerous = TRUE
- gas_overlay = "halon"
- moles_visible = MOLES_GAS_VISIBLE
- rarity = 100
-
-/datum/gas/zauker
- id = "zauker"
- specific_heat = 350
- name = "Zauker"
- dangerous = TRUE
- gas_overlay = "zauker"
- moles_visible = MOLES_GAS_VISIBLE
- rarity = 1
-/datum/gas/hexane
- id = "hexane"
- specific_heat = 5
- name = "Hexane"
- dangerous = TRUE
- gas_overlay = "hexane"
- moles_visible = MOLES_GAS_VISIBLE
- rarity = 100
-
-/obj/effect/overlay/gas
- icon = 'icons/effects/atmospherics.dmi'
- mouse_opacity = MOUSE_OPACITY_TRANSPARENT
- anchored = TRUE // should only appear in vis_contents, but to be safe
- layer = FLY_LAYER
- appearance_flags = TILE_BOUND
-
-/obj/effect/overlay/gas/New(state, alph)
- . = ..()
- icon_state = state
- alpha = alph
diff --git a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm
index 2f1a10e2756a..7de056ed0261 100644
--- a/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm
+++ b/code/modules/atmospherics/gasmixtures/immutable_mixtures.dm
@@ -25,4 +25,4 @@
initial_temperature = T20C
/datum/gas_mixture/immutable/cloner/populate()
- set_moles(/datum/gas/nitrogen, MOLES_O2STANDARD + MOLES_N2STANDARD)
+ set_moles(GAS_N2, MOLES_O2STANDARD + MOLES_N2STANDARD)
diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm
index 537e7b89894c..df267d4e463d 100644
--- a/code/modules/atmospherics/gasmixtures/reactions.dm
+++ b/code/modules/atmospherics/gasmixtures/reactions.dm
@@ -28,35 +28,17 @@ nobliumformation = 1001
/proc/init_gas_reactions()
. = list()
- for(var/type in subtypesof(/datum/gas))
- .[type] = list()
for(var/r in subtypesof(/datum/gas_reaction))
var/datum/gas_reaction/reaction = r
if(initial(reaction.exclude))
continue
reaction = new r
- var/datum/gas/reaction_key
- for (var/req in reaction.min_requirements)
- if (ispath(req))
- var/datum/gas/req_gas = req
- if (!reaction_key || initial(reaction_key.rarity) > initial(req_gas.rarity))
- reaction_key = req_gas
- .[reaction_key] += list(reaction)
- sortTim(., /proc/cmp_gas_reactions, TRUE)
-
-/proc/cmp_gas_reactions(list/datum/gas_reaction/a, list/datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list
- if (!length(a) || !length(b))
- return length(b) - length(a)
- var/maxa
- var/maxb
- for (var/datum/gas_reaction/R in a)
- if (R.priority > maxa)
- maxa = R.priority
- for (var/datum/gas_reaction/R in b)
- if (R.priority > maxb)
- maxb = R.priority
- return maxb - maxa
+ . += reaction
+ sortTim(., /proc/cmp_gas_reaction)
+
+/proc/cmp_gas_reaction(datum/gas_reaction/a, datum/gas_reaction/b) // compares lists of reactions by the maximum priority contained within the list
+ return b.priority - a.priority
/datum/gas_reaction
//regarding the requirements lists: the minimum or maximum requirements must be non-zero.
@@ -81,7 +63,7 @@ nobliumformation = 1001
id = "nobstop"
/datum/gas_reaction/nobliumsupression/init_reqs()
- min_requirements = list(/datum/gas/hypernoblium = REACTION_OPPRESSION_THRESHOLD)
+ min_requirements = list(GAS_HYPERNOB = REACTION_OPPRESSION_THRESHOLD)
/datum/gas_reaction/nobliumsupression/react()
return STOP_REACTIONS
@@ -93,31 +75,98 @@ nobliumformation = 1001
id = "vapor"
/datum/gas_reaction/water_vapor/init_reqs()
- min_requirements = list(/datum/gas/water_vapor = MOLES_GAS_VISIBLE)
+ min_requirements = list(
+ GAS_H2O = MOLES_GAS_VISIBLE,
+ "MAX_TEMP" = T0C + 40
+ )
/datum/gas_reaction/water_vapor/react(datum/gas_mixture/air, datum/holder)
- var/turf/open/location = isturf(holder) ? holder : null
- . = NO_REACTION
+ var/turf/open/location = holder
+ if(!istype(location))
+ return NO_REACTION
if (air.return_temperature() <= WATER_VAPOR_FREEZE)
if(location && location.freon_gas_act())
- . = REACTING
+ return REACTING
else if(location && location.water_vapor_gas_act())
- air.adjust_moles(/datum/gas/water_vapor, -MOLES_GAS_VISIBLE)
- . = REACTING
+ air.adjust_moles(GAS_H2O,-MOLES_GAS_VISIBLE)
+ return REACTING
+
+/datum/gas_reaction/nitrous_decomp
+ priority = 0
+ exclude = TRUE // generic fire now takes care of this
+ name = "Nitrous Oxide Decomposition"
+ id = "nitrous_decomp"
+
+/datum/gas_reaction/nitrous_decomp/init_reqs()
+ min_requirements = list(
+ "TEMP" = N2O_DECOMPOSITION_MIN_ENERGY,
+ GAS_NITROUS = MINIMUM_MOLE_COUNT
+ )
+
+/datum/gas_reaction/nitrous_decomp/react(datum/gas_mixture/air, datum/holder)
+ var/energy_released = 0
+ var/old_heat_capacity = air.heat_capacity() //this speeds things up because accessing datum vars is slow
+ var/temperature = air.return_temperature()
+ var/burned_fuel = 0
+
+
+ burned_fuel = max(0,0.00002*(temperature-(0.00001*(temperature**2))))*air.get_moles(GAS_NITROUS)
+ air.set_moles(GAS_NITROUS, air.get_moles(GAS_NITROUS) - burned_fuel)
+
+ if(burned_fuel)
+ energy_released += (N2O_DECOMPOSITION_ENERGY_RELEASED * burned_fuel)
+
+ air.set_moles(GAS_O2, air.get_moles(GAS_O2) + burned_fuel/2)
+ air.set_moles(GAS_N2, air.get_moles(GAS_N2) + burned_fuel)
+
+ var/new_heat_capacity = air.heat_capacity()
+ if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
+ air.set_temperature((temperature*old_heat_capacity + energy_released)/new_heat_capacity)
+ return REACTING
+ return NO_REACTION
//tritium combustion: combustion of oxygen and tritium (treated as hydrocarbons). creates hotspots. exothermic
/datum/gas_reaction/tritfire
- priority = -2 //fire should ALWAYS be last, but tritium fires happen before plasma fires
+ priority = -1 //fire should ALWAYS be last, but tritium fires happen before plasma fires
+ exclude = TRUE // generic fire now takes care of this
name = "Tritium Combustion"
id = "tritfire"
/datum/gas_reaction/tritfire/init_reqs()
min_requirements = list(
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
- /datum/gas/tritium = MINIMUM_MOLE_COUNT,
- /datum/gas/oxygen = MINIMUM_MOLE_COUNT
+ GAS_TRITIUM = MINIMUM_MOLE_COUNT,
+ GAS_O2 = MINIMUM_MOLE_COUNT
)
+// Called from auxmos internals
+/proc/fire_expose(turf/open/location, datum/gas_mixture/air, temperature)
+ if(istype(location) && temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
+ location.hotspot_expose(temperature, CELL_VOLUME)
+ for(var/I in location)
+ var/atom/movable/item = I
+ item.temperature_expose(air, temperature, CELL_VOLUME)
+ location.temperature_expose(air, temperature, CELL_VOLUME)
+
+// Called from auxmos internals
+/proc/radiation_burn(turf/open/location, energy_released)
+ if(istype(location) && prob(10))
+ radiation_pulse(location, energy_released/TRITIUM_BURN_RADIOACTIVITY_FACTOR)
+
+/proc/fusion_ball(datum/holder, reaction_energy, instability)
+ var/turf/open/location
+ if (istype(holder,/datum/pipeline)) //Find the tile the reaction is occuring on, or a random part of the network if it's a pipenet.
+ var/datum/pipeline/fusion_pipenet = holder
+ location = get_turf(pick(fusion_pipenet.members))
+ else
+ location = get_turf(holder)
+ if(location)
+ var/particle_chance = ((PARTICLE_CHANCE_CONSTANT)/(reaction_energy-PARTICLE_CHANCE_CONSTANT)) + 1//Asymptopically approaches 100% as the energy of the reaction goes up.
+ if(prob(PERCENT(particle_chance)))
+ location.fire_nuclear_particle()
+ var/rad_power = max((FUSION_RAD_COEFFICIENT/instability) + FUSION_RAD_MAX,0)
+ radiation_pulse(location,rad_power)
+
/datum/gas_reaction/tritfire/react(datum/gas_mixture/air, datum/holder)
var/energy_released = 0
var/old_heat_capacity = air.heat_capacity()
@@ -126,15 +175,15 @@ nobliumformation = 1001
cached_results["fire"] = 0
var/turf/open/location = isturf(holder) ? holder : null
var/burned_fuel = 0
- var/initial_trit = air.get_moles(/datum/gas/tritium)// Yogs
- if(air.get_moles(/datum/gas/oxygen) < initial_trit || MINIMUM_TRIT_OXYBURN_ENERGY > (temperature * old_heat_capacity))// Yogs -- Maybe a tiny performance boost? I'unno
- burned_fuel = air.get_moles(/datum/gas/oxygen)/TRITIUM_BURN_OXY_FACTOR
+ var/initial_trit = air.get_moles(GAS_TRITIUM)// Yogs
+ if(air.get_moles(GAS_O2) < initial_trit || MINIMUM_TRIT_OXYBURN_ENERGY > (temperature * old_heat_capacity))// Yogs -- Maybe a tiny performance boost? I'unno
+ burned_fuel = air.get_moles(GAS_O2)/TRITIUM_BURN_OXY_FACTOR
if(burned_fuel > initial_trit) burned_fuel = initial_trit //Yogs -- prevents negative moles of Tritium
- air.adjust_moles(/datum/gas/tritium, -burned_fuel)
+ air.adjust_moles(GAS_TRITIUM, -burned_fuel)
else
burned_fuel = initial_trit // Yogs -- Conservation of Mass fix
- air.set_moles(/datum/gas/tritium, air.get_moles(/datum/gas/tritium) * (1 - 1/TRITIUM_BURN_TRIT_FACTOR)) // Yogs -- Maybe a tiny performance boost? I'unno
- air.adjust_moles(/datum/gas/oxygen, -air.get_moles(/datum/gas/tritium))
+ air.set_moles(GAS_TRITIUM, air.get_moles(GAS_TRITIUM) * (1 - 1/TRITIUM_BURN_TRIT_FACTOR)) // Yogs -- Maybe a tiny performance boost? I'unno
+ air.adjust_moles(GAS_O2, -air.get_moles(GAS_TRITIUM))
energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel * (TRITIUM_BURN_TRIT_FACTOR - 1)) // Yogs -- Fixes low-energy tritium fires
if(burned_fuel)
@@ -143,7 +192,7 @@ nobliumformation = 1001
radiation_pulse(location, energy_released/TRITIUM_BURN_RADIOACTIVITY_FACTOR)
//oxygen+more-or-less hydrogen=H2O
- air.adjust_moles(/datum/gas/water_vapor, burned_fuel )// Yogs -- Conservation of Mass
+ air.adjust_moles(GAS_H2O, burned_fuel )// Yogs -- Conservation of Mass
cached_results["fire"] += burned_fuel
@@ -166,15 +215,16 @@ nobliumformation = 1001
//plasma combustion: combustion of oxygen and plasma (treated as hydrocarbons). creates hotspots. exothermic
/datum/gas_reaction/plasmafire
- priority = -4 //fire should ALWAYS be last, but plasma fires happen after tritium fires
+ priority = -2 //fire should ALWAYS be last, but plasma fires happen after tritium fires
name = "Plasma Combustion"
id = "plasmafire"
+ exclude = TRUE // generic fire now takes care of this
/datum/gas_reaction/plasmafire/init_reqs()
min_requirements = list(
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
- /datum/gas/plasma = MINIMUM_MOLE_COUNT,
- /datum/gas/oxygen = MINIMUM_MOLE_COUNT
+ GAS_PLASMA = MINIMUM_MOLE_COUNT,
+ GAS_O2 = MINIMUM_MOLE_COUNT
)
/datum/gas_reaction/plasmafire/react(datum/gas_mixture/air, datum/holder)
@@ -199,21 +249,21 @@ nobliumformation = 1001
temperature_scale = (temperature-PLASMA_MINIMUM_BURN_TEMPERATURE)/(PLASMA_UPPER_TEMPERATURE-PLASMA_MINIMUM_BURN_TEMPERATURE)
if(temperature_scale > 0)
oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale
- if(air.get_moles(/datum/gas/oxygen) / air.get_moles(/datum/gas/plasma) > SUPER_SATURATION_THRESHOLD) //supersaturation. Form Tritium.
+ if(air.get_moles(GAS_O2) / air.get_moles(GAS_PLASMA) > SUPER_SATURATION_THRESHOLD) //supersaturation. Form Tritium.
super_saturation = TRUE
- if(air.get_moles(/datum/gas/oxygen) > air.get_moles(/datum/gas/plasma)*PLASMA_OXYGEN_FULLBURN)
- plasma_burn_rate = (air.get_moles(/datum/gas/plasma)*temperature_scale)/PLASMA_BURN_RATE_DELTA
+ if(air.get_moles(GAS_O2) > air.get_moles(GAS_PLASMA)*PLASMA_OXYGEN_FULLBURN)
+ plasma_burn_rate = (air.get_moles(GAS_PLASMA)*temperature_scale)/PLASMA_BURN_RATE_DELTA
else
- plasma_burn_rate = (temperature_scale*(air.get_moles(/datum/gas/oxygen)/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA
+ plasma_burn_rate = (temperature_scale*(air.get_moles(GAS_O2)/PLASMA_OXYGEN_FULLBURN))/PLASMA_BURN_RATE_DELTA
if(plasma_burn_rate > MINIMUM_HEAT_CAPACITY)
- plasma_burn_rate = min(plasma_burn_rate,air.get_moles(/datum/gas/plasma),air.get_moles(/datum/gas/oxygen)/oxygen_burn_rate) //Ensures matter is conserved properly
- air.set_moles(/datum/gas/plasma, QUANTIZE(air.get_moles(/datum/gas/plasma) - plasma_burn_rate))
- air.set_moles(/datum/gas/oxygen, QUANTIZE(air.get_moles(/datum/gas/oxygen) - (plasma_burn_rate * oxygen_burn_rate)))
+ plasma_burn_rate = min(plasma_burn_rate,air.get_moles(GAS_PLASMA),air.get_moles(GAS_O2)/oxygen_burn_rate) //Ensures matter is conserved properly
+ air.set_moles(GAS_PLASMA, QUANTIZE(air.get_moles(GAS_PLASMA) - plasma_burn_rate))
+ air.set_moles(GAS_O2, QUANTIZE(air.get_moles(GAS_O2) - (plasma_burn_rate * oxygen_burn_rate)))
if (super_saturation)
- air.adjust_moles(/datum/gas/tritium, plasma_burn_rate)
+ air.adjust_moles(GAS_TRITIUM, plasma_burn_rate)
else
- air.adjust_moles(/datum/gas/carbon_dioxide, plasma_burn_rate)
+ air.adjust_moles(GAS_CO2, plasma_burn_rate)
energy_released += FIRE_PLASMA_ENERGY_RELEASED * (plasma_burn_rate)
@@ -236,6 +286,84 @@ nobliumformation = 1001
return cached_results["fire"] ? REACTING : NO_REACTION
+/datum/gas_reaction/genericfire
+ priority = -3 // very last reaction
+ name = "Combustion"
+ id = "genericfire"
+
+/datum/gas_reaction/genericfire/init_reqs()
+ var/lowest_fire_temp = INFINITY
+ var/list/fire_temperatures = GLOB.gas_data.fire_temperatures
+ for(var/gas in fire_temperatures)
+ lowest_fire_temp = min(lowest_fire_temp, fire_temperatures[gas])
+ var/lowest_oxi_temp = INFINITY
+ var/list/oxidation_temperatures = GLOB.gas_data.oxidation_temperatures
+ for(var/gas in oxidation_temperatures)
+ lowest_oxi_temp = min(lowest_oxi_temp, oxidation_temperatures[gas])
+ min_requirements = list(
+ "TEMP" = max(lowest_oxi_temp, lowest_fire_temp),
+ "FIRE_REAGENTS" = MINIMUM_MOLE_COUNT
+ )
+
+// no requirements, always runs
+// bad idea? maybe
+// this is overridden by auxmos but, hey, good idea to have it readable
+
+/datum/gas_reaction/genericfire/react(datum/gas_mixture/air, datum/holder)
+ var/temperature = air.return_temperature()
+ var/list/oxidation_temps = GLOB.gas_data.oxidation_temperatures
+ var/list/oxidation_rates = GLOB.gas_data.oxidation_rates
+ var/oxidation_power = 0
+ var/list/burn_results = list()
+ var/list/fuels = list()
+ var/list/oxidizers = list()
+ var/list/fuel_rates = GLOB.gas_data.fire_burn_rates
+ var/list/fuel_temps = GLOB.gas_data.fire_temperatures
+ var/total_fuel = 0
+ var/energy_released = 0
+ for(var/G in air.get_gases())
+ var/oxidation_temp = oxidation_temps[G]
+ if(oxidation_temp && oxidation_temp > temperature)
+ var/temperature_scale = max(0, 1-(temperature / oxidation_temp))
+ var/amt = air.get_moles(G) * temperature_scale
+ oxidizers[G] = amt
+ oxidation_power += amt * oxidation_rates[G]
+ else
+ var/fuel_temp = fuel_temps[G]
+ if(fuel_temp && fuel_temp > temperature)
+ var/amt = (air.get_moles(G) / fuel_rates[G]) * max(0, 1-(temperature / fuel_temp))
+ fuels[G] = amt // we have to calculate the actual amount we're using after we get all oxidation together
+ total_fuel += amt
+ if(oxidation_power <= 0 || total_fuel <= 0)
+ return NO_REACTION
+ var/oxidation_ratio = oxidation_power / total_fuel
+ if(oxidation_ratio > 1)
+ for(var/oxidizer in oxidizers)
+ oxidizers[oxidizer] /= oxidation_ratio
+ else if(oxidation_ratio < 1)
+ for(var/fuel in fuels)
+ fuels[fuel] *= oxidation_ratio
+ fuels += oxidizers
+ var/list/fire_products = GLOB.gas_data.fire_products
+ var/list/fire_enthalpies = GLOB.gas_data.enthalpies
+ for(var/fuel in fuels + oxidizers)
+ var/amt = fuels[fuel]
+ if(!burn_results[fuel])
+ burn_results[fuel] = 0
+ burn_results[fuel] -= amt
+ energy_released += amt * fire_enthalpies[fuel]
+ for(var/product in fire_products[fuel])
+ if(!burn_results[product])
+ burn_results[product] = 0
+ burn_results[product] += amt
+ var/final_energy = air.thermal_energy() + energy_released
+ for(var/result in burn_results)
+ air.adjust_moles(result, burn_results[result])
+ air.set_temperature(final_energy / air.heat_capacity())
+ var/list/cached_results = air.reaction_results
+ cached_results["fire"] = min(total_fuel, oxidation_power) * 2
+ return cached_results["fire"] ? REACTING : NO_REACTION
+
//fusion: a terrible idea that was fun but broken. Now reworked to be less broken and more interesting. Again (and again, and again). Again!
//Fusion Rework Counter: Please increment this if you make a major overhaul to this system again.
//6 reworks
@@ -249,16 +377,16 @@ nobliumformation = 1001
/datum/gas_reaction/fusion/init_reqs()
min_requirements = list(
"TEMP" = FUSION_TEMPERATURE_THRESHOLD_MINIMUM, // Yogs -- Cold Fusion
- /datum/gas/tritium = FUSION_TRITIUM_MOLES_USED,
- /datum/gas/plasma = FUSION_MOLE_THRESHOLD,
- /datum/gas/carbon_dioxide = FUSION_MOLE_THRESHOLD)
+ GAS_TRITIUM = FUSION_TRITIUM_MOLES_USED,
+ GAS_PLASMA = FUSION_MOLE_THRESHOLD,
+ GAS_CO2 = FUSION_MOLE_THRESHOLD)
/datum/gas_reaction/fusion/react(datum/gas_mixture/air, datum/holder)
//Yogs start -- Cold Fusion
if(air.return_temperature() < FUSION_TEMPERATURE_THRESHOLD)
- if(!air.get_moles(/datum/gas/dilithium))
+ if(!air.get_moles(GAS_DILITHIUM))
return
- if(air.return_temperature() < (FUSION_TEMPERATURE_THRESHOLD - FUSION_TEMPERATURE_THRESHOLD_MINIMUM) * NUM_E**( - air.get_moles(/datum/gas/dilithium) * DILITHIUM_LAMBDA) + FUSION_TEMPERATURE_THRESHOLD_MINIMUM)
+ if(air.return_temperature() < (FUSION_TEMPERATURE_THRESHOLD - FUSION_TEMPERATURE_THRESHOLD_MINIMUM) * NUM_E**( - air.get_moles(GAS_DILITHIUM) * DILITHIUM_LAMBDA) + FUSION_TEMPERATURE_THRESHOLD_MINIMUM)
// This is an exponential decay equation, actually. Horizontal Asymptote is FUSION_TEMPERATURE_THRESHOLD_MINIMUM.
return
//Yogs End
@@ -273,13 +401,13 @@ nobliumformation = 1001
var/list/cached_scan_results = air.analyzer_results
var/old_heat_capacity = air.heat_capacity()
var/reaction_energy = 0 //Reaction energy can be negative or positive, for both exothermic and endothermic reactions.
- var/initial_plasma = air.get_moles(/datum/gas/plasma)
- var/initial_carbon = air.get_moles(/datum/gas/carbon_dioxide)
+ var/initial_plasma = air.get_moles(GAS_PLASMA)
+ var/initial_carbon = air.get_moles(GAS_CO2)
var/scale_factor = (air.return_volume())/(PI) //We scale it down by volume/Pi because for fusion conditions, moles roughly = 2*volume, but we want it to be based off something constant between reactions.
var/toroidal_size = (2*PI)+TORADIANS(arctan((air.return_volume()-TOROID_VOLUME_BREAKEVEN)/TOROID_VOLUME_BREAKEVEN)) //The size of the phase space hypertorus
var/gas_power = 0
for (var/gas_id in air.get_gases())
- gas_power += (GLOB.meta_gas_info[gas_id][META_GAS_FUSION_POWER]*air.get_moles(gas_id))
+ gas_power += (GLOB.gas_data.fusion_powers[gas_id]*air.get_moles(gas_id))
var/instability = MODULUS((gas_power*INSTABILITY_GAS_POWER_FACTOR)**2,toroidal_size) //Instability effects how chaotic the behavior of the reaction is
cached_scan_results[id] = instability//used for analyzer feedback
@@ -291,9 +419,9 @@ nobliumformation = 1001
carbon = MODULUS(carbon - plasma, toroidal_size)
- air.set_moles(/datum/gas/plasma, plasma*scale_factor + FUSION_MOLE_THRESHOLD )//Scales the gases back up
- air.set_moles(/datum/gas/carbon_dioxide, carbon*scale_factor + FUSION_MOLE_THRESHOLD)
- var/delta_plasma = initial_plasma - air.get_moles(/datum/gas/plasma)
+ air.set_moles(GAS_PLASMA, plasma*scale_factor + FUSION_MOLE_THRESHOLD )//Scales the gases back up
+ air.set_moles(GAS_CO2, carbon*scale_factor + FUSION_MOLE_THRESHOLD)
+ var/delta_plasma = initial_plasma - air.get_moles(GAS_PLASMA)
reaction_energy += delta_plasma*PLASMA_BINDING_ENERGY //Energy is gained or lost corresponding to the creation or destruction of mass.
if(instability < FUSION_INSTABILITY_ENDOTHERMALITY)
@@ -302,17 +430,17 @@ nobliumformation = 1001
reaction_energy *= (instability-FUSION_INSTABILITY_ENDOTHERMALITY)**0.5
if(air.thermal_energy() + reaction_energy < 0) //No using energy that doesn't exist.
- air.set_moles(/datum/gas/plasma, initial_plasma)
- air.set_moles(/datum/gas/carbon_dioxide, initial_carbon)
+ air.set_moles(GAS_PLASMA, initial_plasma)
+ air.set_moles(GAS_CO2, initial_carbon)
return NO_REACTION
- air.adjust_moles(/datum/gas/tritium, -FUSION_TRITIUM_MOLES_USED)
+ air.adjust_moles(GAS_TRITIUM, -FUSION_TRITIUM_MOLES_USED)
//The decay of the tritium and the reaction's energy produces waste gases, different ones depending on whether the reaction is endo or exothermic
if(reaction_energy > 0)
- air.adjust_moles(/datum/gas/oxygen, FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT))
- air.adjust_moles(/datum/gas/nitrous_oxide, FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT))
+ air.adjust_moles(GAS_O2, FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT))
+ air.adjust_moles(GAS_NITROUS, FUSION_TRITIUM_MOLES_USED*(reaction_energy*FUSION_TRITIUM_CONVERSION_COEFFICIENT))
else
- air.adjust_moles(/datum/gas/bz, FUSION_TRITIUM_MOLES_USED*(reaction_energy*-FUSION_TRITIUM_CONVERSION_COEFFICIENT))
- air.adjust_moles(/datum/gas/nitryl, FUSION_TRITIUM_MOLES_USED*(reaction_energy*-FUSION_TRITIUM_CONVERSION_COEFFICIENT))
+ air.adjust_moles(GAS_BZ, FUSION_TRITIUM_MOLES_USED*(reaction_energy*-FUSION_TRITIUM_CONVERSION_COEFFICIENT))
+ air.adjust_moles(GAS_NITRYL, FUSION_TRITIUM_MOLES_USED*(reaction_energy*-FUSION_TRITIUM_CONVERSION_COEFFICIENT))
if(reaction_energy)
if(location)
@@ -334,9 +462,9 @@ nobliumformation = 1001
/datum/gas_reaction/nitrylformation/init_reqs()
min_requirements = list(
- /datum/gas/oxygen = 20,
- /datum/gas/nitrogen = 20,
- /datum/gas/nitrous_oxide = 5,
+ GAS_O2 = 20,
+ GAS_N2 = 20,
+ GAS_NITROUS = 5,
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST*30
)
@@ -344,13 +472,13 @@ nobliumformation = 1001
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST*60),air.get_moles(/datum/gas/oxygen),air.get_moles(/datum/gas/nitrogen))
+ var/heat_efficency = min(temperature/(FIRE_MINIMUM_TEMPERATURE_TO_EXIST*60),air.get_moles(GAS_O2),air.get_moles(GAS_N2))
var/energy_used = heat_efficency*NITRYL_FORMATION_ENERGY
- if ((air.get_moles(/datum/gas/oxygen) - heat_efficency < 0 )|| (air.get_moles(/datum/gas/nitrogen) - heat_efficency < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_O2) - heat_efficency < 0 )|| (air.get_moles(GAS_N2) - heat_efficency < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/oxygen, -heat_efficency)
- air.adjust_moles(/datum/gas/nitrogen, -heat_efficency)
- air.adjust_moles(/datum/gas/nitryl, heat_efficency*2)
+ air.adjust_moles(GAS_O2, -heat_efficency)
+ air.adjust_moles(GAS_N2, -heat_efficency)
+ air.adjust_moles(GAS_NITRYL, heat_efficency*2)
if(energy_used > 0)
var/new_heat_capacity = air.heat_capacity()
@@ -365,8 +493,8 @@ nobliumformation = 1001
/datum/gas_reaction/bzformation/init_reqs()
min_requirements = list(
- /datum/gas/nitrous_oxide = 10,
- /datum/gas/plasma = 10
+ GAS_NITROUS = 10,
+ GAS_PLASMA = 10
)
@@ -374,16 +502,16 @@ nobliumformation = 1001
var/temperature = air.return_temperature()
var/pressure = air.return_pressure()
var/old_heat_capacity = air.heat_capacity()
- var/reaction_efficency = min(1/((clamp(pressure,1,1000)/(0.5*ONE_ATMOSPHERE))*(max(air.get_moles(/datum/gas/plasma)/air.get_moles(/datum/gas/nitrous_oxide),1))),air.get_moles(/datum/gas/nitrous_oxide),air.get_moles(/datum/gas/plasma)/2)
+ var/reaction_efficency = min(1/((clamp(pressure,1,1000)/(0.5*ONE_ATMOSPHERE))*(max(air.get_moles(GAS_PLASMA)/air.get_moles(GAS_NITROUS),1))),air.get_moles(GAS_NITROUS),air.get_moles(GAS_PLASMA)/2)
var/energy_released = 2*reaction_efficency*FIRE_CARBON_ENERGY_RELEASED
- if ((air.get_moles(/datum/gas/nitrous_oxide) - reaction_efficency < 0 )|| (air.get_moles(/datum/gas/plasma) - (2*reaction_efficency) < 0) || energy_released <= 0) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_NITROUS) - reaction_efficency < 0 )|| (air.get_moles(GAS_PLASMA) - (2*reaction_efficency) < 0) || energy_released <= 0) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/bz, reaction_efficency)
- if(reaction_efficency == air.get_moles(/datum/gas/nitrous_oxide))
- air.adjust_moles(/datum/gas/bz, -min(pressure,1))
- air.adjust_moles(/datum/gas/oxygen, min(pressure,1))
- air.adjust_moles(/datum/gas/nitrous_oxide, -reaction_efficency)
- air.adjust_moles(/datum/gas/plasma, -2*reaction_efficency)
+ air.adjust_moles(GAS_BZ, reaction_efficency)
+ if(reaction_efficency == air.get_moles(GAS_NITROUS))
+ air.adjust_moles(GAS_BZ, -min(pressure,1))
+ air.adjust_moles(GAS_O2, min(pressure,1))
+ air.adjust_moles(GAS_NITROUS, -reaction_efficency)
+ air.adjust_moles(GAS_PLASMA, -2*reaction_efficency)
//clamps by a minimum amount in the event of an underflow.
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp((reaction_efficency**2)*BZ_RESEARCH_AMOUNT,0.01,BZ_RESEARCH_MAX_AMOUNT))
@@ -401,22 +529,22 @@ nobliumformation = 1001
/datum/gas_reaction/stimformation/init_reqs()
min_requirements = list(
- /datum/gas/plasma = 10,
- /datum/gas/bz = 20,
- /datum/gas/nitryl = 30,
+ GAS_PLASMA = 10,
+ GAS_BZ = 20,
+ GAS_NITRYL = 30,
"TEMP" = STIMULUM_HEAT_SCALE/2)
/datum/gas_reaction/stimformation/react(datum/gas_mixture/air)
var/old_heat_capacity = air.heat_capacity()
- var/heat_scale = min(air.return_temperature()/STIMULUM_HEAT_SCALE,air.get_moles(/datum/gas/plasma),air.get_moles(/datum/gas/nitryl))
+ var/heat_scale = min(air.return_temperature()/STIMULUM_HEAT_SCALE,air.get_moles(GAS_PLASMA),air.get_moles(GAS_NITRYL))
var/stim_energy_change = heat_scale*STIMULUM_HEAT_SCALE
- if ((air.get_moles(/datum/gas/plasma) - heat_scale < 0) || (air.get_moles(/datum/gas/nitryl) - heat_scale < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_PLASMA) - heat_scale < 0) || (air.get_moles(GAS_NITRYL) - heat_scale < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/stimulum, heat_scale/10)
- air.adjust_moles(/datum/gas/plasma, -heat_scale)
- air.adjust_moles(/datum/gas/nitryl, -heat_scale)
+ air.adjust_moles(GAS_STIMULUM, heat_scale/10)
+ air.adjust_moles(GAS_PLASMA, -heat_scale)
+ air.adjust_moles(GAS_NITRYL, -heat_scale)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp(STIMULUM_RESEARCH_AMOUNT*heat_scale/10,0.01, STIMULUM_RESEARCH_MAX_AMOUNT))
if(stim_energy_change)
var/new_heat_capacity = air.heat_capacity()
@@ -431,17 +559,17 @@ nobliumformation = 1001
/datum/gas_reaction/nobliumformation/init_reqs()
min_requirements = list(
- /datum/gas/nitrogen = 20,
- /datum/gas/tritium = 10,
+ GAS_N2 = 20,
+ GAS_TRITIUM = 10,
"TEMP" = 5000000)
/datum/gas_reaction/nobliumformation/react(datum/gas_mixture/air)
- var/nob_formed = min(air.get_moles(/datum/gas/tritium)/10,air.get_moles(/datum/gas/nitrogen)/20)
+ var/nob_formed = min(air.get_moles(GAS_TRITIUM)/10,air.get_moles(GAS_N2)/20)
var/old_heat_capacity = air.heat_capacity()
- var/energy_taken = nob_formed*(NOBLIUM_FORMATION_ENERGY/(max(air.get_moles(/datum/gas/bz),1)))
- air.adjust_moles(/datum/gas/tritium, -10*nob_formed)
- air.adjust_moles(/datum/gas/nitrogen, -20*nob_formed)
- air.adjust_moles(/datum/gas/hypernoblium, nob_formed)
+ var/energy_taken = nob_formed*(NOBLIUM_FORMATION_ENERGY/(max(air.get_moles(GAS_BZ),1)))
+ air.adjust_moles(GAS_TRITIUM, -10*nob_formed)
+ air.adjust_moles(GAS_N2, -20*nob_formed)
+ air.adjust_moles(GAS_HYPERNOB, nob_formed)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, clamp(nob_formed*NOBLIUM_RESEARCH_AMOUNT, 0.01, NOBLIUM_RESEARCH_MAX_AMOUNT))
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
@@ -457,18 +585,18 @@ nobliumformation = 1001
/datum/gas_reaction/miaster/init_reqs()
min_requirements = list(
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST+70,
- /datum/gas/miasma = MINIMUM_MOLE_COUNT
+ GAS_MIASMA = MINIMUM_MOLE_COUNT
)
/datum/gas_reaction/miaster/react(datum/gas_mixture/air, datum/holder)
// As the name says it, it needs to be dry
- if(air.get_moles(/datum/gas/water_vapor)/air.total_moles() > 0.1) // Yogs --Fixes runtime in Sterilization
+ if(air.get_moles(GAS_H2O)/air.total_moles() > 0.1) // Yogs --Fixes runtime in Sterilization
return NO_REACT
//Replace miasma with oxygen
- var/cleaned_air = min(air.get_moles(/datum/gas/miasma), 20 + (air.return_temperature() - FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 70) / 20)
- air.adjust_moles(/datum/gas/miasma, -cleaned_air)
- air.adjust_moles(/datum/gas/oxygen, cleaned_air)
+ var/cleaned_air = min(air.get_moles(GAS_MIASMA), 20 + (air.return_temperature() - FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 70) / 20)
+ air.adjust_moles(GAS_MIASMA, -cleaned_air)
+ air.adjust_moles(GAS_O2, cleaned_air)
//Possibly burning a bit of organic matter through maillard reaction, so a *tiny* bit more heat would be understandable
air.set_temperature(air.return_temperature() + cleaned_air * 0.002)
@@ -482,9 +610,9 @@ nobliumformation = 1001
/datum/gas_reaction/stim_ball/init_reqs()
min_requirements = list(
- /datum/gas/pluoxium = STIM_BALL_MOLES_REQUIRED,
- /datum/gas/stimulum = STIM_BALL_MOLES_REQUIRED,
- /datum/gas/plasma = STIM_BALL_MOLES_REQUIRED,
+ GAS_PLUOXIUM = STIM_BALL_MOLES_REQUIRED,
+ GAS_STIMULUM = STIM_BALL_MOLES_REQUIRED,
+ GAS_PLASMA = STIM_BALL_MOLES_REQUIRED,
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
)
@@ -497,16 +625,16 @@ nobliumformation = 1001
location = get_turf(pick(pipenet.members))
else
location = get_turf(holder)
- var/reaction_rate = min(STIM_BALL_MAX_REACT_RATE, air.get_moles(/datum/gas/pluoxium), air.get_moles(/datum/gas/stimulum), air.get_moles(/datum/gas/plasma))
+ var/reaction_rate = min(STIM_BALL_MAX_REACT_RATE, air.get_moles(GAS_PLUOXIUM), air.get_moles(GAS_STIMULUM), air.get_moles(GAS_PLASMA))
var/balls_shot = round(reaction_rate/STIM_BALL_MOLES_REQUIRED)
//A percentage of plasma is burned during the reaction that is converted into energy and radballs, though mostly pure heat.
- var/plasma_burned = QUANTIZE((air.get_moles(/datum/gas/plasma) + 5*reaction_rate)*STIM_BALL_PLASMA_COEFFICIENT)
+ var/plasma_burned = QUANTIZE((air.get_moles(GAS_PLASMA) + 5*reaction_rate)*STIM_BALL_PLASMA_COEFFICIENT)
//Stimulum has a lot of stored energy, and breaking it up releases some of it. Plasma is also partially converted into energy in the process.
var/energy_released = (reaction_rate*STIMULUM_HEAT_SCALE) + (plasma_burned*STIM_BALL_PLASMA_ENERGY)
- air.adjust_moles(/datum/gas/stimulum, -reaction_rate)
- air.adjust_moles(/datum/gas/pluoxium, -reaction_rate)
- air.adjust_moles(/datum/gas/nitryl, reaction_rate*5)
- air.adjust_moles(/datum/gas/plasma, -plasma_burned)
+ air.adjust_moles(GAS_STIMULUM, -reaction_rate)
+ air.adjust_moles(GAS_PLUOXIUM, -reaction_rate)
+ air.adjust_moles(GAS_NITRYL, reaction_rate*5)
+ air.adjust_moles(GAS_PLASMA, -plasma_burned)
if(energy_released)
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
@@ -526,8 +654,8 @@ nobliumformation = 1001
/datum/gas_reaction/freonfire/init_reqs()
min_requirements = list(
- /datum/gas/oxygen = MINIMUM_MOLE_COUNT,
- /datum/gas/freon = MINIMUM_MOLE_COUNT,
+ GAS_O2 = MINIMUM_MOLE_COUNT,
+ GAS_FREON = MINIMUM_MOLE_COUNT,
"TEMP" = FREON_LOWER_TEMPERATURE,
"MAX_TEMP" = FREON_MAXIMUM_BURN_TEMPERATURE
)
@@ -552,16 +680,16 @@ nobliumformation = 1001
temperature_scale = (FREON_MAXIMUM_BURN_TEMPERATURE - temperature) / (FREON_MAXIMUM_BURN_TEMPERATURE - FREON_LOWER_TEMPERATURE) //calculate the scale based on the temperature
if(temperature_scale >= 0)
oxygen_burn_rate = OXYGEN_BURN_RATE_BASE - temperature_scale
- if(air.get_moles(/datum/gas/oxygen) > air.get_moles(/datum/gas/freon) * FREON_OXYGEN_FULLBURN)
- freon_burn_rate = (air.get_moles(/datum/gas/freon) * temperature_scale) / FREON_BURN_RATE_DELTA
+ if(air.get_moles(GAS_O2) > air.get_moles(GAS_FREON) * FREON_OXYGEN_FULLBURN)
+ freon_burn_rate = (air.get_moles(GAS_FREON) * temperature_scale) / FREON_BURN_RATE_DELTA
else
- freon_burn_rate = (temperature_scale * (air.get_moles(/datum/gas/oxygen) / FREON_OXYGEN_FULLBURN)) / FREON_BURN_RATE_DELTA
+ freon_burn_rate = (temperature_scale * (air.get_moles(GAS_O2) / FREON_OXYGEN_FULLBURN)) / FREON_BURN_RATE_DELTA
if(freon_burn_rate > MINIMUM_HEAT_CAPACITY)
- freon_burn_rate = min(freon_burn_rate, air.get_moles(/datum/gas/freon), air.get_moles(/datum/gas/oxygen) / oxygen_burn_rate) //Ensures matter is conserved properly
- air.adjust_moles(/datum/gas/freon, -freon_burn_rate)
- air.adjust_moles(/datum/gas/oxygen, -(freon_burn_rate * oxygen_burn_rate))
- air.adjust_moles(/datum/gas/carbon_dioxide, freon_burn_rate)
+ freon_burn_rate = min(freon_burn_rate, air.get_moles(GAS_FREON), air.get_moles(GAS_O2) / oxygen_burn_rate) //Ensures matter is conserved properly
+ air.adjust_moles(GAS_FREON, -freon_burn_rate)
+ air.adjust_moles(GAS_O2, -(freon_burn_rate * oxygen_burn_rate))
+ air.adjust_moles(GAS_CO2, freon_burn_rate)
if(temperature < 160 && temperature > 120 && prob(2))
new /obj/item/stack/sheet/hot_ice(location)
@@ -576,13 +704,14 @@ nobliumformation = 1001
/datum/gas_reaction/h2fire
priority = -3 //fire should ALWAYS be last, but tritium fires happen before plasma fires
name = "Hydrogen Combustion"
+ exclude = TRUE // generic fire now takes care of this
id = "h2fire"
/datum/gas_reaction/h2fire/init_reqs()
min_requirements = list(
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
- /datum/gas/hydrogen = MINIMUM_MOLE_COUNT,
- /datum/gas/oxygen = MINIMUM_MOLE_COUNT
+ GAS_H2 = MINIMUM_MOLE_COUNT,
+ GAS_O2 = MINIMUM_MOLE_COUNT
)
/datum/gas_reaction/h2fire/react(datum/gas_mixture/air, datum/holder)
@@ -594,17 +723,17 @@ nobliumformation = 1001
cached_results["fire"] = 0
var/turf/open/location = isturf(holder) ? holder : null
var/burned_fuel = 0
- if(air.get_moles(/datum/gas/oxygen) < air.get_moles(/datum/gas/hydrogen) || MINIMUM_H2_OXYBURN_ENERGY > air.thermal_energy())
- burned_fuel = (air.get_moles(/datum/gas/oxygen)/HYDROGEN_BURN_OXY_FACTOR)
- air.adjust_moles(/datum/gas/hydrogen, -burned_fuel)
+ if(air.get_moles(GAS_O2) < air.get_moles(GAS_H2) || MINIMUM_H2_OXYBURN_ENERGY > air.thermal_energy())
+ burned_fuel = (air.get_moles(GAS_O2)/HYDROGEN_BURN_OXY_FACTOR)
+ air.adjust_moles(GAS_H2, -burned_fuel)
else
- burned_fuel = (air.get_moles(/datum/gas/hydrogen) * HYDROGEN_BURN_H2_FACTOR)
- air.adjust_moles(/datum/gas/hydrogen, -(air.get_moles(/datum/gas/hydrogen) / HYDROGEN_BURN_H2_FACTOR))
- air.adjust_moles(/datum/gas/oxygen, -air.get_moles(/datum/gas/hydrogen))
+ burned_fuel = (air.get_moles(GAS_H2) * HYDROGEN_BURN_H2_FACTOR)
+ air.adjust_moles(GAS_H2, -(air.get_moles(GAS_H2) / HYDROGEN_BURN_H2_FACTOR))
+ air.adjust_moles(GAS_O2, -air.get_moles(GAS_H2))
if(burned_fuel)
energy_released += (FIRE_HYDROGEN_ENERGY_RELEASED * burned_fuel)
- air.adjust_moles(/datum/gas/water_vapor, (burned_fuel / HYDROGEN_BURN_OXY_FACTOR))
+ air.adjust_moles(GAS_H2O, (burned_fuel / HYDROGEN_BURN_OXY_FACTOR))
cached_results["fire"] += burned_fuel
@@ -633,8 +762,8 @@ nobliumformation = 1001
/datum/gas_reaction/hexane_formation/init_reqs()
min_requirements = list(
- /datum/gas/bz = MINIMUM_MOLE_COUNT,
- /datum/gas/hydrogen = MINIMUM_MOLE_COUNT,
+ GAS_BZ = MINIMUM_MOLE_COUNT,
+ GAS_H2 = MINIMUM_MOLE_COUNT,
"TEMP" = 450,
"MAX_TEMP" = 465
)
@@ -642,13 +771,13 @@ nobliumformation = 1001
/datum/gas_reaction/hexane_formation/react(datum/gas_mixture/air, datum/holder)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature * 0.01, air.get_moles(/datum/gas/hydrogen), air.get_moles(/datum/gas/bz))
+ var/heat_efficency = min(temperature * 0.01, air.get_moles(GAS_H2), air.get_moles(GAS_BZ))
var/energy_used = heat_efficency * 600
- if (air.get_moles(/datum/gas/hydrogen) - (heat_efficency * 5) < 0 || air.get_moles(/datum/gas/bz) - (heat_efficency * 0.25) < 0) //Shouldn't produce gas from nothing.
+ if (air.get_moles(GAS_H2) - (heat_efficency * 5) < 0 || air.get_moles(GAS_BZ) - (heat_efficency * 0.25) < 0) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/hydrogen, -(heat_efficency * 5))
- air.adjust_moles(/datum/gas/bz, -(heat_efficency * 0.25))
- air.adjust_moles(/datum/gas/hexane, (heat_efficency * 5.25))
+ air.adjust_moles(GAS_H2, -(heat_efficency * 5))
+ air.adjust_moles(GAS_BZ, -(heat_efficency * 0.25))
+ air.adjust_moles(GAS_HEXANE, (heat_efficency * 5.25))
if(energy_used)
var/new_heat_capacity = air.heat_capacity()
@@ -663,8 +792,8 @@ nobliumformation = 1001
/datum/gas_reaction/metalhydrogen/init_reqs()
min_requirements = list(
- /datum/gas/hydrogen = 100,
- /datum/gas/bz = 5,
+ GAS_H2 = 100,
+ GAS_BZ = 5,
"TEMP" = METAL_HYDROGEN_MINIMUM_HEAT
)
@@ -677,14 +806,14 @@ nobliumformation = 1001
///the more heat you use the higher is this factor
var/increase_factor = min((temperature / METAL_HYDROGEN_MINIMUM_HEAT), 5)
///the more moles you use and the higher the heat, the higher is the efficiency
- var/heat_efficency = air.get_moles(/datum/gas/hydrogen)* 0.01 * increase_factor
+ var/heat_efficency = air.get_moles(GAS_H2)* 0.01 * increase_factor
var/pressure = air.return_pressure()
var/energy_used = heat_efficency * METAL_HYDROGEN_FORMATION_ENERGY
if(pressure >= METAL_HYDROGEN_MINIMUM_PRESSURE && temperature >= METAL_HYDROGEN_MINIMUM_HEAT)
- air.adjust_moles(/datum/gas/bz, -(heat_efficency * 0.01))
+ air.adjust_moles(GAS_BZ, -(heat_efficency * 0.01))
if (prob(20 * increase_factor))
- air.adjust_moles(/datum/gas/hydrogen, -(heat_efficency * 3.5))
+ air.adjust_moles(GAS_H2, -(heat_efficency * 3.5))
if (prob(100 / increase_factor))
new /obj/item/stack/sheet/mineral/metal_hydrogen(location)
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, min((heat_efficency * increase_factor * 0.5), METAL_HYDROGEN_RESEARCH_MAX_AMOUNT))
@@ -702,23 +831,23 @@ nobliumformation = 1001
/datum/gas_reaction/freonformation/init_reqs() //minimum requirements for freon formation
min_requirements = list(
- /datum/gas/plasma = 40,
- /datum/gas/carbon_dioxide = 20,
- /datum/gas/bz = 20,
+ GAS_PLASMA = 40,
+ GAS_CO2 = 20,
+ GAS_BZ = 20,
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 100
)
/datum/gas_reaction/freonformation/react(datum/gas_mixture/air)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature / (FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), air.get_moles(/datum/gas/plasma), air.get_moles(/datum/gas/carbon_dioxide), air.get_moles(/datum/gas/bz))
+ var/heat_efficency = min(temperature / (FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), air.get_moles(GAS_PLASMA), air.get_moles(GAS_CO2), air.get_moles(GAS_BZ))
var/energy_used = heat_efficency * 100
- if ((air.get_moles(/datum/gas/plasma) - heat_efficency * 1.5 < 0 ) || (air.get_moles(/datum/gas/carbon_dioxide) - heat_efficency * 0.75 < 0) || (air.get_moles(/datum/gas/bz) - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_PLASMA) - heat_efficency * 1.5 < 0 ) || (air.get_moles(GAS_CO2) - heat_efficency * 0.75 < 0) || (air.get_moles(GAS_BZ) - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/plasma, -(heat_efficency * 1.5))
- air.adjust_moles(/datum/gas/carbon_dioxide, -(heat_efficency * 0.75))
- air.adjust_moles(/datum/gas/bz, -(heat_efficency * 0.25))
- air.adjust_moles(/datum/gas/freon, (heat_efficency * 2.5))
+ air.adjust_moles(GAS_PLASMA, -(heat_efficency * 1.5))
+ air.adjust_moles(GAS_CO2, -(heat_efficency * 0.75))
+ air.adjust_moles(GAS_BZ, -(heat_efficency * 0.25))
+ air.adjust_moles(GAS_FREON, (heat_efficency * 2.5))
if(energy_used > 0)
var/new_heat_capacity = air.heat_capacity()
@@ -734,8 +863,8 @@ nobliumformation = 1001
/datum/gas_reaction/halon_formation/init_reqs()
min_requirements = list(
- /datum/gas/bz = MINIMUM_MOLE_COUNT,
- /datum/gas/tritium = MINIMUM_MOLE_COUNT,
+ GAS_BZ = MINIMUM_MOLE_COUNT,
+ GAS_TRITIUM = MINIMUM_MOLE_COUNT,
"TEMP" = 30,
"MAX_TEMP" = 55
)
@@ -743,13 +872,13 @@ nobliumformation = 1001
/datum/gas_reaction/halon_formation/react(datum/gas_mixture/air, datum/holder)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature * 0.01, air.get_moles(/datum/gas/tritium), air.get_moles(/datum/gas/bz))
+ var/heat_efficency = min(temperature * 0.01, air.get_moles(GAS_TRITIUM), air.get_moles(GAS_BZ))
var/energy_used = heat_efficency * 300
- if ((air.get_moles(/datum/gas/tritium) - heat_efficency * 4 < 0 ) || (air.get_moles(/datum/gas/bz) - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_TRITIUM) - heat_efficency * 4 < 0 ) || (air.get_moles(GAS_BZ) - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/tritium, -(heat_efficency * 4))
- air.adjust_moles(/datum/gas/bz, -(heat_efficency * 0.25))
- air.adjust_moles(/datum/gas/halon, (heat_efficency * 4.25))
+ air.adjust_moles(GAS_TRITIUM, -(heat_efficency * 4))
+ air.adjust_moles(GAS_BZ, -(heat_efficency * 0.25))
+ air.adjust_moles(GAS_HALON, (heat_efficency * 4.25))
if(energy_used)
var/new_heat_capacity = air.heat_capacity()
@@ -764,8 +893,8 @@ nobliumformation = 1001
/datum/gas_reaction/healium_formation/init_reqs()
min_requirements = list(
- /datum/gas/bz = MINIMUM_MOLE_COUNT,
- /datum/gas/freon = MINIMUM_MOLE_COUNT,
+ GAS_BZ = MINIMUM_MOLE_COUNT,
+ GAS_FREON = MINIMUM_MOLE_COUNT,
"TEMP" = 25,
"MAX_TEMP" = 300
)
@@ -773,13 +902,13 @@ nobliumformation = 1001
/datum/gas_reaction/healium_formation/react(datum/gas_mixture/air, datum/holder)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature * 0.3, air.get_moles(/datum/gas/freon), air.get_moles(/datum/gas/bz))
+ var/heat_efficency = min(temperature * 0.3, air.get_moles(GAS_FREON), air.get_moles(GAS_BZ))
var/energy_used = heat_efficency * 9000
- if ((air.get_moles(/datum/gas/freon) - heat_efficency * 2.75 < 0 ) || (air.get_moles(/datum/gas/bz) - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_FREON) - heat_efficency * 2.75 < 0 ) || (air.get_moles(GAS_BZ) - heat_efficency * 0.25 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/freon, -(heat_efficency * 2.75))
- air.adjust_moles(/datum/gas/bz, -(heat_efficency * 0.25))
- air.adjust_moles(/datum/gas/healium, (heat_efficency * 3))
+ air.adjust_moles(GAS_FREON, -(heat_efficency * 2.75))
+ air.adjust_moles(GAS_BZ, -(heat_efficency * 0.25))
+ air.adjust_moles(GAS_HEALIUM, (heat_efficency * 3))
if(energy_used)
var/new_heat_capacity = air.heat_capacity()
@@ -794,8 +923,8 @@ nobliumformation = 1001
/datum/gas_reaction/pluonium_formation/init_reqs()
min_requirements = list(
- /datum/gas/pluoxium = MINIMUM_MOLE_COUNT,
- /datum/gas/hydrogen = MINIMUM_MOLE_COUNT,
+ GAS_PLUOXIUM = MINIMUM_MOLE_COUNT,
+ GAS_H2 = MINIMUM_MOLE_COUNT,
"TEMP" = 5000,
"MAX_TEMP" = 10000
)
@@ -803,13 +932,13 @@ nobliumformation = 1001
/datum/gas_reaction/pluonium_formation/react(datum/gas_mixture/air, datum/holder)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature * 0.005, air.get_moles(/datum/gas/pluoxium), air.get_moles(/datum/gas/hydrogen))
+ var/heat_efficency = min(temperature * 0.005, air.get_moles(GAS_PLUOXIUM), air.get_moles(GAS_H2))
var/energy_used = heat_efficency * 650
- if ((air.get_moles(/datum/gas/pluoxium) - heat_efficency * 0.2 < 0 ) || (air.get_moles(/datum/gas/hydrogen) - heat_efficency * 2 < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_PLUOXIUM) - heat_efficency * 0.2 < 0 ) || (air.get_moles(GAS_H2) - heat_efficency * 2 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/hydrogen, -(heat_efficency * 2))
- air.adjust_moles(/datum/gas/pluoxium, -(heat_efficency * 0.2))
- air.adjust_moles(/datum/gas/pluonium, (heat_efficency * 2.2))
+ air.adjust_moles(GAS_H2, -(heat_efficency * 2))
+ air.adjust_moles(GAS_PLUOXIUM, -(heat_efficency * 0.2))
+ air.adjust_moles(GAS_PLUONIUM, (heat_efficency * 2.2))
if(energy_used > 0)
var/new_heat_capacity = air.heat_capacity()
@@ -824,8 +953,8 @@ nobliumformation = 1001
/datum/gas_reaction/zauker_formation/init_reqs()
min_requirements = list(
- /datum/gas/hypernoblium = MINIMUM_MOLE_COUNT,
- /datum/gas/stimulum = MINIMUM_MOLE_COUNT,
+ GAS_HYPERNOB = MINIMUM_MOLE_COUNT,
+ GAS_STIMULUM = MINIMUM_MOLE_COUNT,
"TEMP" = 50000,
"MAX_TEMP" = 75000
)
@@ -833,13 +962,13 @@ nobliumformation = 1001
/datum/gas_reaction/zauker_formation/react(datum/gas_mixture/air, datum/holder)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature * 0.000005, air.get_moles(/datum/gas/hypernoblium), air.get_moles(/datum/gas/stimulum))
+ var/heat_efficency = min(temperature * 0.000005, air.get_moles(GAS_HYPERNOB), air.get_moles(GAS_STIMULUM))
var/energy_used = heat_efficency * 5000
- if ((air.get_moles(/datum/gas/hypernoblium) - heat_efficency * 0.01 < 0 ) || (air.get_moles(/datum/gas/stimulum) - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_HYPERNOB) - heat_efficency * 0.01 < 0 ) || (air.get_moles(GAS_STIMULUM) - heat_efficency * 0.5 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/hypernoblium, -(heat_efficency * 0.01))
- air.adjust_moles(/datum/gas/stimulum, -(heat_efficency * 0.5))
- air.adjust_moles(/datum/gas/zauker, (heat_efficency * 0.5))
+ air.adjust_moles(GAS_HYPERNOB, -(heat_efficency * 0.01))
+ air.adjust_moles(GAS_STIMULUM, -(heat_efficency * 0.5))
+ air.adjust_moles(GAS_ZAUKER, (heat_efficency * 0.5))
if(energy_used)
var/new_heat_capacity = air.heat_capacity()
@@ -854,21 +983,21 @@ nobliumformation = 1001
/datum/gas_reaction/halon_o2removal/init_reqs()
min_requirements = list(
- /datum/gas/halon = MINIMUM_MOLE_COUNT,
- /datum/gas/oxygen = MINIMUM_MOLE_COUNT,
+ GAS_HALON = MINIMUM_MOLE_COUNT,
+ GAS_O2 = MINIMUM_MOLE_COUNT,
"TEMP" = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
)
/datum/gas_reaction/halon_o2removal/react(datum/gas_mixture/air, datum/holder)
var/temperature = air.return_temperature()
var/old_heat_capacity = air.heat_capacity()
- var/heat_efficency = min(temperature / ( FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), air.get_moles(/datum/gas/halon), air.get_moles(/datum/gas/oxygen))
+ var/heat_efficency = min(temperature / ( FIRE_MINIMUM_TEMPERATURE_TO_EXIST * 10), air.get_moles(GAS_HALON), air.get_moles(GAS_O2))
var/energy_used = heat_efficency * 2500
- if ((air.get_moles(/datum/gas/halon) - heat_efficency < 0 ) || (air.get_moles(/datum/gas/oxygen) - heat_efficency * 20 < 0)) //Shouldn't produce gas from nothing.
+ if ((air.get_moles(GAS_HALON) - heat_efficency < 0 ) || (air.get_moles(GAS_O2) - heat_efficency * 20 < 0)) //Shouldn't produce gas from nothing.
return NO_REACTION
- air.adjust_moles(/datum/gas/halon, -(heat_efficency))
- air.adjust_moles(/datum/gas/oxygen, -(heat_efficency * 20))
- air.adjust_moles(/datum/gas/carbon_dioxide, (heat_efficency * 5))
+ air.adjust_moles(GAS_HALON, -(heat_efficency))
+ air.adjust_moles(GAS_O2, -(heat_efficency * 20))
+ air.adjust_moles(GAS_CO2, (heat_efficency * 5))
if(energy_used)
var/new_heat_capacity = air.heat_capacity()
@@ -883,8 +1012,8 @@ nobliumformation = 1001
/datum/gas_reaction/zauker_decomp/init_reqs()
min_requirements = list(
- /datum/gas/nitrogen = MINIMUM_MOLE_COUNT,
- /datum/gas/zauker = MINIMUM_MOLE_COUNT
+ GAS_N2 = MINIMUM_MOLE_COUNT,
+ GAS_ZAUKER = MINIMUM_MOLE_COUNT
)
/datum/gas_reaction/zauker_decomp/react(datum/gas_mixture/air, datum/holder)
@@ -893,15 +1022,15 @@ nobliumformation = 1001
//this speeds things up because accessing datum vars is slow
var/temperature = air.return_temperature()
var/burned_fuel = 0
- burned_fuel = min(20, air.get_moles(/datum/gas/nitrogen), air.get_moles(/datum/gas/zauker))
- if(air.get_moles(/datum/gas/zauker) - burned_fuel < 0)
+ burned_fuel = min(20, air.get_moles(GAS_N2), air.get_moles(GAS_ZAUKER))
+ if(air.get_moles(GAS_ZAUKER) - burned_fuel < 0)
return NO_REACTION
- air.adjust_moles(/datum/gas/zauker, -burned_fuel)
+ air.adjust_moles(GAS_ZAUKER, -burned_fuel)
if(burned_fuel)
energy_released += (460 * burned_fuel)
- air.adjust_moles(/datum/gas/oxygen, (burned_fuel * 0.3))
- air.adjust_moles(/datum/gas/nitrogen, (burned_fuel * 0.7))
+ air.adjust_moles(GAS_O2, (burned_fuel * 0.3))
+ air.adjust_moles(GAS_N2, (burned_fuel * 0.7))
var/new_heat_capacity = air.heat_capacity()
if(new_heat_capacity > MINIMUM_HEAT_CAPACITY)
@@ -916,8 +1045,8 @@ nobliumformation = 1001
/datum/gas_reaction/pluonium_bz_response/init_reqs()
min_requirements = list(
- /datum/gas/pluonium = MINIMUM_MOLE_COUNT,
- /datum/gas/bz = MINIMUM_MOLE_COUNT,
+ GAS_PLUONIUM = MINIMUM_MOLE_COUNT,
+ GAS_BZ = MINIMUM_MOLE_COUNT,
"TEMP" = 260,
"MAX_TEMP" = 280
)
@@ -933,15 +1062,15 @@ nobliumformation = 1001
location = get_turf(pick(pipenet.members))
else
location = get_turf(holder)
- var consumed_amount = min(5, air.get_moles(/datum/gas/bz), air.get_moles(/datum/gas/pluonium))
- if(air.get_moles(/datum/gas/bz) - consumed_amount < 0)
+ var consumed_amount = min(5, air.get_moles(GAS_BZ), air.get_moles(GAS_PLUONIUM))
+ if(air.get_moles(GAS_BZ) - consumed_amount < 0)
return NO_REACTION
- if(air.get_moles(/datum/gas/bz) < 30)
+ if(air.get_moles(GAS_BZ) < 30)
radiation_pulse(location, consumed_amount * 20, 2.5, TRUE, FALSE)
- air.adjust_moles(/datum/gas/bz, -consumed_amount)
+ air.adjust_moles(GAS_BZ, -consumed_amount)
else
for(var/mob/living/carbon/L in location)
- L.hallucination += (air.get_moles(/datum/gas/bz * 0.7))
+ L.hallucination += (air.get_moles(GAS_BZ * 0.7))
energy_released += 100
if(energy_released)
var/new_heat_capacity = air.heat_capacity()
@@ -956,8 +1085,8 @@ nobliumformation = 1001
/datum/gas_reaction/pluonium_tritium_response/init_reqs()
min_requirements = list(
- /datum/gas/pluonium = MINIMUM_MOLE_COUNT,
- /datum/gas/tritium = MINIMUM_MOLE_COUNT,
+ GAS_PLUONIUM = MINIMUM_MOLE_COUNT,
+ GAS_TRITIUM = MINIMUM_MOLE_COUNT,
"TEMP" = 150,
"MAX_TEMP" = 340
)
@@ -967,13 +1096,13 @@ nobliumformation = 1001
var/old_heat_capacity = air.heat_capacity()
var/temperature = air.return_temperature()
var/turf/open/location = isturf(holder) ? holder : null
- var produced_amount = min(5, air.get_moles(/datum/gas/tritium), air.get_moles(/datum/gas/pluonium))
- if(air.get_moles(/datum/gas/tritium) - produced_amount < 0 || air.get_moles(/datum/gas/pluonium) - produced_amount * 0.01 < 0)
+ var produced_amount = min(5, air.get_moles(GAS_TRITIUM), air.get_moles(GAS_PLUONIUM))
+ if(air.get_moles(GAS_TRITIUM) - produced_amount < 0 || air.get_moles(GAS_PLUONIUM) - produced_amount * 0.01 < 0)
return NO_REACTION
location.rad_act(produced_amount * 2.4)
- air.adjust_moles(/datum/gas/tritium, -produced_amount)
- air.adjust_moles(/datum/gas/hydrogen, produced_amount)
- air.adjust_moles(/datum/gas/pluonium, -(produced_amount * 0.01))
+ air.adjust_moles(GAS_TRITIUM, -produced_amount)
+ air.adjust_moles(GAS_H2, produced_amount)
+ air.adjust_moles(GAS_PLUONIUM, -(produced_amount * 0.01))
energy_released += 50
if(energy_released)
var/new_heat_capacity = air.heat_capacity()
@@ -988,19 +1117,19 @@ nobliumformation = 1001
/datum/gas_reaction/pluonium_hydrogen_response/init_reqs()
min_requirements = list(
- /datum/gas/pluonium = MINIMUM_MOLE_COUNT,
- /datum/gas/hydrogen = 150,
+ GAS_PLUONIUM = MINIMUM_MOLE_COUNT,
+ GAS_H2 = 150,
)
/datum/gas_reaction/pluonium_hydrogen_response/react(datum/gas_mixture/air, datum/holder)
var/energy_released = 0
var/old_heat_capacity = air.heat_capacity()
var/temperature = air.return_temperature()
- var produced_amount = min(5, air.get_moles(/datum/gas/hydrogen), air.adjust_moles(/datum/gas/pluonium))
- if(air.get_moles(/datum/gas/hydrogen) - produced_amount < 0)
+ var produced_amount = min(5, air.get_moles(GAS_H2), air.adjust_moles(GAS_PLUONIUM))
+ if(air.get_moles(GAS_H2) - produced_amount < 0)
return NO_REACTION
- air.adjust_moles(/datum/gas/hydrogen, -produced_amount)
- air.adjust_moles(/datum/gas/pluonium, (produced_amount * 0.5))
+ air.adjust_moles(GAS_H2, -produced_amount)
+ air.adjust_moles(GAS_PLUONIUM, (produced_amount * 0.5))
energy_released = produced_amount * 2500
if(energy_released)
var/new_heat_capacity = air.heat_capacity()
diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm
index 62be84fa138b..3f652231d054 100644
--- a/code/modules/atmospherics/machinery/airalarm.dm
+++ b/code/modules/atmospherics/machinery/airalarm.dm
@@ -94,80 +94,80 @@
var/list/TLV = list( // Breathable air.
"pressure" = new/datum/tlv(ONE_ATMOSPHERE * 0.8, ONE_ATMOSPHERE* 0.9, ONE_ATMOSPHERE * 1.1, ONE_ATMOSPHERE * 1.2), // kPa. Values are min2, min1, max1, max2
"temperature" = new/datum/tlv(T0C, T0C+10, T0C+40, T0C+66),
- /datum/gas/oxygen = new/datum/tlv(16, 19, 135, 140), // Partial pressure, kpa
- /datum/gas/nitrogen = new/datum/tlv(-1, -1, 1000, 1000),
- /datum/gas/carbon_dioxide = new/datum/tlv(-1, -1, 5, 10),
- /datum/gas/miasma = new/datum/tlv/(-1, -1, 15, 30),
- /datum/gas/plasma = new/datum/tlv/dangerous,
- /datum/gas/nitrous_oxide = new/datum/tlv/dangerous,
- /datum/gas/bz = new/datum/tlv/dangerous,
- /datum/gas/hypernoblium = new/datum/tlv(-1, -1, 1000, 1000), // Hyper-Noblium is inert and nontoxic
- /datum/gas/water_vapor = new/datum/tlv/dangerous,
- /datum/gas/tritium = new/datum/tlv/dangerous,
- /datum/gas/stimulum = new/datum/tlv(-1, -1, 1000, 1000), // Stimulum has only positive effects
- /datum/gas/nitryl = new/datum/tlv/dangerous,
- /datum/gas/dilithium = new/datum/tlv/dangerous,//Yogs -- Dilithium
- /datum/gas/pluoxium = new/datum/tlv(-1, -1, 1000, 1000), // Unlike oxygen, pluoxium does not fuel plasma/tritium fires
- /datum/gas/freon = new/datum/tlv/dangerous,
- /datum/gas/hydrogen = new/datum/tlv/dangerous,
- /datum/gas/healium = new/datum/tlv/dangerous,
- /datum/gas/pluonium = new/datum/tlv/dangerous,
- /datum/gas/zauker = new/datum/tlv/dangerous,
- /datum/gas/halon = new/datum/tlv/dangerous,
- /datum/gas/hexane = new/datum/tlv/dangerous
+ GAS_O2 = new/datum/tlv(16, 19, 40, 50), // Partial pressure, kpa
+ GAS_N2 = new/datum/tlv(-1, -1, 1000, 1000),
+ GAS_CO2 = new/datum/tlv(-1, -1, 5, 10),
+ GAS_MIASMA = new/datum/tlv/(-1, -1, 15, 30),
+ GAS_PLASMA = new/datum/tlv/dangerous,
+ GAS_NITROUS = new/datum/tlv/dangerous,
+ GAS_BZ = new/datum/tlv/dangerous,
+ GAS_HYPERNOB = new/datum/tlv(-1, -1, 1000, 1000), // Hyper-Noblium is inert and nontoxic
+ GAS_H2O = new/datum/tlv/dangerous,
+ GAS_TRITIUM = new/datum/tlv/dangerous,
+ GAS_STIMULUM = new/datum/tlv(-1, -1, 1000, 1000), // Stimulum has only positive effects
+ GAS_NITRYL = new/datum/tlv/dangerous,
+ GAS_DILITHIUM = new/datum/tlv/dangerous,//Yogs -- Dilithium
+ GAS_PLUOXIUM = new/datum/tlv(-1, -1, 5, 6), // Unlike oxygen, pluoxium does not fuel plasma/tritium fires
+ GAS_FREON = new/datum/tlv/dangerous,
+ GAS_H2 = new/datum/tlv/dangerous,
+ GAS_HEALIUM = new/datum/tlv/dangerous,
+ GAS_PLUONIUM = new/datum/tlv/dangerous,
+ GAS_ZAUKER = new/datum/tlv/dangerous,
+ GAS_HALON = new/datum/tlv/dangerous,
+ GAS_HEXANE = new/datum/tlv/dangerous
)
/obj/machinery/airalarm/server // No checks here.
TLV = list(
"pressure" = new/datum/tlv/no_checks,
"temperature" = new/datum/tlv/no_checks,
- /datum/gas/oxygen = new/datum/tlv/no_checks,
- /datum/gas/nitrogen = new/datum/tlv/no_checks,
- /datum/gas/carbon_dioxide = new/datum/tlv/no_checks,
- /datum/gas/miasma = new/datum/tlv/no_checks,
- /datum/gas/plasma = new/datum/tlv/no_checks,
- /datum/gas/nitrous_oxide = new/datum/tlv/no_checks,
- /datum/gas/bz = new/datum/tlv/no_checks,
- /datum/gas/hypernoblium = new/datum/tlv/no_checks,
- /datum/gas/water_vapor = new/datum/tlv/no_checks,
- /datum/gas/tritium = new/datum/tlv/no_checks,
- /datum/gas/stimulum = new/datum/tlv/no_checks,
- /datum/gas/nitryl = new/datum/tlv/no_checks,
- /datum/gas/dilithium = new/datum/tlv/no_checks,//Yogs -- Dilithium
- /datum/gas/pluoxium = new/datum/tlv/no_checks,
- /datum/gas/freon = new/datum/tlv/no_checks,
- /datum/gas/hydrogen = new/datum/tlv/no_checks,
- /datum/gas/healium = new/datum/tlv/dangerous,
- /datum/gas/pluonium = new/datum/tlv/dangerous,
- /datum/gas/halon = new/datum/tlv/dangerous,
- /datum/gas/hexane = new/datum/tlv/dangerous
+ GAS_O2 = new/datum/tlv/no_checks,
+ GAS_N2 = new/datum/tlv/no_checks,
+ GAS_CO2 = new/datum/tlv/no_checks,
+ GAS_MIASMA = new/datum/tlv/no_checks,
+ GAS_PLASMA = new/datum/tlv/no_checks,
+ GAS_NITROUS = new/datum/tlv/no_checks,
+ GAS_BZ = new/datum/tlv/no_checks,
+ GAS_HYPERNOB = new/datum/tlv/no_checks,
+ GAS_H2O = new/datum/tlv/no_checks,
+ GAS_TRITIUM = new/datum/tlv/no_checks,
+ GAS_STIMULUM = new/datum/tlv/no_checks,
+ GAS_NITRYL = new/datum/tlv/no_checks,
+ GAS_DILITHIUM = new/datum/tlv/no_checks,//Yogs -- Dilithium
+ GAS_PLUOXIUM = new/datum/tlv/no_checks,
+ GAS_FREON = new/datum/tlv/no_checks,
+ GAS_H2 = new/datum/tlv/no_checks,
+ GAS_HEALIUM = new/datum/tlv/dangerous,
+ GAS_PLUONIUM = new/datum/tlv/dangerous,
+ GAS_HALON = new/datum/tlv/dangerous,
+ GAS_HEXANE = new/datum/tlv/dangerous
)
/obj/machinery/airalarm/kitchen_cold_room // Kitchen cold rooms start off at -80°C or 193.15°K.
TLV = list(
"pressure" = new/datum/tlv(ONE_ATMOSPHERE * 0.8, ONE_ATMOSPHERE* 0.9, ONE_ATMOSPHERE * 1.1, ONE_ATMOSPHERE * 1.2), // kPa
"temperature" = new/datum/tlv(T0C-273.15, T0C-100, T0C-60, T0C),
- /datum/gas/oxygen = new/datum/tlv(16, 19, 135, 140), // Partial pressure, kpa
- /datum/gas/nitrogen = new/datum/tlv(-1, -1, 1000, 1000),
- /datum/gas/carbon_dioxide = new/datum/tlv(-1, -1, 5, 10),
- /datum/gas/miasma = new/datum/tlv/(-1, -1, 2, 5),
- /datum/gas/plasma = new/datum/tlv/dangerous,
- /datum/gas/nitrous_oxide = new/datum/tlv/dangerous,
- /datum/gas/bz = new/datum/tlv/dangerous,
- /datum/gas/hypernoblium = new/datum/tlv(-1, -1, 1000, 1000), // Hyper-Noblium is inert and nontoxic
- /datum/gas/water_vapor = new/datum/tlv/dangerous,
- /datum/gas/tritium = new/datum/tlv/dangerous,
- /datum/gas/stimulum = new/datum/tlv(-1, -1, 1000, 1000), // Stimulum has only positive effects
- /datum/gas/nitryl = new/datum/tlv/dangerous,
- /datum/gas/dilithium = new/datum/tlv/dangerous,//Yogs -- Dilithium
- /datum/gas/pluoxium = new/datum/tlv(-1, -1, 1000, 1000), // Unlike oxygen, pluoxium does not fuel plasma/tritium fires
- /datum/gas/freon = new/datum/tlv/dangerous,
- /datum/gas/hydrogen = new/datum/tlv/dangerous,
- /datum/gas/healium = new/datum/tlv/dangerous,
- /datum/gas/pluonium = new/datum/tlv/dangerous,
- /datum/gas/zauker = new/datum/tlv/dangerous,
- /datum/gas/halon = new/datum/tlv/dangerous,
- /datum/gas/hexane = new/datum/tlv/dangerous
+ GAS_O2 = new/datum/tlv(16, 19, 135, 140), // Partial pressure, kpa
+ GAS_N2 = new/datum/tlv(-1, -1, 1000, 1000),
+ GAS_CO2 = new/datum/tlv(-1, -1, 5, 10),
+ GAS_MIASMA = new/datum/tlv/(-1, -1, 2, 5),
+ GAS_PLASMA = new/datum/tlv/dangerous,
+ GAS_NITROUS = new/datum/tlv/dangerous,
+ GAS_BZ = new/datum/tlv/dangerous,
+ GAS_HYPERNOB = new/datum/tlv(-1, -1, 1000, 1000), // Hyper-Noblium is inert and nontoxic
+ GAS_H2O = new/datum/tlv/dangerous,
+ GAS_TRITIUM = new/datum/tlv/dangerous,
+ GAS_STIMULUM = new/datum/tlv(-1, -1, 1000, 1000), // Stimulum has only positive effects
+ GAS_NITRYL = new/datum/tlv/dangerous,
+ GAS_DILITHIUM = new/datum/tlv/dangerous,//Yogs -- Dilithium
+ GAS_PLUOXIUM = new/datum/tlv(-1, -1, 1000, 1000), // Unlike oxygen, pluoxium does not fuel plasma/tritium fires
+ GAS_FREON = new/datum/tlv/dangerous,
+ GAS_H2 = new/datum/tlv/dangerous,
+ GAS_HEALIUM = new/datum/tlv/dangerous,
+ GAS_PLUONIUM = new/datum/tlv/dangerous,
+ GAS_ZAUKER = new/datum/tlv/dangerous,
+ GAS_HALON = new/datum/tlv/dangerous,
+ GAS_HEXANE = new/datum/tlv/dangerous
)
/obj/machinery/airalarm/unlocked
@@ -221,8 +221,8 @@
var/list/air_vent_info = list()
var/list/air_scrub_info = list()
-/obj/machinery/airalarm/New(loc, ndir, nbuild)
- ..()
+/obj/machinery/airalarm/Initialize(loc, ndir, nbuild)
+ . = ..()
wires = new /datum/wires/airalarm(src)
if(ndir)
setDir(ndir)
@@ -311,7 +311,7 @@
continue
cur_tlv = TLV[gas_id]
data["environment_data"] += list(list(
- "name" = GLOB.meta_gas_info[gas_id][META_GAS_NAME],
+ "name" = GLOB.gas_data.names[gas_id],
"value" = environment.get_moles(gas_id) / total_moles * 100,
"unit" = "%",
"danger_level" = cur_tlv.get_danger_level(environment.get_moles(gas_id) * partial_pressure)
@@ -380,11 +380,11 @@
thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max1", "selected" = selected.max1))
thresholds[thresholds.len]["settings"] += list(list("env" = "temperature", "val" = "max2", "selected" = selected.max2))
- for(var/gas_id in GLOB.meta_gas_info)
+ for(var/gas_id in GLOB.gas_data.names)
if(!(gas_id in TLV)) // We're not interested in this gas, it seems.
continue
selected = TLV[gas_id]
- thresholds += list(list("name" = GLOB.meta_gas_info[gas_id][META_GAS_NAME], "settings" = list()))
+ thresholds += list(list("name" = GLOB.gas_data.names[gas_id], "settings" = list()))
thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min2", "selected" = selected.min2))
thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "min1", "selected" = selected.min1))
thresholds[thresholds.len]["settings"] += list(list("env" = gas_id, "val" = "max1", "selected" = selected.max1))
@@ -528,7 +528,7 @@
for(var/device_id in A.air_scrub_names)
send_signal(device_id, list(
"power" = 1,
- "set_filters" = list(/datum/gas/carbon_dioxide),
+ "set_filters" = list(GAS_CO2),
"scrubbing" = 1,
"widenet" = 0
), signal_source)
@@ -543,25 +543,25 @@
send_signal(device_id, list(
"power" = 1,
"set_filters" = list(
- /datum/gas/carbon_dioxide,
- /datum/gas/miasma,
- /datum/gas/plasma,
- /datum/gas/water_vapor,
- /datum/gas/hypernoblium,
- /datum/gas/nitrous_oxide,
- /datum/gas/nitryl,
- /datum/gas/tritium,
- /datum/gas/bz,
- /datum/gas/stimulum,
- /datum/gas/pluoxium,//yogs comma
- /datum/gas/dilithium,//Yogs -- Adds Dilithium
- /datum/gas/freon,
- /datum/gas/hydrogen,
- /datum/gas/healium,
- /datum/gas/pluonium,
- /datum/gas/zauker,
- /datum/gas/halon,
- /datum/gas/hexane
+ GAS_CO2,
+ GAS_MIASMA,
+ GAS_PLASMA,
+ GAS_H2O,
+ GAS_HYPERNOB,
+ GAS_NITROUS,
+ GAS_NITRYL,
+ GAS_TRITIUM,
+ GAS_BZ,
+ GAS_STIMULUM,
+ GAS_PLUOXIUM,//yogs comma
+ GAS_DILITHIUM,//Yogs -- Adds Dilithium
+ GAS_FREON,
+ GAS_H2,
+ GAS_HEALIUM,
+ GAS_PLUONIUM,
+ GAS_ZAUKER,
+ GAS_HALON,
+ GAS_HEXANE
),
"scrubbing" = 1,
"widenet" = 1
diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm
index 956fb3a6eee0..437c8933dc1c 100644
--- a/code/modules/atmospherics/machinery/atmosmachinery.dm
+++ b/code/modules/atmospherics/machinery/atmosmachinery.dm
@@ -37,6 +37,7 @@ GLOBAL_LIST_EMPTY(pipeimages)
var/construction_type
var/pipe_state //icon_state as a pipe item
var/on = FALSE
+ var/interacts_with_air = FALSE
/obj/machinery/atmospherics/examine(mob/user)
. = ..()
@@ -45,7 +46,7 @@ GLOBAL_LIST_EMPTY(pipeimages)
if(L.ventcrawler)
. += span_notice("Alt-click to crawl through it.")
-/obj/machinery/atmospherics/New(loc, process = TRUE, setdir)
+/obj/machinery/atmospherics/Initialize(loc, process = TRUE, setdir)
if(!isnull(setdir))
setDir(setdir)
if(pipe_flags & PIPING_CARDINAL_AUTONORMALIZE)
@@ -53,9 +54,12 @@ GLOBAL_LIST_EMPTY(pipeimages)
nodes = new(device_type)
if (!armor)
armor = list("melee" = 25, "bullet" = 10, "laser" = 10, "energy" = 100, "bomb" = 0, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 70)
- ..()
+ . = ..()
if(process)
- SSair.atmos_machinery += src
+ if(interacts_with_air)
+ SSair.atmos_air_machinery += src
+ else
+ SSair.atmos_machinery += src
SetInitDirections()
/obj/machinery/atmospherics/Destroy()
@@ -63,6 +67,7 @@ GLOBAL_LIST_EMPTY(pipeimages)
nullifyNode(i)
SSair.atmos_machinery -= src
+ SSair.atmos_air_machinery -= src
if(SSair.currentpart == SSAIR_ATMOSMACHINERY)
SSair.currentrun -= src
SSair.pipenets_needing_rebuilt -= src
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
index 9181b33d5709..da6dd7075993 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/dp_vent_pump.dm
@@ -15,6 +15,7 @@
desc = "Has a valve and pump attached to it. There are two ports."
level = 1
+ interacts_with_air = TRUE
var/frequency = 0
var/id = null
var/datum/radio_frequency/radio_connection
@@ -52,7 +53,8 @@
/obj/machinery/atmospherics/components/binary/dp_vent_pump/process_atmos()
..()
-
+ if(welded || !is_operational() || !isopenturf(loc))
+ return FALSE
if(!on)
return
var/datum/gas_mixture/air1 = airs[1]
@@ -73,19 +75,14 @@
if(air1.return_temperature() > 0)
var/transfer_moles = pressure_delta*environment.return_volume()/(air1.return_temperature() * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = air1.remove(transfer_moles)
- //Removed can be null if there is no atmosphere in air1
- if(!removed)
- return
+ loc.assume_air_moles(air1, transfer_moles)
- loc.assume_air(removed)
air_update_turf()
var/datum/pipeline/parent1 = parents[1]
- parent1.update = 1
+ parent1.update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
else //external -> output
-
if(environment.return_pressure() > 0)
var/our_multiplier = air2.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION)
var/moles_delta = 10000 * our_multiplier
@@ -93,20 +90,15 @@
moles_delta = min(moles_delta, (environment_pressure - output_pressure_max) * environment.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION))
if(pressure_checks&INPUT_MIN)
moles_delta = min(moles_delta, (input_pressure_min - air2.return_pressure()) * our_multiplier)
-
- if(moles_delta > 0)
- var/datum/gas_mixture/removed = loc.remove_air(moles_delta)
- if (isnull(removed)) // in space
- return
- air2.merge(removed)
+ if(moles_delta > 0)
+ loc.transfer_air(air2, moles_delta)
air_update_turf()
var/datum/pipeline/parent2 = parents[2]
- parent2.update = 1
-
- //Radio remote control
+ parent2.update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
+//Radio remote control
/obj/machinery/atmospherics/components/binary/dp_vent_pump/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
index bdb23355e1d6..51c2dc18aabe 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/passive_gate.dm
@@ -57,26 +57,7 @@ Passive gate is similar to the regular pump except:
var/datum/gas_mixture/air1 = airs[1]
var/datum/gas_mixture/air2 = airs[2]
-
- var/output_starting_pressure = air2.return_pressure()
- var/input_starting_pressure = air1.return_pressure()
-
- if(output_starting_pressure >= min(target_pressure,input_starting_pressure-10))
- //No need to pump gas if target is already reached or input pressure is too low
- //Need at least 10 KPa difference to overcome friction in the mechanism
- return
-
- //Calculate necessary moles to transfer using PV = nRT
- if((air1.total_moles() > 0) && (air1.return_temperature()>0))
- var/pressure_delta = min(target_pressure - output_starting_pressure, (input_starting_pressure - output_starting_pressure)/2)
- //Can not have a pressure delta that would cause output_pressure > input_pressure
-
- var/transfer_moles = pressure_delta*air2.return_volume()/(air1.return_temperature() * R_IDEAL_GAS_EQUATION)
-
- //Actually transfer the gas
- var/datum/gas_mixture/removed = air1.remove(transfer_moles)
- air2.merge(removed)
-
+ if(air1.release_gas_to(air2, target_pressure))
update_parents()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
index 72c5cd0be971..2daafa5e725f 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/pump.dm
@@ -55,21 +55,16 @@
var/datum/gas_mixture/air1 = airs[1]
var/datum/gas_mixture/air2 = airs[2]
-
var/output_starting_pressure = air2.return_pressure()
-
if((target_pressure - output_starting_pressure) < 0.01)
//No need to pump gas if target is already reached!
return
-
//Calculate necessary moles to transfer using PV=nRT
if((air1.total_moles() > 0) && (air1.return_temperature()>0))
var/pressure_delta = target_pressure - output_starting_pressure
var/transfer_moles = pressure_delta*air2.return_volume()/(air1.return_temperature() * R_IDEAL_GAS_EQUATION)
- //Actually transfer the gas
- var/datum/gas_mixture/removed = air1.remove(transfer_moles)
- air2.merge(removed)
+ air1.transfer_to(air2,transfer_moles)
update_parents()
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm
index 3c7a39dd59c1..2049e940824d 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/temperature_pump.dm
@@ -32,18 +32,31 @@
icon_state = "tpump_[on && is_operational() ? "on" : "off"]-[set_overlay_offset(piping_layer)]"
/obj/machinery/atmospherics/components/binary/temperature_pump/process_atmos()
- ..()
+
if(!on || !is_operational())
return
var/datum/gas_mixture/air_input = airs[1]
var/datum/gas_mixture/air_output = airs[2]
- if((air_output.return_temperature() + heat_transfer_rate) >= air_input.return_temperature() || (air_input.return_temperature() - heat_transfer_rate) <= TCRYO)
+ if(!QUANTIZE(air_input.total_moles()) || !QUANTIZE(air_output.total_moles())) //Don't transfer if there's no gas
return
+ var/datum/gas_mixture/remove_input = air_input.remove_ratio(0.9)
+ var/datum/gas_mixture/remove_output = air_output.remove_ratio(0.9)
+
+ var/coolant_temperature_delta = remove_input.return_temperature() - remove_output.return_temperature()
+
+ if(coolant_temperature_delta > 0)
+ var/input_capacity = remove_input.heat_capacity()
+ var/output_capacity = air_output.heat_capacity()
+
+ var/cooling_heat_amount = (heat_transfer_rate * 0.01) * coolant_temperature_delta * (input_capacity * output_capacity / (input_capacity + output_capacity))
+ remove_input.set_temperature(max(remove_input.return_temperature() - (cooling_heat_amount / input_capacity), TCMB))
+ remove_output.set_temperature(max(remove_output.return_temperature() + (cooling_heat_amount / output_capacity), TCMB))
+
+ air_input.merge(remove_input)
+ air_output.merge(remove_output)
- air_input.set_temperature(air_input.return_temperature() - heat_transfer_rate)
- air_output.set_temperature(air_output.return_temperature() + heat_transfer_rate)
update_parents()
/obj/machinery/atmospherics/components/binary/temperature_pump/ui_interact(mob/user, datum/tgui/ui)
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm
index 1974d31816fd..336c2c50f7f7 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/valve.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/valve.dm
@@ -24,6 +24,17 @@ It's like a regular ol' straight pipe, but you can turn it on and off.
var/switching = FALSE
+
+/obj/machinery/atmospherics/components/binary/valve/Destroy()
+ //Should only happen on extreme circumstances
+ if(on)
+ //Let's give presumably now-severed pipenets a chance to scramble for what's happening at next SSair fire()
+ if(parents[1])
+ parents[1].update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
+ if(parents[2])
+ parents[2].update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
+ . = ..()
+
/obj/machinery/atmospherics/components/binary/valve/update_icon_nopipes(animation = FALSE)
normalize_cardinal_directions()
if(animation)
diff --git a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
index 499b9bc773d7..5c79c9d93f6d 100644
--- a/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
+++ b/code/modules/atmospherics/machinery/components/binary_devices/volume_pump.dm
@@ -67,18 +67,15 @@
return
- var/transfer_ratio = transfer_rate/air1.return_volume()
-
- var/datum/gas_mixture/removed = air1.remove_ratio(transfer_ratio)
-
if(overclocked)//Some of the gas from the mixture leaks to the environment when overclocked
var/turf/open/T = loc
if(istype(T))
- var/datum/gas_mixture/leaked = removed.remove_ratio(VOLUME_PUMP_LEAK_AMOUNT)
+ var/datum/gas_mixture/leaked = air1.remove_ratio(VOLUME_PUMP_LEAK_AMOUNT)
T.assume_air(leaked)
T.air_update_turf()
- air2.merge(removed)
+ var/transfer_ratio = transfer_rate / air1.return_volume()
+ air1.transfer_ratio_to(air2,transfer_ratio)
update_parents()
diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm
index 1865c441b545..d1515aa4b3ff 100644
--- a/code/modules/atmospherics/machinery/components/components_base.dm
+++ b/code/modules/atmospherics/machinery/components/components_base.dm
@@ -84,8 +84,16 @@
reference.other_atmosmch -= src
parents[i] = null
+// We should return every air sharing a parent
/obj/machinery/atmospherics/components/returnPipenetAir(datum/pipeline/reference)
- return airs[parents.Find(reference)]
+ for(var/i in 1 to device_type)
+ if(parents[i] == reference)
+ if(.)
+ if(!islist(.))
+ . = list(.)
+ . += airs[i]
+ else
+ . = airs[i]
/obj/machinery/atmospherics/components/pipeline_expansion(datum/pipeline/reference)
if(reference)
@@ -116,14 +124,9 @@
times_lost++
var/shared_loss = lost/times_lost
- var/datum/gas_mixture/to_release
for(var/i in 1 to device_type)
var/datum/gas_mixture/air = airs[i]
- if(!to_release)
- to_release = air.remove(shared_loss)
- continue
- to_release.merge(air.remove(shared_loss))
- T.assume_air(to_release)
+ T.assume_air_moles(air, shared_loss)
air_update_turf(1)
/obj/machinery/atmospherics/components/proc/safe_input(var/title, var/text, var/default_set)
@@ -138,10 +141,11 @@
for(var/i in 1 to device_type)
var/datum/pipeline/parent = parents[i]
if(!parent)
- WARNING("Component is missing a pipenet! Rebuilding...")
+ //WARNING("Component is missing a pipenet! Rebuilding...")
+ //At pre-SSair_rebuild_pipenets times, not having a parent wasn't supposed to happen
SSair.add_to_rebuild_queue(src)
- else
- parent.update = 1
+ continue
+ parent.update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
/obj/machinery/atmospherics/components/returnPipenets()
. = list()
diff --git a/code/modules/atmospherics/machinery/components/gas_recipe_machines/atmos_machines_recipes.dm b/code/modules/atmospherics/machinery/components/gas_recipe_machines/atmos_machines_recipes.dm
index a1c3e448aa8a..ac454dfc94e2 100644
--- a/code/modules/atmospherics/machinery/components/gas_recipe_machines/atmos_machines_recipes.dm
+++ b/code/modules/atmospherics/machinery/components/gas_recipe_machines/atmos_machines_recipes.dm
@@ -45,7 +45,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 150000
reaction_type = ENDOTHERMIC_REACTION
energy_release = 2500000
- requirements = list(/datum/gas/hydrogen = 300, /datum/gas/bz = 50)
+ requirements = list(GAS_H2 = 300, GAS_BZ = 50)
products = list(/obj/item/stack/sheet/mineral/metal_hydrogen = 1)
/datum/gas_recipe/crystallizer/healium_grenade
@@ -55,7 +55,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 400
reaction_type = ENDOTHERMIC_REACTION
energy_release = 2000000
- requirements = list(/datum/gas/healium = 100, /datum/gas/freon = 120, /datum/gas/plasma = 50)
+ requirements = list(GAS_HEALIUM = 100, GAS_FREON = 120, GAS_PLASMA = 50)
products = list(/obj/item/grenade/gas_crystal/healium_crystal = 1)
/datum/gas_recipe/crystallizer/pluonium_grenade
@@ -65,7 +65,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 400
reaction_type = EXOTHERMIC_REACTION
energy_release = 1500000
- requirements = list(/datum/gas/pluonium = 100, /datum/gas/nitrogen = 80, /datum/gas/oxygen = 80)
+ requirements = list(GAS_PLUONIUM = 100, GAS_N2 = 80, GAS_O2 = 80)
products = list(/obj/item/grenade/gas_crystal/pluonium_crystal = 1)
/datum/gas_recipe/crystallizer/hot_ice
@@ -75,7 +75,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 35
reaction_type = ENDOTHERMIC_REACTION
energy_release = 3000000
- requirements = list(/datum/gas/freon = 60, /datum/gas/plasma = 160, /datum/gas/oxygen = 80)
+ requirements = list(GAS_FREON = 60, GAS_PLASMA = 160, GAS_O2 = 80)
products = list(/obj/item/stack/sheet/hot_ice = 1)
/datum/gas_recipe/crystallizer/ammonia_crystal
@@ -85,7 +85,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 240
reaction_type = EXOTHERMIC_REACTION
energy_release = 950000
- requirements = list(/datum/gas/hydrogen = 50, /datum/gas/nitrogen = 40)
+ requirements = list(GAS_H2 = 50, GAS_N2 = 40)
products = list(/obj/item/stack/ammonia_crystals = 2)
/datum/gas_recipe/crystallizer/tesla
@@ -96,7 +96,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
reaction_type = ENDOTHERMIC_REACTION
energy_release = 350000
dangerous = TRUE
- requirements = list(/datum/gas/stimulum = 500, /datum/gas/freon = 500, /datum/gas/nitryl = 800)
+ requirements = list(GAS_STIMULUM = 500, GAS_FREON = 500, GAS_NITRYL = 800)
products = list(/obj/machinery/the_singularitygen/tesla = 1)
/datum/gas_recipe/crystallizer/n2o_crystal
@@ -106,7 +106,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 350
reaction_type = EXOTHERMIC_REACTION
energy_release = 3500000
- requirements = list(/datum/gas/nitrous_oxide = 100, /datum/gas/bz = 5)
+ requirements = list(GAS_NITROUS = 100, GAS_BZ = 5)
products = list(/obj/item/grenade/gas_crystal/nitrous_oxide_crystal = 1)
/datum/gas_recipe/crystallizer/diamond
@@ -116,7 +116,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 30000
reaction_type = ENDOTHERMIC_REACTION
energy_release = 9500000
- requirements = list(/datum/gas/carbon_dioxide = 10000)
+ requirements = list(GAS_CO2 = 10000)
products = list(/obj/item/stack/sheet/mineral/diamond = 1)
/datum/gas_recipe/crystallizer/plasma_sheet
@@ -126,7 +126,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 20
reaction_type = EXOTHERMIC_REACTION
energy_release = 3500000
- requirements = list(/datum/gas/plasma = 450)
+ requirements = list(GAS_PLASMA = 450)
products = list(/obj/item/stack/sheet/mineral/plasma = 1)
/datum/gas_recipe/crystallizer/crystal_cell
@@ -136,7 +136,7 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 90
reaction_type = ENDOTHERMIC_REACTION
energy_release = 800000
- requirements = list(/datum/gas/plasma = 800, /datum/gas/healium = 100, /datum/gas/bz = 50)
+ requirements = list(GAS_PLASMA = 800, GAS_HEALIUM = 100, GAS_BZ = 50)
products = list(/obj/item/stock_parts/cell/crystal_cell = 1)
/datum/gas_recipe/crystallizer/zaukerite
@@ -146,5 +146,5 @@ GLOBAL_LIST_INIT(gas_recipe_meta, gas_recipes_list())
max_temp = 20
reaction_type = EXOTHERMIC_REACTION
energy_release = 2900000
- requirements = list(/datum/gas/hypernoblium = 5, /datum/gas/zauker = 10, /datum/gas/bz = 7.5)
+ requirements = list(GAS_HYPERNOB = 5, GAS_ZAUKER = 10, GAS_BZ = 7.5)
products = list(/obj/item/stack/sheet/mineral/zaukerite = 2)
diff --git a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm
index 592c7e85b615..e08ef5cb09e3 100644
--- a/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm
+++ b/code/modules/atmospherics/machinery/components/gas_recipe_machines/crystallizer.dm
@@ -282,13 +282,13 @@
if(internal.total_moles())
for(var/gasid in internal.get_gases())
internal_gas_data.Add(list(list(
- "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME],
+ "name"= GLOB.gas_data.names[gasid],
"amount" = round(internal.get_moles(gasid), 0.01),
)))
else
for(var/gasid in internal.get_gases())
internal_gas_data.Add(list(list(
- "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME],
+ "name"= GLOB.gas_data.names[gasid],
"amount" = 0,
)))
data["internal_gas_data"] = internal_gas_data
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
index d472abb5b30f..aa01d34e24b8 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/filter.dm
@@ -76,37 +76,17 @@
//No need to transfer if target is already full!
return
- var/transfer_ratio = transfer_rate/air1.return_volume()
+ var/transfer_ratio = transfer_rate / air1.return_volume()
//Actually transfer the gas
if(transfer_ratio <= 0)
return
- var/datum/gas_mixture/removed = air1.remove_ratio(transfer_ratio)
-
- if(!removed)
- return
-
- var/filtering = TRUE
- if(!ispath(filter_type))
- if(filter_type)
- filter_type = gas_id2path(filter_type) //support for mappers so they don't need to type out paths
- else
- filtering = FALSE
-
- if(filtering && removed.get_moles(filter_type))
- var/datum/gas_mixture/filtered_out = new
-
- filtered_out.set_temperature(removed.return_temperature())
- filtered_out.set_moles(filter_type, removed.get_moles(filter_type))
-
- removed.set_moles(filter_type, 0)
-
- var/datum/gas_mixture/target = (air2.return_pressure() < MAX_OUTPUT_PRESSURE ? air2 : air1) //if there's no room for the filtered gas; just leave it in air1
- target.merge(filtered_out)
-
- air3.merge(removed)
+ if(filter_type && air2.return_pressure() <= 9000)
+ air1.scrub_into(air2, transfer_ratio, list(filter_type))
+ if(air3.return_pressure() <= 9000)
+ air1.transfer_ratio_to(air3, transfer_ratio)
update_parents()
@@ -127,10 +107,9 @@
data["max_rate"] = round(MAX_TRANSFER_RATE)
data["filter_types"] = list()
- data["filter_types"] += list(list("name" = "Nothing", "path" = "", "selected" = !filter_type))
- for(var/path in GLOB.meta_gas_info)
- var/list/gas = GLOB.meta_gas_info[path]
- data["filter_types"] += list(list("name" = gas[META_GAS_NAME], "id" = gas[META_GAS_ID], "selected" = (path == gas_id2path(filter_type))))
+ data["filter_types"] += list(list("name" = "Nothing", "id" = "", "selected" = !filter_type))
+ for(var/id in GLOB.gas_data.ids)
+ data["filter_types"] += list(list("name" = GLOB.gas_data.names[id], "id" = id, "selected" = (id == filter_type)))
return data
@@ -162,12 +141,11 @@
if("filter")
filter_type = null
var/filter_name = "nothing"
- var/gas = gas_id2path(params["mode"])
- if(gas in GLOB.meta_gas_info)
+ var/gas = params["mode"]
+ if(gas in GLOB.gas_data.names)
filter_type = gas
- filter_name = GLOB.meta_gas_info[gas][META_GAS_NAME]
+ filter_name = GLOB.gas_data.names[gas]
investigate_log("was set to filter [filter_name] by [key_name(usr)]", INVESTIGATE_ATMOS)
- investigate_log("was set to filter [filter_name] by [key_name(usr)]", INVESTIGATE_SUPERMATTER) // yogs - make supermatter invest useful
. = TRUE
update_icon()
diff --git a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
index 39f38b22030b..d1fc2b20cb01 100644
--- a/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
+++ b/code/modules/atmospherics/machinery/components/trinary_devices/mixer.dm
@@ -108,19 +108,17 @@
//Actually transfer the gas
if(transfer_moles1)
- var/datum/gas_mixture/removed1 = air1.remove(transfer_moles1)
- air3.merge(removed1)
+ air1.transfer_to(air3, transfer_moles1)
var/datum/pipeline/parent1 = parents[1]
- parent1.update = TRUE
+ parent1.update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
if(transfer_moles2)
- var/datum/gas_mixture/removed2 = air2.remove(transfer_moles2)
- air3.merge(removed2)
+ air2.transfer_to(air3, transfer_moles2)
var/datum/pipeline/parent2 = parents[2]
- parent2.update = TRUE
+ parent2.update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
var/datum/pipeline/parent3 = parents[3]
- parent3.update = TRUE
+ parent3.update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
/obj/machinery/atmospherics/components/trinary/mixer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index d8501c0e7f57..988ca01463a0 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -234,7 +234,7 @@
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
beaker.reagents.reaction(occupant, VAPOR)
- air1.adjust_moles(/datum/gas/oxygen, -max(0,air1.get_moles(/datum/gas/oxygen) - 2 / efficiency)) //Let's use gas for this
+ air1.adjust_moles(GAS_O2, -max(0,air1.get_moles(GAS_O2) - 2 / efficiency)) //Let's use gas for this
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
reagent_transfer = 0
@@ -248,7 +248,7 @@
var/datum/gas_mixture/air1 = airs[1]
- if(!nodes[1] || !airs[1] || air1.get_moles(/datum/gas/oxygen) < 5) // Turn off if the machine won't work.
+ if(!nodes[1] || !airs[1] || air1.get_moles(GAS_O2) < 5) // Turn off if the machine won't work.
on = FALSE
update_icon()
return
@@ -270,7 +270,7 @@
air1.set_temperature(max(air1.return_temperature() - heat / air_heat_capacity, TCMB))
mob_occupant.adjust_bodytemperature(heat / heat_capacity, TCMB)
- air1.set_moles(/datum/gas/oxygen, max(0,air1.get_moles(/datum/gas/oxygen) - 0.5 / efficiency)) // Magically consume gas? Why not, we run on cryo magic.
+ air1.set_moles(GAS_O2, max(0,air1.get_moles(GAS_O2) - 0.5 / efficiency)) // Magically consume gas? Why not, we run on cryo magic.
/obj/machinery/atmospherics/components/unary/cryo_cell/relaymove(mob/user)
if(message_cooldown <= world.time)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
index b26ecd7456ed..8650e8141402 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/outlet_injector.dm
@@ -19,6 +19,7 @@
var/datum/radio_frequency/radio_connection
level = 1
+ interacts_with_air = TRUE
layer = GAS_SCRUBBER_LAYER
pipe_state = "injector"
@@ -62,13 +63,8 @@
var/datum/gas_mixture/air_contents = airs[1]
if(air_contents.return_temperature() > 0)
- var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.return_temperature() * R_IDEAL_GAS_EQUATION)
-
- var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
-
- loc.assume_air(removed)
+ loc.assume_air_ratio(air_contents, volume_rate / air_contents.return_volume())
air_update_turf()
-
update_parents()
/obj/machinery/atmospherics/components/unary/outlet_injector/proc/inject()
@@ -81,9 +77,7 @@
injecting = 1
if(air_contents.return_temperature() > 0)
- var/transfer_moles = (air_contents.return_pressure())*volume_rate/(air_contents.return_temperature() * R_IDEAL_GAS_EQUATION)
- var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
- loc.assume_air(removed)
+ loc.assume_air_ratio(air_contents, volume_rate / air_contents.return_volume())
update_parents()
flick("inje_inject", src)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm
index 933455cf947f..61d21bc3596d 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/passive_vent.dm
@@ -1,67 +1,52 @@
/obj/machinery/atmospherics/components/unary/passive_vent
- icon_state = "passive_vent_map-3"
+ icon_state = "passive_vent_map-2"
name = "passive vent"
desc = "It is an open vent."
-
can_unwrench = TRUE
+
+ level = 1
+ interacts_with_air = TRUE
layer = GAS_SCRUBBER_LAYER
- shift_underlay_only = FALSE
pipe_state = "pvent"
/obj/machinery/atmospherics/components/unary/passive_vent/update_icon_nopipes()
cut_overlays()
if(showpipe)
- var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions)
+ var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, piping_layer = piping_layer)
add_overlay(cap)
icon_state = "passive_vent"
/obj/machinery/atmospherics/components/unary/passive_vent/process_atmos()
- return
- /* MONSTER EXTOOLS PROC NEEDED (EQUALIZE)
-////////////////////////////////////////////////////////////////////////
- /datum/gas_mixture/proc/equalize(datum/gas_mixture/other)
- . = FALSE
- if(abs(return_temperature() - other.return_temperature()) > MINIMUM_TEMPERATURE_DELTA_TO_SUSPEND)
- . = TRUE
- var/self_heat_cap = heat_capacity()
- var/other_heat_cap = other.heat_capacity()
- var/new_temp = (temperature * self_heat_cap + other.temperature * other_heat_cap) / (self_heat_cap + other_heat_cap)
- temperature = new_temp
- other.temperature = new_temp
-
- var/min_p_delta = 0.1
- var/total_volume = volume + other.volume
- var/list/gas_list = gases | other.gases
- for(var/gas_id in gas_list)
- assert_gas(gas_id)
- other.assert_gas(gas_id)
- //math is under the assumption temperatures are equal
- if(abs(gases[gas_id][MOLES] / volume - other.gases[gas_id][MOLES] / other.volume) > min_p_delta / (R_IDEAL_GAS_EQUATION * temperature))
- . = TRUE
- var/total_moles = gases[gas_id][MOLES] + other.gases[gas_id][MOLES]
- gases[gas_id][MOLES] = total_moles * (volume/total_volume)
- other.gases[gas_id][MOLES] = total_moles * (other.volume/total_volume)
- ////////////////////////////////////////////////////////////////////////////////
-
-
..()
+ if(isclosedturf(loc))
+ return
+ var/active = FALSE
var/datum/gas_mixture/external = loc.return_air()
var/datum/gas_mixture/internal = airs[1]
+ var/external_pressure = external.return_pressure()
+ var/internal_pressure = internal.return_pressure()
+ var/pressure_delta = abs(external_pressure - internal_pressure)
+
+ if(pressure_delta > 0.5)
+ equalize_all_gases_in_list(list(internal,external))
+ active = TRUE
+
+ active = internal.temperature_share(external, OPEN_HEAT_TRANSFER_COEFFICIENT) || active
- if(internal.equalize(external))
+ if(active)
air_update_turf()
update_parents()
-*/
+
/obj/machinery/atmospherics/components/unary/passive_vent/can_crawl_through()
return TRUE
-/obj/machinery/atmospherics/components/unary/passive_vent/layer2
- piping_layer = 2
- icon_state = "passive_vent_map-2"
+/obj/machinery/atmospherics/components/unary/passive_vent/layer1
+ piping_layer = 1
+ icon_state = "passive_vent_map-1"
-/obj/machinery/atmospherics/components/unary/passive_vent/layer4
- piping_layer = 4
- icon_state = "passive_vent_map-4"
+/obj/machinery/atmospherics/components/unary/passive_vent/layer3
+ piping_layer = 3
+ icon_state = "passive_vent_map-3"
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm
index 782bbe2e4064..23b0e4f51a6e 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/portables_connector.dm
@@ -1,16 +1,17 @@
/obj/machinery/atmospherics/components/unary/portables_connector
- icon_state = "connector"
+ icon_state = "connector_map-2"
+
name = "connector port"
desc = "For connecting portables devices related to atmospherics control."
+
can_unwrench = TRUE
+
use_power = NO_POWER_USE
level = 0
layer = GAS_FILTER_LAYER
- shift_underlay_only = FALSE
+
pipe_flags = PIPING_ONE_PER_TURF
pipe_state = "connector"
- piping_layer = 3
- showpipe = TRUE
var/obj/machinery/portable_atmospherics/connected_device
@@ -27,8 +28,7 @@
/obj/machinery/atmospherics/components/unary/portables_connector/update_icon_nopipes()
icon_state = "connector"
if(showpipe)
- cut_overlays()
- var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions)
+ var/image/cap = getpipeimage(icon, "connector_cap", initialize_directions, piping_layer = piping_layer)
add_overlay(cap)
/obj/machinery/atmospherics/components/unary/portables_connector/process_atmos()
@@ -39,9 +39,16 @@
/obj/machinery/atmospherics/components/unary/portables_connector/can_unwrench(mob/user)
. = ..()
if(. && connected_device)
- to_chat(user, span_warning("You cannot unwrench [src], detach [connected_device] first!"))
+ to_chat(user, "You cannot unwrench [src], detach [connected_device] first!")
return FALSE
+/obj/machinery/atmospherics/components/unary/portables_connector/portableConnectorReturnAir()
+ return connected_device.portableConnectorReturnAir()
+
+/obj/proc/portableConnectorReturnAir()
+ return
+
+
/obj/machinery/atmospherics/components/unary/portables_connector/layer2
piping_layer = 2
icon_state = "connector_map-2"
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm
index c52bd69bb205..2e58310386ce 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm
@@ -14,14 +14,14 @@
var/volume = 10000 //in liters
var/gas_type = 0
-/obj/machinery/atmospherics/components/unary/tank/New()
- ..()
+/obj/machinery/atmospherics/components/unary/tank/Initialize()
+ . = ..()
var/datum/gas_mixture/air_contents = airs[1]
air_contents.set_volume(volume)
air_contents.set_temperature(T20C)
if(gas_type)
- air_contents.set_moles(AIR_CONTENTS)
- name = "[name] ([GLOB.meta_gas_info[gas_type][META_GAS_NAME]])"
+ air_contents.set_moles(gas_type, AIR_CONTENTS)
+ name = "[name] ([GLOB.gas_data.names[gas_type]])"
setPipingLayer(piping_layer)
@@ -29,43 +29,43 @@
icon_state = "grey"
name = "pressure tank (Air)"
-/obj/machinery/atmospherics/components/unary/tank/air/New()
- ..()
+/obj/machinery/atmospherics/components/unary/tank/air/Initialize()
+ . = ..()
var/datum/gas_mixture/air_contents = airs[1]
- air_contents.set_moles(/datum/gas/oxygen, AIR_CONTENTS * 0.2)
- air_contents.set_moles(/datum/gas/nitrogen, AIR_CONTENTS * 0.8)
+ air_contents.set_moles(GAS_O2, AIR_CONTENTS * 0.2)
+ air_contents.set_moles(GAS_N2, AIR_CONTENTS * 0.8)
/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide
- gas_type = /datum/gas/carbon_dioxide
+ gas_type = GAS_CO2
-/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/New()
- ..()
+/obj/machinery/atmospherics/components/unary/tank/carbon_dioxide/Initialize()
+ . = ..()
var/datum/gas_mixture/air_contents = airs[1]
- air_contents.set_moles(/datum/gas/carbon_dioxide, AIR_CONTENTS)
+ air_contents.set_moles(GAS_CO2, AIR_CONTENTS)
/obj/machinery/atmospherics/components/unary/tank/toxins
icon_state = "orange"
- gas_type = /datum/gas/plasma
+ gas_type = GAS_PLASMA
-/obj/machinery/atmospherics/components/unary/tank/toxins/New()
- ..()
+/obj/machinery/atmospherics/components/unary/tank/toxins/Initialize()
+ . = ..()
var/datum/gas_mixture/air_contents = airs[1]
- air_contents.set_moles(/datum/gas/plasma, AIR_CONTENTS)
+ air_contents.set_moles(GAS_PLASMA, AIR_CONTENTS)
/obj/machinery/atmospherics/components/unary/tank/oxygen
icon_state = "blue"
- gas_type = /datum/gas/oxygen
+ gas_type = GAS_O2
-/obj/machinery/atmospherics/components/unary/tank/oxygen/New()
- ..()
+/obj/machinery/atmospherics/components/unary/tank/oxygen/Initialize()
+ . = ..()
var/datum/gas_mixture/air_contents = airs[1]
- air_contents.set_moles(/datum/gas/oxygen, AIR_CONTENTS)
+ air_contents.set_moles(GAS_O2, AIR_CONTENTS)
/obj/machinery/atmospherics/components/unary/tank/nitrogen
icon_state = "red"
- gas_type = /datum/gas/nitrogen
+ gas_type = GAS_N2
-/obj/machinery/atmospherics/components/unary/tank/nitrogen/New()
- ..()
+/obj/machinery/atmospherics/components/unary/tank/nitrogen/Initialize()
+ . = ..()
var/datum/gas_mixture/air_contents = airs[1]
- air_contents.set_moles(/datum/gas/nitrogen, AIR_CONTENTS)
\ No newline at end of file
+ air_contents.set_moles(GAS_N2, AIR_CONTENTS)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
index 17c6b028b226..b933dadd6e0f 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_pump.dm
@@ -6,7 +6,7 @@
#define RELEASING 1
/obj/machinery/atmospherics/components/unary/vent_pump
- icon_state = "vent_map-3"
+ icon_state = "vent_map-2"
name = "air vent"
desc = "Has a valve and pump attached to it."
@@ -16,8 +16,8 @@
welded = FALSE
level = 1
layer = GAS_SCRUBBER_LAYER
- shift_underlay_only = FALSE
- showpipe = FALSE
+
+ interacts_with_air = TRUE
var/id_tag = null
var/pump_direction = RELEASING
@@ -29,12 +29,6 @@
// INT_BOUND: Do not pass internal_pressure_bound
// NO_BOUND: Do not pass either
- var/fast_fill = TRUE
- var/space_detection = TRUE
- var/space_shutoff_ticks = 0
- var/last_moles
- var/last_moles_added
-
var/frequency = FREQ_ATMOS_CONTROL
var/datum/radio_frequency/radio_connection
var/radio_filter_out
@@ -48,9 +42,6 @@
..()
if(!id_tag)
id_tag = assign_uid_vents()
- var/datum/gas_mixture/N = airs[1]
- N.set_volume(1000) // Increase the volume of the air vent's node.
- // Allows it to pump much faster.
/obj/machinery/atmospherics/components/unary/vent_pump/Destroy()
var/area/A = get_area(src)
@@ -67,10 +58,8 @@
/obj/machinery/atmospherics/components/unary/vent_pump/update_icon_nopipes()
cut_overlays()
if(showpipe)
- var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions)
+ var/image/cap = getpipeimage(icon, "vent_cap", initialize_directions, piping_layer = piping_layer)
add_overlay(cap)
- else
- PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT)
if(welded)
icon_state = "vent_welded"
@@ -82,21 +71,12 @@
return
if(pump_direction & RELEASING)
- var/do_flick = (icon_state == "vent_out")
- if(space_shutoff_ticks > 0)
- icon_state = "vent_off_spaceerror"
- else
- icon_state = "vent_off"
- if(do_flick)
- flick("vent_out-off", src)
+ icon_state = "vent_out-off"
else // pump_direction == SIPHONING
- var/do_flick = (icon_state == "vent_in")
- icon_state = "vent_off"
- if(do_flick)
- flick("vent_in-off",src)
+ icon_state = "vent_in-off"
return
- if(icon_state == "vent_out-off" || icon_state == "vent_in-off" || icon_state == "vent_off" || icon_state == "vent_off_spaceerror")
+ if(icon_state == ("vent_out-off" || "vent_in-off" || "vent_off"))
if(pump_direction & RELEASING)
icon_state = "vent_out"
flick("vent_out-starting", src)
@@ -112,63 +92,37 @@
/obj/machinery/atmospherics/components/unary/vent_pump/process_atmos()
..()
- if(!is_operational())
- last_moles_added = 0
+ if(!is_operational() || !isopenturf(loc))
return
- if(space_shutoff_ticks > 0)
- space_shutoff_ticks--
- if(space_shutoff_ticks <= 1 && !on)
- on = TRUE
- update_icon()
if(!nodes[1])
on = FALSE
if(!on || welded)
- last_moles_added = 0
return
var/datum/gas_mixture/air_contents = airs[1]
var/datum/gas_mixture/environment = loc.return_air()
+
+ if(environment == null)
+ return
+
var/environment_pressure = environment.return_pressure()
- var/environment_moles = environment.total_moles()
- var/last_moles_real_added = environment_moles - last_moles
- if(!aac)
- if((last_moles_added > 0 && environment_moles == 0 && space_detection) || (is_mining_level(z) && ISINRANGE(environment_moles, 36, 38)))
- // looks like we have a S P A C E problem.
- last_moles_added = 0
- on = FALSE
- space_shutoff_ticks = 20 // shut off for about 20 seconds before trying again.
- update_icon()
- return
if(pump_direction & RELEASING) // internal -> external
var/pressure_delta = 10000
if(pressure_checks&EXT_BOUND)
- var/multiplier = 1 // fast_fill multiplier
- if(fast_fill)
- if(last_moles_added > 0 && last_moles_real_added > 0)
- multiplier = clamp(last_moles_added / last_moles_real_added * 0.25, 1, 100)
- else if(last_moles_added > 0 && last_moles_real_added < 0 && environment_moles != 0)
- multiplier = 10 // pressure is going down, but let's fight it anyways
- pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure) * multiplier)
+ pressure_delta = min(pressure_delta, (external_pressure_bound - environment_pressure))
if(pressure_checks&INT_BOUND)
pressure_delta = min(pressure_delta, (air_contents.return_pressure() - internal_pressure_bound))
- if(space_shutoff_ticks > 0) // if we just came off a space-shutoff, only transfer a little bit.
- pressure_delta = min(pressure_delta, 10)
if(pressure_delta > 0)
if(air_contents.return_temperature() > 0)
-
var/transfer_moles = pressure_delta*environment.return_volume()/(air_contents.return_temperature() * R_IDEAL_GAS_EQUATION)
- last_moles_added = transfer_moles
-
- var/datum/gas_mixture/removed = air_contents.remove(transfer_moles)
- loc.assume_air(removed)
+ loc.assume_air_moles(air_contents, transfer_moles)
air_update_turf()
else // external -> internal
- last_moles_added = 0
if(environment.return_pressure() > 0)
var/our_multiplier = air_contents.return_volume() / (environment.return_temperature() * R_IDEAL_GAS_EQUATION)
var/moles_delta = 10000 * our_multiplier
@@ -178,13 +132,8 @@
moles_delta = min(moles_delta, (internal_pressure_bound - air_contents.return_pressure()) * our_multiplier)
if(moles_delta > 0)
- var/datum/gas_mixture/removed = loc.remove_air(moles_delta)
- if (isnull(removed)) // in space
- return
-
- air_contents.merge(removed)
+ loc.transfer_air(air_contents, moles_delta)
air_update_turf()
- last_moles = environment_moles
update_parents()
//Radio remote control
@@ -250,11 +199,9 @@
if("power" in signal.data)
on = text2num(signal.data["power"])
- space_shutoff_ticks = 0
if("power_toggle" in signal.data)
on = !on
- space_shutoff_ticks = 0
if("checks" in signal.data)
var/old_checks = pressure_checks
@@ -307,25 +254,23 @@
/obj/machinery/atmospherics/components/unary/vent_pump/welder_act(mob/living/user, obj/item/I)
if(!I.tool_start_check(user, amount=0))
return TRUE
- to_chat(user, span_notice("You begin welding the vent..."))
+ to_chat(user, "You begin welding the vent...")
if(I.use_tool(src, user, 20, volume=50))
if(!welded)
- user.visible_message("[user] welds the vent shut.", span_notice("You weld the vent shut."), span_italics("You hear welding."))
+ user.visible_message("[user] welds the vent shut.", "You weld the vent shut.", "You hear welding.")
welded = TRUE
else
- user.visible_message("[user] unwelded the vent.", span_notice("You unweld the vent."), span_italics("You hear welding."))
+ user.visible_message("[user] unwelded the vent.", "You unweld the vent.", "You hear welding.")
welded = FALSE
update_icon()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
- investigate_log("was [welded ? "welded shut" : "unwelded"] by [key_name(user)]", INVESTIGATE_ATMOS)
- add_fingerprint(user)
return TRUE
/obj/machinery/atmospherics/components/unary/vent_pump/can_unwrench(mob/user)
. = ..()
if(. && on && is_operational())
- to_chat(user, span_warning("You cannot unwrench [src], turn it off first!"))
+ to_chat(user, "You cannot unwrench [src], turn it off first!")
return FALSE
/obj/machinery/atmospherics/components/unary/vent_pump/examine(mob/user)
@@ -334,16 +279,16 @@
. += "It seems welded shut."
/obj/machinery/atmospherics/components/unary/vent_pump/power_change()
- . = ..()
+ ..()
update_icon_nopipes()
/obj/machinery/atmospherics/components/unary/vent_pump/can_crawl_through()
return !welded
/obj/machinery/atmospherics/components/unary/vent_pump/attack_alien(mob/user)
- if(!welded || !(do_after(user, 2 SECONDS, target = src)))
+ if(!welded || !(do_after(user, 20, target = src)))
return
- user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the vent", "You hear loud scraping noises.")
+ user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the vent.", "You hear loud scraping noises.")
welded = FALSE
update_icon()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
index e9fc7beabd7a..ebeccd732c46 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/vent_scrubber.dm
@@ -2,7 +2,7 @@
#define SCRUBBING 1
/obj/machinery/atmospherics/components/unary/vent_scrubber
- icon_state = "scrub_map-3"
+ icon_state = "scrub_map-2"
name = "air scrubber"
desc = "Has a valve and pump attached to it."
@@ -13,12 +13,13 @@
welded = FALSE
level = 1
layer = GAS_SCRUBBER_LAYER
- shift_underlay_only = FALSE
- showpipe = FALSE
+
+ interacts_with_air = TRUE
+
var/id_tag = null
var/scrubbing = SCRUBBING //0 = siphoning, 1 = scrubbing
- var/filter_types = list(/datum/gas/carbon_dioxide)
+ var/filter_types = list(GAS_CO2, GAS_BZ)
var/volume_rate = 200
var/widenet = 0 //is this scrubber acting on the 3x3 area around it.
var/list/turf/adjacent_turfs = list()
@@ -35,11 +36,6 @@
if(!id_tag)
id_tag = assign_uid_vents()
- for(var/f in filter_types)
- if(istext(f))
- filter_types -= f
- filter_types += gas_id2path(f)
-
/obj/machinery/atmospherics/components/unary/vent_scrubber/Destroy()
var/area/A = get_area(src)
if (A)
@@ -70,10 +66,8 @@
/obj/machinery/atmospherics/components/unary/vent_scrubber/update_icon_nopipes()
cut_overlays()
if(showpipe)
- var/image/cap = getpipeimage(icon, "scrub_cap", initialize_directions)
+ var/image/cap = getpipeimage(icon, "scrub_cap", initialize_directions, piping_layer = piping_layer)
add_overlay(cap)
- else
- PIPING_LAYER_SHIFT(src, PIPING_LAYER_DEFAULT)
if(welded)
icon_state = "scrub_welded"
@@ -101,9 +95,8 @@
return FALSE
var/list/f_types = list()
- for(var/path in GLOB.meta_gas_info)
- var/list/gas = GLOB.meta_gas_info[path]
- f_types += list(list("gas_id" = gas[META_GAS_ID], "gas_name" = gas[META_GAS_NAME], "enabled" = (path in filter_types)))
+ for(var/id in GLOB.gas_data.ids)
+ f_types += list(list("gas_id" = id, "gas_name" = GLOB.gas_data.names[id], "enabled" = (id in filter_types)))
var/datum/signal/signal = new(list(
"tag" = id_tag,
@@ -149,38 +142,21 @@
scrub(tile)
return TRUE
-/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/scrub(var/turf/tile)
+/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/scrub(var/turf/open/tile)
if(!istype(tile))
return FALSE
var/datum/gas_mixture/environment = tile.return_air()
var/datum/gas_mixture/air_contents = airs[1]
- if(air_contents.return_pressure() >= 50*ONE_ATMOSPHERE)
+ if(air_contents.return_pressure() >= 50 * ONE_ATMOSPHERE || !islist(filter_types))
return FALSE
if(scrubbing & SCRUBBING)
- var/transfer_moles = min(1, volume_rate/environment.return_volume())*environment.total_moles()
-
- //Take a gas sample
- var/datum/gas_mixture/removed = tile.remove_air(transfer_moles)
-
- //Nothing left to remove from the tile
- if(isnull(removed))
- return FALSE
-
- removed.scrub_into(air_contents, filter_types)
-
- //Remix the resulting gases
- tile.assume_air(removed)
+ environment.scrub_into(air_contents, volume_rate/environment.return_volume(), filter_types)
tile.air_update_turf()
else //Just siphoning all air
-
- var/transfer_moles = environment.total_moles()*(volume_rate/environment.return_volume())
-
- var/datum/gas_mixture/removed = tile.remove_air(transfer_moles)
-
- air_contents.merge(removed)
+ environment.transfer_ratio_to(air_contents, volume_rate/environment.return_volume())
tile.air_update_turf()
update_parents()
@@ -227,12 +203,12 @@
investigate_log(" was toggled to [scrubbing ? "scrubbing" : "siphon"] mode by [key_name(signal_sender)]",INVESTIGATE_ATMOS)
if("toggle_filter" in signal.data)
- filter_types ^= gas_id2path(signal.data["toggle_filter"])
+ filter_types ^= signal.data["toggle_filter"]
if("set_filters" in signal.data)
filter_types = list()
for(var/gas in signal.data["set_filters"])
- filter_types += gas_id2path(gas)
+ filter_types += gas
if("init" in signal.data)
name = signal.data["init"]
@@ -247,13 +223,13 @@
return
/obj/machinery/atmospherics/components/unary/vent_scrubber/power_change()
- . = ..()
+ ..()
update_icon_nopipes()
/obj/machinery/atmospherics/components/unary/vent_scrubber/welder_act(mob/living/user, obj/item/I)
if(!I.tool_start_check(user, amount=0))
return TRUE
- to_chat(user, span_notice("Now welding the scrubber."))
+ to_chat(user, "Now welding the scrubber.")
if(I.use_tool(src, user, 20, volume=50))
if(!welded)
user.visible_message("[user] welds the scrubber shut.","You weld the scrubber shut.", "You hear welding.")
@@ -264,14 +240,12 @@
update_icon()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
pipe_vision_img.plane = ABOVE_HUD_PLANE
- investigate_log("was [welded ? "welded shut" : "unwelded"] by [key_name(user)]", INVESTIGATE_ATMOS)
- add_fingerprint(user)
return TRUE
/obj/machinery/atmospherics/components/unary/vent_scrubber/can_unwrench(mob/user)
. = ..()
if(. && on && is_operational())
- to_chat(user, span_warning("You cannot unwrench [src], turn it off first!"))
+ to_chat(user, "You cannot unwrench [src], turn it off first!")
return FALSE
/obj/machinery/atmospherics/components/unary/vent_scrubber/examine(mob/user)
@@ -283,9 +257,9 @@
return !welded
/obj/machinery/atmospherics/components/unary/vent_scrubber/attack_alien(mob/user)
- if(!welded || !(do_after(user, 2 SECONDS, target = src)))
+ if(!welded || !(do_after(user, 20, target = src)))
return
- user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the scrubber.", "You hear loud scraping noises.")
+ user.visible_message("[user] furiously claws at [src]!", "You manage to clear away the stuff blocking the scrubber.", "You hear loud scraping noises.")
welded = FALSE
update_icon()
pipe_vision_img = image(src, loc, layer = ABOVE_HUD_LAYER, dir = dir)
diff --git a/code/modules/atmospherics/machinery/datum_pipeline.dm b/code/modules/atmospherics/machinery/datum_pipeline.dm
index 06a0a275ff79..2bae4e25e771 100644
--- a/code/modules/atmospherics/machinery/datum_pipeline.dm
+++ b/code/modules/atmospherics/machinery/datum_pipeline.dm
@@ -43,20 +43,22 @@
if(!air)
air = new
var/list/possible_expansions = list(base)
- while(possible_expansions.len)
+ while(possible_expansions.len>0)
for(var/obj/machinery/atmospherics/borderline in possible_expansions)
+
var/list/result = borderline.pipeline_expansion(src)
- if(result && result.len)
+
+ if(result.len>0)
for(var/obj/machinery/atmospherics/P in result)
if(istype(P, /obj/machinery/atmospherics/pipe))
var/obj/machinery/atmospherics/pipe/item = P
if(!members.Find(item))
if(item.parent)
- var/static/pipenetwarnings = 100
+ var/static/pipenetwarnings = 10
if(pipenetwarnings > 0)
- log_mapping("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) around [AREACOORD(item)].")
- pipenetwarnings--
+ log_mapping("build_pipeline(): [item.type] added to a pipenet while still having one. (pipes leading to the same spot stacking in one turf) Nearby: ([item.x], [item.y], [item.z]).")
+ pipenetwarnings -= 1
if(pipenetwarnings == 0)
log_mapping("build_pipeline(): further messages about pipenets will be suppressed")
members += item
@@ -186,13 +188,13 @@
else
return 1
- air.set_temperature(air.return_temperature() + self_temperature_delta);
+ air.set_temperature(air.return_temperature() + self_temperature_delta)
modeled_location.TakeTemperature(sharer_temperature_delta)
else
if((target.heat_capacity>0) && (partial_heat_capacity>0))
- var/delta_temperature = air.return_temperature() - target.temperature
+ var/delta_temperature = air.return_temperature() - target.return_temperature()
var/heat = thermal_conductivity*delta_temperature* \
(partial_heat_capacity*target.heat_capacity/(partial_heat_capacity+target.heat_capacity))
@@ -203,10 +205,14 @@
/datum/pipeline/proc/return_air()
. = other_airs + air
if(null in .)
- stack_trace("[src] has one or more null gas mixtures, which may cause bugs. Null mixtures will not be considered in reconcile_air().")
- return removeNullsFromList(.)
+ stack_trace("[src]([REF(src)]) has one or more null gas mixtures, which may cause bugs. Null mixtures will not be considered in reconcile_air().")
+ listclearnulls(.)
-/datum/pipeline/proc/reconcile_air()
+/datum/pipeline/proc/empty()
+ for(var/datum/gas_mixture/GM in get_all_connected_airs())
+ GM.clear()
+
+/datum/pipeline/proc/get_all_connected_airs()
var/list/datum/gas_mixture/GL = list()
var/list/datum/pipeline/PL = list()
PL += src
@@ -215,8 +221,7 @@
var/datum/pipeline/P = PL[i]
if(!P)
continue
- GL += P.other_airs
- GL += P.air
+ GL += P.return_air()
for(var/atmosmch in P.other_atmosmch)
if (istype(atmosmch, /obj/machinery/atmospherics/components/binary/valve))
var/obj/machinery/atmospherics/components/binary/valve/V = atmosmch
@@ -226,19 +231,9 @@
else if (istype(atmosmch, /obj/machinery/atmospherics/components/unary/portables_connector))
var/obj/machinery/atmospherics/components/unary/portables_connector/C = atmosmch
if(C.connected_device)
- GL += C.connected_device.air_contents
-
- var/datum/gas_mixture/total_gas_mixture = new(0)
- var/total_volume = 0
-
- for(var/i in GL)
- var/datum/gas_mixture/G = i
- total_gas_mixture.merge(G)
- total_volume += G.return_volume()
-
- if(total_volume > 0)
- //Update individual gas_mixtures by volume ratio
- for(var/i in GL)
- var/datum/gas_mixture/G = i
- G.copy_from(total_gas_mixture)
- G.multiply(G.return_volume()/total_volume)
+ GL += C.portableConnectorReturnAir()
+ return GL
+
+/datum/pipeline/proc/reconcile_air()
+ var/list/datum/gas_mixture/GL = get_all_connected_airs()
+ equalize_all_gases_in_list(GL)
diff --git a/code/modules/atmospherics/machinery/other/miner.dm b/code/modules/atmospherics/machinery/other/miner.dm
index 5649e44f340d..d4210f0f605b 100644
--- a/code/modules/atmospherics/machinery/other/miner.dm
+++ b/code/modules/atmospherics/machinery/other/miner.dm
@@ -117,7 +117,7 @@
on_overlay.color = overlay_color
add_overlay(on_overlay)
-/obj/machinery/atmospherics/miner/process()
+/obj/machinery/atmospherics/miner/process_atmos()
update_power()
check_operation()
if(active && !broken)
@@ -144,34 +144,34 @@
/obj/machinery/atmospherics/miner/n2o
name = "\improper N2O Gas Miner"
overlay_color = "#FFCCCC"
- spawn_id = /datum/gas/nitrous_oxide
+ spawn_id = GAS_NITROUS
/obj/machinery/atmospherics/miner/nitrogen
name = "\improper N2 Gas Miner"
overlay_color = "#CCFFCC"
- spawn_id = /datum/gas/nitrogen
+ spawn_id = GAS_N2
/obj/machinery/atmospherics/miner/oxygen
name = "\improper O2 Gas Miner"
overlay_color = "#007FFF"
- spawn_id = /datum/gas/oxygen
+ spawn_id = GAS_O2
/obj/machinery/atmospherics/miner/toxins
name = "\improper Plasma Gas Miner"
overlay_color = "#FF0000"
- spawn_id = /datum/gas/plasma
+ spawn_id = GAS_PLASMA
/obj/machinery/atmospherics/miner/carbon_dioxide
name = "\improper CO2 Gas Miner"
overlay_color = "#CDCDCD"
- spawn_id = /datum/gas/carbon_dioxide
+ spawn_id = GAS_CO2
/obj/machinery/atmospherics/miner/bz
name = "\improper BZ Gas Miner"
overlay_color = "#FAFF00"
- spawn_id = /datum/gas/bz
+ spawn_id = GAS_BZ
/obj/machinery/atmospherics/miner/water_vapor
name = "\improper Water Vapor Gas Miner"
overlay_color = "#99928E"
- spawn_id = /datum/gas/water_vapor
+ spawn_id = GAS_H2O
diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm
index 7bc6043fd76c..ec4ff292ebd9 100644
--- a/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm
+++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/he_pipes.dm
@@ -6,6 +6,7 @@
buckle_lying = -1
var/icon_temperature = T20C //stop small changes in temperature causing icon refresh
resistance_flags = LAVA_PROOF | FIRE_PROOF
+ interacts_with_air = TRUE
/obj/machinery/atmospherics/pipe/heat_exchanging/Initialize()
. = ..()
diff --git a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm
index ab63bddb6a14..a80bb957a014 100644
--- a/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm
+++ b/code/modules/atmospherics/machinery/pipes/heat_exchange/manifold.dm
@@ -17,10 +17,10 @@
var/mutable_appearance/center
-/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/New()
+/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/Initialize()
+ . = ..()
icon_state = ""
center = mutable_appearance(icon, "manifold_center")
- return ..()
/obj/machinery/atmospherics/pipe/heat_exchanging/manifold/SetInitDirections()
initialize_directions = NORTH|SOUTH|EAST|WEST
diff --git a/code/modules/atmospherics/machinery/pipes/manifold.dm b/code/modules/atmospherics/machinery/pipes/manifold.dm
index 7e1464138d0f..448606b4585b 100644
--- a/code/modules/atmospherics/machinery/pipes/manifold.dm
+++ b/code/modules/atmospherics/machinery/pipes/manifold.dm
@@ -26,10 +26,10 @@
* in the mapping subsystem init before Initialize() is called in the atoms subsystem init.
* This is true for the other manifolds (the 4 ways and the heat exchanges) too.
*/
-/obj/machinery/atmospherics/pipe/manifold/New()
+/obj/machinery/atmospherics/pipe/manifold/Initialize()
+ . = ..()
icon_state = ""
center = mutable_appearance(icon, "manifold_center")
- return ..()
/obj/machinery/atmospherics/pipe/manifold/SetInitDirections()
initialize_directions = NORTH|SOUTH|EAST|WEST
diff --git a/code/modules/atmospherics/machinery/pipes/manifold4w.dm b/code/modules/atmospherics/machinery/pipes/manifold4w.dm
index 75aa68046046..872c3fb8c8bd 100644
--- a/code/modules/atmospherics/machinery/pipes/manifold4w.dm
+++ b/code/modules/atmospherics/machinery/pipes/manifold4w.dm
@@ -21,10 +21,10 @@
var/mutable_appearance/center
-/obj/machinery/atmospherics/pipe/manifold4w/New()
+/obj/machinery/atmospherics/pipe/manifold4w/Initialize()
+ . = ..()
icon_state = ""
center = mutable_appearance(icon, "manifold4w_center")
- return ..()
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
initialize_directions = initial(initialize_directions)
diff --git a/code/modules/atmospherics/machinery/pipes/pipes.dm b/code/modules/atmospherics/machinery/pipes/pipes.dm
index 54d437274f81..b6c8700ecf63 100644
--- a/code/modules/atmospherics/machinery/pipes/pipes.dm
+++ b/code/modules/atmospherics/machinery/pipes/pipes.dm
@@ -18,10 +18,10 @@
),\
)
-/obj/machinery/atmospherics/pipe/New()
+/obj/machinery/atmospherics/pipe/Initialize()
+ . = ..()
add_atom_colour(pipe_color, FIXED_COLOUR_PRIORITY)
volume = 35 * device_type
- ..()
/obj/machinery/atmospherics/pipe/nullifyNode(i)
var/obj/machinery/atmospherics/oldN = nodes[i]
@@ -59,6 +59,9 @@
/obj/machinery/atmospherics/pipe/remove_air(amount)
return parent.air.remove(amount)
+/obj/machinery/atmospherics/pipe/remove_air_ratio(ratio)
+ return parent.air.remove_ratio(ratio)
+
/obj/machinery/atmospherics/pipe/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pipe_meter))
var/obj/item/pipe_meter/meter = W
@@ -76,7 +79,8 @@
return ..()
/obj/machinery/atmospherics/pipe/returnPipenet()
- return parent
+ if (parent)
+ return parent.air
/obj/machinery/atmospherics/pipe/setPipenet(datum/pipeline/P)
parent = P
diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm
index 2add86857420..6a4713974955 100644
--- a/code/modules/atmospherics/machinery/portable/canister.dm
+++ b/code/modules/atmospherics/machinery/portable/canister.dm
@@ -22,7 +22,7 @@
integrity_failure = 100
pressure_resistance = 7 * ONE_ATMOSPHERE
var/temperature_resistance = 1000 + T0C
- var/starter_temp
+ var/starter_temp = T20C
// Prototype vars
var/prototype = FALSE
var/valve_timer = null
@@ -85,37 +85,37 @@
name = "Nitrogen canister"
desc = "Nitrogen gas. Reportedly useful for something."
icon_state = "nitrogen"
- gas_type = /datum/gas/nitrogen
+ gas_type = GAS_N2
/obj/machinery/portable_atmospherics/canister/oxygen
name = "Oxygen canister"
desc = "Oxygen. Necessary for human life."
icon_state = "oxygen"
- gas_type = /datum/gas/oxygen
+ gas_type = GAS_O2
/obj/machinery/portable_atmospherics/canister/carbon_dioxide
name = "Carbon dioxide canister"
desc = "Carbon dioxide. What the fuck is carbon dioxide?"
icon_state = "carbon"
- gas_type = /datum/gas/carbon_dioxide
+ gas_type = GAS_CO2
/obj/machinery/portable_atmospherics/canister/toxins
name = "Plasma canister"
desc = "Plasma gas. The reason YOU are here. Highly toxic."
icon_state = "plasma"
- gas_type = /datum/gas/plasma
+ gas_type = GAS_PLASMA
/obj/machinery/portable_atmospherics/canister/bz
name = "\improper BZ canister"
desc = "BZ, a powerful hallucinogenic nerve agent."
icon_state = "bz"
- gas_type = /datum/gas/bz
+ gas_type = GAS_BZ
/obj/machinery/portable_atmospherics/canister/nitrous_oxide
name = "Nitrous oxide canister"
desc = "Nitrous oxide gas. Known to cause drowsiness."
icon_state = "nitrous"
- gas_type = /datum/gas/nitrous_oxide
+ gas_type = GAS_NITROUS
/obj/machinery/portable_atmospherics/canister/air
name = "Air canister"
@@ -126,99 +126,99 @@
name = "Tritium canister"
desc = "Tritium. Inhalation might cause irradiation."
icon_state = "tritium"
- gas_type = /datum/gas/tritium
+ gas_type = GAS_TRITIUM
/obj/machinery/portable_atmospherics/canister/nob
name = "Hyper-noblium canister"
desc = "Hyper-Noblium. More noble than all other gases."
icon_state = "hypno"
- gas_type = /datum/gas/hypernoblium
+ gas_type = GAS_HYPERNOB
/obj/machinery/portable_atmospherics/canister/nitryl
name = "Nitryl canister"
desc = "Nitryl gas. Feels great 'til the acid eats your lungs."
icon_state = "nitryl"
- gas_type = /datum/gas/nitryl
+ gas_type = GAS_NITRYL
/obj/machinery/portable_atmospherics/canister/stimulum
name = "Stimulum canister"
desc = "Stimulum. High energy gas, high energy people."
icon_state = "stimulum"
- gas_type = /datum/gas/stimulum
+ gas_type = GAS_STIMULUM
/obj/machinery/portable_atmospherics/canister/pluoxium
name = "Pluoxium canister"
desc = "Pluoxium. Like oxygen, but more bang for your buck."
icon_state = "pluoxium"
- gas_type = /datum/gas/pluoxium
+ gas_type = GAS_PLUOXIUM
/obj/machinery/portable_atmospherics/canister/water_vapor
name = "Water vapor canister"
desc = "Water vapor. We get it, you vape."
icon_state = "water"
- gas_type = /datum/gas/water_vapor
+ gas_type = GAS_H2O
filled = 1
/obj/machinery/portable_atmospherics/canister/miasma
name = "Miasma canister"
desc = "Foul miasma. Even the canister reeks of fetid refuse."
icon_state = "miasma"
- gas_type = /datum/gas/miasma
+ gas_type = GAS_MIASMA
filled = 1
/obj/machinery/portable_atmospherics/canister/dilithium
name = "Dilithium canister"
desc = "A gas produced from dilithium crystal."
icon_state = "dilithium"
- gas_type = /datum/gas/dilithium
+ gas_type = GAS_DILITHIUM
/obj/machinery/portable_atmospherics/canister/freon
name = "Freon canister"
desc = "Freon. Can absorb heat"
icon_state = "freon"
- gas_type = /datum/gas/freon
+ gas_type = GAS_FREON
filled = 1
/obj/machinery/portable_atmospherics/canister/hydrogen
name = "Hydrogen canister"
desc = "Hydrogen, highly flammable"
icon_state = "h2"
- gas_type = /datum/gas/hydrogen
+ gas_type = GAS_H2
filled = 1
/obj/machinery/portable_atmospherics/canister/healium
name = "Healium canister"
desc = "Healium, causes deep sleep"
icon_state = "healium"
- gas_type = /datum/gas/healium
+ gas_type = GAS_HEALIUM
filled = 1
/obj/machinery/portable_atmospherics/canister/pluonium
name = "Pluonium canister"
desc = "Pluonium, react differently with various gases"
icon_state = "pluonium"
- gas_type = /datum/gas/pluonium
+ gas_type = GAS_PLUONIUM
filled = 1
/obj/machinery/portable_atmospherics/canister/halon
name = "Halon canister"
desc = "Halon, remove oxygen from high temperature fires and cool down the area"
icon_state = "halon"
- gas_type = /datum/gas/halon
+ gas_type = GAS_HALON
filled = 1
/obj/machinery/portable_atmospherics/canister/hexane
name = "Hexane canister"
desc = "hexane, highly flammable."
icon_state = "hexane"
- gas_type = /datum/gas/hexane
+ gas_type = GAS_HEXANE
filled = 1
/obj/machinery/portable_atmospherics/canister/zauker
name = "Zauker canister"
desc = "Zauker, highly toxic"
icon_state = "zauker"
- gas_type = /datum/gas/zauker
+ gas_type = GAS_ZAUKER
filled = 1
/obj/machinery/portable_atmospherics/canister/proc/get_time_left()
@@ -251,13 +251,13 @@
/obj/machinery/portable_atmospherics/canister/proto/default/oxygen
name = "prototype canister"
desc = "A prototype canister for a prototype bike, what could go wrong?"
- gas_type = /datum/gas/oxygen
+ gas_type = GAS_O2
filled = 1
release_pressure = ONE_ATMOSPHERE*2
-/obj/machinery/portable_atmospherics/canister/New(loc, datum/gas_mixture/existing_mixture)
- ..()
+/obj/machinery/portable_atmospherics/canister/Initialize(loc, datum/gas_mixture/existing_mixture)
+ . = ..()
if(existing_mixture)
air_contents.copy_from(existing_mixture)
else
@@ -280,13 +280,15 @@
if(gas_type)
if(starter_temp)
air_contents.set_temperature(starter_temp)
- air_contents.set_moles(gas_type, (maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
+ if(!air_contents.return_volume())
+ CRASH("Auxtools is failing somehow! Gas with pointer [air_contents._extools_pointer_gasmixture] is not valid.")
+ if (gas_type)
+ air_contents.set_moles(gas_type, (maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
/obj/machinery/portable_atmospherics/canister/air/create_gas()
- if(starter_temp)
- air_contents.set_temperature(starter_temp)
- air_contents.set_moles(/datum/gas/oxygen, (O2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
- air_contents.set_moles(/datum/gas/nitrogen, (N2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
+ air_contents.set_temperature(starter_temp)
+ air_contents.set_moles(GAS_O2, (O2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
+ air_contents.set_moles(GAS_N2, (N2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature()))
#define CANISTER_UPDATE_HOLDING (1<<0)
#define CANISTER_UPDATE_CONNECTED (1<<1)
@@ -434,9 +436,8 @@
/obj/machinery/portable_atmospherics/canister/proc/canister_break()
disconnect()
- var/datum/gas_mixture/expelled_gas = air_contents.remove(air_contents.total_moles())
var/turf/T = get_turf(src)
- T.assume_air(expelled_gas)
+ T.assume_air(air_contents)
air_update_turf()
obj_break()
@@ -465,21 +466,17 @@
if(timing && valve_timer < world.time)
valve_open = !valve_open
timing = FALSE
+
+ // Handle gas transfer.
if(valve_open)
var/turf/T = get_turf(src)
- pump.airs[1] = air_contents
- pump.airs[2] = holding ? holding.air_contents : T.return_air()
- pump.target_pressure = release_pressure
-
- pump.process_atmos() // Pump gas.
- if(!holding)
- air_update_turf() // Update the environment if needed.
- else
- pump.airs[1] = null
- pump.airs[2] = null
+ var/datum/gas_mixture/target_air = holding ? holding.air_contents : T.return_air()
+ if(air_contents.release_gas_to(target_air, release_pressure) && !holding)
+ air_update_turf()
update_icon()
+
/obj/machinery/portable_atmospherics/canister/ui_state(mob/user)
return GLOB.physical_state
@@ -566,11 +563,10 @@
if(!holding)
var/list/danger = list()
for(var/id in air_contents.get_gases())
- if(!GLOB.meta_gas_info[id][META_GAS_DANGER])
+ if(!(GLOB.gas_data.flags[id] & GAS_FLAG_DANGEROUS))
continue
- if(air_contents.get_moles(id) > (GLOB.meta_gas_info[id][META_GAS_MOLES_VISIBLE] || MOLES_GAS_VISIBLE)) //if moles_visible is undefined, default to default visibility
- danger[GLOB.meta_gas_info[id][META_GAS_NAME]] = air_contents.get_moles(id) //ex. "plasma" = 20
-
+ if(air_contents.get_moles(id) > (GLOB.gas_data.visibility[id] || MOLES_GAS_VISIBLE)) //if moles_visible is undefined, default to default visibility
+ danger[GLOB.gas_data.names[id]] = air_contents.get_moles(id) //ex. "plasma" = 20
if(danger.len)
message_admins("[ADMIN_LOOKUPFLW(usr)] opened a canister that contains the following at [ADMIN_VERBOSEJMP(src)]:")
log_admin("[key_name(usr)] opened a canister that contains the following at [AREACOORD(src)]:")
@@ -628,10 +624,10 @@
desc = "This should never be spawned in game."
icon_state = "danger"
/obj/machinery/portable_atmospherics/canister/fusion_test/create_gas()
- air_contents.set_moles(/datum/gas/tritium, 10)
- air_contents.set_moles(/datum/gas/plasma, 500)
- air_contents.set_moles(/datum/gas/hydrogen, 500)
- air_contents.set_moles(/datum/gas/nitrous_oxide, 100)
+ air_contents.set_moles(GAS_TRITIUM, 10)
+ air_contents.set_moles(GAS_PLASMA, 500)
+ air_contents.set_moles(GAS_H2, 500)
+ air_contents.set_moles(GAS_NITROUS, 100)
air_contents.set_temperature(10000)
/// Canister 1 Kelvin below the fusion point. Contains far too much plasma. Only good for adding more fuel to ongoing fusion reactions.
@@ -640,10 +636,10 @@
desc = "This should never be spawned in game."
icon_state = "danger"
/obj/machinery/portable_atmospherics/canister/fusion_test_2/create_gas()
- air_contents.set_moles(/datum/gas/tritium, 10)
- air_contents.set_moles(/datum/gas/plasma, 15000)
- air_contents.set_moles(/datum/gas/carbon_dioxide, 1500)
- air_contents.set_moles(/datum/gas/nitrous_oxide, 100)
+ air_contents.set_moles(GAS_TRITIUM, 10)
+ air_contents.set_moles(GAS_PLASMA, 15000)
+ air_contents.set_moles(GAS_CO2, 1500)
+ air_contents.set_moles(GAS_NITROUS, 100)
air_contents.set_temperature(9999)
/// Canister at the perfect conditions to start and continue fusion for a long time.
@@ -652,9 +648,9 @@
desc = "This should never be spawned in game."
icon_state = "danger"
/obj/machinery/portable_atmospherics/canister/fusion_test_3/create_gas()
- air_contents.set_moles(/datum/gas/tritium, 1000)
- air_contents.set_moles(/datum/gas/plasma, 4500)
- air_contents.set_moles(/datum/gas/carbon_dioxide, 1500)
+ air_contents.set_moles(GAS_TRITIUM, 1000)
+ air_contents.set_moles(GAS_PLASMA, 4500)
+ air_contents.set_moles(GAS_CO2, 1500)
air_contents.set_temperature(1000000)
/** Canister for testing dilithium based cold fusion. Use fusion_test_3 if you don't know what you are doing.
@@ -664,10 +660,10 @@
desc = "This should never be spawned in game. Contains dilithium for cold fusion."
icon_state = "danger"
/obj/machinery/portable_atmospherics/canister/fusion_test_4/create_gas()
- air_contents.set_moles(/datum/gas/tritium, 1000)
- air_contents.set_moles(/datum/gas/plasma, 4500)
- air_contents.set_moles(/datum/gas/carbon_dioxide, 1500)
- air_contents.set_moles(/datum/gas/dilithium, 2000)
+ air_contents.set_moles(GAS_TRITIUM, 1000)
+ air_contents.set_moles(GAS_PLASMA, 4500)
+ air_contents.set_moles(GAS_CO2, 1500)
+ air_contents.set_moles(GAS_DILITHIUM, 2000)
air_contents.set_temperature(10000)
/// A canister that is 1 Kelvin away from doing the stimball reaction.
@@ -676,7 +672,7 @@
desc = "This should never be spawned in game except for testing purposes."
icon_state = "danger"
/obj/machinery/portable_atmospherics/canister/stimball_test/create_gas()
- air_contents.set_moles(/datum/gas/stimulum, 1000)
- air_contents.set_moles(/datum/gas/plasma, 1000)
- air_contents.set_moles(/datum/gas/pluoxium, 1000)
+ air_contents.set_moles(GAS_STIMULUM, 1000)
+ air_contents.set_moles(GAS_PLASMA, 1000)
+ air_contents.set_moles(GAS_PLUOXIUM, 1000)
air_contents.set_temperature(FIRE_MINIMUM_TEMPERATURE_TO_EXIST-1)
diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
index 614f3d7408be..34cd11b4e768 100644
--- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
+++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm
@@ -14,17 +14,15 @@
var/maximum_pressure = 90 * ONE_ATMOSPHERE
-/obj/machinery/portable_atmospherics/New()
- ..()
- SSair.atmos_machinery += src
+/obj/machinery/portable_atmospherics/Initialize()
+ . = ..()
+ SSair.atmos_air_machinery += src
air_contents = new(volume)
air_contents.set_temperature(T20C)
- return 1
-
/obj/machinery/portable_atmospherics/Destroy()
- SSair.atmos_machinery -= src
+ SSair.atmos_air_machinery -= src
disconnect()
qdel(air_contents)
@@ -45,7 +43,7 @@
return ..()
/obj/machinery/portable_atmospherics/process_atmos()
- if(!connected_port) // Pipe network handles reactions if connected.
+ if(!connected_port && air_contents != null && src != null) // Pipe network handles reactions if connected.
air_contents.react(src)
/obj/machinery/portable_atmospherics/return_air()
@@ -63,8 +61,7 @@
//Perform the connection
connected_port = new_port
connected_port.connected_device = src
- var/datum/pipeline/connected_port_parent = connected_port.parents[1]
- connected_port_parent.reconcile_air()
+ connected_port.parents[1].update = PIPENET_UPDATE_STATUS_RECONCILE_NEEDED
anchored = TRUE //Prevent movement
pixel_x = new_port.pixel_x
@@ -72,6 +69,9 @@
update_icon()
return TRUE
+/obj/machinery/portable_atmospherics/portableConnectorReturnAir()
+ return air_contents
+
/obj/machinery/portable_atmospherics/Move()
. = ..()
if(.)
diff --git a/code/modules/atmospherics/machinery/portable/pump.dm b/code/modules/atmospherics/machinery/portable/pump.dm
index c343f352948f..267edd556b53 100644
--- a/code/modules/atmospherics/machinery/portable/pump.dm
+++ b/code/modules/atmospherics/machinery/portable/pump.dm
@@ -112,8 +112,8 @@
if("power")
on = !on
if(on && !holding)
- var/plasma = air_contents.get_moles(/datum/gas/plasma)
- var/n2o = air_contents.get_moles(/datum/gas/nitrous_oxide)
+ var/plasma = air_contents.get_moles(GAS_PLASMA)
+ var/n2o = air_contents.get_moles(GAS_NITROUS)
if(n2o || plasma)
message_admins("[ADMIN_LOOKUPFLW(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [ADMIN_VERBOSEJMP(src)]")
log_admin("[key_name(usr)] turned on a pump that contains [n2o ? "N2O" : ""][n2o && plasma ? " & " : ""][plasma ? "Plasma" : ""] at [AREACOORD(src)]")
@@ -159,4 +159,4 @@
if(!user.canUseTopic(src, BE_CLOSE))
return
on = !on
- update_icon()
\ No newline at end of file
+ update_icon()
diff --git a/code/modules/atmospherics/machinery/portable/scrubber.dm b/code/modules/atmospherics/machinery/portable/scrubber.dm
index 06650ffa0179..105deda49756 100644
--- a/code/modules/atmospherics/machinery/portable/scrubber.dm
+++ b/code/modules/atmospherics/machinery/portable/scrubber.dm
@@ -3,28 +3,14 @@
icon_state = "pscrubber:0"
density = TRUE
+
+
var/on = FALSE
var/volume_rate = 1000
var/overpressure_m = 80
volume = 1000
- var/list/scrubbing = list(
- /datum/gas/plasma,
- /datum/gas/carbon_dioxide,
- /datum/gas/nitrous_oxide,
- /datum/gas/bz,
- /datum/gas/nitryl,
- /datum/gas/tritium,
- /datum/gas/hypernoblium,
- /datum/gas/freon,
- /datum/gas/hydrogen,
- /datum/gas/water_vapor,
- /datum/gas/healium,
- /datum/gas/pluonium,
- /datum/gas/halon,
- /datum/gas/zauker,
- /datum/gas/hexane,
- )
+ var/list/scrubbing = list(GAS_PLASMA, GAS_CO2, GAS_NITROUS, GAS_BZ, GAS_NITRYL, GAS_TRITIUM, GAS_HYPERNOB, GAS_H2O)
/obj/machinery/portable_atmospherics/scrubber/Destroy()
var/turf/T = get_turf(src)
@@ -56,15 +42,7 @@
if(air_contents.return_pressure() >= overpressure_m * ONE_ATMOSPHERE)
return
- var/transfer_moles = min(1, volume_rate / mixture.return_volume()) * mixture.total_moles()
-
- var/datum/gas_mixture/filtering = mixture.remove(transfer_moles) // Remove part of the mixture to filter.
- if(!filtering)
- return
-
- filtering.scrub_into(air_contents, scrubbing)
-
- mixture.merge(filtering) // Returned the cleaned gas.
+ mixture.scrub_into(air_contents, volume_rate / mixture.return_volume(), scrubbing)
if(!holding)
air_update_turf()
@@ -77,11 +55,16 @@
on = !on
update_icon()
+
+/obj/machinery/portable_atmospherics/scrubber/ui_state(mob/user)
+ return GLOB.physical_state
+
/obj/machinery/portable_atmospherics/scrubber/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
- ui = new(user, src, "PortableScrubber", name)
+ ui = new(user, src, "PortableScrubber")
ui.open()
+ ui.set_autoupdate(TRUE) // Air pressure, tank pressure
/obj/machinery/portable_atmospherics/scrubber/ui_data()
var/data = list()
@@ -91,9 +74,8 @@
data["id_tag"] = -1 //must be defined in order to reuse code between portable and vent scrubbers
data["filter_types"] = list()
- for(var/path in GLOB.meta_gas_info)
- var/list/gas = GLOB.meta_gas_info[path]
- data["filter_types"] += list(list("gas_id" = gas[META_GAS_ID], "gas_name" = gas[META_GAS_NAME], "enabled" = (path in scrubbing)))
+ for(var/id in GLOB.gas_data.ids)
+ data["filter_types"] += list(list("gas_id" = id, "gas_name" = GLOB.gas_data.names[id], "enabled" = (id in scrubbing)))
if(holding)
data["holding"] = list()
@@ -111,7 +93,7 @@
on = FALSE
update_icon()
else if(on && holding)
- investigate_log("[key_name(user)] started a transfer into [holding].
", INVESTIGATE_ATMOS)
+ investigate_log("[key_name(user)] started a transfer into [holding].", INVESTIGATE_ATMOS)
/obj/machinery/portable_atmospherics/scrubber/ui_act(action, params)
if(..())
@@ -125,9 +107,10 @@
replace_tank(usr, FALSE)
. = TRUE
if("toggle_filter")
- scrubbing ^= gas_id2path(params["val"])
+ scrubbing ^= params["val"]
. = TRUE
- update_icon()
+ if(.)
+ update_icon()
/obj/machinery/portable_atmospherics/scrubber/huge
name = "huge air scrubber"
@@ -166,10 +149,5 @@
if(default_unfasten_wrench(user, W))
if(!movable)
on = FALSE
- return ..()
-
-/obj/machinery/portable_atmospherics/scrubber/CtrlShiftClick(mob/user)
- if(!user.canUseTopic(src, BE_CLOSE))
- return
- on = !on
- update_icon()
+ else
+ return ..()
diff --git a/code/modules/awaymissions/mission_code/snowdin.dm b/code/modules/awaymissions/mission_code/snowdin.dm
index c6f592f38c7e..1c9f08e5cd62 100644
--- a/code/modules/awaymissions/mission_code/snowdin.dm
+++ b/code/modules/awaymissions/mission_code/snowdin.dm
@@ -151,8 +151,8 @@
/turf/open/floor/plasteel/dark/snowdin
initial_gas_mix = FROZEN_ATMOS
- planetary_atmos = 1
- temperature = 180
+ planetary_atmos = TRUE
+ initial_temperature = 180
/turf/open/lava/plasma
name = "liquid plasma"
diff --git a/code/modules/cargo/bounties/engineering.dm b/code/modules/cargo/bounties/engineering.dm
index 2761045951ee..b80eff5d2e65 100644
--- a/code/modules/cargo/bounties/engineering.dm
+++ b/code/modules/cargo/bounties/engineering.dm
@@ -13,46 +13,46 @@
name = "Full Tank of Pluoxium"
description = "CentCom RnD is researching extra compact internals. Ship us a tank full of Pluoxium and you'll be compensated."
reward = 2500
- gas_type = /datum/gas/pluoxium
+ gas_type = GAS_PLUOXIUM
/datum/bounty/item/atmos/simple/nitryl_tank
name = "Full Tank of Nitryl"
description = "The non-human staff of Station 88 has been volunteered to test performance enhancing drugs. Ship them a tank full of Nitryl so they can get started."
reward = 6000
- gas_type = /datum/gas/nitryl
+ gas_type = GAS_NITRYL
/datum/bounty/item/atmos/simple/tritium_tank
name = "Full Tank of Tritium"
description = "Station 49 is looking to kickstart their research program. Ship them a tank full of Tritium."
reward = 3500
- gas_type = /datum/gas/tritium
+ gas_type = GAS_TRITIUM
/datum/bounty/item/atmos/simple/freon_tank
name = "Full Tank of Freon"
description = "The Supermatter of station 33 has started the delamination process. Deliver a tank of Freon gas to help them stop it! (20 Moles)"
reward = 4500
- gas_type = /datum/gas/freon
+ gas_type = GAS_FREON
/datum/bounty/item/atmos/simple/healium_tank
name = "Full Tank of Healium"
description = "Station 42's medical staff are working on an experimental cryogenics setup. They need a tank of Healium. (20 Moles)"
reward = 8000
- gas_type = /datum/gas/healium
+ gas_type = GAS_HEALIUM
/datum/bounty/item/atmos/complex/zauker_tank
name = "Full Tank of Zauker"
description = "The main planet of \[REDACTED] has been chosen as testing grounds for the new weapon that uses Zauker gas. Ship us a tank full of it. (20 Moles)"
reward = 25000
- gas_type = /datum/gas/zauker
+ gas_type = GAS_ZAUKER
/datum/bounty/item/atmos/complex/hypernob_tank
name = "Full Tank of Hypernoblium"
description = "Station 26's atmospheric division has had a mishap with an experimental fusion mix. Some Hyper-Noblium would be appreciated. (20 Moles)"
reward = 15000
- gas_type = /datum/gas/hypernoblium
+ gas_type = GAS_HYPERNOB
/datum/bounty/item/atmos/complex/stimulum_tank
name = "Full Tank of Stimulum"
description = "Station 14's staff are behind schedule on important research. Ship them some Stimulum to get them back up to speed. (20 Moles)"
reward = 12000
- gas_type = /datum/gas/stimulum
+ gas_type = GAS_STIMULUM
diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm
index 032cf232da71..d14dfa025947 100644
--- a/code/modules/events/spacevine.dm
+++ b/code/modules/events/spacevine.dm
@@ -176,7 +176,7 @@
var/turf/open/floor/T = holder.loc
if(istype(T))
var/datum/gas_mixture/GM = T.air
- GM.set_moles(/datum/gas/oxygen, max(GM.get_moles(/datum/gas/oxygen) - severity * holder.energy, 0))
+ GM.set_moles(GAS_O2, max(GM.get_moles(GAS_O2) - severity * holder.energy, 0))
/datum/spacevine_mutation/nitro_eater
name = "nitrogen consuming"
@@ -188,7 +188,7 @@
var/turf/open/floor/T = holder.loc
if(istype(T))
var/datum/gas_mixture/GM = T.air
- GM.set_moles(/datum/gas/nitrogen, max(GM.get_moles(/datum/gas/nitrogen) - severity * holder.energy, 0))
+ GM.set_moles(GAS_N2, max(GM.get_moles(GAS_N2) - severity * holder.energy, 0))
/datum/spacevine_mutation/carbondioxide_eater
name = "CO2 consuming"
@@ -200,7 +200,7 @@
var/turf/open/floor/T = holder.loc
if(istype(T))
var/datum/gas_mixture/GM = T.air
- GM.set_moles(/datum/gas/carbon_dioxide, max(GM.get_moles(/datum/gas/carbon_dioxide) - severity * holder.energy, 0))
+ GM.set_moles(GAS_CO2, max(GM.get_moles(GAS_CO2) - severity * holder.energy, 0))
/datum/spacevine_mutation/plasma_eater
name = "toxins consuming"
@@ -212,7 +212,7 @@
var/turf/open/floor/T = holder.loc
if(istype(T))
var/datum/gas_mixture/GM = T.air
- GM.set_moles(/datum/gas/plasma, max(GM.get_moles(/datum/gas/plasma) - severity * holder.energy, 0))
+ GM.set_moles(GAS_PLASMA, max(GM.get_moles(GAS_PLASMA) - severity * holder.energy, 0))
/datum/spacevine_mutation/thorns
name = "thorny"
diff --git a/code/modules/goals/station_goals/dna_vault.dm b/code/modules/goals/station_goals/dna_vault.dm
index bf8e7063909e..420014676597 100644
--- a/code/modules/goals/station_goals/dna_vault.dm
+++ b/code/modules/goals/station_goals/dna_vault.dm
@@ -261,8 +261,7 @@
to_chat(H, span_notice("You feel resistant to airborne toxins."))
if(locate(/obj/item/organ/lungs) in H.internal_organs)
var/obj/item/organ/lungs/L = H.internal_organs_slot[ORGAN_SLOT_LUNGS]
- L.tox_breath_dam_min = 0
- L.tox_breath_dam_max = 0
+ L.gas_max -= GAS_PLASMA
ADD_TRAIT(H, TRAIT_VIRUSIMMUNE, "dna_vault")
if(VAULT_NOBREATH)
to_chat(H, span_notice("Your lungs feel great."))
diff --git a/code/modules/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm
index fcc2ed8389e6..8f51be99b99f 100644
--- a/code/modules/holodeck/area_copy.dm
+++ b/code/modules/holodeck/area_copy.dm
@@ -133,8 +133,6 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
if(toupdate.len)
for(var/turf/T1 in toupdate)
- CALCULATE_ADJACENT_TURFS(T1)
- SSair.add_to_active(T1,1)
-
+ T1.ImmediateCalculateAdjacentTurfs()
return copiedobjs
diff --git a/code/modules/holodeck/holo_effect.dm b/code/modules/holodeck/holo_effect.dm
index fee0b2b7c91f..e005c6697786 100644
--- a/code/modules/holodeck/holo_effect.dm
+++ b/code/modules/holodeck/holo_effect.dm
@@ -61,7 +61,7 @@
var/datum/effect_system/spark_spread/s = new
s.set_up(3, 1, T)
s.start()
- T.temperature = 5000
+ T.set_temperature(5000)
T.hotspot_expose(50000,50000,1)
diff --git a/code/modules/hydroponics/grown/misc.dm b/code/modules/hydroponics/grown/misc.dm
index 17cf235bb5ba..471f83901ee8 100644
--- a/code/modules/hydroponics/grown/misc.dm
+++ b/code/modules/hydroponics/grown/misc.dm
@@ -57,7 +57,7 @@
return
var/datum/gas_mixture/stank = new
- stank.set_moles(/datum/gas/miasma, (yield + 6)*7*MIASMA_CORPSE_MOLES) // this process is only being called about 2/7 as much as corpses so this is 12-32 times a corpses
+ stank.set_moles(GAS_MIASMA, (yield + 6)*7*MIASMA_CORPSE_MOLES) // this process is only being called about 2/7 as much as corpses so this is 12-32 times a corpses
stank.set_temperature(T20C) // without this the room would eventually freeze and miasma mining would be easier
T.assume_air(stank)
T.air_update_turf()
diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm
index e275cd34843b..db61339f1659 100644
--- a/code/modules/hydroponics/grown/towercap.dm
+++ b/code/modules/hydroponics/grown/towercap.dm
@@ -231,7 +231,7 @@
if(isopenturf(loc))
var/turf/open/O = loc
if(O.air)
- if(O.air.get_moles(/datum/gas/oxygen) > 13)
+ if(O.air.get_moles(GAS_O2) > 13)
return TRUE
return FALSE
diff --git a/code/modules/mapping/map_template.dm b/code/modules/mapping/map_template.dm
index 1f55f1882360..49cd65147d2a 100644
--- a/code/modules/mapping/map_template.dm
+++ b/code/modules/mapping/map_template.dm
@@ -84,6 +84,15 @@
if(T.y+height > world.maxy)
return
+ var/list/border = block(locate(max(T.x, 1), max(T.y, 1), T.z),
+ locate(min(T.x+width, world.maxx), min(T.y+height, world.maxy), T.z))
+ for(var/L in border)
+ var/turf/turf_to_disable = L
+ turf_to_disable.set_sleeping(TRUE)
+
+ if(SSair.initialized)
+ sleep(1)
+
// Accept cached maps, but don't save them automatically - we don't want
// ruins clogging up memory for the whole round.
var/datum/parsed_map/parsed = cached_map || new(file(mappath))
diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm
index fc0521fa084e..fe48194f5c42 100644
--- a/code/modules/mob/living/carbon/alien/life.dm
+++ b/code/modules/mob/living/carbon/alien/life.dm
@@ -15,20 +15,20 @@
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.return_temperature())/BREATH_VOLUME
//Partial pressure of the toxins in our breath
- var/Toxins_pp = (breath.get_moles(/datum/gas/plasma)/breath.total_moles())*breath_pressure
+ var/Toxins_pp = (breath.get_moles(GAS_PLASMA)/breath.total_moles())*breath_pressure
if(Toxins_pp > tox_detect_threshold) // Detect toxins in air
- adjustPlasma(breath.get_moles(/datum/gas/plasma)*250)
+ adjustPlasma(breath.get_moles(GAS_PLASMA)*250)
throw_alert("alien_tox", /obj/screen/alert/alien_tox)
- toxins_used = breath.get_moles(/datum/gas/plasma)
+ toxins_used = breath.get_moles(GAS_PLASMA)
else
clear_alert("alien_tox")
//Breathe in toxins and out oxygen
- breath.adjust_moles(/datum/gas/plasma, -toxins_used)
- breath.adjust_moles(/datum/gas/oxygen, toxins_used)
+ breath.adjust_moles(GAS_PLASMA, -toxins_used)
+ breath.adjust_moles(GAS_O2, toxins_used)
//BREATH TEMPERATURE
handle_breath_temperature(breath)
diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm
index 7c79a6d72f22..6753eed1836a 100644
--- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm
+++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm
@@ -35,7 +35,7 @@
if((!istype(H.w_uniform, /obj/item/clothing/under/plasmaman) || !istype(H.head, /obj/item/clothing/head/helmet/space/plasmaman)) && !atmos_sealed)
if(environment)
if(environment.total_moles())
- if(environment.get_moles(/datum/gas/oxygen) >= 1) //Same threshhold that extinguishes fire
+ if(environment.get_moles(GAS_O2) >= 1) //Same threshhold that extinguishes fire
H.adjust_fire_stacks(0.5)
if(!H.on_fire && H.fire_stacks > 0)
H.visible_message(span_danger("[H]'s body reacts with the atmosphere and bursts into flames!"),span_userdanger("Your body reacts with the atmosphere and bursts into flame!"))
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index 3192416d9e14..e2eae12cf741 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -109,16 +109,18 @@
breath = loc_as_obj.handle_internal_lifeform(src, BREATH_VOLUME)
else if(isturf(loc)) //Breathe from loc as turf
- var/breath_moles = 0
+ var/breath_ratio = 0
if(environment)
- breath_moles = environment.total_moles()*BREATH_PERCENTAGE
+ breath_ratio = BREATH_VOLUME/environment.return_volume()
- breath = loc.remove_air(breath_moles)
+ breath = loc.remove_air_ratio(breath_ratio)
else //Breathe from loc as obj again
if(istype(loc, /obj/))
var/obj/loc_as_obj = loc
loc_as_obj.handle_internal_lifeform(src,0)
+ if(breath)
+ breath.set_volume(BREATH_VOLUME)
check_breath(breath)
if(breath)
@@ -158,11 +160,13 @@
var/SA_para_min = 1
var/SA_sleep_min = 5
var/oxygen_used = 0
- var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.return_temperature())/BREATH_VOLUME
+ var/moles = breath.total_moles()
- var/O2_partialpressure = (breath.get_moles(/datum/gas/oxygen)/breath.total_moles())*breath_pressure
- var/Toxins_partialpressure = (breath.get_moles(/datum/gas/plasma)/breath.total_moles())*breath_pressure
- var/CO2_partialpressure = (breath.get_moles(/datum/gas/carbon_dioxide)/breath.total_moles())*breath_pressure
+
+ var/breath_pressure = (moles*R_IDEAL_GAS_EQUATION*breath.return_temperature())/BREATH_VOLUME
+ var/O2_partialpressure = ((breath.get_moles(GAS_O2)/moles)*breath_pressure) + (((breath.get_moles(GAS_PLUOXIUM)*8)/moles)*breath_pressure)
+ var/Toxins_partialpressure = (breath.get_moles(GAS_PLASMA)/moles)*breath_pressure
+ var/CO2_partialpressure = (breath.get_moles(GAS_CO2)/moles)*breath_pressure
//OXYGEN
@@ -173,7 +177,7 @@
var/ratio = 1 - O2_partialpressure/safe_oxy_min
adjustOxyLoss(min(5*ratio, 3))
failed_last_breath = 1
- oxygen_used = breath.get_moles(/datum/gas/oxygen)*ratio
+ oxygen_used = breath.get_moles(GAS_O2)*ratio
else
adjustOxyLoss(3)
failed_last_breath = 1
@@ -183,11 +187,11 @@
failed_last_breath = 0
if(health >= crit_threshold)
adjustOxyLoss(-5)
- oxygen_used = breath.get_moles(/datum/gas/oxygen)
+ oxygen_used = breath.get_moles(GAS_O2)
clear_alert("not_enough_oxy")
- breath.adjust_moles(/datum/gas/oxygen, -oxygen_used)
- breath.adjust_moles(/datum/gas/carbon_dioxide, oxygen_used)
+ breath.adjust_moles(GAS_O2, -oxygen_used)
+ breath.adjust_moles(GAS_CO2, oxygen_used)
//CARBON DIOXIDE
if(CO2_partialpressure > safe_co2_max)
@@ -206,15 +210,15 @@
//TOXINS/PLASMA
if(Toxins_partialpressure > safe_tox_max)
- var/ratio = (breath.get_moles(/datum/gas/plasma)/safe_tox_max) * 10
+ var/ratio = (breath.get_moles(GAS_PLASMA)/safe_tox_max) * 10
adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
else
clear_alert("too_much_tox")
//NITROUS OXIDE
- if(breath.get_moles(/datum/gas/nitrous_oxide))
- var/SA_partialpressure = (breath.get_moles(/datum/gas/nitrous_oxide)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_NITROUS))
+ var/SA_partialpressure = (breath.get_moles(GAS_NITROUS)/breath.total_moles())*breath_pressure
if(SA_partialpressure > SA_para_min)
Unconscious(60)
if(SA_partialpressure > SA_sleep_min)
@@ -228,8 +232,8 @@
//yogs start -- Adds Nitrogen Narcosis https://en.wikipedia.org/wiki/Nitrogen_narcosis
//NITROGEN
- if(breath.get_moles(/datum/gas/nitrogen))
- var/SA_partialpressure = (breath.get_moles(/datum/gas/nitrogen)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_N2))
+ var/SA_partialpressure = (breath.get_moles(GAS_N2)/breath.total_moles())*breath_pressure
if(SA_partialpressure > NITROGEN_NARCOSIS_PRESSURE_LOW) // Giggles
if(prob(20))
emote(pick("giggle","laugh"))
@@ -240,8 +244,8 @@
hallucination += 5
//yogs end
//BZ (Facepunch port of their Agent B)
- if(breath.get_moles(/datum/gas/bz))
- var/bz_partialpressure = (breath.get_moles(/datum/gas/bz)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_BZ))
+ var/bz_partialpressure = (breath.get_moles(GAS_BZ)/breath.total_moles())*breath_pressure
/* Yogs comment-out: Smoothed BZ hallucination levels
if(bz_partialpressure > 1)
hallucination += 10
@@ -251,23 +255,23 @@
hallucination += round(BZ_MAX_HALLUCINATION * (1 - NUM_E ** (-BZ_LAMBDA * bz_partialpressure))) // Yogs -- Better BZ hallucination values. Keep in mind that hallucination has to be an integer value, due to how it's handled in handle_hallucination()
//TRITIUM
- if(breath.get_moles(/datum/gas/tritium))
- var/tritium_partialpressure = (breath.get_moles(/datum/gas/tritium)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_TRITIUM))
+ var/tritium_partialpressure = (breath.get_moles(GAS_TRITIUM)/breath.total_moles())*breath_pressure
radiation += tritium_partialpressure/10
//NITRYL
- if(breath.get_moles(/datum/gas/nitryl))
- var/nitryl_partialpressure = (breath.get_moles(/datum/gas/nitryl)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_NITRYL))
+ var/nitryl_partialpressure = (breath.get_moles(GAS_NITRYL)/breath.total_moles())*breath_pressure
adjustFireLoss(nitryl_partialpressure/4)
//FREON
- if(breath.get_moles(/datum/gas/freon))
- var/freon_partialpressure = (breath.get_moles(/datum/gas/freon)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_FREON))
+ var/freon_partialpressure = (breath.get_moles(GAS_FREON)/breath.total_moles())*breath_pressure
adjustFireLoss(freon_partialpressure * 0.25)
//MIASMA
- if(breath.get_moles(/datum/gas/miasma))
- var/miasma_partialpressure = (breath.get_moles(/datum/gas/miasma)/breath.total_moles())*breath_pressure
+ if(breath.get_moles(GAS_MIASMA))
+ var/miasma_partialpressure = (breath.get_moles(GAS_MIASMA)/breath.total_moles())*breath_pressure
if(prob(1 * miasma_partialpressure))
var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(2,3)
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index 0319db88ff57..1b8f2033ece4 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -117,7 +117,7 @@
ExtinguishMob()
return TRUE //mob was put out, on_fire = FALSE via ExtinguishMob(), no need to update everything down the chain.
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
- if(G.get_moles(/datum/gas/oxygen) < 1)
+ if(G.get_moles(GAS_O2) < 1)
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
return TRUE
var/turf/location = get_turf(src)
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 78855140bdc4..4a8be8c0b57a 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -886,7 +886,7 @@
loc_temp = obj_temp
else if(isspaceturf(get_turf(src)))
var/turf/heat_turf = get_turf(src)
- loc_temp = heat_turf.temperature
+ loc_temp = heat_turf.return_temperature()
return loc_temp
/mob/living/proc/get_standard_pixel_x_offset(lying = 0)
diff --git a/code/modules/mob/living/silicon/pai/software.dm b/code/modules/mob/living/silicon/pai/software.dm
index 793dc8d2194b..81e51cc9c07d 100644
--- a/code/modules/mob/living/silicon/pai/software.dm
+++ b/code/modules/mob/living/silicon/pai/software.dm
@@ -573,7 +573,7 @@
for(var/id in environment.get_gases())
var/gas_level = environment.get_moles(id)/total_moles
if(gas_level > 0.01)
- dat += "[GLOB.meta_gas_info[id][META_GAS_NAME]]: [round(gas_level*100)]%
"
+ dat += "[GLOB.gas_data.names[id]]: [round(gas_level*100)]%
"
dat += "Temperature: [round(environment.return_temperature()-T0C)]°C
"
dat += "Refresh Reading
"
dat += "
"
diff --git a/code/modules/mob/living/simple_animal/bot/atmosbot.dm b/code/modules/mob/living/simple_animal/bot/atmosbot.dm
index 868674d90709..f23a1ff97ec8 100644
--- a/code/modules/mob/living/simple_animal/bot/atmosbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/atmosbot.dm
@@ -136,7 +136,7 @@
return ATMOSBOT_CHECK_BREACH
//Too little oxygen or too little pressure
var/partial_pressure = R_IDEAL_GAS_EQUATION * gas_mix.return_temperature() / gas_mix.return_volume()
- var/oxygen_moles = gas_mix.get_moles(/datum/gas/oxygen) * partial_pressure
+ var/oxygen_moles = gas_mix.get_moles(GAS_O2) * partial_pressure
if(oxygen_moles < 20 || gas_mix.return_pressure() < WARNING_LOW_PRESSURE)
return ATMOSBOT_LOW_OXYGEN
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index 22d872782edb..543122f69686 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -727,6 +727,12 @@
else
return null
+/mob/living/simple_animal/bot/mulebot/remove_air_ratio(ratio)
+ if(loc)
+ return loc.remove_air_ratio(ratio)
+ else
+ return null
+
/mob/living/simple_animal/bot/mulebot/resist()
..()
if(load)
diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm
index 117a53cecfd2..2dfa4cf289f9 100644
--- a/code/modules/mob/living/simple_animal/hostile/tree.dm
+++ b/code/modules/mob/living/simple_animal/hostile/tree.dm
@@ -45,12 +45,12 @@
if(isopenturf(loc))
var/turf/open/T = src.loc
if(T.air)
- var/co2 = T.air.get_moles(/datum/gas/carbon_dioxide)
+ var/co2 = T.air.get_moles(GAS_CO2)
if(co2 > 0)
if(prob(25))
var/amt = min(co2, 9)
- T.air.adjust_moles(/datum/gas/carbon_dioxide, -amt)
- T.atmos_spawn_air("o2=[amt]")
+ T.air.adjust_moles(GAS_CO2, -amt)
+ T.atmos_spawn_air("o2=[amt];TEMP=293.15")
/mob/living/simple_animal/hostile/tree/AttackingTarget()
. = ..()
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index bc11b5d579ea..d15b9a9717ac 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -226,10 +226,10 @@
var/turf/open/ST = src.loc
if(ST.air)
- var/tox = ST.air.get_moles(/datum/gas/plasma)
- var/oxy = ST.air.get_moles(/datum/gas/oxygen)
- var/n2 = ST.air.get_moles(/datum/gas/nitrogen)
- var/co2 = ST.air.get_moles(/datum/gas/carbon_dioxide)
+ var/tox = ST.air.get_moles(GAS_PLASMA)
+ var/oxy = ST.air.get_moles(GAS_O2)
+ var/n2 = ST.air.get_moles(GAS_N2)
+ var/co2 = ST.air.get_moles(GAS_CO2)
if(atmos_requirements["min_oxy"] && oxy < atmos_requirements["min_oxy"])
. = FALSE
diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm
index f6b309564d32..1885f67d9c9d 100644
--- a/code/modules/mob/living/simple_animal/slime/life.dm
+++ b/code/modules/mob/living/simple_animal/slime/life.dm
@@ -134,7 +134,7 @@
Tempstun = 0
if(stat != DEAD)
- var/bz_percentage = environment.total_moles() ? (environment.get_moles(/datum/gas/bz) / environment.total_moles()) : 0
+ var/bz_percentage = environment.total_moles() ? (environment.get_moles(GAS_BZ) / environment.total_moles()) : 0
var/stasis = (bz_percentage >= 0.05 && bodytemperature < (T0C + 100)) || force_stasis
if(stat == CONSCIOUS && stasis)
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index b0cae501bfff..50631e09a9e6 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -120,7 +120,7 @@
t += span_danger("Temperature: [environment.return_temperature()] \n")
for(var/id in environment.get_gases())
if(environment.get_moles(id))
- t+=span_notice("[GLOB.meta_gas_info[id][META_GAS_NAME]]: [environment.get_moles(id)] \n")
+ t+=span_notice("[GLOB.gas_data.names[id]]: [environment.get_moles(id)] \n")
to_chat(usr, t)
diff --git a/code/modules/modular_computers/file_system/programs/atmosscan.dm b/code/modules/modular_computers/file_system/programs/atmosscan.dm
index eafb14402b45..753057bc9c33 100644
--- a/code/modules/modular_computers/file_system/programs/atmosscan.dm
+++ b/code/modules/modular_computers/file_system/programs/atmosscan.dm
@@ -34,7 +34,7 @@
var/moles = environment.get_moles(id)
var/gas_level = moles/total_moles
if(gas_level > 0)
- airlist += list(list("name" = "[GLOB.meta_gas_info[id][META_GAS_NAME]]", "percentage" = round(gas_level*100, 0.01)))
+ airlist += list(list("name" = "[GLOB.gas_data.names[id]]", "percentage" = round(gas_level*100, 0.01)))
data["AirData"] = airlist
else
data["AirPressure"] = 0
diff --git a/code/modules/modular_computers/file_system/programs/sm_monitor.dm b/code/modules/modular_computers/file_system/programs/sm_monitor.dm
index 55cbcca653b5..e41e58fbaa00 100644
--- a/code/modules/modular_computers/file_system/programs/sm_monitor.dm
+++ b/code/modules/modular_computers/file_system/programs/sm_monitor.dm
@@ -150,17 +150,17 @@
for(var/gasid in air.get_gases())
if(data_corrupted)
gasdata.Add(list(list(
- "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME],
+ "name"= GLOB.gas_data.names[gasid],
"amount" = round(rand()*100,0.01))))
else
gasdata.Add(list(list(
- "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME],
+ "name"= GLOB.gas_data.names[gasid],
"amount" = round(100*air.get_moles(gasid)/air.total_moles(),0.01))))
else
for(var/gasid in air.get_gases())
gasdata.Add(list(list(
- "name"= GLOB.meta_gas_info[gasid][META_GAS_NAME],
+ "name"= GLOB.gas_data.names[gasid],
"amount" = 0)))
data["gases"] = gasdata
diff --git a/code/modules/power/singularity/collector.dm b/code/modules/power/singularity/collector.dm
index a08f8722bccb..267ad31202a0 100644
--- a/code/modules/power/singularity/collector.dm
+++ b/code/modules/power/singularity/collector.dm
@@ -39,30 +39,30 @@
if(!loaded_tank)
return
if(!bitcoinmining)
- if(loaded_tank.air_contents.get_moles(/datum/gas/plasma) < 0.0001)
+ if(loaded_tank.air_contents.get_moles(GAS_PLASMA) < 0.0001)
investigate_log("out of fuel.", INVESTIGATE_SINGULO)
investigate_log("out of fuel.", INVESTIGATE_SUPERMATTER) // yogs - so supermatter investigate is useful
playsound(src, 'sound/machines/ding.ogg', 50, 1)
eject()
else
- var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.get_moles(/datum/gas/plasma))
- loaded_tank.air_contents.adjust_moles(/datum/gas/plasma, -gasdrained)
- loaded_tank.air_contents.adjust_moles(/datum/gas/tritium, gasdrained)
+ var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.get_moles(GAS_PLASMA))
+ loaded_tank.air_contents.adjust_moles(GAS_PLASMA, -gasdrained)
+ loaded_tank.air_contents.adjust_moles(GAS_TRITIUM, gasdrained)
var/power_produced = RAD_COLLECTOR_OUTPUT
add_avail(power_produced)
stored_power-=power_produced
else if(is_station_level(z) && SSresearch.science_tech)
- var/trit_amount = loaded_tank.air_contents.get_moles(/datum/gas/tritium)
- var/oxy_amount = loaded_tank.air_contents.get_moles(/datum/gas/oxygen)
+ var/trit_amount = loaded_tank.air_contents.get_moles(GAS_TRITIUM)
+ var/oxy_amount = loaded_tank.air_contents.get_moles(GAS_O2)
if(!trit_amount || !oxy_amount)
playsound(src, 'sound/machines/ding.ogg', 50, 1)
eject()
else
var/gasdrained = min(bitcoinproduction_drain*drainratio, min(trit_amount, oxy_amount))
- loaded_tank.air_contents.adjust_moles(/datum/gas/tritium, -gasdrained)
- loaded_tank.air_contents.adjust_moles(/datum/gas/oxygen, -gasdrained)
- loaded_tank.air_contents.adjust_moles(/datum/gas/carbon_dioxide, gasdrained*2)
+ loaded_tank.air_contents.adjust_moles(GAS_TRITIUM, -gasdrained)
+ loaded_tank.air_contents.adjust_moles(GAS_O2, -gasdrained)
+ loaded_tank.air_contents.adjust_moles(GAS_CO2, gasdrained*2)
var/bitcoins_mined = RAD_COLLECTOR_OUTPUT
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_ENG)
if(D)
@@ -76,7 +76,7 @@
toggle_power()
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
span_notice("You turn the [src.name] [active? "on":"off"]."))
- var/fuel = loaded_tank.air_contents.get_moles(/datum/gas/plasma)
+ var/fuel = loaded_tank.air_contents.get_moles(GAS_PLASMA)
investigate_log("turned [active?"on":"off"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"It is empty"].", INVESTIGATE_SINGULO)
investigate_log("turned [active?"on":"off"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"It is empty"].", INVESTIGATE_SUPERMATTER) // yogs - so supermatter investigate is useful
return
diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm
index 7b93078f3bf6..301f283c8ad4 100644
--- a/code/modules/power/supermatter/supermatter.dm
+++ b/code/modules/power/supermatter/supermatter.dm
@@ -200,7 +200,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/obj/machinery/power/supermatter_crystal/Initialize()
. = ..()
uid = gl_uid++
- SSair.atmos_machinery += src
+ SSair.atmos_air_machinery += src
countdown = new(src)
countdown.start()
GLOB.poi_list |= src
@@ -216,7 +216,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
/obj/machinery/power/supermatter_crystal/Destroy()
investigate_log("has been destroyed.", INVESTIGATE_SUPERMATTER)
- SSair.atmos_machinery -= src
+ SSair.atmos_air_machinery -= src
QDEL_NULL(radio)
GLOB.poi_list -= src
QDEL_NULL(countdown)
@@ -421,7 +421,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
if(produces_gas)
//Remove gas from surrounding area
- removed = env.remove(gasefficency * env.total_moles())
+ removed = env.remove_ratio(gasefficency)
else
// Pass all the gas related code an empty gas container
removed = new()
@@ -448,17 +448,17 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
// Calculate the gas mix ratio
combined_gas = max(removed.total_moles(), 0)
- var/plasmacomp = max(removed.get_moles(/datum/gas/plasma)/combined_gas, 0)
- var/o2comp = max(removed.get_moles(/datum/gas/oxygen)/combined_gas, 0)
- var/co2comp = max(removed.get_moles(/datum/gas/carbon_dioxide)/combined_gas, 0)
- var/n2ocomp = max(removed.get_moles(/datum/gas/nitrous_oxide)/combined_gas, 0)
- var/n2comp = max(removed.get_moles(/datum/gas/nitrogen)/combined_gas, 0)
- var/pluoxiumcomp = max(removed.get_moles(/datum/gas/pluoxium)/combined_gas, 0)
- var/tritiumcomp = max(removed.get_moles(/datum/gas/tritium)/combined_gas, 0)
- var/bzcomp = max(removed.get_moles(/datum/gas/bz)/combined_gas, 0)
+ var/plasmacomp = max(removed.get_moles(GAS_PLASMA)/combined_gas, 0)
+ var/o2comp = max(removed.get_moles(GAS_O2)/combined_gas, 0)
+ var/co2comp = max(removed.get_moles(GAS_CO2)/combined_gas, 0)
+ var/n2ocomp = max(removed.get_moles(GAS_NITROUS)/combined_gas, 0)
+ var/n2comp = max(removed.get_moles(GAS_N2)/combined_gas, 0)
+ var/pluoxiumcomp = max(removed.get_moles(GAS_PLUOXIUM)/combined_gas, 0)
+ var/tritiumcomp = max(removed.get_moles(GAS_TRITIUM)/combined_gas, 0)
+ var/bzcomp = max(removed.get_moles(GAS_BZ)/combined_gas, 0)
// Mole releated calculations
- var/bzmol = max(removed.get_moles(/datum/gas/bz), 0)
+ var/bzmol = max(removed.get_moles(GAS_BZ), 0)
// Power of the gas. Scale of 0 to 1
gasmix_power_ratio = min(max(plasmacomp + o2comp + co2comp + tritiumcomp + bzcomp - pluoxiumcomp - n2comp, 0), 1)
@@ -521,11 +521,11 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
//Calculate how much gas to release, antinoblium seeded SM produces much more gas
if(antinoblium_attached)
- removed.adjust_moles(/datum/gas/plasma, max(((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER) * (1+(100-support_integrity)/25), 0))
- removed.adjust_moles(/datum/gas/oxygen, max((((device_energy + removed.return_temperature() * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER) * (1+(100-support_integrity)/25), 0))
+ removed.adjust_moles(GAS_PLASMA, max(((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER) * (1+(100-support_integrity)/25), 0))
+ removed.adjust_moles(GAS_O2, max((((device_energy + removed.return_temperature() * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER) * (1+(100-support_integrity)/25), 0))
else
- removed.adjust_moles(/datum/gas/plasma, max((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER, 0))
- removed.adjust_moles(/datum/gas/oxygen, max(((device_energy + removed.return_temperature() * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER, 0))
+ removed.adjust_moles(GAS_PLASMA, max((device_energy * dynamic_heat_modifier) / PLASMA_RELEASE_MODIFIER, 0))
+ removed.adjust_moles(GAS_O2, max(((device_energy + removed.return_temperature() * dynamic_heat_modifier) - T0C) / OXYGEN_RELEASE_MODIFIER, 0))
if(produces_gas)
env.merge(removed)
diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm
index f63f1b2c71b6..e6e7a6440eaa 100644
--- a/code/modules/power/turbine.dm
+++ b/code/modules/power/turbine.dm
@@ -139,13 +139,11 @@
cut_overlays()
rpm = 0.9* rpm + 0.1 * rpmtarget
- var/datum/gas_mixture/environment = inturf.return_air()
// It's a simplified version taking only 1/10 of the moles from the turf nearby. It should be later changed into a better version
-
- var/transfer_moles = environment.total_moles()/10
- var/datum/gas_mixture/removed = inturf.remove_air(transfer_moles)
- gas_contained.merge(removed)
+ // above todo 7 years and counting
+
+ inturf.transfer_air_ratio(gas_contained, 0.1)
// RPM function to include compression friction - be advised that too low/high of a compfriction value can make things screwy
diff --git a/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm b/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm
index 00dba2d00014..18607b919aba 100644
--- a/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm
+++ b/code/modules/procedural_mapping/mapGeneratorModules/helpers.dm
@@ -10,12 +10,13 @@
if(!mother)
return
var/list/map = mother.map
- for(var/turf/T in map)
- SSair.remove_from_active(T)
for(var/turf/open/T in map)
if(T.air)
- T.air.copy_from_turf(T)
- SSair.add_to_active(T)
+ if(T.initial_gas_mix)
+ T.air.parse_gas_string(T.initial_gas_mix)
+ T.set_temperature(T.air.return_temperature())
+ else
+ T.air.copy_from_turf(T)
/datum/mapGeneratorModule/bottomLayer/massdelete
spawnableAtoms = list()
diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm
index 0e5746977c4f..6acf2ac3ce2d 100644
--- a/code/modules/reagents/chemistry/reagents/food_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm
@@ -459,10 +459,9 @@
T.MakeSlippery(TURF_WET_LUBE, min_wet_time = 10 SECONDS, wet_time_to_add = reac_volume*2 SECONDS)
var/obj/effect/hotspot/hotspot = (locate(/obj/effect/hotspot) in T)
if(hotspot)
- var/datum/gas_mixture/lowertemp = T.remove_air(T.air.total_moles())
- lowertemp.set_temperature(max( min(lowertemp.return_temperature()-2000,lowertemp.return_temperature() / 2) ,0))
+ var/datum/gas_mixture/lowertemp = T.return_air()
+ lowertemp.set_temperature(max( min(lowertemp.return_temperature()-2000,lowertemp.return_temperature() / 2) ,TCMB))
lowertemp.react(src)
- T.assume_air(lowertemp)
qdel(hotspot)
/datum/reagent/consumable/enzyme
diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm
index 667436a7c6c2..5e55c92d81b8 100644
--- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm
+++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm
@@ -279,8 +279,7 @@
if(holder && holder.my_atom)
var/turf/open/T = get_turf(holder.my_atom)
if(istype(T))
- var/datum/gas/gastype = /datum/gas/nitrogen
- T.atmos_spawn_air("[initial(gastype.id)]=50;TEMP=2.7")
+ T.atmos_spawn_air("n2=50;TEMP=2.7")
/datum/chemical_reaction/slime/slimefireproof
name = "Slime Fireproof"
diff --git a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm
index 5be45906a8a8..f6c1c4bc0eff 100644
--- a/code/modules/research/experimentor.dm
+++ b/code/modules/research/experimentor.dm
@@ -408,14 +408,7 @@
autoexperiment = 0
visible_message(span_warning("[src] malfunctions, melting [exp_on] and leaking hot air!"))
var/datum/gas_mixture/env = loc.return_air()
- var/transfer_moles = 0.25 * env.total_moles()
- var/datum/gas_mixture/removed = env.remove(transfer_moles)
- if(removed)
- var/heat_capacity = removed.heat_capacity()
- if(heat_capacity == 0 || heat_capacity == null)
- heat_capacity = 1
- removed.set_temperature(min((removed.return_temperature()*heat_capacity + 100000)/heat_capacity, 1000))
- env.merge(removed)
+ env.adjust_heat(100000)
air_update_turf()
investigate_log("Experimentor has released hot air.", INVESTIGATE_EXPERIMENTOR)
ejectItem(TRUE)
@@ -458,14 +451,7 @@
autoexperiment = 0
visible_message(span_warning("[src] malfunctions, shattering [exp_on] and leaking cold air!"))
var/datum/gas_mixture/env = loc.return_air()
- var/transfer_moles = 0.25 * env.total_moles()
- var/datum/gas_mixture/removed = env.remove(transfer_moles)
- if(removed)
- var/heat_capacity = removed.heat_capacity()
- if(heat_capacity == 0 || heat_capacity == null)
- heat_capacity = 1
- removed.set_temperature((removed.return_temperature()*heat_capacity - 75000)/heat_capacity)
- env.merge(removed)
+ env.adjust_heat(-75000)
air_update_turf()
investigate_log("Experimentor has released cold air.", INVESTIGATE_EXPERIMENTOR)
ejectItem(TRUE)
diff --git a/code/modules/research/server.dm b/code/modules/research/server.dm
index 8d5d02f476e8..c6b0b976a590 100644
--- a/code/modules/research/server.dm
+++ b/code/modules/research/server.dm
@@ -11,7 +11,7 @@
var/server_id = 0
var/base_mining_income = 2
var/current_temp = 0
- var/heat_gen = 100
+ var/heat_gen = 1
var/heating_power = 40000
var/delay = 5
var/temp_tolerance_low = 0
@@ -37,7 +37,7 @@
var/tot_rating = 0
for(var/obj/item/stock_parts/SP in src)
tot_rating += SP.rating
- heat_gen /= max(1, tot_rating)
+ heat_gen = initial(src.heat_gen) / max(1, tot_rating)
/obj/machinery/rnd/server/update_icon()
if(panel_open)
@@ -60,6 +60,26 @@
refresh_working()
return
+/obj/machinery/rnd/server/process()
+ if(!working)
+ current_temp = -1
+ return
+ var/turf/L = get_turf(src)
+ var/datum/gas_mixture/env
+ if(istype(L))
+ env = L.return_air()
+ // This is from the RD server code. It works well enough but I need to move over the
+ // sspace heater code so we can caculate power used per tick as well and making this both
+ // exothermic and an endothermic component
+ if(env)
+ var/perc = max((get_env_temp() - temp_tolerance_high), 0) * temp_penalty_coefficient / base_mining_income
+
+ env.adjust_heat(heating_power * perc * heat_gen)
+ air_update_turf()
+ src.air_update_turf()
+ else
+ current_temp = env ? env.return_temperature() : -1
+
/obj/machinery/rnd/server/proc/refresh_working()
if(stat & EMPED || research_disabled || stat & NOPOWER)
working = FALSE
@@ -92,30 +112,9 @@
/obj/machinery/rnd/server/proc/get_env_temp()
var/turf/L = loc
if(isturf(L))
- return L.temperature
+ return L.return_temperature()
return 0
-/obj/machinery/rnd/server/proc/produce_heat(heat_amt)
- if(!(stat & (NOPOWER|BROKEN))) //Blatently stolen from space heater.
- var/turf/L = loc
- if(istype(L))
- var/datum/gas_mixture/env = L.return_air()
- if(env.return_temperature() < (heat_amt+T0C))
-
- var/transfer_moles = 0.25 * env.total_moles()
-
- var/datum/gas_mixture/removed = env.remove(transfer_moles)
-
- if(removed)
-
- var/heat_capacity = removed.heat_capacity()
- if(heat_capacity == 0 || heat_capacity == null)
- heat_capacity = 1
- removed.set_temperature(min((removed.return_temperature()*heat_capacity + heating_power)/heat_capacity, 1000))
-
- env.merge(removed)
- air_update_turf()
-
/proc/fix_noid_research_servers()
var/list/no_id_servers = list()
var/list/server_ids = list()
diff --git a/code/modules/research/xenobiology/crossbreeding/_structures.dm b/code/modules/research/xenobiology/crossbreeding/_structures.dm
index 109aea6883ca..c465c7e483d7 100644
--- a/code/modules/research/xenobiology/crossbreeding/_structures.dm
+++ b/code/modules/research/xenobiology/crossbreeding/_structures.dm
@@ -232,8 +232,8 @@ GLOBAL_LIST_EMPTY(bluespace_slime_crystals)
return
var/turf/open/open_turf = T
var/datum/gas_mixture/air = open_turf.return_air()
- if(air.get_moles(/datum/gas/plasma) > 15)
- air.adjust_moles(/datum/gas/plasma, -15)
+ if(air.get_moles(GAS_PLASMA) > 15)
+ air.adjust_moles(GAS_PLASMA, -15)
new /obj/item/stack/sheet/mineral/plasma(open_turf)
/obj/structure/slime_crystal/darkpurple/Destroy()
diff --git a/code/modules/research/xenobiology/crossbreeding/chilling.dm b/code/modules/research/xenobiology/crossbreeding/chilling.dm
index bcb478d8932a..baff9f270d69 100644
--- a/code/modules/research/xenobiology/crossbreeding/chilling.dm
+++ b/code/modules/research/xenobiology/crossbreeding/chilling.dm
@@ -107,7 +107,7 @@ Chilling extracts:
for(var/turf/open/T in A)
var/datum/gas_mixture/G = T.air
if(istype(G))
- G.set_moles(/datum/gas/plasma, 0)
+ G.set_moles(GAS_PLASMA, 0)
filtered = TRUE
T.air_update_turf()
if(filtered)
diff --git a/code/modules/shuttle/docking.dm b/code/modules/shuttle/docking.dm
index 7295ab28326f..8d3e5bebc4df 100644
--- a/code/modules/shuttle/docking.dm
+++ b/code/modules/shuttle/docking.dm
@@ -77,6 +77,14 @@
remove_ripples()
return DOCKING_IMMOBILIZED
+ for(var/turf/old_terf in old_turfs)
+ old_terf.set_sleeping(TRUE)
+ for(var/turf/new_terf in new_turfs)
+ new_terf.set_sleeping(TRUE)
+
+ if(SSair.initialized)
+ sleep(1)
+
// Moving to the new location will trample the ripples there at the exact
// same time any mobs there are trampled, to avoid any discrepancy where
// the ripples go away before it is safe.
@@ -132,6 +140,12 @@
old_turfs[oldT] = move_mode
/obj/docking_port/mobile/proc/takeoff(list/old_turfs, list/new_turfs, list/moved_atoms, rotation, movement_direction, old_dock, area/underlying_old_area)
+
+ for(var/turf/old_terf as anything in old_turfs)
+ old_terf.set_sleeping(TRUE)
+ for(var/turf/new_terf as anything in new_turfs)
+ new_terf.set_sleeping(TRUE)
+
for(var/i in 1 to old_turfs.len)
var/turf/oldT = old_turfs[i]
var/turf/newT = new_turfs[i]
@@ -205,3 +219,9 @@
var/turf/oldT = moved_atoms[moved_object]
moved_object.lateShuttleMove(oldT, movement_force, movement_direction)
+/obj/docking_port/mobile/proc/reset_air()
+ var/list/turfs = return_ordered_turfs(x, y, z, dir)
+ for(var/i in 1 to length(turfs))
+ var/turf/open/T = turfs[i]
+ if(istype(T))
+ T.air.copy_from_turf(T)
diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm
index 76edff4ee88a..636c20eda7fd 100644
--- a/code/modules/shuttle/on_move.dm
+++ b/code/modules/shuttle/on_move.dm
@@ -53,16 +53,7 @@ All ShuttleMove procs go here
if(!shuttle_boundary)
CRASH("A turf queued to move via shuttle somehow had no skipover in baseturfs. [src]([type]):[loc]")
var/depth = baseturfs.len - shuttle_boundary + 1
- newT.CopyOnTop(src, 1, depth, TRUE)
- //Air stuff
- newT.blocks_air = TRUE
- newT.air_update_turf(TRUE)
- blocks_air = TRUE
- air_update_turf(TRUE)
- if(isopenturf(newT))
- var/turf/open/new_open = newT
- new_open.copy_air_with_tile(src)
-
+ newT.CopyOnTop(src, 1, depth, TRUE, CHANGETURF_DEFER_CHANGE)
return TRUE
// Called on the new turf after everything has been moved
@@ -72,7 +63,7 @@ All ShuttleMove procs go here
SSexplosions.wipe_turf(src)
var/shuttle_boundary = baseturfs.Find(/turf/baseturf_skipover/shuttle)
if(shuttle_boundary)
- oldT.ScrapeAway(baseturfs.len - shuttle_boundary + 1)
+ oldT.ScrapeAway(baseturfs.len - shuttle_boundary + 1, CHANGETURF_DEFER_CHANGE)
if(rotation)
shuttleRotate(rotation) //see shuttle_rotate.dm
@@ -80,11 +71,8 @@ All ShuttleMove procs go here
return TRUE
/turf/proc/lateShuttleMove(turf/oldT)
- blocks_air = initial(blocks_air)
- air_update_turf(TRUE)
- oldT.blocks_air = initial(oldT.blocks_air)
- oldT.air_update_turf(TRUE)
-
+ AfterChange(CHANGETURF_RECALC_ADJACENT)
+ oldT.AfterChange(CHANGETURF_RECALC_ADJACENT)
/////////////////////////////////////////////////////////////////////////////////////
diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm
index 0403f5459f27..f0b225d33fe9 100644
--- a/code/modules/surgery/organs/augments_chest.dm
+++ b/code/modules/surgery/organs/augments_chest.dm
@@ -197,13 +197,8 @@
// Priority 3: use internals tank.
var/obj/item/tank/I = owner.internal
- if(I && I.air_contents && I.air_contents.total_moles() > num)
- var/datum/gas_mixture/removed = I.air_contents.remove(num)
- if(removed.total_moles() > 0.005)
- T.assume_air(removed)
- return 1
- else
- T.assume_air(removed)
+ if(I && I.air_contents && I.air_contents.total_moles() >= num)
+ T.assume_air_moles(I.air_contents, num)
toggle(silent = TRUE)
return 0
diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm
index 7da1485338fb..39fb0a39c776 100644
--- a/code/modules/surgery/organs/lungs.dm
+++ b/code/modules/surgery/organs/lungs.dm
@@ -17,33 +17,34 @@
//Breath damage
- var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
- var/safe_oxygen_max = 0
- var/safe_nitro_min = 0
- var/safe_nitro_max = 0
- var/safe_co2_min = 0
- var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
- var/safe_toxins_min = 0
- var/safe_toxins_max = 0.05
- var/SA_para_min = 1 //Sleeping agent
- var/SA_sleep_min = 5 //Sleeping agent
+ var/breathing_class = BREATH_OXY // can be a gas instead of a breathing class
+ var/safe_breath_min = 16
+ var/safe_breath_max = 50
+ var/safe_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
+ var/safe_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
+ var/safe_damage_type = OXY
+ var/list/gas_min = list()
+ var/list/gas_max = list(
+ GAS_CO2 = 30, // Yes it's an arbitrary value who cares?
+ GAS_PLASMA = MOLES_GAS_VISIBLE
+ )
+ var/list/gas_damage = list(
+ "default" = list(
+ min = MIN_TOXIC_GAS_DAMAGE,
+ max = MAX_TOXIC_GAS_DAMAGE,
+ damage_type = OXY
+ ),
+ GAS_PLASMA = list(
+ min = MIN_TOXIC_GAS_DAMAGE,
+ max = MAX_TOXIC_GAS_DAMAGE,
+ damage_type = TOX
+ )
+ )
+
+ var/SA_para_min = 1 //nitrous values
+ var/SA_sleep_min = 5
var/BZ_trip_balls_min = 1 //BZ gas
var/gas_stimulation_min = 0.002 //Nitryl and Stimulum
- ///list of gasses that can be used in place of oxygen and the amount they are multiplied by, i.e. 1 pp pluox = 8 pp oxygen
- var/list/oxygen_substitutes = list(/datum/gas/pluoxium = 8)
-
- var/oxy_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
- var/oxy_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
- var/oxy_damage_type = OXY
- var/nitro_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
- var/nitro_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
- var/nitro_damage_type = OXY
- var/co2_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
- var/co2_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
- var/co2_damage_type = OXY
- var/tox_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
- var/tox_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
- var/tox_damage_type = TOX
var/cold_message = "your face freezing and an icicle forming"
var/cold_level_1_threshold = 260
@@ -65,8 +66,22 @@
var/crit_stabilizing_reagent = /datum/reagent/medicine/epinephrine
+/obj/item/organ/lungs/Initialize()
+ . = ..()
+ populate_gas_info()
+
+/obj/item/organ/lungs/proc/populate_gas_info()
+ gas_min[breathing_class] = safe_breath_min
+ gas_max[breathing_class] = safe_breath_max
+ gas_damage[breathing_class] = list(
+ min = safe_breath_dam_min,
+ max = safe_breath_dam_max,
+ damage_type = safe_damage_type
+ )
/obj/item/organ/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
+//TODO: add lung damage = less oxygen gains
+ var/breathModifier = (5-(5*(damage/maxHealth)/2)) //range 2.5 - 5
if(H.status_flags & GODMODE)
return
if(HAS_TRAIT(H, TRAIT_NOBREATH))
@@ -81,150 +96,122 @@
H.adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS)
H.failed_last_breath = TRUE
- if(safe_oxygen_min)
- H.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
- else if(safe_toxins_min)
- H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
- else if(safe_co2_min)
- H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
- else if(safe_nitro_min)
- H.throw_alert("not_enough_nitro", /obj/screen/alert/not_enough_nitro)
+ var/alert_category
+ var/alert_type
+ if(ispath(breathing_class))
+ var/datum/breathing_class/class = GLOB.gas_data.breathing_classes[breathing_class]
+ alert_category = class.low_alert_category
+ alert_type = class.low_alert_datum
+ else
+ var/list/breath_alert_info = GLOB.gas_data.breath_alert_info
+ if(breathing_class in breath_alert_info)
+ var/list/alert = breath_alert_info[breathing_class]["not_enough_alert"]
+ alert_category = alert["alert_category"]
+ alert_type = alert["alert_type"]
+ if(alert_category)
+ H.throw_alert(alert_category, alert_type)
return FALSE
- var/gas_breathed = 0
- var/eff = get_organ_efficiency()
-
- //Partial pressures in our breath
- var/O2_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/oxygen))
- for(var/i in oxygen_substitutes)
- O2_pp += oxygen_substitutes[i] * breath.get_breath_partial_pressure(breath.get_moles(i))
- var/N2_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/nitrogen))
- var/Toxins_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/plasma))
- var/CO2_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/carbon_dioxide))
-
-
- //-- OXY --//
-
- //Too much oxygen! //Yes, some species may not like it.
- if(safe_oxygen_max)
- if(O2_pp > safe_oxygen_max)
- var/ratio = (breath.get_moles(/datum/gas/oxygen)/safe_oxygen_max) * 10
- H.apply_damage_type(clamp(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
- H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
- else
- H.clear_alert("too_much_oxy")
+ #define PP_MOLES(X) ((X / total_moles) * pressure)
- //Too little oxygen!
- if(safe_oxygen_min)
- if(O2_pp < safe_oxygen_min)
- gas_breathed = handle_too_little_breath(H, O2_pp, safe_oxygen_min, breath.get_moles(/datum/gas/oxygen))
- H.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
- else
- H.failed_last_breath = FALSE
- if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5 * eff)
- gas_breathed = breath.get_moles(/datum/gas/oxygen)
- H.clear_alert("not_enough_oxy")
-
- //Exhale
- breath.adjust_moles(/datum/gas/oxygen, -gas_breathed)
- breath.adjust_moles(/datum/gas/carbon_dioxide, gas_breathed)
- gas_breathed = 0
-
- //-- Nitrogen --//
-
- //Too much nitrogen!
- if(safe_nitro_max)
- if(N2_pp > safe_nitro_max)
- var/ratio = (breath.get_moles(/datum/gas/nitrogen)/safe_nitro_max) * 10
- H.apply_damage_type(clamp(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
- H.throw_alert("too_much_nitro", /obj/screen/alert/too_much_nitro)
- else
- H.clear_alert("too_much_nitro")
+ #define PP(air, gas) PP_MOLES(air.get_moles(gas))
- //Too little nitrogen!
- if(safe_nitro_min)
- if(N2_pp < safe_nitro_min)
- gas_breathed = handle_too_little_breath(H, N2_pp, safe_nitro_min, breath.get_moles(/datum/gas/nitrogen))
- H.throw_alert("nitro", /obj/screen/alert/not_enough_nitro)
- else
- H.failed_last_breath = FALSE
- if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5 * eff)
- gas_breathed = breath.get_moles(/datum/gas/nitrogen)
- H.clear_alert("nitro")
-
- //Exhale
- breath.adjust_moles(/datum/gas/nitrogen, -gas_breathed)
- breath.adjust_moles(/datum/gas/carbon_dioxide, gas_breathed)
- gas_breathed = 0
-
- //-- CO2 --//
-
- //CO2 does not affect failed_last_breath. So if there was enough oxygen in the air but too much co2, this will hurt you, but only once per 4 ticks, instead of once per tick.
- if(safe_co2_max)
- if(CO2_pp > safe_co2_max)
- if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
- H.co2overloadtime = world.time
- else if(world.time - H.co2overloadtime > 120)
- H.Unconscious(60)
- H.apply_damage_type(3, co2_damage_type) // Lets hurt em a little, let them know we mean business
- if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
- H.apply_damage_type(8, co2_damage_type)
- H.throw_alert("too_much_co2", /obj/screen/alert/too_much_co2)
- if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
- H.emote("cough")
+ var/gas_breathed = 0
+ var/eff = get_organ_efficiency()
+ var/pressure = breath.return_pressure()
+ var/total_moles = breath.total_moles()
+ var/list/breath_alert_info = GLOB.gas_data.breath_alert_info
+ var/list/breath_results = GLOB.gas_data.breath_results
+ var/list/breathing_classes = GLOB.gas_data.breathing_classes
+ var/list/mole_adjustments = list()
+ for(var/entry in gas_min)
+ var/required_pp = 0
+ var/required_moles = 0
+ var/safe_min = gas_min[entry]
+ var/alert_category = null
+ var/alert_type = null
+ if(ispath(entry))
+ var/datum/breathing_class/class = breathing_classes[entry]
+ var/list/gases = class.gases
+ var/list/products = class.products
+ alert_category = class.low_alert_category
+ alert_type = class.low_alert_datum
+ for(var/gas in gases)
+ var/moles = breath.get_moles(gas)
+ var/multiplier = gases[gas]
+ mole_adjustments[gas] = (gas in mole_adjustments) ? mole_adjustments[gas] - moles : -moles
+ required_pp += PP_MOLES(moles) * multiplier
+ required_moles += moles
+ if(multiplier > 0)
+ var/to_add = moles * multiplier
+ for(var/product in products)
+ mole_adjustments[product] = (product in mole_adjustments) ? mole_adjustments[product] + to_add : to_add
else
- H.co2overloadtime = 0
- H.clear_alert("too_much_co2")
-
- //Too little CO2!
- if(safe_co2_min)
- if(CO2_pp < safe_co2_min)
- gas_breathed = handle_too_little_breath(H, CO2_pp, safe_co2_min, breath.get_moles(/datum/gas/carbon_dioxide))
- H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
+ required_moles = breath.get_moles(entry)
+ required_pp = PP_MOLES(required_moles)
+ if(entry in breath_alert_info)
+ var/list/alert = breath_alert_info[entry]["not_enough_alert"]
+ alert_category = alert["alert_category"]
+ alert_type = alert["alert_type"]
+ mole_adjustments[entry] = -required_moles
+ mole_adjustments[breath_results[entry]] = required_moles
+ if(required_pp < safe_min)
+ var/multiplier = 0
+ if(required_moles > 0)
+ multiplier = handle_too_little_breath(H, required_pp, safe_min, required_moles) / required_moles
+ for(var/adjustment in mole_adjustments)
+ mole_adjustments[adjustment] *= multiplier
+ if(alert_category)
+ H.throw_alert(alert_category, alert_type)
+ H.throw_alert(alert_category, alert_type)
else
H.failed_last_breath = FALSE
if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5 * organ_efficiency)
- gas_breathed = breath.get_moles(/datum/gas/carbon_dioxide)
- H.clear_alert("not_enough_co2")
-
- //Exhale
- breath.adjust_moles(/datum/gas/carbon_dioxide, -gas_breathed)
- breath.adjust_moles(/datum/gas/oxygen, gas_breathed)
- gas_breathed = 0
-
-
- //-- TOX --//
-
- //Too much toxins!
- if(safe_toxins_max)
- if(Toxins_pp > safe_toxins_max)
- var/ratio = (breath.get_moles(/datum/gas/plasma)/safe_toxins_max) * 10
- H.apply_damage_type(clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
- H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
+ H.adjustOxyLoss(-breathModifier)
+ if(alert_category)
+ H.clear_alert(alert_category)
+ var/list/danger_reagents = GLOB.gas_data.breath_reagents_dangerous
+ for(var/entry in gas_max)
+ var/found_pp = 0
+ var/datum/breathing_class/breathing_class = entry
+ var/datum/reagent/danger_reagent = null
+ var/alert_category = null
+ var/alert_type = null
+ if(ispath(breathing_class))
+ breathing_class = breathing_classes[breathing_class]
+ var/list/gases = breathing_class.gases
+ alert_category = breathing_class.high_alert_category
+ alert_type = breathing_class.high_alert_datum
+ danger_reagent = breathing_class.danger_reagent
+ for(var/gas in gases)
+ found_pp += PP(breath, gas)
else
- H.clear_alert("too_much_tox")
-
-
- //Too little toxins!
- if(safe_toxins_min)
- if(Toxins_pp < safe_toxins_min)
- gas_breathed = handle_too_little_breath(H, Toxins_pp, safe_toxins_min, breath.get_moles(/datum/gas/plasma))
- H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
- else
- H.failed_last_breath = FALSE
- if(H.health >= H.crit_threshold)
- H.adjustOxyLoss(-5 * eff)
- gas_breathed = breath.get_moles(/datum/gas/plasma)
- H.clear_alert("not_enough_tox")
-
- //Exhale
- breath.adjust_moles(/datum/gas/plasma, -gas_breathed)
- breath.adjust_moles(/datum/gas/carbon_dioxide, gas_breathed)
- gas_breathed = 0
+ danger_reagent = danger_reagents[entry]
+ if(entry in breath_alert_info)
+ var/list/alert = breath_alert_info[entry]["too_much_alert"]
+ alert_category = alert["alert_category"]
+ alert_type = alert["alert_type"]
+ found_pp = PP(breath, entry)
+ if(found_pp > gas_max[entry])
+ if(istype(danger_reagent))
+ H.reagents.add_reagent(danger_reagent,1)
+ var/list/damage_info = (entry in gas_damage) ? gas_damage[entry] : gas_damage["default"]
+ var/dam = found_pp / gas_max[entry] * 10
+ H.apply_damage_type(clamp(dam, damage_info["min"], damage_info["max"]), damage_info["damage_type"])
+ if(alert_category && alert_type)
+ H.throw_alert(alert_category, alert_type)
+ else if(alert_category)
+ H.clear_alert(alert_category)
+ var/list/breath_reagents = GLOB.gas_data.breath_reagents
+ for(var/gas in breath.get_gases())
+ if(gas in breath_reagents)
+ var/datum/reagent/R = breath_reagents[gas]
+ H.reagents.add_reagent(R, PP(breath,gas))
+ mole_adjustments[gas] = (gas in mole_adjustments) ? mole_adjustments[gas] - breath.get_moles(gas) : -breath.get_moles(gas)
+
+ for(var/gas in mole_adjustments)
+ breath.adjust_moles(gas, mole_adjustments[gas])
//-- TRACES --//
@@ -232,13 +219,12 @@
if(breath) // If there's some other shit in the air lets deal with it here.
// N2O
- REMOVE_TRAIT(H, TRAIT_SURGERY_PREPARED, "N2O")
- var/SA_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/nitrous_oxide))
+
+ var/SA_pp = PP(breath, GAS_NITROUS)
if(SA_pp > SA_para_min) // Enough to make us stunned for a bit
H.Unconscious(60) // 60 gives them one second to wake up and run away a bit!
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
H.Sleeping(max(H.AmountSleeping() + 40, 200))
- ADD_TRAIT(H, TRAIT_SURGERY_PREPARED, "N2O")
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
H.emote(pick("giggle", "laugh"))
@@ -249,7 +235,7 @@
// BZ
- var/bz_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/bz))
+ var/bz_pp = PP(breath, GAS_BZ)
if(bz_pp > BZ_trip_balls_min)
H.hallucination += 10
H.reagents.add_reagent(/datum/reagent/bz_metabolites,5)
@@ -260,16 +246,8 @@
H.hallucination += 5
H.reagents.add_reagent(/datum/reagent/bz_metabolites,1)
-
- // Tritium
- var/trit_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/tritium))
- if (trit_pp > 50)
- H.radiation += trit_pp/2 //If you're breathing in half an atmosphere of radioactive gas, you fucked up.
- else
- H.radiation += trit_pp/10
-
// Nitryl
- var/nitryl_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/nitryl))
+ var/nitryl_pp = PP(breath,GAS_NITRYL)
if (prob(nitryl_pp))
to_chat(H, span_alert("Your mouth feels like it's burning!"))
if (nitryl_pp >40)
@@ -280,14 +258,14 @@
H.silent = max(H.silent, 3)
else
H.adjustFireLoss(nitryl_pp/4)
- gas_breathed = breath.get_moles(/datum/gas/nitryl)
+ gas_breathed = breath.get_moles(GAS_NITRYL)
if (gas_breathed > gas_stimulation_min)
H.reagents.add_reagent(/datum/reagent/nitryl,1*eff)
- breath.adjust_moles(/datum/gas/nitryl, -gas_breathed)
+ breath.adjust_moles(GAS_NITRYL, -gas_breathed)
-// Freon
- var/freon_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/freon))
+ // Freon
+ var/freon_pp = PP(breath,GAS_FREON)
if (prob(freon_pp))
to_chat(H, span_alert("Your mouth feels like it's burning!"))
if (freon_pp >40)
@@ -298,15 +276,15 @@
H.silent = max(H.silent, 3)
else
H.adjustFireLoss(freon_pp/4)
- gas_breathed = breath.get_moles(/datum/gas/freon)
+ gas_breathed = breath.get_moles(GAS_FREON)
if (gas_breathed > gas_stimulation_min)
H.reagents.add_reagent(/datum/reagent/freon,1*eff)
- breath.adjust_moles(/datum/gas/freon, -gas_breathed)
+ breath.adjust_moles(GAS_FREON, -gas_breathed)
// Healium
REMOVE_TRAIT(H, TRAIT_SURGERY_PREPARED, "healium")
- var/healium_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/healium))
+ var/healium_pp = PP(breath,GAS_HEALIUM)
if(healium_pp > SA_sleep_min)
var/existing = H.reagents.get_reagent_amount(/datum/reagent/healium)
ADD_TRAIT(H, TRAIT_SURGERY_PREPARED, "healium")
@@ -314,57 +292,56 @@
H.adjustFireLoss(-7)
H.adjustToxLoss(-5)
H.adjustBruteLoss(-5)
- gas_breathed = breath.get_moles(/datum/gas/healium)
- breath.adjust_moles(/datum/gas/healium, -gas_breathed)
+ gas_breathed = breath.get_moles(GAS_HEALIUM)
+ breath.adjust_moles(GAS_HEALIUM, -gas_breathed)
// Pluonium
// Inert
// Zauker
- var/zauker_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/zauker))
- if(zauker_pp > safe_toxins_max)
+ var/zauker_pp = PP(breath,GAS_ZAUKER)
+ if(zauker_pp > safe_breath_max)
H.adjustBruteLoss(25)
H.adjustOxyLoss(5)
H.adjustFireLoss(8)
H.adjustToxLoss(8)
- gas_breathed = breath.get_moles(/datum/gas/zauker)
- breath.adjust_moles(/datum/gas/zauker, -gas_breathed)
+ gas_breathed = breath.get_moles(GAS_ZAUKER)
+ breath.adjust_moles(GAS_ZAUKER, -gas_breathed)
// Halon
- gas_breathed = breath.get_moles(/datum/gas/halon)
+ gas_breathed = breath.get_moles(GAS_HALON)
if(gas_breathed > gas_stimulation_min)
H.adjustOxyLoss(5)
var/existing = H.reagents.get_reagent_amount(/datum/reagent/halon)
H.reagents.add_reagent(/datum/reagent/halon,max(0, 1 - existing))
- gas_breathed = breath.get_moles(/datum/gas/halon)
- breath.adjust_moles(/datum/gas/halon, -gas_breathed)
+ gas_breathed = breath.get_moles(GAS_HALON)
+ breath.adjust_moles(GAS_HALON, -gas_breathed)
// Hexane
- gas_breathed = breath.get_moles(/datum/gas/hexane)
+ gas_breathed = breath.get_moles(GAS_HEXANE)
if(gas_breathed > gas_stimulation_min)
H.hallucination += 50
H.reagents.add_reagent(/datum/reagent/hexane,5)
if(prob(33))
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3, 150)
+ breath.adjust_moles(GAS_HEXANE, -gas_breathed)
// Stimulum
- gas_breathed = breath.get_moles(/datum/gas/stimulum)
+ gas_breathed = PP(breath,GAS_STIMULUM)
if (gas_breathed > gas_stimulation_min)
var/existing = H.reagents.get_reagent_amount(/datum/reagent/stimulum)
- H.reagents.add_reagent(/datum/reagent/stimulum,max(0, 1*eff - existing))
- breath.adjust_moles(/datum/gas/stimulum, -gas_breathed)
+ H.reagents.add_reagent(/datum/reagent/stimulum,max(0, 1 - existing))
+ breath.adjust_moles(GAS_STIMULUM, -gas_breathed)
// Miasma
- if (breath.get_moles(/datum/gas/miasma))
- var/miasma_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/miasma))
+ if (breath.get_moles(GAS_MIASMA))
+ var/miasma_pp = PP(breath,GAS_MIASMA)
//Miasma sickness
if(prob(0.5 * miasma_pp))
- var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(min(round(max(miasma_pp/2, 1), 1), 6), min(round(max(miasma_pp, 1), 1), 8))
- if(owner.CanContractDisease(miasma_disease))
- //tl;dr the first argument chooses the smaller of miasma_pp/2 or 6(typical max virus symptoms), the second chooses the smaller of miasma_pp or 8(max virus symptom level) //
- miasma_disease.name = "Unknown"//^each argument has a minimum of 1 and rounds to the nearest value. Feel free to change the pp scaling I couldn't decide on good numbers for it.
- miasma_disease.try_infect(owner)
+ var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(2, 3)
+ miasma_disease.name = "Unknown"
+ miasma_disease.try_infect(owner)
// Miasma side effects
switch(miasma_pp)
@@ -397,7 +374,7 @@
// Then again, this is a purely hypothetical scenario and hardly reachable
owner.adjust_disgust(0.1 * miasma_pp)
- breath.adjust_moles(/datum/gas/miasma, -gas_breathed)
+ breath.adjust_moles(GAS_MIASMA, -gas_breathed)
// Clear out moods when no miasma at all
else
@@ -466,10 +443,10 @@
user.visible_message(span_notice("[user] extends [src] with [W]!"), span_notice("You use [W] to extend [src]!"), "You hear something stretching.")
name = "extended [name]"
icon_state += "-crobar" //shh! don't tell anyone i handed you this card
- safe_oxygen_min *= 2 //SCREAM LOUDER i dont know maybe eventually
+ /*safe_oxygen_min *= 2 //SCREAM LOUDER i dont know maybe eventually
safe_toxins_min *= 2
safe_nitro_min *= 2 //BREATHE HARDER
- safe_co2_min *= 2
+ safe_co2_min *= 2*/
organ_efficiency = 2 //HOLD YOUR BREATH FOR REALLY LONG
maxHealth *= 0.5 //This procedure is not legal but i will do it for you
@@ -483,38 +460,39 @@
desc = "A spongy rib-shaped mass for filtering plasma from the air."
icon_state = "lungs-plasma"
- safe_oxygen_min = 0 //We don't breath this
- safe_toxins_min = 16 //We breath THIS!
- safe_toxins_max = 0
+ breathing_class = BREATH_PLASMA
+
+/obj/item/organ/lungs/plasmaman/populate_gas_info()
+ ..()
+ gas_max -= GAS_PLASMA
/obj/item/organ/lungs/xeno
name = "devolved plasma vessel"
desc = "A lung-shaped organ vaguely similar to a plasma vessel, restructured from a storage system to a respiratory one."
icon_state = "lungs-x"
- safe_toxins_max = 0 //lmoa~
- oxygen_substitutes = list(/datum/gas/pluoxium = 8, /datum/gas/plasma = 1)
heat_level_1_threshold = 313
heat_level_2_threshold = 353
heat_level_3_threshold = 600
/obj/item/organ/lungs/xeno/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H) //handling this externally so I don't have to nerf pluoxium, can't handle it internally without removing perpetual pluox or requiring plasma for breathing
. = ..()
- if(breath)
- var/breath_amt = breath.get_moles(/datum/gas/plasma)
- breath.adjust_moles(/datum/gas/plasma, -breath_amt)
- breath.adjust_moles(/datum/gas/oxygen, breath_amt)
+ if(!breath.total_moles())
+ return .
+ var/breath_amt = breath.get_moles(GAS_PLASMA)
+ breath.adjust_moles(GAS_PLASMA, -breath_amt)
+ breath.adjust_moles(GAS_O2, breath_amt)
/obj/item/organ/lungs/slime
name = "vacuole"
desc = "A large organelle designed to store oxygen and other important gasses."
- safe_toxins_max = 0 //We breathe this to gain POWER.
-
/obj/item/organ/lungs/slime/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
. = ..()
if (breath)
- var/plasma_pp = breath.get_breath_partial_pressure(breath.get_moles(/datum/gas/plasma))
+ var/total_moles = breath.total_moles()
+ var/pressure = breath.return_pressure()
+ var/plasma_pp = PP(breath, GAS_PLASMA)
owner.blood_volume += (0.2 * plasma_pp) // 10/s when breathing literally nothing but plasma, which will suffocate you.
/obj/item/organ/lungs/ghetto
@@ -530,7 +508,8 @@
icon_state = "lungs-c"
organ_flags = ORGAN_SYNTHETIC
maxHealth = 1.1 * STANDARD_ORGAN_THRESHOLD
- safe_oxygen_min = 13
+ safe_breath_min = 13
+ safe_breath_max = 100
/obj/item/organ/lungs/cybernetic/emp_act()
. = ..()
@@ -542,11 +521,14 @@
name = "upgraded cybernetic lungs"
desc = "A more advanced version of the stock cybernetic lungs, more efficient at, well, breathing. Features higher temperature tolerances and the ability to filter out most potentially harmful gases."
icon_state = "lungs-c-u"
+ safe_breath_min = 4
+ safe_breath_max = 250
+ gas_max = list(
+ GAS_PLASMA = 30,
+ GAS_CO2 = 30
+ )
maxHealth = 2 * STANDARD_ORGAN_THRESHOLD
organ_efficiency = 1.5
- safe_oxygen_min = 10
- safe_co2_max = 20
- safe_toxins_max = 20 //Higher resistance to most harmful gasses
SA_para_min = 3
SA_sleep_min = 6
BZ_trip_balls_min = 2
diff --git a/dependencies.sh b/dependencies.sh
index 46516ffc69a0..7bfd7b62ecd3 100755
--- a/dependencies.sh
+++ b/dependencies.sh
@@ -20,3 +20,6 @@ export PHP_VERSION=7.2
# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.7
+
+# Auxmos git tag
+export AUXMOS_VERSION=708a593a9eb924c46ca0f1bb39c544f2f0c9b41d
diff --git a/libauxmos.so b/libauxmos.so
new file mode 100644
index 000000000000..23429de7727d
Binary files /dev/null and b/libauxmos.so differ
diff --git a/libbyond-extools.so b/libbyond-extools.so
deleted file mode 100755
index c950d4f774c1..000000000000
Binary files a/libbyond-extools.so and /dev/null differ
diff --git a/tgui/yarn.lock b/tgui/yarn.lock
index 053a58291816..424af64aed55 100644
--- a/tgui/yarn.lock
+++ b/tgui/yarn.lock
@@ -1881,12 +1881,12 @@ __metadata:
languageName: node
linkType: hard
-"axios@npm:^0.19.2":
- version: 0.19.2
- resolution: "axios@npm:0.19.2"
+"axios@npm:^0.21.2":
+ version: 0.21.4
+ resolution: "axios@npm:0.21.4"
dependencies:
- follow-redirects: 1.5.10
- checksum: bad346deea24050f9953ce09bb8015f85a99a7b8f016806adccfab0b8981827d1fbee9c77c0ef7c70cc48392c1af6bbc65e07c3e88221d17282d2d5fd0a191f6
+ follow-redirects: ^1.14.0
+ checksum: e6d42b269b599d36eb13be0671c237781f32e6ae72be824297c55a3e1ce63b22ba4f46bad5ab28da7d3bae50a72637d55c792cf803be1cf9de6a8bcd6d0dcc1a
languageName: node
linkType: hard
@@ -3099,15 +3099,6 @@ __metadata:
languageName: node
linkType: hard
-"debug@npm:=3.1.0":
- version: 3.1.0
- resolution: "debug@npm:3.1.0"
- dependencies:
- ms: 2.0.0
- checksum: 1295acd5e0531761255661d325cd0a80ac8c5f6de8942a53bb23c2197ccb97526972de662ed0e5d9393be83f3428a298a6e7185ecb02f0da6282019cd2ffb4a8
- languageName: node
- linkType: hard
-
"debug@npm:^4.0.1, debug@npm:^4.1.0":
version: 4.1.1
resolution: "debug@npm:4.1.1"
@@ -4037,12 +4028,15 @@ __metadata:
languageName: node
linkType: hard
-"follow-redirects@npm:1.5.10":
- version: 1.5.10
- resolution: "follow-redirects@npm:1.5.10"
- dependencies:
- debug: =3.1.0
- checksum: 6e58e02c31337b6b41ffc3d5f3d49920b7db428eddcf374537da00ef121fe473983e12d8557f4304287604168d3efcc288d1f009abaf4c9d61e5db0c0cee3c4a
+"follow-redirects@npm:^1.14.0":
+ version: 1.14.9
+ resolution: "follow-redirects@npm:1.14.9"
+ peerDependencies:
+ debug: "*"
+ peerDependenciesMeta:
+ debug:
+ optional: true
+ checksum: 1b602c548b4194c66d8d530d2c8f76b4116b6c498434acfa561f583f45b571fd9fc042fba778748cd863044051656cf4788ba11c8ff35407223ed0d38ffff0d4
languageName: node
linkType: hard
@@ -8318,7 +8312,7 @@ fsevents@~2.1.2:
version: 0.0.0-use.local
resolution: "tgui-dev-server@workspace:packages/tgui-dev-server"
dependencies:
- axios: ^0.19.2
+ axios: ^0.21.2
common: "workspace:*"
esm: ^3.2.25
glob: ^7.1.4
diff --git a/tools/deploy.sh b/tools/deploy.sh
index a83f1cb5756b..ced6b9ecce1c 100755
--- a/tools/deploy.sh
+++ b/tools/deploy.sh
@@ -37,4 +37,4 @@ cp -r strings/* $1/strings/
#dlls on windows
cp rust_g* $1/ || true
-cp *byond-extools.* $1/ || true
\ No newline at end of file
+cp *auxmos.* $1/ || true
diff --git a/tools/tgs4_scripts/PreCompile.sh b/tools/tgs4_scripts/PreCompile.sh
index 1e26561db6c9..0a82220cca87 100644
--- a/tools/tgs4_scripts/PreCompile.sh
+++ b/tools/tgs4_scripts/PreCompile.sh
@@ -65,6 +65,28 @@ env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-un
mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so"
cd ..
+# Auxtools dependencies
+apt-get install -y build-essential g++-multilib libc6-i386 libstdc++6:i386
+
+# Update auxmos
+if [ ! -d "auxmos" ]; then
+ echo "Cloning auxmos..."
+ git clone https://github.com/yogstation13/auxmos
+ cd auxmos
+ ~/.cargo/bin/rustup target add i686-unknown-linux-gnu
+else
+ echo "Fetching auxmos..."
+ cd auxmos
+ git fetch
+ ~/.cargo/bin/rustup target add i686-unknown-linux-gnu
+fi
+
+echo "Deploying auxmos..."
+git checkout "$AUXMOS_VERSION"
+env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo rustc --release --target=i686-unknown-linux-gnu --features all_reaction_hooks,katmos -- -C target-cpu=native
+mv -f target/i686-unknown-linux-gnu/release/libauxmos.so "$1/libauxmos.so"
+cd ..
+
# compile tgui
echo "Compiling tgui..."
cd "$1"
diff --git a/yogstation.dme b/yogstation.dme
index 5e8a959a231d..ccb02fa3edd0 100644
--- a/yogstation.dme
+++ b/yogstation.dme
@@ -16,6 +16,7 @@
#include "_maps\_basemap.dm"
#include "code\_compile_options.dm"
#include "code\world.dm"
+#include "code\__DEFINES\_auxtools.dm"
#include "code\__DEFINES\_globals.dm"
#include "code\__DEFINES\_protect.dm"
#include "code\__DEFINES\_tick.dm"
@@ -47,7 +48,6 @@
#include "code\__DEFINES\events.dm"
#include "code\__DEFINES\exosuit_fab.dm"
#include "code\__DEFINES\exports.dm"
-#include "code\__DEFINES\extools.dm"
#include "code\__DEFINES\fantasy_affixes.dm"
#include "code\__DEFINES\fastdmm2.dm"
#include "code\__DEFINES\flags.dm"
@@ -141,6 +141,7 @@
#include "code\__DEFINES\{yogs_defines}\spacepods.dm"
#include "code\__DEFINES\{yogs_defines}\telecomms.dm"
#include "code\__DEFINES\{yogs_defines}\wires.dm"
+#include "code\__HELPERS\_extools_api.dm"
#include "code\__HELPERS\_lists.dm"
#include "code\__HELPERS\_logging.dm"
#include "code\__HELPERS\_string_lists.dm"
@@ -263,12 +264,12 @@
#include "code\controllers\configuration\entries\resources.dm"
#include "code\controllers\subsystem\achievements.dm"
#include "code\controllers\subsystem\acid.dm"
-#include "code\controllers\subsystem\adjacent_air.dm"
#include "code\controllers\subsystem\air.dm"
#include "code\controllers\subsystem\assets.dm"
#include "code\controllers\subsystem\atoms.dm"
#include "code\controllers\subsystem\augury.dm"
#include "code\controllers\subsystem\blackbox.dm"
+#include "code\controllers\subsystem\callback.dm"
#include "code\controllers\subsystem\chat.dm"
#include "code\controllers\subsystem\communications.dm"
#include "code\controllers\subsystem\dbcore.dm"
@@ -1585,11 +1586,13 @@
#include "code\modules\asset_cache\asset_list_items.dm"
#include "code\modules\asset_cache\transports\asset_transport.dm"
#include "code\modules\asset_cache\transports\webroot_transport.dm"
+#include "code\modules\atmospherics\auxgm\breathing_classes.dm"
+#include "code\modules\atmospherics\auxgm\gas_types.dm"
#include "code\modules\atmospherics\environmental\LINDA_fire.dm"
#include "code\modules\atmospherics\environmental\LINDA_system.dm"
#include "code\modules\atmospherics\environmental\LINDA_turf_tile.dm"
+#include "code\modules\atmospherics\gasmixtures\auxgm.dm"
#include "code\modules\atmospherics\gasmixtures\gas_mixture.dm"
-#include "code\modules\atmospherics\gasmixtures\gas_types.dm"
#include "code\modules\atmospherics\gasmixtures\immutable_mixtures.dm"
#include "code\modules\atmospherics\gasmixtures\reactions.dm"
#include "code\modules\atmospherics\machinery\airalarm.dm"
@@ -3453,7 +3456,6 @@
#include "yogstation\code\modules\antagonists\traitor\datum_traitor.dm"
#include "yogstation\code\modules\assembly\signaler.dm"
#include "yogstation\code\modules\atmospherics\airalarm.dm"
-#include "yogstation\code\modules\atmospherics\gasmixtures\gas_types.dm"
#include "yogstation\code\modules\atmospherics\machinery\pipes\bluespace.dm"
#include "yogstation\code\modules\atmospherics\unary_devices\vent_pump.dm"
#include "yogstation\code\modules\cargo\cargo_packs.dm"
diff --git a/yogstation/code/game/machinery/computer/atmos_sim.dm b/yogstation/code/game/machinery/computer/atmos_sim.dm
index 2ebf23a25cdb..be8037d099c3 100644
--- a/yogstation/code/game/machinery/computer/atmos_sim.dm
+++ b/yogstation/code/game/machinery/computer/atmos_sim.dm
@@ -79,16 +79,16 @@
dat += "