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

Binary file not shown.

Binary file not shown.

View File

@@ -128,6 +128,7 @@
#define TANK_MAX_RELEASE_PRESSURE (ONE_ATMOSPHERE*3)
#define TANK_MIN_RELEASE_PRESSURE 0
#define TANK_DEFAULT_RELEASE_PRESSURE 17
#define TANK_POST_FRAGMENT_REACTIONS 5
//CANATMOSPASS
#define ATMOS_PASS_YES 1
@@ -257,6 +258,7 @@
#define GAS_HYPERNOB "nob"
#define GAS_NITROUS "n2o"
#define GAS_NITRYL "no2"
#define GAS_HYDROGEN "hydrogen"
#define GAS_TRITIUM "tritium"
#define GAS_BZ "bz"
#define GAS_STIMULUM "stim"
@@ -267,6 +269,7 @@
#define GAS_BROMINE "bromine"
#define GAS_AMMONIA "ammonia"
#define GAS_FLUORINE "fluorine"
#define GAS_ETHANOL "ethanol"
#define GAS_GROUP_CHEMICALS "Chemicals"

View File

@@ -25,6 +25,9 @@
/// Do not allow this random event to continue.
#define CANCEL_PRE_RANDOM_EVENT (1<<0)
/// called by auxgm add_gas: (gas_id)
#define COMSIG_GLOB_NEW_GAS "!new_gas"
// signals from globally accessible objects
/// from SSsun when the sun changes position : (primary_sun, suns)
#define COMSIG_SUN_MOVED "sun_moved"

View File

@@ -74,3 +74,4 @@
)
#define TECHWEB_BOMB_POINTCAP 50000 //Adjust as needed; Stops toxins from nullifying RND progression mechanics. Current Value Cap Radius: 100
#define TECHWEB_BOMB_SIZE 160 // The shockwave radius required for a bomb to get TECHWEB_BOMB_POINTCAP points.

View File

@@ -116,6 +116,11 @@ SUBSYSTEM_DEF(air)
/datum/controller/subsystem/air/proc/auxtools_update_reactions()
/datum/controller/subsystem/air/proc/add_reaction(datum/gas_reaction/r)
gas_reactions += r
sortTim(gas_reactions, /proc/cmp_gas_reaction)
auxtools_update_reactions()
/proc/reset_all_air()
SSair.can_fire = 0
message_admins("Air reset begun.")

View File

@@ -194,22 +194,17 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
/*****The Point Calculator*****/
if(orig_light < 10)
if(orig_light < 1)
say("Explosion not large enough for research calculations.")
return
else
point_gain = (100000 * orig_light) / (orig_light + 5000)
point_gain = (TECHWEB_BOMB_POINTCAP * 2 * orig_light) / (orig_light + TECHWEB_BOMB_SIZE)
/*****The Point Capper*****/
if(point_gain > linked_techweb.largest_bomb_value)
if(point_gain <= TECHWEB_BOMB_POINTCAP || linked_techweb.largest_bomb_value < TECHWEB_BOMB_POINTCAP)
var/old_tech_largest_bomb_value = linked_techweb.largest_bomb_value //held so we can pull old before we do math
linked_techweb.largest_bomb_value = point_gain
point_gain -= old_tech_largest_bomb_value
point_gain = min(point_gain,TECHWEB_BOMB_POINTCAP)
else
linked_techweb.largest_bomb_value = TECHWEB_BOMB_POINTCAP
point_gain = 1000
var/datum/bank_account/D = SSeconomy.get_dep_account(ACCOUNT_SCI)
if(D)
D.adjust_money(point_gain)

View File

@@ -291,7 +291,7 @@
message_admins("Explosive tank rupture! Last key to touch the tank was [src.fingerprintslast].")
log_game("Explosive tank rupture! Last key to touch the tank was [src.fingerprintslast].")
//Give the gas a chance to build up more pressure through reacting
air_contents.react(src)
for(var/i in 1 to TANK_POST_FRAGMENT_REACTIONS)
air_contents.react(src)
pressure = air_contents.return_pressure()

View File

@@ -104,6 +104,19 @@
enthalpy = 33200
oxidation_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
/datum/gas/hydrogen
id = GAS_HYDROGEN
specific_heat = 10
name = "Hydrogen"
flags = GAS_FLAG_DANGEROUS
fusion_power = 0
powermix = 1
heat_penalty = 3
transmit_modifier = 10
fire_products = list(GAS_H2O = 2)
fire_burn_rate = 2
fire_temperature = FIRE_MINIMUM_TEMPERATURE_TO_EXIST - 50
/datum/gas/tritium
id = GAS_TRITIUM
specific_heat = 10
@@ -211,3 +224,15 @@
group = GAS_GROUP_CHEMICALS
enthalpy = 193 // yeah it's small but it's good to include it
breath_reagent = /datum/reagent/bromine
/datum/gas/ammonia
id = GAS_AMMONIA
specific_heat = 35
name = "Ammonia"
flags = GAS_FLAG_DANGEROUS
group = GAS_GROUP_CHEMICALS
enthalpy = -45900
breath_reagent = /datum/reagent/ammonia
fire_products = list(GAS_H2O = 1.5, GAS_N2 = 0.5)
fire_burn_rate = 4/3
fire_temperature = 924

