Skip to content

Commit

Permalink
Atmos tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit committed Feb 15, 2024
1 parent 1fbd555 commit c7eb310
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 41 deletions.
1 change: 1 addition & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3289,6 +3289,7 @@
#include "code\modules\tgs\includes.dm"
#include "code\modules\trading_stations\_faction.dm"
#include "code\modules\trading_stations\_trading_station.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\atmos.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\engineering.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\eva.dm"
#include "code\modules\trading_stations\trading_station_types\0_always_spawn\materials.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/supply.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#define TRADE_CAT_MEDKIT "Medical Kits"
#define TRADE_CAT_CHEMICAL "Chemical"
#define TRADE_CAT_CHEMCARTS "Chemical Cartridges"
#define TRADE_CAT_CANISTERS "Gas Canisters"
#define TRADE_CAT_MACHINES "Machinery"

// As in - faction is a part of us
#define FACTION_STATE_PROTECTORATE 4
Expand Down
11 changes: 0 additions & 11 deletions code/_helpers/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,3 @@
/proc/print_atmos_analysis(user, var/list/result)
for(var/line in result)
to_chat(user, "<span class='notice'>[line]</span>")

/proc/GetGasDatum(gas_id)
if(!(gas_id in gas_data.gases))
return null
var/list/all_gases = decls_repository.get_decls_of_subtype(/decl/xgm_gas)
for(var/type in all_gases)
var/decl/xgm_gas/gas = all_gases[type]
if(gas_id != gas.id)
continue
return gas
return null
26 changes: 26 additions & 0 deletions code/game/machinery/atmoalter/canister.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@
GAS_CHLORINE = -1
)

/obj/machinery/portable_atmospherics/canister/tritium
name = "gas canister \[Tritium\]"
icon_state = "green"
canister_color = "green"
can_label = FALSE
initial_gases = list(
GAS_TRITIUM = -1
)

/obj/machinery/portable_atmospherics/canister/deuterium
name = "gas canister \[Deuterium\]"
icon_state = "green"
canister_color = "green"
can_label = FALSE
initial_gases = list(
GAS_DEUTERIUM = -1
)

/obj/machinery/portable_atmospherics/canister/air/airlock
start_pressure = 3 * ONE_ATMOSPHERE

Expand Down Expand Up @@ -219,6 +237,14 @@
icon_state = "purple"
canister_type = /obj/machinery/portable_atmospherics/canister/hydrogen

/obj/machinery/portable_atmospherics/canister/empty/tritium
icon_state = "green"
canister_type = /obj/machinery/portable_atmospherics/canister/tritium

/obj/machinery/portable_atmospherics/canister/empty/deuterium
icon_state = "green"
canister_type = /obj/machinery/portable_atmospherics/canister/deuterium



/obj/machinery/portable_atmospherics/canister/proc/check_change()
Expand Down
5 changes: 1 addition & 4 deletions code/modules/hydroponics/seed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,7 @@
. += 15

for(var/gas_id in exude_gasses)
var/decl/xgm_gas/gas = GetGasDatum(gas_id)
if(!istype(gas))
continue
. += gas.value * exude_gasses[gas_id]
. += gas_data.value[gas_id] * exude_gasses[gas_id]

if(check_chems)
for(var/chem in chems)
Expand Down
12 changes: 4 additions & 8 deletions code/modules/item_worth/value_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,12 @@
/obj/item/tank/Value(base)
. = ..()
for(var/gas_id in air_contents.gas)
var/decl/xgm_gas/gas = GetGasDatum(gas_id)
if(!istype(gas))
continue
. += gas.value * air_contents.gas[gas_id]
. += gas_data.value[gas_id] * air_contents.gas[gas_id]
. = round(.)

