From 0c99bd28f4b2790e46e5071339b95ae0c9e05266 Mon Sep 17 00:00:00 2001 From: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Date: Sat, 27 May 2023 19:45:22 -0400 Subject: [PATCH] Makes gasses use defines (#75542) ## About The Pull Request Adds defines for gasses and replaces uses I've found to instead use the defines. Can you believe I made this PR while trying to work with Xenos? This sucks! ## Why It's Good For The Game There's a lot of different uses of things like "o2" and "plasma", and they are pretty inconsistent. In some places, it's "hydrogen", in others it's "h2". In some it's "plasma", others "plasm". This unifies it all under defines so it has a less chance of breaking in the future. ## Changelog Nothing player-facing. --- code/__DEFINES/atmospherics/atmos_gasses.dm | 21 ++++++ .../atmospherics/atmos_mapping_helpers.dm | 65 +++++++++++-------- code/__HELPERS/spatial_info.dm | 5 -- code/datums/components/combustible_flooder.dm | 5 +- .../computer/atmos_computers/__identifiers.dm | 42 ++++++------ .../anomalies/anomalies_pyroclastic.dm | 4 +- .../fluid_spread/effects_foam.dm | 2 +- .../fluid_spread/effects_smoke.dm | 2 +- code/game/objects/effects/mines.dm | 8 +-- .../objects/items/grenades/atmos_grenades.dm | 4 +- .../objects/items/stacks/sheets/mineral.dm | 2 +- code/game/turfs/closed/minerals.dm | 3 - code/game/turfs/open/asteroid.dm | 9 +-- code/game/turfs/open/floor/iron_floor.dm | 3 - .../turfs/open/floor/plating/misc_plating.dm | 7 +- code/game/turfs/open/ice.dm | 7 +- code/game/turfs/open/lava.dm | 2 +- code/game/turfs/turf.dm | 4 ++ .../abductor/equipment/glands/plasma.dm | 2 +- .../environmental/LINDA_turf_tile.dm | 2 +- .../atmospherics/gasmixtures/gas_types.dm | 40 ++++++------ .../atmospherics/gasmixtures/reactions.dm | 2 +- .../machinery/portable/canister.dm | 42 ++++++------ .../awaymissions/mission_code/snowdin.dm | 2 +- code/modules/clothing/under/accessories.dm | 2 +- code/modules/events/aurora_caelus.dm | 2 +- .../food_and_drinks/machinery/smartfridge.dm | 2 +- code/modules/holodeck/turfs.dm | 4 +- .../ruins/spaceruin_code/atmos_asteroid.dm | 2 +- code/modules/mob/living/basic/tree.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 33 +++++----- .../mob/living/carbon/human/species.dm | 47 ++++++-------- .../carbon/human/species_types/plasmamen.dm | 2 +- .../living/simple_animal/hostile/regalrat.dm | 2 +- code/modules/mod/modules/modules_general.dm | 2 +- .../chemistry/reagents/other_reagents.dm | 12 ++-- .../chemistry/reagents/toxin_reagents.dm | 4 +- .../reagents/chemistry/recipes/others.dm | 2 +- .../chemistry/recipes/pyrotechnics.dm | 6 +- .../chemistry/recipes/slime_extracts.dm | 4 +- .../xenobiology/crossbreeding/burning.dm | 4 +- .../research/xenobiology/xenobiology.dm | 6 +- tgstation.dme | 1 + 43 files changed, 213 insertions(+), 211 deletions(-) create mode 100644 code/__DEFINES/atmospherics/atmos_gasses.dm diff --git a/code/__DEFINES/atmospherics/atmos_gasses.dm b/code/__DEFINES/atmospherics/atmos_gasses.dm new file mode 100644 index 00000000000..0e290242e4a --- /dev/null +++ b/code/__DEFINES/atmospherics/atmos_gasses.dm @@ -0,0 +1,21 @@ +#define GAS_N2 "n2" +#define GAS_O2 "o2" +#define GAS_CO2 "co2" +#define GAS_PLASMA "plasma" +#define GAS_N2O "n2o" +#define GAS_NITRIUM "nitrium" +#define GAS_BZ "bz" +#define GAS_AIR "air" +#define GAS_WATER_VAPOR "water_vapor" +#define GAS_TRITIUM "tritium" +#define GAS_HYPER_NOBLIUM "hypernoblium" +#define GAS_PLUOXIUM "pluoxium" +#define GAS_MIASMA "miasma" +#define GAS_FREON "freon" +#define GAS_HYDROGEN "hydrogen" +#define GAS_HEALIUM "healium" +#define GAS_PROTO_NITRATE "proto_nitrate" +#define GAS_ZAUKER "zauker" +#define GAS_HELIUM "helium" +#define GAS_ANTINOBLIUM "antinoblium" +#define GAS_HALON "halon" diff --git a/code/__DEFINES/atmospherics/atmos_mapping_helpers.dm b/code/__DEFINES/atmospherics/atmos_mapping_helpers.dm index 94517b21795..dd794cbf053 100644 --- a/code/__DEFINES/atmospherics/atmos_mapping_helpers.dm +++ b/code/__DEFINES/atmospherics/atmos_mapping_helpers.dm @@ -1,40 +1,51 @@ +///Used to define the temperature of a tile, arg is the temperature it should be at. Should always be put at the end of the atmos list. +///This is solely to be used after compile-time. +#define TURF_TEMPERATURE(temperature) "TEMP=[temperature]" + //OPEN TURF ATMOS /// the default air mix that open turfs spawn -#define OPENTURF_DEFAULT_ATMOS "o2=22;n2=82;TEMP=293.15" -#define OPENTURF_LOW_PRESSURE "o2=14;n2=30;TEMP=293.15" +#define OPENTURF_DEFAULT_ATMOS GAS_O2 + "=22;" + GAS_N2 + "=82;TEMP=293.15" +/// the default low-pressure air mix used mostly for mining areas. +#define OPENTURF_LOW_PRESSURE GAS_O2 + "=14;" + GAS_N2 + "=30;TEMP=293.15" /// -193,15°C telecommunications. also used for xenobiology slime killrooms -#define TCOMMS_ATMOS "n2=100;TEMP=80" +#define TCOMMS_ATMOS GAS_N2 + "=100;TEMP=80" /// space #define AIRLESS_ATMOS "TEMP=2.7" /// -93.15°C snow and ice turfs -#define FROZEN_ATMOS "o2=22;n2=82;TEMP=180" +#define FROZEN_ATMOS GAS_O2 + "=22;" + GAS_N2 + "=82;TEMP=180" +/// -14°C snow and ice turfs, a more breatheable coldroom atmos. +#define COLD_ATMOS GAS_O2 + "=22;" + GAS_N2 + "=82;TEMP=259.15" /// -14°C kitchen coldroom, just might loss your tail; higher amount of mol to reach about 101.3 kpA -#define KITCHEN_COLDROOM_ATMOS "o2=26;n2=97;TEMP=[COLD_ROOM_TEMP]" +#define KITCHEN_COLDROOM_ATMOS GAS_O2 + "=26;" + GAS_N2 + "=97;TEMP=259.15" /// used in the holodeck burn test program -#define BURNMIX_ATMOS "o2=2500;plasma=5000;TEMP=370" +#define BURNMIX_ATMOS GAS_O2 + "=2500;" + GAS_PLASMA + "=5000;TEMP=370" +///-153.15°C plasma air, used for burning people. +#define BURNING_COLD GAS_N2 + "=82;" + GAS_PLASMA + "=24;TEMP=120" +///Space temperature hyper nob +#define SPACE_TEMP_NOBLIUM GAS_HYPER_NOBLIUM + "=7500;TEMP=2.7" //ATMOSPHERICS DEPARTMENT GAS TANK TURFS -#define ATMOS_TANK_N2O "n2o=6000;TEMP=293.15" -#define ATMOS_TANK_CO2 "co2=50000;TEMP=293.15" -#define ATMOS_TANK_PLASMA "plasma=70000;TEMP=293.15" -#define ATMOS_TANK_O2 "o2=100000;TEMP=293.15" -#define ATMOS_TANK_N2 "n2=100000;TEMP=293.15" -#define ATMOS_TANK_BZ "bz=100000;TEMP=293.15" -#define ATMOS_TANK_FREON "freon=100000;TEMP=293.15" -#define ATMOS_TANK_HALON "halon=100000;TEMP=293.15" -#define ATMOS_TANK_HEALIUM "healium=100000;TEMP=293.15" -#define ATMOS_TANK_H2 "hydrogen=100000;TEMP=293.15" -#define ATMOS_TANK_HYPERNOBLIUM "nob=100000;TEMP=293.15" -#define ATMOS_TANK_MIASMA "miasma=100000;TEMP=293.15" -#define ATMOS_TANK_NITRIUM "nitrium=100000;TEMP=293.15" -#define ATMOS_TANK_PLUOXIUM "pluox=100000;TEMP=293.15" -#define ATMOS_TANK_PROTO_NITRATE "proto_nitrate=100000;TEMP=293.15" -#define ATMOS_TANK_TRITIUM "tritium=100000;TEMP=293.15" -#define ATMOS_TANK_H2O "water_vapor=100000;TEMP=293.15" -#define ATMOS_TANK_ZAUKER "zauker=100000;TEMP=293.15" -#define ATMOS_TANK_HELIUM "helium=100000;TEMP=293.15" -#define ATMOS_TANK_ANTINOBLIUM "antinoblium=100000;TEMP=293.15" -#define ATMOS_TANK_AIRMIX "o2=2644;n2=10580;TEMP=293.15" +#define ATMOS_TANK_N2O GAS_N2O + "=6000;TEMP=293.15" +#define ATMOS_TANK_CO2 GAS_CO2 + "=50000;TEMP=293.15" +#define ATMOS_TANK_PLASMA GAS_PLASMA + "=70000;TEMP=293.15" +#define ATMOS_TANK_O2 GAS_O2 + "=100000;TEMP=293.15" +#define ATMOS_TANK_N2 GAS_N2 + "=100000;TEMP=293.15" +#define ATMOS_TANK_BZ GAS_BZ + "=100000;TEMP=293.15" +#define ATMOS_TANK_FREON GAS_FREON + "=100000;TEMP=293.15" +#define ATMOS_TANK_HALON GAS_HALON + "=100000;TEMP=293.15" +#define ATMOS_TANK_HEALIUM GAS_HEALIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_H2 GAS_HYDROGEN + "=100000;TEMP=293.15" +#define ATMOS_TANK_HYPERNOBLIUM GAS_HYPER_NOBLIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_MIASMA GAS_MIASMA + "=100000;TEMP=293.15" +#define ATMOS_TANK_NITRIUM GAS_NITRIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_PLUOXIUM GAS_PLUOXIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_PROTO_NITRATE GAS_PROTO_NITRATE + "=100000;TEMP=293.15" +#define ATMOS_TANK_TRITIUM GAS_TRITIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_H2O GAS_WATER_VAPOR + "=100000;TEMP=293.15" +#define ATMOS_TANK_ZAUKER GAS_ZAUKER + "=100000;TEMP=293.15" +#define ATMOS_TANK_HELIUM GAS_HELIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_ANTINOBLIUM GAS_ANTINOBLIUM + "=100000;TEMP=293.15" +#define ATMOS_TANK_AIRMIX GAS_O2 + "=2644;" + GAS_N2 + "=10580;TEMP=293.15" //LAVALAND /// what pressure you have to be under to increase the effect of equipment meant for lavaland diff --git a/code/__HELPERS/spatial_info.dm b/code/__HELPERS/spatial_info.dm index 7cc953691e7..b98ff84a2e1 100644 --- a/code/__HELPERS/spatial_info.dm +++ b/code/__HELPERS/spatial_info.dm @@ -1,8 +1,3 @@ -/turf - ///what /mob/oranges_ear instance is already assigned to us as there should only ever be one. - ///used for guaranteeing there is only one oranges_ear per turf when assigned, speeds up view() iteration - var/mob/oranges_ear/assigned_oranges_ear - /** # Oranges Ear * * turns out view() spends a significant portion of its processing time generating lists of contents of viewable turfs which includes EVERYTHING on it visible diff --git a/code/datums/components/combustible_flooder.dm b/code/datums/components/combustible_flooder.dm index 177da4399c9..e92393a7d4a 100644 --- a/code/datums/components/combustible_flooder.dm +++ b/code/datums/components/combustible_flooder.dm @@ -37,7 +37,7 @@ flooded_turf = parent_turf.ScrapeAway(1, CHANGETURF_INHERIT_AIR) delete_parent = FALSE - flooded_turf.atmos_spawn_air("[gas_id]=[gas_amount];TEMP=[temp_amount || trigger_temperature]") + flooded_turf.atmos_spawn_air("[gas_id]=[gas_amount];[TURF_TEMPERATURE((temp_amount || trigger_temperature))]") // Logging-related var/admin_message = "[flooded_turf] ignited in [ADMIN_VERBOSEJMP(flooded_turf)]" @@ -46,9 +46,8 @@ admin_message += " by [ADMIN_LOOKUPFLW(user)]" user.log_message(log_message, LOG_ATTACK, log_globally = FALSE)//only individual log else - log_message = "[key_name(user)] " + log_message + log_message = "[key_name(user)] " + log_message + " by fire" admin_message += " by fire" - log_message += " by fire" log_attack(log_message) message_admins(admin_message) diff --git a/code/game/machinery/computer/atmos_computers/__identifiers.dm b/code/game/machinery/computer/atmos_computers/__identifiers.dm index ffb4d8aa479..2b007885cc7 100644 --- a/code/game/machinery/computer/atmos_computers/__identifiers.dm +++ b/code/game/machinery/computer/atmos_computers/__identifiers.dm @@ -3,28 +3,28 @@ // They last three adds _sensor, _in, and _out respectively to the id_tag variable. // Dont put underscores here, we use them as delimiters. -#define ATMOS_GAS_MONITOR_O2 "o2" -#define ATMOS_GAS_MONITOR_PLAS "plas" -#define ATMOS_GAS_MONITOR_AIR "air" +#define ATMOS_GAS_MONITOR_O2 GAS_O2 +#define ATMOS_GAS_MONITOR_PLAS GAS_PLASMA +#define ATMOS_GAS_MONITOR_AIR GAS_AIR #define ATMOS_GAS_MONITOR_MIX "mix" -#define ATMOS_GAS_MONITOR_N2O "n2o" -#define ATMOS_GAS_MONITOR_N2 "n2" -#define ATMOS_GAS_MONITOR_CO2 "co2" -#define ATMOS_GAS_MONITOR_BZ "bz" -#define ATMOS_GAS_MONITOR_FREON "freon" -#define ATMOS_GAS_MONITOR_HALON "halon" -#define ATMOS_GAS_MONITOR_HEALIUM "healium" -#define ATMOS_GAS_MONITOR_H2 "h2" -#define ATMOS_GAS_MONITOR_HYPERNOBLIUM "hypernoblium" -#define ATMOS_GAS_MONITOR_MIASMA "miasma" -#define ATMOS_GAS_MONITOR_NITRIUM "nitrium" -#define ATMOS_GAS_MONITOR_PLUOXIUM "pluoxium" -#define ATMOS_GAS_MONITOR_PROTO_NITRATE "proto-nitrate" -#define ATMOS_GAS_MONITOR_TRITIUM "tritium" -#define ATMOS_GAS_MONITOR_H2O "h2o" -#define ATMOS_GAS_MONITOR_ZAUKER "zauker" -#define ATMOS_GAS_MONITOR_HELIUM "helium" -#define ATMOS_GAS_MONITOR_ANTINOBLIUM "antinoblium" +#define ATMOS_GAS_MONITOR_N2O GAS_N2O +#define ATMOS_GAS_MONITOR_N2 GAS_N2 +#define ATMOS_GAS_MONITOR_CO2 GAS_CO2 +#define ATMOS_GAS_MONITOR_BZ GAS_BZ +#define ATMOS_GAS_MONITOR_FREON GAS_FREON +#define ATMOS_GAS_MONITOR_HALON GAS_HALON +#define ATMOS_GAS_MONITOR_HEALIUM GAS_HEALIUM +#define ATMOS_GAS_MONITOR_H2 GAS_HYDROGEN +#define ATMOS_GAS_MONITOR_HYPERNOBLIUM GAS_HYPER_NOBLIUM +#define ATMOS_GAS_MONITOR_MIASMA GAS_MIASMA +#define ATMOS_GAS_MONITOR_NITRIUM GAS_NITRIUM +#define ATMOS_GAS_MONITOR_PLUOXIUM GAS_PLUOXIUM +#define ATMOS_GAS_MONITOR_PROTO_NITRATE GAS_PROTO_NITRATE +#define ATMOS_GAS_MONITOR_TRITIUM GAS_TRITIUM +#define ATMOS_GAS_MONITOR_H2O GAS_WATER_VAPOR +#define ATMOS_GAS_MONITOR_ZAUKER GAS_ZAUKER +#define ATMOS_GAS_MONITOR_HELIUM GAS_HEALIUM +#define ATMOS_GAS_MONITOR_ANTINOBLIUM GAS_ANTINOBLIUM #define ATMOS_GAS_MONITOR_INCINERATOR "incinerator" #define ATMOS_GAS_MONITOR_ORDNANCE_BURN "ordnanceburn" #define ATMOS_GAS_MONITOR_ORDNANCE_FREEZER "ordnancefreezer" diff --git a/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm b/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm index 09d69142e21..f97f3482e83 100644 --- a/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm +++ b/code/game/objects/effects/anomalies/anomalies_pyroclastic.dm @@ -16,7 +16,7 @@ ticks -= releasedelay var/turf/open/tile = get_turf(src) if(istype(tile)) - tile.atmos_spawn_air("o2=5;plasma=5;TEMP=1000") + tile.atmos_spawn_air("[GAS_O2]=5;[GAS_PLASMA]=5;[TURF_TEMPERATURE(1000)]") return TRUE /obj/effect/anomaly/pyro/detonate() @@ -25,7 +25,7 @@ /obj/effect/anomaly/pyro/proc/makepyroslime() var/turf/open/tile = get_turf(src) if(istype(tile)) - tile.atmos_spawn_air("o2=500;plasma=500;TEMP=1000") //Make it hot and burny for the new slime + tile.atmos_spawn_air("[GAS_O2]=500;[GAS_PLASMA]=500;[TURF_TEMPERATURE(1000)]") //Make it hot and burny for the new slime var/new_colour = pick("red", "orange") var/mob/living/simple_animal/slime/pyro = new(tile, new_colour) diff --git a/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm b/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm index 1a98afb01af..80f393e97db 100644 --- a/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm +++ b/code/game/objects/effects/effect_system/fluid_spread/effects_foam.dm @@ -423,7 +423,7 @@ location.ClearWet() if(location.air) var/datum/gas_mixture/air = location.air - air.temperature = 293.15 + air.temperature = T20C for(var/obj/effect/hotspot/fire in location) qdel(fire) diff --git a/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm b/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm index c2ba1568a06..dae527c3e6b 100644 --- a/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm +++ b/code/game/objects/effects/effect_system/fluid_spread/effects_smoke.dm @@ -330,7 +330,7 @@ /// A variant of the base freezing smoke formerly used by the vent decontamination event. /datum/effect_system/fluid_spread/smoke/freezing/decon - temperature = 293.15 + temperature = T20C distcheck = FALSE weldvents = FALSE diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm index e7594e7c560..d71e851896d 100644 --- a/code/game/objects/effects/mines.dm +++ b/code/game/objects/effects/mines.dm @@ -177,7 +177,7 @@ /obj/effect/mine/gas name = "oxygen mine" var/gas_amount = 360 - var/gas_type = "o2" + var/gas_type = GAS_O2 /obj/effect/mine/gas/mineEffect(mob/victim) atmos_spawn_air("[gas_type]=[gas_amount]") @@ -185,18 +185,18 @@ /obj/effect/mine/gas/plasma name = "plasma mine" - gas_type = "plasma" + gas_type = GAS_PLASMA /obj/effect/mine/gas/n2o name = "\improper N2O mine" - gas_type = "n2o" + gas_type = GAS_N2O /obj/effect/mine/gas/water_vapor name = "chilled vapor mine" gas_amount = 500 - gas_type = "water_vapor" + gas_type = GAS_WATER_VAPOR /obj/effect/mine/sound name = "honkblaster 1000" diff --git a/code/game/objects/items/grenades/atmos_grenades.dm b/code/game/objects/items/grenades/atmos_grenades.dm index 4a22de46778..9f35ac6824c 100644 --- a/code/game/objects/items/grenades/atmos_grenades.dm +++ b/code/game/objects/items/grenades/atmos_grenades.dm @@ -68,7 +68,7 @@ continue var/distance_from_center = max(get_dist(turf_loc, loc), 1) var/turf/open/floor_loc = turf_loc - floor_loc.atmos_spawn_air("n2=[n2_gas_amount / distance_from_center];o2=[o2_gas_amount / distance_from_center];TEMP=273") + floor_loc.atmos_spawn_air("[GAS_N2]=[n2_gas_amount / distance_from_center];[GAS_O2]=[o2_gas_amount / distance_from_center];[TURF_TEMPERATURE(273)]") qdel(src) /obj/item/grenade/gas_crystal/nitrous_oxide_crystal @@ -92,7 +92,7 @@ continue var/distance_from_center = max(get_dist(turf_loc, loc), 1) var/turf/open/floor_loc = turf_loc - floor_loc.atmos_spawn_air("n2o=[n2o_gas_amount / distance_from_center];TEMP=273") + floor_loc.atmos_spawn_air("[GAS_N2O]=[n2o_gas_amount / distance_from_center];[TURF_TEMPERATURE(273)]") qdel(src) /obj/item/grenade/gas_crystal/crystal_foam diff --git a/code/game/objects/items/stacks/sheets/mineral.dm b/code/game/objects/items/stacks/sheets/mineral.dm index fb6540461f4..527af398bd2 100644 --- a/code/game/objects/items/stacks/sheets/mineral.dm +++ b/code/game/objects/items/stacks/sheets/mineral.dm @@ -451,7 +451,7 @@ GLOBAL_LIST_INIT(abductor_recipes, list ( \ return ..() /obj/item/stack/sheet/mineral/coal/fire_act(exposed_temperature, exposed_volume) - atmos_spawn_air("co2=[amount*10];TEMP=[exposed_temperature]") + atmos_spawn_air("[GAS_CO2]=[amount*10];[TURF_TEMPERATURE(exposed_temperature)]") qdel(src) /obj/item/stack/sheet/mineral/coal/five diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index 803554a6bbf..6be28e9c0b3 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -630,10 +630,7 @@ /turf/closed/mineral/snowmountain/coldroom baseturfs = /turf/open/misc/asteroid/snow/coldroom turf_type = /turf/open/misc/asteroid/snow/coldroom - -/turf/closed/mineral/snowmountain/coldroom/Initialize(mapload) initial_gas_mix = KITCHEN_COLDROOM_ATMOS - return ..() //yoo RED ROCK RED ROCK diff --git a/code/game/turfs/open/asteroid.dm b/code/game/turfs/open/asteroid.dm index a7f78ec5904..c3f32160f41 100644 --- a/code/game/turfs/open/asteroid.dm +++ b/code/game/turfs/open/asteroid.dm @@ -231,7 +231,7 @@ GLOBAL_LIST_EMPTY(dug_up_basalt) name = "icy snow" desc = "Looks colder." baseturfs = /turf/open/misc/asteroid/snow/ice - initial_gas_mix = "n2=82;plasma=24;TEMP=120" + initial_gas_mix = BURNING_COLD floor_variance = 0 icon_state = "snow-ice" base_icon_state = "snow-ice" @@ -258,18 +258,15 @@ GLOBAL_LIST_EMPTY(dug_up_basalt) worm_chance = 0 /turf/open/misc/asteroid/snow/temperatre - initial_gas_mix = "o2=22;n2=82;TEMP=255.37" + initial_gas_mix = COLD_ATMOS //Used for when you want to have real, genuine snow in your kitchen's cold room /turf/open/misc/asteroid/snow/coldroom baseturfs = /turf/open/misc/asteroid/snow/coldroom + initial_gas_mix = KITCHEN_COLDROOM_ATMOS planetary_atmos = FALSE temperature = COLD_ROOM_TEMP -/turf/open/misc/asteroid/snow/coldroom/Initialize(mapload) - initial_gas_mix = KITCHEN_COLDROOM_ATMOS - return ..() - //Used in SnowCabin.dm /turf/open/misc/asteroid/snow/snow_cabin temperature = 180 diff --git a/code/game/turfs/open/floor/iron_floor.dm b/code/game/turfs/open/floor/iron_floor.dm index 8e42e606ab1..d38aedfd4f9 100644 --- a/code/game/turfs/open/floor/iron_floor.dm +++ b/code/game/turfs/open/floor/iron_floor.dm @@ -437,10 +437,7 @@ /turf/open/floor/iron/kitchen_coldroom name = "cold room floor" - -/turf/open/floor/iron/kitchen_coldroom/Initialize(mapload) initial_gas_mix = KITCHEN_COLDROOM_ATMOS - return ..() /turf/open/floor/iron/kitchen_coldroom/freezerfloor icon_state = "freezerfloor" diff --git a/code/game/turfs/open/floor/plating/misc_plating.dm b/code/game/turfs/open/floor/plating/misc_plating.dm index 1cfb360eff4..1933b291aee 100644 --- a/code/game/turfs/open/floor/plating/misc_plating.dm +++ b/code/game/turfs/open/floor/plating/misc_plating.dm @@ -55,7 +55,7 @@ heavyfootstep = FOOTSTEP_GENERIC_HEAVY /turf/open/floor/plating/snowed/cavern - initial_gas_mix = "n2=82;plasma=24;TEMP=120" + initial_gas_mix = BURNING_COLD /turf/open/floor/plating/snowed/icemoon initial_gas_mix = ICEMOON_DEFAULT_ATMOS @@ -74,13 +74,10 @@ // When you want real, genuine snowed plating in your kitchen's cold room. /turf/open/floor/plating/snowed/coldroom + initial_gas_mix = KITCHEN_COLDROOM_ATMOS planetary_atmos = FALSE temperature = COLD_ROOM_TEMP -/turf/open/floor/plating/snowed/coldroom/Initialize(mapload) - initial_gas_mix = KITCHEN_COLDROOM_ATMOS - return ..() - //Used in SnowCabin.dm /turf/open/floor/plating/snowed/snow_cabin temperature = 180 diff --git a/code/game/turfs/open/ice.dm b/code/game/turfs/open/ice.dm index 49ecb84aeb7..96bf1baac09 100644 --- a/code/game/turfs/open/ice.dm +++ b/code/game/turfs/open/ice.dm @@ -43,15 +43,12 @@ /turf/open/misc/ice/temperate baseturfs = /turf/open/misc/ice/temperate desc = "Somehow, it is not melting under these conditions. Must be some very thick ice. Just as slippery too." - initial_gas_mix = "o2=22;n2=82;TEMP=255.37" //it works with /turf/open/misc/asteroid/snow/temperatre + initial_gas_mix = COLD_ATMOS //it works with /turf/open/misc/asteroid/snow/temperatre //For when you want real, genuine ice in your kitchen's cold room. /turf/open/misc/ice/coldroom desc = "Somehow, it is not melting under these conditions. Must be some very thick ice. Just as slippery too." baseturfs = /turf/open/misc/ice/coldroom + initial_gas_mix = KITCHEN_COLDROOM_ATMOS planetary_atmos = FALSE temperature = COLD_ROOM_TEMP - -/turf/open/misc/ice/coldroom/Initialize(mapload) - initial_gas_mix = KITCHEN_COLDROOM_ATMOS - return ..() diff --git a/code/game/turfs/open/lava.dm b/code/game/turfs/open/lava.dm index f0cf7a0e1fb..2675c60dd58 100644 --- a/code/game/turfs/open/lava.dm +++ b/code/game/turfs/open/lava.dm @@ -342,7 +342,7 @@ name = "liquid plasma" desc = "A flowing stream of chilled liquid plasma. You probably shouldn't get in." icon_state = "liquidplasma" - initial_gas_mix = "n2=82;plasma=24;TEMP=120" + initial_gas_mix = BURNING_COLD baseturfs = /turf/open/lava/plasma light_range = 3 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 180f7307af7..b52182a88e8 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -6,6 +6,10 @@ GLOBAL_LIST_EMPTY(station_turfs) vis_flags = VIS_INHERIT_ID // Important for interaction with and visualization of openspace. luminosity = 1 + ///what /mob/oranges_ear instance is already assigned to us as there should only ever be one. + ///used for guaranteeing there is only one oranges_ear per turf when assigned, speeds up view() iteration + var/mob/oranges_ear/assigned_oranges_ear + /// Turf bitflags, see code/__DEFINES/flags.dm var/turf_flags = NONE diff --git a/code/modules/antagonists/abductor/equipment/glands/plasma.dm b/code/modules/antagonists/abductor/equipment/glands/plasma.dm index 92aa7abcc45..c167dd8a329 100644 --- a/code/modules/antagonists/abductor/equipment/glands/plasma.dm +++ b/code/modules/antagonists/abductor/equipment/glands/plasma.dm @@ -18,5 +18,5 @@ owner.visible_message(span_danger("[owner] vomits a cloud of plasma!")) var/turf/open/T = get_turf(owner) if(istype(T)) - T.atmos_spawn_air("plasma=50;TEMP=[T20C]") + T.atmos_spawn_air("[GAS_PLASMA]=50;[TURF_TEMPERATURE(T20C)]") owner.vomit() diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index 50ae0888355..a5822084b61 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -62,7 +62,7 @@ var/datum/gas_mixture/immutable/planetary/mix = new mix.parse_string_immutable(initial_gas_mix) SSair.planetary[initial_gas_mix] = mix - . = ..() + return ..() /turf/open/Destroy() if(active_hotspot) diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 8747125c5d0..a6467b71305 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -68,7 +68,7 @@ /datum/gas/oxygen - id = "o2" + id = GAS_O2 specific_heat = 20 name = "Oxygen" rarity = 900 @@ -77,7 +77,7 @@ desc = "The gas most life forms need to be able to survive. Also an oxidizer." /datum/gas/nitrogen - id = "n2" + id = GAS_N2 specific_heat = 20 name = "Nitrogen" rarity = 1000 @@ -86,7 +86,7 @@ desc = "A very common gas that used to pad artifical atmospheres to habitable pressure." /datum/gas/carbon_dioxide //what the fuck is this? - id = "co2" + id = GAS_CO2 specific_heat = 30 name = "Carbon Dioxide" dangerous = TRUE @@ -96,7 +96,7 @@ desc = "What the fuck is carbon dioxide?" /datum/gas/plasma - id = "plasma" + id = GAS_PLASMA specific_heat = 200 name = "Plasma" gas_overlay = "plasma" @@ -107,7 +107,7 @@ desc = "A flammable gas with many other curious properties. It's research is one of NT's primary objective." /datum/gas/water_vapor - id = "water_vapor" + id = GAS_WATER_VAPOR specific_heat = 40 name = "Water Vapor" gas_overlay = "water_vapor" @@ -119,7 +119,7 @@ desc = "Water, in gas form. Makes things slippery." /datum/gas/hypernoblium - id = "nob" + id = GAS_HYPER_NOBLIUM specific_heat = 2000 name = "Hyper-noblium" gas_overlay = "freon" @@ -130,7 +130,7 @@ desc = "The most noble gas of them all. High quantities of hyper-noblium actively prevents reactions from occuring." /datum/gas/nitrous_oxide - id = "n2o" + id = GAS_N2O specific_heat = 40 name = "Nitrous Oxide" gas_overlay = "nitrous_oxide" @@ -143,7 +143,7 @@ desc = "Causes drowsiness, euphoria, and eventually unconsciousness." /datum/gas/nitrium - id = "nitrium" + id = GAS_NITRIUM specific_heat = 10 name = "Nitrium" fusion_power = 7 @@ -155,7 +155,7 @@ desc = "An experimental performance enhancing gas. Nitrium can have amplified effects as more of it gets into your bloodstream." /datum/gas/tritium - id = "tritium" + id = GAS_TRITIUM specific_heat = 10 name = "Tritium" gas_overlay = "tritium" @@ -167,7 +167,7 @@ desc = "A highly flammable and radioctive gas." /datum/gas/bz - id = "bz" + id = GAS_BZ specific_heat = 20 name = "BZ" dangerous = TRUE @@ -178,7 +178,7 @@ desc = "A powerful hallucinogenic nerve agent able to induce cognitive damage." /datum/gas/pluoxium - id = "pluox" + id = GAS_PLUOXIUM specific_heat = 80 name = "Pluoxium" fusion_power = -10 @@ -187,7 +187,7 @@ desc = "A gas that could supply even more oxygen to the bloodstream when inhaled, without being an oxidizer." /datum/gas/miasma - id = "miasma" + id = GAS_MIASMA specific_heat = 20 name = "Miasma" dangerous = TRUE @@ -198,7 +198,7 @@ desc = "Not necessarily a gas, miasma refers to biological pollutants found in the atmosphere." /datum/gas/freon - id = "freon" + id = GAS_FREON specific_heat = 600 name = "Freon" dangerous = TRUE @@ -210,7 +210,7 @@ desc = "A coolant gas. Mainly used for it's endothermic reaction with oxygen." /datum/gas/hydrogen - id = "hydrogen" + id = GAS_HYDROGEN specific_heat = 15 name = "Hydrogen" dangerous = TRUE @@ -220,7 +220,7 @@ desc = "A highly flammable gas." /datum/gas/healium - id = "healium" + id = GAS_HEALIUM specific_heat = 10 name = "Healium" dangerous = TRUE @@ -231,7 +231,7 @@ desc = "Causes deep, regenerative sleep." /datum/gas/proto_nitrate - id = "proto_nitrate" + id = GAS_PROTO_NITRATE specific_heat = 30 name = "Proto Nitrate" dangerous = TRUE @@ -242,7 +242,7 @@ desc = "A very volatile gas that reacts differently with various gases." /datum/gas/zauker - id = "zauker" + id = GAS_ZAUKER specific_heat = 350 name = "Zauker" dangerous = TRUE @@ -253,7 +253,7 @@ desc = "A highly toxic gas, it's production is highly regulated on top of being difficult. It also breaks down when in contact with nitrogen." /datum/gas/halon - id = "halon" + id = GAS_HALON specific_heat = 175 name = "Halon" dangerous = TRUE @@ -264,7 +264,7 @@ desc = "A potent fire supressant. Removes oxygen from high temperature fires and cools down the area" /datum/gas/helium - id = "helium" + id = GAS_HELIUM specific_heat = 15 name = "Helium" fusion_power = 7 @@ -273,7 +273,7 @@ desc = "A very inert gas produced by the fusion of hydrogen and it's derivatives." /datum/gas/antinoblium - id = "antinoblium" + id = GAS_ANTINOBLIUM specific_heat = 1 name = "Antinoblium" dangerous = TRUE diff --git a/code/modules/atmospherics/gasmixtures/reactions.dm b/code/modules/atmospherics/gasmixtures/reactions.dm index 36d7d2efe4e..d3b76880227 100644 --- a/code/modules/atmospherics/gasmixtures/reactions.dm +++ b/code/modules/atmospherics/gasmixtures/reactions.dm @@ -65,7 +65,7 @@ * * E.G. * factor["Temperature"] = "Minimum temperature of 20 kelvins, maximum temperature of 100 kelvins" - * factor["o2"] = "Minimum oxygen amount of 20 moles, more oxygen increases reaction rate up to 150 moles" + * factor[GAS_O2] = "Minimum oxygen amount of 20 moles, more oxygen increases reaction rate up to 150 moles" */ var/list/factor diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index ed9e3be476f..9919794e03a 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -5,28 +5,28 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) /proc/init_gas_id_to_canister() return sort_list(list( - "n2" = /obj/machinery/portable_atmospherics/canister/nitrogen, - "o2" = /obj/machinery/portable_atmospherics/canister/oxygen, - "co2" = /obj/machinery/portable_atmospherics/canister/carbon_dioxide, - "plasma" = /obj/machinery/portable_atmospherics/canister/plasma, - "n2o" = /obj/machinery/portable_atmospherics/canister/nitrous_oxide, - "nitrium" = /obj/machinery/portable_atmospherics/canister/nitrium, - "bz" = /obj/machinery/portable_atmospherics/canister/bz, - "air" = /obj/machinery/portable_atmospherics/canister/air, - "water_vapor" = /obj/machinery/portable_atmospherics/canister/water_vapor, - "tritium" = /obj/machinery/portable_atmospherics/canister/tritium, - "hyper-noblium" = /obj/machinery/portable_atmospherics/canister/nob, - "pluoxium" = /obj/machinery/portable_atmospherics/canister/pluoxium, + GAS_N2 = /obj/machinery/portable_atmospherics/canister/nitrogen, + GAS_O2 = /obj/machinery/portable_atmospherics/canister/oxygen, + GAS_CO2 = /obj/machinery/portable_atmospherics/canister/carbon_dioxide, + GAS_PLASMA = /obj/machinery/portable_atmospherics/canister/plasma, + GAS_N2O = /obj/machinery/portable_atmospherics/canister/nitrous_oxide, + GAS_NITRIUM = /obj/machinery/portable_atmospherics/canister/nitrium, + GAS_BZ = /obj/machinery/portable_atmospherics/canister/bz, + GAS_AIR = /obj/machinery/portable_atmospherics/canister/air, + GAS_WATER_VAPOR = /obj/machinery/portable_atmospherics/canister/water_vapor, + GAS_TRITIUM = /obj/machinery/portable_atmospherics/canister/tritium, + GAS_HYPER_NOBLIUM = /obj/machinery/portable_atmospherics/canister/nob, + GAS_PLUOXIUM = /obj/machinery/portable_atmospherics/canister/pluoxium, "caution" = /obj/machinery/portable_atmospherics/canister, - "miasma" = /obj/machinery/portable_atmospherics/canister/miasma, - "freon" = /obj/machinery/portable_atmospherics/canister/freon, - "hydrogen" = /obj/machinery/portable_atmospherics/canister/hydrogen, - "healium" = /obj/machinery/portable_atmospherics/canister/healium, - "proto_nitrate" = /obj/machinery/portable_atmospherics/canister/proto_nitrate, - "zauker" = /obj/machinery/portable_atmospherics/canister/zauker, - "helium" = /obj/machinery/portable_atmospherics/canister/helium, - "antinoblium" = /obj/machinery/portable_atmospherics/canister/antinoblium, - "halon" = /obj/machinery/portable_atmospherics/canister/halon + GAS_MIASMA = /obj/machinery/portable_atmospherics/canister/miasma, + GAS_FREON = /obj/machinery/portable_atmospherics/canister/freon, + GAS_HYDROGEN = /obj/machinery/portable_atmospherics/canister/hydrogen, + GAS_HEALIUM = /obj/machinery/portable_atmospherics/canister/healium, + GAS_PROTO_NITRATE = /obj/machinery/portable_atmospherics/canister/proto_nitrate, + GAS_ZAUKER = /obj/machinery/portable_atmospherics/canister/zauker, + GAS_HELIUM = /obj/machinery/portable_atmospherics/canister/helium, + GAS_ANTINOBLIUM = /obj/machinery/portable_atmospherics/canister/antinoblium, + GAS_HALON = /obj/machinery/portable_atmospherics/canister/halon )) /obj/machinery/portable_atmospherics/canister diff --git a/code/modules/awaymissions/mission_code/snowdin.dm b/code/modules/awaymissions/mission_code/snowdin.dm index 73da55ad2fe..e85a3e6ddb7 100644 --- a/code/modules/awaymissions/mission_code/snowdin.dm +++ b/code/modules/awaymissions/mission_code/snowdin.dm @@ -155,7 +155,7 @@ /turf/open/floor/iron/dark/snowdin initial_gas_mix = FROZEN_ATMOS - planetary_atmos = 1 + planetary_atmos = TRUE temperature = 180 /////////// papers diff --git a/code/modules/clothing/under/accessories.dm b/code/modules/clothing/under/accessories.dm index 32d704468f0..5b022a33226 100644 --- a/code/modules/clothing/under/accessories.dm +++ b/code/modules/clothing/under/accessories.dm @@ -266,7 +266,7 @@ return exposed_temperature > 300 /obj/item/clothing/accessory/medal/plasma/atmos_expose(datum/gas_mixture/air, exposed_temperature) - atmos_spawn_air("plasma=20;TEMP=[exposed_temperature]") + atmos_spawn_air("[GAS_PLASMA]=20;[TURF_TEMPERATURE(exposed_temperature)]") visible_message(span_danger("\The [src] bursts into flame!"), span_userdanger("Your [src] bursts into flame!")) qdel(src) diff --git a/code/modules/events/aurora_caelus.dm b/code/modules/events/aurora_caelus.dm index 330779c7a6e..d45578299e7 100644 --- a/code/modules/events/aurora_caelus.dm +++ b/code/modules/events/aurora_caelus.dm @@ -42,7 +42,7 @@ if(roast_ruiner) roast_ruiner.balloon_alert_to_viewers("oh egads!") var/turf/ruined_roast = get_turf(roast_ruiner) - ruined_roast.atmos_spawn_air("plasma=100;TEMP=1000") + ruined_roast.atmos_spawn_air("[GAS_PLASMA]=100;[TURF_TEMPERATURE(1000)]") message_admins("Aurora Caelus event caused an oven to ignite at [ADMIN_VERBOSEJMP(ruined_roast)].") log_game("Aurora Caelus event caused an oven to ignite at [loc_name(ruined_roast)].") announce_to_ghosts(roast_ruiner) diff --git a/code/modules/food_and_drinks/machinery/smartfridge.dm b/code/modules/food_and_drinks/machinery/smartfridge.dm index 6ebc4f1aff0..d7573975081 100644 --- a/code/modules/food_and_drinks/machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/machinery/smartfridge.dm @@ -500,7 +500,7 @@ . = ..() if(. & EMP_PROTECT_SELF) return - atmos_spawn_air("TEMP=1000") + atmos_spawn_air("[TURF_TEMPERATURE(1000)]") // ---------------------------- diff --git a/code/modules/holodeck/turfs.dm b/code/modules/holodeck/turfs.dm index 5f521bcb3dd..05e42b854cc 100644 --- a/code/modules/holodeck/turfs.dm +++ b/code/modules/holodeck/turfs.dm @@ -172,13 +172,11 @@ icon = 'icons/turf/snow.dmi' icon_state = "snow" slowdown = 2 + initial_gas_mix = SPACE_TEMP_NOBLIUM bullet_sizzle = TRUE bullet_bounce_sound = null tiled_dirt = FALSE -/turf/open/floor/holofloor/snow/cold - initial_gas_mix = "nob=7500;TEMP=2.7" - /turf/open/floor/holofloor/dark icon_state = "darkfull" desc = "The surrounding enviroment is so dark you can hardly see yourself." diff --git a/code/modules/mapfluff/ruins/spaceruin_code/atmos_asteroid.dm b/code/modules/mapfluff/ruins/spaceruin_code/atmos_asteroid.dm index a672780159f..99c2e5aa878 100644 --- a/code/modules/mapfluff/ruins/spaceruin_code/atmos_asteroid.dm +++ b/code/modules/mapfluff/ruins/spaceruin_code/atmos_asteroid.dm @@ -1,7 +1,7 @@ /// ## A bunch of turf subtypes used to really make this ruin work. /// Define of the specific gas mix we want across all of the turfs. -#define CO2_PRESSURIZED_MIX "o2=22;n2=82;co2=500;TEMP=293.15" +#define CO2_PRESSURIZED_MIX GAS_O2 + "=22;" + GAS_N2 + "=82;" + GAS_CO2 + "=500;TEMP=T20C" /turf/open/floor/iron/co2_pressurized initial_gas_mix = CO2_PRESSURIZED_MIX diff --git a/code/modules/mob/living/basic/tree.dm b/code/modules/mob/living/basic/tree.dm index 4ba0bdb94b9..3bde822af2e 100644 --- a/code/modules/mob/living/basic/tree.dm +++ b/code/modules/mob/living/basic/tree.dm @@ -69,7 +69,7 @@ if(co2 > 0 && SPT_PROB(13, seconds_per_tick)) var/amt = min(co2, 9) our_turf.air.gases[/datum/gas/carbon_dioxide][MOLES] -= amt - our_turf.atmos_spawn_air("o2=[amt]") + our_turf.atmos_spawn_air("[GAS_O2]=[amt]") /mob/living/basic/tree/melee_attack(atom/target, list/modifiers) . = ..() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 214451c1cbe..18033f79479 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -75,32 +75,29 @@ return ..() /mob/living/carbon/human/check_breath(datum/gas_mixture/breath) - var/L = get_organ_slot(ORGAN_SLOT_LUNGS) + var/obj/item/organ/internal/lungs/human_lungs = get_organ_slot(ORGAN_SLOT_LUNGS) + if(human_lungs) + return human_lungs.check_breath(breath, src) - if(!L) - if(health >= crit_threshold) - adjustOxyLoss(HUMAN_MAX_OXYLOSS + 1) - else if(!HAS_TRAIT(src, TRAIT_NOCRITDAMAGE)) - adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) + if(health >= crit_threshold) + adjustOxyLoss(HUMAN_MAX_OXYLOSS + 1) + else if(!HAS_TRAIT(src, TRAIT_NOCRITDAMAGE)) + adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS) - failed_last_breath = TRUE + failed_last_breath = TRUE - var/datum/species/S = dna.species + var/datum/species/human_species = dna.species - if(S.breathid == "o2") + switch(human_species.breathid) + if(GAS_O2) throw_alert(ALERT_NOT_ENOUGH_OXYGEN, /atom/movable/screen/alert/not_enough_oxy) - else if(S.breathid == "plas") + if(GAS_PLASMA) throw_alert(ALERT_NOT_ENOUGH_PLASMA, /atom/movable/screen/alert/not_enough_plas) - else if(S.breathid == "co2") + if(GAS_CO2) throw_alert(ALERT_NOT_ENOUGH_CO2, /atom/movable/screen/alert/not_enough_co2) - else if(S.breathid == "n2") + if(GAS_N2) throw_alert(ALERT_NOT_ENOUGH_NITRO, /atom/movable/screen/alert/not_enough_nitro) - - return FALSE - else - if(istype(L, /obj/item/organ/internal/lungs)) - var/obj/item/organ/internal/lungs/lun = L - lun.check_breath(breath,src) + return FALSE /// Environment handlers for species /mob/living/carbon/human/handle_environment(datum/gas_mixture/environment, seconds_per_tick, times_fired) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index bbec9bb780d..562d03c137e 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -71,8 +71,6 @@ GLOBAL_LIST_EMPTY(features_by_species) * Layer hiding is handled by [/datum/species/proc/handle_mutant_bodyparts] below. */ var/list/mutant_bodyparts = list() - ///Internal organs that are unique to this race, like a tail. - var/list/mutant_organs = list() ///The bodyparts this species uses. assoc of bodypart string - bodypart type. Make sure all the fucking entries are in or I'll skin you alive. var/list/bodypart_overrides = list( BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left, @@ -82,9 +80,29 @@ GLOBAL_LIST_EMPTY(features_by_species) BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right, BODY_ZONE_CHEST = /obj/item/bodypart/chest, ) + ///Internal organs that are unique to this race, like a tail. + var/list/mutant_organs = list() ///List of external organs to generate like horns, frills, wings, etc. list(typepath of organ = "Round Beautiful BDSM Snout"). Still WIP var/list/external_organs = list() + ///Replaces default brain with a different organ + var/obj/item/organ/internal/brain/mutantbrain = /obj/item/organ/internal/brain + ///Replaces default heart with a different organ + var/obj/item/organ/internal/heart/mutantheart = /obj/item/organ/internal/heart + ///Replaces default lungs with a different organ + var/obj/item/organ/internal/lungs/mutantlungs = /obj/item/organ/internal/lungs + ///Replaces default eyes with a different organ + var/obj/item/organ/internal/eyes/mutanteyes = /obj/item/organ/internal/eyes + ///Replaces default ears with a different organ + var/obj/item/organ/internal/ears/mutantears = /obj/item/organ/internal/ears + ///Replaces default tongue with a different organ + var/obj/item/organ/internal/tongue/mutanttongue = /obj/item/organ/internal/tongue + ///Replaces default liver with a different organ + var/obj/item/organ/internal/liver/mutantliver = /obj/item/organ/internal/liver + ///Replaces default stomach with a different organ + var/obj/item/organ/internal/stomach/mutantstomach = /obj/item/organ/internal/stomach + ///Replaces default appendix with a different organ. + var/obj/item/organ/internal/appendix/mutantappendix = /obj/item/organ/internal/appendix ///Multiplier for the race's speed. Positive numbers make it move slower, negative numbers make it move faster. var/speedmod = 0 @@ -143,36 +161,13 @@ GLOBAL_LIST_EMPTY(features_by_species) var/list/inherent_factions ///What gas does this species breathe? Used by suffocation screen alerts, most of actual gas breathing is handled by mutantlungs. See [life.dm][code/modules/mob/living/carbon/human/life.dm] - var/breathid = "o2" + var/breathid = GAS_O2 ///What anim to use for dusting var/dust_anim = "dust-h" ///What anim to use for gibbing var/gib_anim = "gibbed-h" - // Prefer anything other than setting these to null, such as TRAITS - // why? - // because traits also disable the downsides of not having an organ, removing organs but not having the trait or logic will make your species die - - ///Replaces default brain with a different organ - var/obj/item/organ/internal/brain/mutantbrain = /obj/item/organ/internal/brain - ///Replaces default heart with a different organ - var/obj/item/organ/internal/heart/mutantheart = /obj/item/organ/internal/heart - ///Replaces default lungs with a different organ - var/obj/item/organ/internal/lungs/mutantlungs = /obj/item/organ/internal/lungs - ///Replaces default eyes with a different organ - var/obj/item/organ/internal/eyes/mutanteyes = /obj/item/organ/internal/eyes - ///Replaces default ears with a different organ - var/obj/item/organ/internal/ears/mutantears = /obj/item/organ/internal/ears - ///Replaces default tongue with a different organ - var/obj/item/organ/internal/tongue/mutanttongue = /obj/item/organ/internal/tongue - ///Replaces default liver with a different organ - var/obj/item/organ/internal/liver/mutantliver = /obj/item/organ/internal/liver - ///Replaces default stomach with a different organ - var/obj/item/organ/internal/stomach/mutantstomach = /obj/item/organ/internal/stomach - ///Replaces default appendix with a different organ. - var/obj/item/organ/internal/appendix/mutantappendix = /obj/item/organ/internal/appendix - ///Bitflag that controls what in game ways something can select this species as a spawnable source, such as magic mirrors. See [mob defines][code/__DEFINES/mobs.dm] for possible sources. var/changesource_flags = NONE 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 34f0310c39b..ef6f07c376d 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -29,7 +29,7 @@ heatmod = 1.5 brutemod = 1.5 payday_modifier = 0.75 - breathid = "plas" + breathid = GAS_PLASMA disliked_food = FRUIT | CLOTH liked_food = VEGETABLES changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_PRIDE | MIRROR_MAGIC diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 56756afc3b4..abd6756e666 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -206,7 +206,7 @@ /datum/action/cooldown/domain/proc/domain() var/turf/T = get_turf(owner) - T.atmos_spawn_air("miasma=4;TEMP=[T20C]") + T.atmos_spawn_air("[GAS_MIASMA]=4;[TURF_TEMPERATURE(T20C)]") switch (rand(1,10)) if (8) new /obj/effect/decal/cleanable/vomit(T) diff --git a/code/modules/mod/modules/modules_general.dm b/code/modules/mod/modules/modules_general.dm index 8de9c6f962e..0a96cee059a 100644 --- a/code/modules/mod/modules/modules_general.dm +++ b/code/modules/mod/modules/modules_general.dm @@ -365,7 +365,7 @@ /// The temperature we are regulating to. var/temperature_setting = BODYTEMP_NORMAL /// Minimum temperature we can set. - var/min_temp = 293.15 + var/min_temp = T20C /// Maximum temperature we can set. var/max_temp = 318.15 diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 33aab793f2d..1b7a61d2a47 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -823,8 +823,7 @@ /datum/reagent/oxygen/expose_turf(turf/open/exposed_turf, reac_volume) . = ..() if(istype(exposed_turf)) - var/temp = holder ? holder.chem_temp : T20C - exposed_turf.atmos_spawn_air("o2=[reac_volume/20];TEMP=[temp]") + exposed_turf.atmos_spawn_air("[GAS_O2]=[reac_volume/20];[TURF_TEMPERATURE(holder ? holder.chem_temp : T20C)]") return /datum/reagent/copper @@ -856,8 +855,7 @@ /datum/reagent/nitrogen/expose_turf(turf/open/exposed_turf, reac_volume) if(istype(exposed_turf)) - var/temp = holder ? holder.chem_temp : T20C - exposed_turf.atmos_spawn_air("n2=[reac_volume/20];TEMP=[temp]") + exposed_turf.atmos_spawn_air("[GAS_N2]=[reac_volume/20];[TURF_TEMPERATURE(holder ? holder.chem_temp : T20C)]") return ..() /datum/reagent/hydrogen @@ -1409,8 +1407,7 @@ /datum/reagent/carbondioxide/expose_turf(turf/open/exposed_turf, reac_volume) if(istype(exposed_turf)) - var/temp = holder ? holder.chem_temp : T20C - exposed_turf.atmos_spawn_air("co2=[reac_volume/20];TEMP=[temp]") + exposed_turf.atmos_spawn_air("[GAS_CO2]=[reac_volume/20];[TURF_TEMPERATURE(holder ? holder.chem_temp : T20C)]") return ..() /datum/reagent/nitrous_oxide @@ -1427,8 +1424,7 @@ /datum/reagent/nitrous_oxide/expose_turf(turf/open/exposed_turf, reac_volume) . = ..() if(istype(exposed_turf)) - var/temp = holder ? holder.chem_temp : T20C - exposed_turf.atmos_spawn_air("n2o=[reac_volume/20];TEMP=[temp]") + exposed_turf.atmos_spawn_air("[GAS_N2O]=[reac_volume/20];[TURF_TEMPERATURE(holder ? holder.chem_temp : T20C)]") /datum/reagent/nitrous_oxide/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume) . = ..() diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index 2e256fc6c9c..b358d2ede76 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -118,7 +118,7 @@ if((holder.flags & SEALED_CONTAINER) && (holder.chem_temp < LIQUID_PLASMA_IG)) return var/atom/A = holder.my_atom - A.atmos_spawn_air("plasma=[volume];TEMP=[holder.chem_temp]") + A.atmos_spawn_air("[GAS_PLASMA]=[volume];[TURF_TEMPERATURE(holder.chem_temp)]") holder.del_reagent(type) /datum/reagent/toxin/plasma/expose_turf(turf/open/exposed_turf, reac_volume) @@ -126,7 +126,7 @@ return var/temp = holder ? holder.chem_temp : T20C if(temp >= LIQUID_PLASMA_BP) - exposed_turf.atmos_spawn_air("plasma=[reac_volume];TEMP=[temp]") + exposed_turf.atmos_spawn_air("[GAS_PLASMA]=[reac_volume];[TURF_TEMPERATURE(temp)]") return ..() #undef LIQUID_PLASMA_BP diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index 20af933b404..2fb4bc9ce26 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -156,7 +156,7 @@ var/turf/exposed_turf = get_turf(holder.my_atom) if(!exposed_turf) return - exposed_turf.atmos_spawn_air("n2o=[equilibrium.step_target_vol/2];TEMP=[holder.chem_temp]") + exposed_turf.atmos_spawn_air("[GAS_N2O]=[equilibrium.step_target_vol/2];[TURF_TEMPERATURE(holder.chem_temp)]") clear_products(holder, equilibrium.step_target_vol) /datum/chemical_reaction/nitrous_oxide/overheated(datum/reagents/holder, datum/equilibrium/equilibrium, step_volume_added) diff --git a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm index e0b8c74f75a..4894c3d4faf 100644 --- a/code/modules/reagents/chemistry/recipes/pyrotechnics.dm +++ b/code/modules/reagents/chemistry/recipes/pyrotechnics.dm @@ -395,7 +395,7 @@ return var/turf/open/T = get_turf(holder.my_atom) if(istype(T)) - T.atmos_spawn_air("plasma=[created_volume];TEMP=1000") + T.atmos_spawn_air("[GAS_PLASMA]=[created_volume];[TURF_TEMPERATURE(1000)]") holder.clear_reagents() return @@ -579,8 +579,8 @@ var/range = clamp(sqrt(created_volume*2), 1, 6) //This first throws people away and then it explodes goonchem_vortex(turfie, 1, range) - turfie.atmos_spawn_air("o2=[created_volume/2];TEMP=[575]") - turfie.atmos_spawn_air("n2=[created_volume/2];TEMP=[575]") + turfie.atmos_spawn_air("[GAS_O2]=[created_volume/2];[TURF_TEMPERATURE(575)]") + turfie.atmos_spawn_air("[GAS_N2]=[created_volume/2];[TURF_TEMPERATURE(575)]") return ..() /datum/chemical_reaction/firefighting_foam diff --git a/code/modules/reagents/chemistry/recipes/slime_extracts.dm b/code/modules/reagents/chemistry/recipes/slime_extracts.dm index 012655eec4d..5dc9fed83ce 100644 --- a/code/modules/reagents/chemistry/recipes/slime_extracts.dm +++ b/code/modules/reagents/chemistry/recipes/slime_extracts.dm @@ -205,7 +205,7 @@ 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("[initial(gastype.id)]=50;[TURF_TEMPERATURE(2.7)]") /datum/chemical_reaction/slime/slimefireproof required_reagents = list(/datum/reagent/water = 1) @@ -239,7 +239,7 @@ if(holder?.my_atom) var/turf/open/T = get_turf(holder.my_atom) if(istype(T)) - T.atmos_spawn_air("plasma=50;TEMP=1000") + T.atmos_spawn_air("[GAS_PLASMA]=50;[TURF_TEMPERATURE(1000)]") /datum/chemical_reaction/slime/slimesmoke diff --git a/code/modules/research/xenobiology/crossbreeding/burning.dm b/code/modules/research/xenobiology/crossbreeding/burning.dm index 172dfc96783..a5f281bb375 100644 --- a/code/modules/research/xenobiology/crossbreeding/burning.dm +++ b/code/modules/research/xenobiology/crossbreeding/burning.dm @@ -111,8 +111,8 @@ Burning extracts: /obj/item/slimecross/burning/darkpurple/do_effect(mob/user) user.visible_message(span_danger("[src] sublimates into a cloud of plasma!")) var/turf/T = get_turf(user) - T.atmos_spawn_air("plasma=60") - ..() + T.atmos_spawn_air("[GAS_PLASMA]=60") + return ..() /obj/item/slimecross/burning/darkblue colour = "dark blue" diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 8ab3b65db92..7c3465e9796 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -233,7 +233,7 @@ if(SLIME_ACTIVATE_MAJOR) var/turf/open/T = get_turf(user) if(istype(T)) - T.atmos_spawn_air("plasma=20") + T.atmos_spawn_air("[GAS_PLASMA]=20") to_chat(user, span_warning("You activate [src], and a cloud of plasma bursts out of your skin!")) return 900 @@ -339,7 +339,7 @@ if(SLIME_ACTIVATE_MAJOR) var/turf/open/T = get_turf(user) if(istype(T)) - T.atmos_spawn_air("nitrogen=40;TEMP=2.7") + T.atmos_spawn_air("[GAS_N2]=40;[TURF_TEMPERATURE(2.7)]") to_chat(user, span_warning("You activate [src], and icy air bursts out of your skin!")) return 900 @@ -572,7 +572,7 @@ if(SLIME_ACTIVATE_MAJOR) var/turf/open/T = get_turf(user) if(istype(T)) - T.atmos_spawn_air("o2=11;n2=41;TEMP=293.15") + T.atmos_spawn_air("[GAS_O2]=11;[GAS_N2]=41;[TURF_TEMPERATURE(T20C)]") to_chat(user, span_warning("You activate [src], and fresh air bursts out of your skin!")) return 600 diff --git a/tgstation.dme b/tgstation.dme index bb0e590fad0..e1870c32cfd 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -243,6 +243,7 @@ #include "code\__DEFINES\wounds.dm" #include "code\__DEFINES\xenobiology.dm" #include "code\__DEFINES\atmospherics\atmos_core.dm" +#include "code\__DEFINES\atmospherics\atmos_gasses.dm" #include "code\__DEFINES\atmospherics\atmos_helpers.dm" #include "code\__DEFINES\atmospherics\atmos_machinery.dm" #include "code\__DEFINES\atmospherics\atmos_mapping_helpers.dm"