View File

@@ -25,7 +25,6 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
var/list/ids = list()
var/list/typepaths = list()
var/list/fusion_powers = list()
var/list/turf_reagents = list()
var/list/breathing_classes = list()
var/list/breath_results = list()
var/list/breath_reagents = list()
@@ -52,7 +51,6 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
var/group = null // groups for scrubber/filter listing
var/fusion_power = 0 // How much the gas destabilizes a fusion reaction
var/breath_results = GAS_CO2 // what breathing this breathes out
var/datum/reagent/turf_reagent = null
var/datum/reagent/breath_reagent = null // what breathing this adds to your reagents
var/datum/reagent/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
@@ -101,8 +99,6 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
breath_reagents[g] = gas.breath_reagent
if(gas.breath_reagent_dangerous)
breath_reagents_dangerous[g] = gas.breath_reagent_dangerous
if(gas.turf_reagent)
turf_reagents[g] = gas.turf_reagent
if(gas.oxidation_temperature)
oxidation_temperatures[g] = gas.oxidation_temperature
oxidation_rates[g] = gas.oxidation_rate
@@ -127,6 +123,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA
var/datum/gas_reaction/R = r
R.init_reqs()
SSair.auxtools_update_reactions()
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_GAS, g)
/proc/finalize_gas_refs()

View File

@@ -71,50 +71,46 @@
// no test cause it's entirely based on location
/datum/gas_reaction/reagent_stuff
/datum/gas_reaction/condensation
priority = 0
name = "Condensation"
id = "condense"
exclude = TRUE
var/datum/reagent/condensing_reagent
/datum/gas_reaction/condensation/init_reqs()
var/highest_condensation_temp = -INFINITY
var/list/reagents = GLOB.gas_data.turf_reagents
for(var/gas in reagents)
var/datum/reagent/R = reagents[gas]
highest_condensation_temp = max(highest_condensation_temp, initial(R.boiling_point))
/datum/gas_reaction/condensation/New(var/datum/reagent/R)
. = ..()
if(!istype(R))
return
min_requirements = list(
"MAX_TEMP" = highest_condensation_temp,
"ANY_REAGENT" = 1
"MAX_TEMP" = initial(R.boiling_point)
)
min_requirements[R.get_gas()] = MOLES_GAS_VISIBLE
name = "[R.name] condensation"
id = "[R.type] condensation"
condensing_reagent = R
exclude = FALSE
/datum/gas_reaction/condensation/react(datum/gas_mixture/air, datum/holder)
. = NO_REACTION
var/turf/open/location = holder
if(!istype(location))
return NO_REACTION
var/list/gas_reagents = GLOB.gas_data.turf_reagents
return
var/temperature = air.return_temperature()
. = NO_REACTION
var/static/datum/reagents/reagents_holder = new
reagents_holder.clear_reagents()
reagents_holder.chem_temp = temperature
for(var/G in air.get_gases())
if(G in gas_reagents)
var/datum/reagent/R = gas_reagents[G]
if(temperature < initial(R.boiling_point))
var/G = condensing_reagent.get_gas()
var/amt = air.get_moles(G)
air.adjust_moles(G, -min(initial(R.condensation_amount), amt))
reagents_holder.add_reagent(R, amt)
air.adjust_moles(G, -min(initial(condensing_reagent.condensation_amount), amt))
reagents_holder.add_reagent(condensing_reagent, amt)
. = REACTING
if(. == REACTING)
for(var/atom/movable/AM in location)
if(location.intact && AM.level == 1) //hidden under the floor
if(location.intact && AM.level == 1)
continue
reagents_holder.reaction(AM, TOUCH)
reagents_holder.reaction(location, TOUCH)
//tritium combustion: combustion of oxygen and tritium (treated as hydrocarbons). creates hotspots. exothermic
/datum/gas_reaction/tritfire
priority = -1 //fire should ALWAYS be last, but tritium fires happen before plasma fires

View File

@@ -36,6 +36,7 @@
if(!id_tag)
id_tag = assign_uid_vents()
generate_clean_filter_types()
RegisterSignal(SSdcs,COMSIG_GLOB_NEW_GAS,.proc/generate_clean_filter_types)
/obj/machinery/atmospherics/components/unary/vent_scrubber/proc/generate_clean_filter_types()
clean_filter_types = list()

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

View File

@@ -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."

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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?