// Mostly for canisters
/obj/machinery/portable_atmospherics/Value(base)
. = ..()
for(var/gas_id in air_contents.gas)
var/decl/xgm_gas/gas = GetGasDatum(gas_id)
if(!istype(gas))
continue
. += gas.value * air_contents.gas[gas_id]
. += gas_data.value[gas_id] * air_contents.gas[gas_id]
. = round(.)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/datum/trading_station/atmospherics
name_pool = list(
"FTB \"Deuterium Star\"" = "Free Trade Beacon \"Deuterium Star\": All the gases of the world in convenient packaging.",
"FTB \"Breathe-Easy\"" = "Free Trade Beacon \"Breathe-Easy\": Fill those corridors with fresh-fresh air!",
)
uid = "atmospherics"
unlock_favor = 9000
random_factions = list(
FACTION_INDEPENDENT,
FACTION_ISC,
)
spawn_always = TRUE
markup = 1.4
inventory = list(
TRADE_CAT_EQUIPMENT = list(
/obj/item/tank/oxygen = GOODS_DEFAULT,
/obj/item/tank/nitrogen = GOODS_DEFAULT,
/obj/item/tank/emergency/oxygen = GOODS_DEFAULT,
/obj/item/tank/emergency/oxygen/double = GOODS_DEFAULT,
/obj/item/tank/jetpack/carbondioxide = GOODS_DEFAULT,
/obj/item/tank/jetpack/oxygen = GOODS_DEFAULT,
),
TRADE_CAT_CANISTERS = list(
/obj/machinery/portable_atmospherics/canister/empty = CUSTOM_GOODS_NAME("empty canister"),
/obj/machinery/portable_atmospherics/canister/oxygen = GOODS_DEFAULT,
/obj/machinery/portable_atmospherics/canister/nitrogen = GOODS_DEFAULT,
/obj/machinery/portable_atmospherics/canister/air = GOODS_DEFAULT,
/obj/machinery/portable_atmospherics/canister/carbon_dioxide = GOODS_DEFAULT,
/obj/machinery/portable_atmospherics/canister/phoron = GOODS_DEFAULT,
),
TRADE_CAT_MACHINES = list(
/obj/machinery/portable_atmospherics/powered/pump = GOODS_DEFAULT,
/obj/machinery/portable_atmospherics/powered/scrubber = GOODS_DEFAULT,
),
)
hidden_inventory = list(
TRADE_CAT_EQUIPMENT = list(
/obj/item/tank/jetpack/ascent = CUSTOM_GOODS_NAME("unidentified alien jetpack"),
),
TRADE_CAT_CANISTERS = list(
/obj/machinery/portable_atmospherics/canister/tritium = GOODS_DEFAULT,
/obj/machinery/portable_atmospherics/canister/deuterium = GOODS_DEFAULT,
),
)
35 changes: 18 additions & 17 deletions code/modules/xgm/gases.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
breathed_product = /datum/reagent/oxygen
symbol_html = "O<sub>2</sub>"
symbol = "O2"
value = 4
value = 3


/decl/xgm_gas/nitrogen
Expand All @@ -17,7 +17,7 @@
molar_mass = 0.028 // kg/mol
symbol_html = "N<sub>2</sub>"
symbol = "N2"
value = 2
value = 1.5

/decl/xgm_gas/carbon_dioxide
id = GAS_CO2
Expand All @@ -26,7 +26,7 @@
molar_mass = 0.044 // kg/mol
symbol_html = "CO<sub>2</sub>"
symbol = "CO2"
value = 4
value = 3

/decl/xgm_gas/methyl_bromide
id = GAS_METHYL_BROMIDE
Expand All @@ -36,7 +36,7 @@
breathed_product = /datum/reagent/toxin/methyl_bromide
symbol_html = "CH<sub>3</sub>Br"
symbol = "CH3Br"
value = 8
value = 6

/decl/xgm_gas/phoron
id = GAS_PHORON
Expand All @@ -57,7 +57,7 @@
breathed_product = /datum/reagent/toxin/phoron
symbol_html = "Ph"
symbol = "Ph"
value = 12
value = 8

/decl/xgm_gas/sleeping_agent
id = GAS_N2O
Expand All @@ -68,7 +68,7 @@
breathed_product = /datum/reagent/nitrous_oxide
symbol_html = "N<sub>2</sub>O"
symbol = "N2O"
value = 3
value = 2

