From 24560e5c46dfc678194260662a186cf638ed22f0 Mon Sep 17 00:00:00 2001 From: EgorDinamit Date: Wed, 14 Feb 2024 23:26:59 +0300 Subject: [PATCH] Grown plants and gas values --- code/_helpers/atmospherics.dm | 7 ++++- code/modules/hydroponics/seed.dm | 42 ++++++++++++++++++++++++++ code/modules/item_worth/value_procs.dm | 26 ++++++++++++++++ code/modules/item_worth/worths_list.dm | 4 +-- code/modules/xgm/gases.dm | 22 ++++++++++++++ code/modules/xgm/xgm_gas_data.dm | 2 ++ 6 files changed, 100 insertions(+), 3 deletions(-) diff --git a/code/_helpers/atmospherics.dm b/code/_helpers/atmospherics.dm index ec309d81cf4..1d050f4deae 100644 --- a/code/_helpers/atmospherics.dm +++ b/code/_helpers/atmospherics.dm @@ -13,4 +13,9 @@ /proc/print_atmos_analysis(user, var/list/result) for(var/line in result) - to_chat(user, "[line]") \ No newline at end of file + to_chat(user, "[line]") + +/proc/GetGasDatum(gas_id) + if(!(gas_id in gas_data.gases)) + return null + return gas_data.gases[gas_id] diff --git a/code/modules/hydroponics/seed.dm b/code/modules/hydroponics/seed.dm index eed07e72002..762a2bc7518 100644 --- a/code/modules/hydroponics/seed.dm +++ b/code/modules/hydroponics/seed.dm @@ -861,3 +861,45 @@ res.overlays += I return res + +/datum/seed/proc/Value(check_chems = TRUE) + . = 5 + for(var/trait in traits) + var/trait_value = get_trait(trait) + if(!trait_value) + continue + + switch(trait) + if(TRAIT_POTENCY) + . += trait_value * 0.4 + if(TRAIT_EXPLOSIVE) + . += 15 + if(TRAIT_HARVEST_REPEAT) + . += 15 + if(TRAIT_PRODUCTION) + . += trait_value + if(TRAIT_YIELD) + . += trait_value + if(TRAIT_MATURATION) + . -= trait_value + if(TRAIT_ENDURANCE) + . += trait_value * 0.25 + if(TRAIT_JUICY) + . += trait_value * 5 + if(TRAIT_STINGS) + . += 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] + + if(check_chems) + for(var/chem in chems) + var/datum/reagent/R = GLOB.chemical_reagents_list[chem] + if(!istype(R)) + continue + . += R.value * chems[chem] + + . = round(max(2, .)) diff --git a/code/modules/item_worth/value_procs.dm b/code/modules/item_worth/value_procs.dm index 3ef203f4d6c..797f5e9366d 100644 --- a/code/modules/item_worth/value_procs.dm +++ b/code/modules/item_worth/value_procs.dm @@ -91,3 +91,29 @@ . += length(allowed_spells * 1000) if(!isnull(owner)) . *= 0.5 + +/obj/item/reagent_containers/food/snacks/grown/Value(base) + . = ..() + . += seed.Value(FALSE) + +// Seeds cost less than fully grown plants +/obj/item/seeds/Value(base) + . = ..() + . += round(seed.Value(TRUE) * 0.3) + +/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] + +// 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] diff --git a/code/modules/item_worth/worths_list.dm b/code/modules/item_worth/worths_list.dm index 7f3a0d35248..575762b4983 100644 --- a/code/modules/item_worth/worths_list.dm +++ b/code/modules/item_worth/worths_list.dm @@ -300,8 +300,8 @@ var/list/worths = list( /obj/item/melee/classic_baton = 40, /obj/item/melee/telebaton = 100, /obj/item/excalibur = 5000, - /obj/item/tank/jetpack = 450, - /obj/item/tank = 50, + /obj/item/tank/jetpack = -250, + /obj/item/tank = -50, /obj/item/contraband/poster = 25, //MATERIAL, /obj/item/material/sword/katana/replica = -120, diff --git a/code/modules/xgm/gases.dm b/code/modules/xgm/gases.dm index 902182cb921..568d52b5711 100644 --- a/code/modules/xgm/gases.dm +++ b/code/modules/xgm/gases.dm @@ -7,6 +7,7 @@ breathed_product = /datum/reagent/oxygen symbol_html = "O2" symbol = "O2" + value = 4 /decl/xgm_gas/nitrogen @@ -16,6 +17,7 @@ molar_mass = 0.028 // kg/mol symbol_html = "N2" symbol = "N2" + value = 2 /decl/xgm_gas/carbon_dioxide id = GAS_CO2 @@ -24,6 +26,7 @@ molar_mass = 0.044 // kg/mol symbol_html = "CO2" symbol = "CO2" + value = 4 /decl/xgm_gas/methyl_bromide id = GAS_METHYL_BROMIDE @@ -33,6 +36,7 @@ breathed_product = /datum/reagent/toxin/methyl_bromide symbol_html = "CH3Br" symbol = "CH3Br" + value = 8 /decl/xgm_gas/phoron id = GAS_PHORON @@ -53,6 +57,7 @@ breathed_product = /datum/reagent/toxin/phoron symbol_html = "Ph" symbol = "Ph" + value = 12 /decl/xgm_gas/sleeping_agent id = GAS_N2O @@ -63,6 +68,7 @@ breathed_product = /datum/reagent/nitrous_oxide symbol_html = "N2O" symbol = "N2O" + value = 3 /decl/xgm_gas/methane id = GAS_METHANE @@ -72,6 +78,7 @@ flags = XGM_GAS_FUEL symbol_html = "CH4" symbol = "CH4" + value = 3 /decl/xgm_gas/alium id = GAS_ALIEN @@ -79,6 +86,7 @@ hidden_from_codex = TRUE symbol_html = "X" symbol = "X" + value = 20 /decl/xgm_gas/alium/New() var/num = rand(100,999) @@ -109,18 +117,21 @@ burn_product = GAS_STEAM symbol_html = "H2" symbol = "H2" + value = 10 /decl/xgm_gas/hydrogen/deuterium id = GAS_DEUTERIUM name = "Deuterium" symbol_html = "D" symbol = "D" + value = 10 /decl/xgm_gas/hydrogen/tritium id = GAS_TRITIUM name = "Tritium" symbol_html = "T" symbol = "T" + value = 15 /decl/xgm_gas/helium id = GAS_HELIUM @@ -131,6 +142,7 @@ breathed_product = /datum/reagent/helium symbol_html = "He" symbol = "He" + value = 7 /decl/xgm_gas/argon id = GAS_ARGON @@ -139,6 +151,7 @@ molar_mass = 0.018 // kg/mol symbol_html = "Ar" symbol = "Ar" + value = 25 // If narcosis is ever simulated, krypton has a narcotic potency seven times greater than regular airmix. /decl/xgm_gas/krypton @@ -148,6 +161,7 @@ molar_mass = 0.036 // kg/mol symbol_html = "Kr" symbol = "Kr" + value = 25 /decl/xgm_gas/neon id = GAS_NEON @@ -156,6 +170,7 @@ molar_mass = 0.01 // kg/mol symbol_html = "Ne" symbol = "Ne" + value = 10 /decl/xgm_gas/xenon id = GAS_XENON @@ -165,6 +180,7 @@ breathed_product = /datum/reagent/nitrous_oxide/xenon symbol_html = "Xe" symbol = "Xe" + value = 10 /decl/xgm_gas/nitrodioxide id = GAS_NO2 @@ -186,6 +202,7 @@ flags = XGM_GAS_OXIDIZER symbol_html = "NO" symbol = "NO" + value = 15 /decl/xgm_gas/chlorine id = GAS_CHLORINE @@ -198,6 +215,7 @@ breathed_product = /datum/reagent/toxin/chlorine symbol_html = "Cl" symbol = "Cl" + value = 7 /decl/xgm_gas/vapor id = GAS_STEAM @@ -211,6 +229,7 @@ condensation_point = 308.15 // 35C. Dew point is ~20C but this is better for gameplay considerations. symbol_html = "H2O" symbol = "H2O" + value = 1 /decl/xgm_gas/sulfurdioxide id = GAS_SULFUR @@ -220,6 +239,7 @@ molar_mass = 0.044 // kg/mol symbol_html = "SO2" symbol = "SO2" + value = 12 /decl/xgm_gas/ammonia id = GAS_AMMONIA @@ -230,6 +250,7 @@ breathed_product = /datum/reagent/ammonia symbol_html = "NH3" symbol = "NH3" + value = 1 /decl/xgm_gas/carbon_monoxide id = GAS_CO @@ -239,3 +260,4 @@ breathed_product = /datum/reagent/carbon_monoxide symbol_html = "CO" symbol = "CO" + value = 5 diff --git a/code/modules/xgm/xgm_gas_data.dm b/code/modules/xgm/xgm_gas_data.dm index 46c76985ab8..481a411380d 100644 --- a/code/modules/xgm/xgm_gas_data.dm +++ b/code/modules/xgm/xgm_gas_data.dm @@ -51,6 +51,8 @@ var/symbol_html = "X" var/symbol = "X" + /// Cost per mole + var/value = 0 /hook/startup/proc/generateGasData() gas_data = new