Chem gas tweaks, + toxins rebalance

This commit is contained in:
Putnam3145
2021-11-15 16:29:30 -08:00
parent b91fb21234
commit 1da28b8ec6
19 changed files with 148 additions and 99 deletions
+13 -5
View File
@@ -53,9 +53,10 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
var/chemical_flags // See fermi/readme.dm REAGENT_DEAD_PROCESS, REAGENT_DONOTSPLIT, REAGENT_ONLYINVERSE, REAGENT_ONMOBMERGE, REAGENT_INVISIBLE, REAGENT_FORCEONNEW, REAGENT_SNEAKYNAME
var/value = REAGENT_VALUE_NONE //How much does it sell for in cargo?
var/datum/material/material //are we made of material?
var/gas //do we have an associated gas?
var/gas = null //do we have an associated gas? (expects a string, not a datum typepath!)
var/boiling_point = null // point at which this gas boils; if null, will never boil (and thus not become a gas)
var/condensation_amount = 1
var/molarity = 5 // How many units per mole of this reagent. Technically this is INVERSE molarity, but hey.
/datum/reagent/New()
. = ..()
@@ -80,7 +81,10 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
return 1
/datum/reagent/proc/reaction_obj(obj/O, volume)
return
if(O && volume && boiling_point)
var/temp = holder ? holder.chem_temp : T20C
if(temp > boiling_point)
O.atmos_spawn_air("[get_gas()]=[volume/molarity];TEMP=[temp]")
/datum/reagent/proc/reaction_turf(turf/T, volume, show_message, from_gas)
if(!from_gas && boiling_point)
@@ -93,7 +97,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
else
temp = T20C
if(temp > boiling_point)
T.atmos_spawn_air("[get_gas()]=[volume/2];TEMP=[temp]")
T.atmos_spawn_air("[get_gas()]=[volume/molarity];TEMP=[temp]")
/datum/reagent/proc/on_mob_life(mob/living/carbon/M)
current_cycle++
@@ -259,13 +263,17 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
G.specific_heat = specific_heat / 10
G.color = color
G.breath_reagent = src.type
G.turf_reagent = src.type
G.group = GAS_GROUP_CHEMICALS
return G
/datum/reagent/proc/create_gas()
var/datum/gas/G = define_gas()
if(istype(G)) // if this reagent should never be a gas, define_gas may return null
GLOB.gas_data.add_gas(G)
var/datum/gas_reaction/condensation/condensation_reaction = new(src) // did you know? you can totally just add new reactions at runtime. it's allowed
SSair.add_reaction(condensation_reaction)
return G
/datum/reagent/proc/get_gas()
if(gas)
@@ -274,7 +282,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
var/datum/auxgm/cached_gas_data = GLOB.gas_data
. = "[src.type]"
if(!(. in cached_gas_data.ids))
var/datum/gas/G = define_gas()
var/datum/gas/G = create_gas()
if(istype(G))
cached_gas_data.add_gas(G)
else // this codepath should probably not happen at all, since we never use get_gas() on anything with no boiling point
@@ -90,6 +90,31 @@ All effects don't start immediately, but rather get worse over time; the rate is
// +10% success propability on each step, useful while operating in less-than-perfect conditions
return ..()
/datum/reagent/consumable/ethanol/define_gas() // So that all alcohols have the same gas, i.e. "ethanol"
var/datum/gas/G = new
G.id = GAS_ETHANOL
G.name = "Ethanol"
G.enthalpy = -234800
G.specific_heat = 38
G.fire_products = list(GAS_CO2 = 1, GAS_H2O = 1.5)
G.fire_burn_rate = 1 / 3
G.fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
G.color = "#404030"
G.breath_reagent = /datum/reagent/consumable/ethanol
G.group = GAS_GROUP_CHEMICALS
return G
/datum/reagent/consumable/ethanol/get_gas()
var/datum/auxgm/cached_gas_data = GLOB.gas_data
. = GAS_ETHANOL
if(!(. in cached_gas_data.ids))
var/datum/gas/G = define_gas()
if(istype(G))
cached_gas_data.add_gas(G)
else // this codepath should probably not happen at all, since we never use get_gas() on anything with no boiling point
return null
/datum/reagent/consumable/ethanol/beer
name = "Beer"
description = "An alcoholic beverage brewed since ancient times on Old Earth. Still popular today."
@@ -2,7 +2,6 @@
name = "Drug"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
taste_description = "bitterness"
boiling_point = T0C + 100
var/trippy = TRUE //Does this drug make you trip?
/datum/reagent/drug/on_mob_end_metabolize(mob/living/M)
@@ -8,7 +8,6 @@
/datum/reagent/medicine
name = "Medicine"
taste_description = "bitterness"
boiling_point = T0C + 100
value = REAGENT_VALUE_VERY_COMMON //Low prices, spess medical companies are cheapstakes and products are taxed honk...
/datum/reagent/medicine/on_mob_life(mob/living/carbon/M)
@@ -899,8 +899,10 @@
description = "A colorless, odorless gas. Grows on trees but is still pretty valuable."
reagent_state = GAS
color = "#808080" // rgb: 128, 128, 128
gas = GAS_O2
taste_mult = 0 // oderless and tasteless
pH = 9.2//It's acutally a huge range and very dependant on the chemistry but pH is basically a made up var in it's implementation anyways
molarity = 2
/datum/reagent/oxygen/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
@@ -933,26 +935,16 @@
name = "Nitrogen"
description = "A colorless, odorless, tasteless gas. A simple asphyxiant that can silently displace vital oxygen."
reagent_state = GAS
gas = GAS_N2
color = "#808080" // rgb: 128, 128, 128
taste_mult = 0
/datum/reagent/nitrogen/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("n2=[reac_volume/2];TEMP=[temp]")
/datum/reagent/nitrogen/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("n2=[reac_volume/2];TEMP=[temp]")
return
molarity = 2
/datum/reagent/hydrogen
name = "Hydrogen"
description = "A colorless, odorless, nonmetallic, tasteless, highly combustible diatomic gas."
reagent_state = GAS
gas = GAS_HYDROGEN
color = "#808080" // rgb: 128, 128, 128
taste_mult = 0
pH = 0.1//Now I'm stuck in a trap of my own design. Maybe I should make -ve pHes? (not 0 so I don't get div/0 errors)
@@ -1005,7 +997,7 @@
name = "Chlorine"
description = "A pale yellow gas that's well known as an oxidizer. While it forms many harmless molecules in its elemental form it is far from harmless."
reagent_state = GAS
color = "#808080" // rgb: 128, 128, 128
color = "#c0c0a0" // rgb: 192, 192, 160
taste_description = "chlorine"
pH = 7.4
boiling_point = 239.11
@@ -1275,13 +1267,14 @@
glass_name = "glass of welder fuel"
glass_desc = "Unless you're an industrial tool, this is probably not safe for consumption."
pH = 4
boiling_point = 189
boiling_point = 400
/datum/reagent/fuel/define_gas()
var/datum/gas/G = ..()
G.fire_energy_released = 200000
G.fire_products = list(GAS_CO2 = 1)
G.fire_temperature = T20C+30
G.enthalpy = 227400
G.fire_burn_rate = 2 / 5
G.fire_products = list(GAS_CO2 = 2, GAS_H2O = 1)
G.fire_temperature = T0C+300
return G
/datum/reagent/fuel/reaction_mob(mob/living/M, method=TOUCH, reac_volume)//Splashing people with welding fuel to make them easy to ignite!
@@ -1480,6 +1473,7 @@
name = "Ammonia"
description = "A caustic substance commonly used in fertilizer or household cleaners."
reagent_state = GAS
gas = GAS_AMMONIA
color = "#404030" // rgb: 64, 64, 48
taste_description = "mordant"
pH = 11.6
@@ -1498,8 +1492,17 @@
description = "A secondary amine, mildly corrosive."
color = "#604030" // rgb: 96, 64, 48
taste_description = "iron"
boiling_point = 328
pH = 12
/datum/reagent/diethylamine/define_gas()
var/datum/gas/G = ..()
G.fire_burn_rate = 1 / 6
G.fire_products = list(GAS_H2O = 4, GAS_AMMONIA = 1, GAS_CO2 = 4)
G.enthalpy = -131000
G.fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST
return G
// This is more bad ass, and pests get hurt by the corrosive nature of it, not the plant. The new trade off is it culls stability.
/datum/reagent/diethylamine/on_hydroponics_apply(obj/item/seeds/myseed, datum/reagents/chems, obj/machinery/hydroponics/mytray, mob/user)
. = ..()
@@ -1516,40 +1519,23 @@
description = "A gas commonly produced by burning carbon fuels. You're constantly producing this in your lungs."
color = "#B0B0B0" // rgb : 192, 192, 192
taste_description = "something unknowable"
boiling_point = 195.68 // technically sublimation, not boiling, but same deal
molarity = 5
gas = GAS_CO2
pH = 6
/datum/reagent/carbondioxide/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("co2=[reac_volume/5];TEMP=[temp]")
/datum/reagent/carbondioxide/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("co2=[reac_volume/5];TEMP=[temp]")
return
/datum/reagent/nitrous_oxide
name = "Nitrous Oxide"
description = "A potent oxidizer used as fuel in rockets and as an anaesthetic during surgery."
reagent_state = LIQUID
metabolization_rate = 1.5 * REAGENTS_METABOLISM
color = "#808080"
boiling_point = 184.67
molarity = 5
gas = GAS_NITROUS
taste_description = "sweetness"
pH = 5.8
/datum/reagent/nitrous_oxide/reaction_obj(obj/O, reac_volume)
if((!O) || (!reac_volume))
return 0
var/temp = holder ? holder.chem_temp : T20C
O.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[temp]")
/datum/reagent/nitrous_oxide/reaction_turf(turf/open/T, reac_volume)
if(istype(T))
var/temp = holder ? holder.chem_temp : T20C
T.atmos_spawn_air("n2o=[reac_volume/5];TEMP=[temp]")
/datum/reagent/nitrous_oxide/reaction_mob(mob/living/M, method=TOUCH, reac_volume)
if(method == VAPOR)
M.drowsyness += max(round(reac_volume, 1), 2)
@@ -1568,8 +1554,10 @@
name = "Stimulum"
description = "An unstable experimental gas that greatly increases the energy of those that inhale it"
reagent_state = GAS
gas = GAS_STIMULUM
metabolization_rate = 1.5 * REAGENTS_METABOLISM
color = "E1A116"
boiling_point = 150
taste_description = "sourness"
value = REAGENT_VALUE_EXCEPTIONAL
@@ -1593,9 +1581,11 @@
name = "Nitryl"
description = "A highly reactive gas that makes you feel faster"
reagent_state = GAS
gas = GAS_NITRYL
metabolization_rate = REAGENTS_METABOLISM
color = "90560B"
color = "#90560B"
taste_description = "burning"
boiling_point = 294.3
pH = 2
value = REAGENT_VALUE_VERY_RARE
@@ -1802,6 +1792,8 @@
reagent_state = LIQUID
color = "#b37740"
taste_description = "chemicals"
gas = GAS_BROMINE
boiling_point = 332
pH = 7.8
/datum/reagent/phenol
@@ -45,7 +45,9 @@
color = "#FFC8C8"
metabolization_rate = 4
taste_description = "burning"
/* no gaseous CLF3 until i can think of a good way to get it to burn that doesn't destroy matter in mysterious ways
boiling_point = 289.4
*/
condensation_amount = 2
value = REAGENT_VALUE_COMMON
@@ -86,10 +88,8 @@
/datum/reagent/clf3/define_gas()
var/datum/gas/G = ..()
G.fire_energy_released = 123000
G.oxidation_rate = 4
G.enthalpy = -163200
G.oxidation_temperature = T0C - 50
G.turf_reagent = src.type
return G
/datum/reagent/sorium
@@ -164,7 +164,8 @@
/datum/reagent/phlogiston/define_gas()
var/datum/gas/G = ..()
G.fire_energy_released = FIRE_PLASMA_ENERGY_RELEASED / 100
G.enthalpy = FIRE_PLASMA_ENERGY_RELEASED / 100
G.fire_products = list(GAS_O2 = 0.25, GAS_METHANE = 0.75) // meanwhile this is just magic
G.fire_burn_rate = 1
G.fire_temperature = T20C+1
return G
@@ -8,7 +8,6 @@
taste_description = "bitterness"
taste_mult = 1.2
value = REAGENT_VALUE_COMMON //Encouraging people to mix toxins for reasons beyond harming each other or mixing reagents such as pen acid.
boiling_point = T0C + 100
var/toxpwr = 1.5
// Are you a bad enough dude to poison your own plants?