/decl/xgm_gas/methane
id = GAS_METHANE
Expand All @@ -78,7 +78,7 @@
flags = XGM_GAS_FUEL
symbol_html = "CH<sub>4</sub>"
symbol = "CH4"
value = 3
value = 2

/decl/xgm_gas/alium
id = GAS_ALIEN
Expand Down Expand Up @@ -117,21 +117,21 @@
burn_product = GAS_STEAM
symbol_html = "H<sub>2</sub>"
symbol = "H2"
value = 10
value = 5

/decl/xgm_gas/hydrogen/deuterium
id = GAS_DEUTERIUM
name = "Deuterium"
symbol_html = "D"
symbol = "D"
value = 10
value = 12

/decl/xgm_gas/hydrogen/tritium
id = GAS_TRITIUM
name = "Tritium"
symbol_html = "T"
symbol = "T"
value = 15
value = 12

/decl/xgm_gas/helium
id = GAS_HELIUM
Expand All @@ -142,7 +142,7 @@
breathed_product = /datum/reagent/helium
symbol_html = "He"
symbol = "He"
value = 7
value = 5

/decl/xgm_gas/argon
id = GAS_ARGON
Expand All @@ -151,7 +151,7 @@
molar_mass = 0.018 // kg/mol
symbol_html = "Ar"
symbol = "Ar"
value = 25
value = 15

// If narcosis is ever simulated, krypton has a narcotic potency seven times greater than regular airmix.
/decl/xgm_gas/krypton
Expand All @@ -161,7 +161,7 @@
molar_mass = 0.036 // kg/mol
symbol_html = "Kr"
symbol = "Kr"
value = 25
value = 20

/decl/xgm_gas/neon
id = GAS_NEON
Expand Down Expand Up @@ -192,6 +192,7 @@
breathed_product = /datum/reagent/toxin
symbol_html = "NO<sub>2</sub>"
symbol = "NO2"
value = 2

/decl/xgm_gas/nitricoxide
id = GAS_NO
Expand All @@ -202,7 +203,7 @@
flags = XGM_GAS_OXIDIZER
symbol_html = "NO"
symbol = "NO"
value = 15
value = 10

/decl/xgm_gas/chlorine
id = GAS_CHLORINE
Expand All @@ -215,7 +216,7 @@
breathed_product = /datum/reagent/toxin/chlorine
symbol_html = "Cl"
symbol = "Cl"
value = 7
value = 5

/decl/xgm_gas/vapor
id = GAS_STEAM
Expand All @@ -239,7 +240,7 @@
molar_mass = 0.044 // kg/mol
symbol_html = "SO<sub>2</sub>"
symbol = "SO2"
value = 12
value = 10

/decl/xgm_gas/ammonia
id = GAS_AMMONIA
Expand All @@ -260,4 +261,4 @@
breathed_product = /datum/reagent/carbon_monoxide
symbol_html = "CO"
symbol = "CO"
value = 5
value = 4
7 changes: 6 additions & 1 deletion code/modules/xgm/xgm_gas_data.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
var/list/symbol_html = list()
var/list/symbol = list()

//Values
var/list/value = list()

/decl/xgm_gas
var/id = ""
var/name = "Unnamed Gas"
Expand All @@ -56,7 +59,7 @@

/hook/startup/proc/generateGasData()
gas_data = new
for(var/p in (typesof(/decl/xgm_gas) - /decl/xgm_gas))
for(var/p in subtypesof(/decl/xgm_gas))
var/decl/xgm_gas/gas = new p //avoid initial() because of potential New() actions

if(gas.id in gas_data.gases)
Expand All @@ -83,6 +86,8 @@
gas_data.breathed_product[gas.id] = gas.breathed_product
gas_data.hidden_from_codex[gas.id] = gas.hidden_from_codex

gas_data.value[gas.id] = gas.value

return 1

/obj/effect/gas_overlay
Expand Down
Binary file modified icons/obj/atmos.dmi
Binary file not shown.

0 comments on commit c7eb310

Please sign in to comment.