lungs 
Vars | |
| breath_lost | Assoc list of procs to run when a gas is immediately removed from the breath, in the form gas id -> proc_path |
|---|---|
| breath_out | Gas mixture to breath out when we're done processing a breath Will get emptied out when it's all done |
| breath_present | Assoc list of procs to run while a gas is present, in the form gas id -> proc_path |
| breathe_always | Assoc list of procs to always run, in the form gas_id -> proc_path |
| cold_damage_type | Type of damage dealt by a cold breath |
| cold_level_damage | Amount of damage dealt by a cold breath. Halved if at the hazard threshold |
| cold_level_danger_threshold | At this threshold, a cold breath deals a moderate amount of damage |
| cold_level_hazard_threshold | At this threshold, a cold breath deals a minor amount of damage |
| cold_level_warning_threshold | At this threshold, a cold breath displays a warning message |
| cold_message | Message displayed when breathing cold air |
| healium_para_min | Minimum amount of healium to make you unconscious for 4 seconds |
| healium_sleep_min | Minimum amount of healium to knock you down for good |
| heat_damage_type | Type of damage dealt by a hot breath |
| heat_level_damage | Amount of damage dealt by a hot breath. Halved if at the hazard threshold |
| heat_level_danger_threshold | At this threshold, a hot breath deals a moderate amount of damage |
| heat_level_hazard_threshold | At this threshold, a hot breath deals a minor amount of damage |
| heat_level_warning_threshold | At this threshold, a hot breath displays a warning message |
| helium_speech_min | Minimum amount of helium to affect speech |
| high_pressure_threshold | Above this threshold, the mob lungs take damage due to the pressure difference |
| hot_message | Message displayed when breathing hot air |
| last_partial_pressures | Our previous breath's partial pressures, in the form gas id -> partial pressure |
| low_pressure_threshold | Below this threshold, the mob lungs take damage due to the pressure difference This is guaranteed to be lower than the lowest breathable gas minimum |
| received_pressure_mult | All incoming breaths will have their pressure multiplied against this. Higher values allow more air to be breathed at once, while lower values can cause suffocation in low pressure environments. |
| safe_plasma_max | How much breath partial pressure is a safe amount of plasma. 0 means that we are immune to plasma. |
| suffers_miasma | Whether these lungs react negatively to miasma |
| treat_as | List of gas to treat as other gas, in the form list(inital_gas, treat_as, multiplier) |
Procs | |
| add_gas_reaction | Tells the lungs to pay attention to the passed in gas type We'll check for it when breathing, in a few possible ways Accepts 3 optional arguments: |
| add_gas_relationship | Tells the lungs to treat the passed in gas type as another passed in gas type Takes the gas to check for as an argument, alongside the gas to convert and the multiplier to use These act in the order of insertion, use that how you will |
| adjust_received_pressure_mult | Adjusting proc for [received_pressure_mult]. Updates bronchodilation alerts. |
| breathe_gas_volume | Remove gas from breath. If output_gas is given, transfers the removed gas to the lung's gas_mixture. Removes 100% of the given gas type unless given a volume argument. Returns the amount of gas theoretically removed. |
| breathe_nitro | If the lungs need Nitrogen to breathe properly, N2 is exchanged with CO2. |
| breathe_oxygen | Handles oxygen breathing. Always called by things that need o2, no matter what |
| breathe_plasma | If the lungs need Plasma to breathe properly, Plasma is exchanged with CO2. |
| check_breath | This proc tests if the lungs can breathe, if they can breathe a given gas mixture, and throws/clears gas alerts. It does this by calling subprocs "registered" to pay attention to different gas types There's also support for gases that should always be checked for, and procs that should run when a gas is finished |
| consume_healium | Sleeping gas with healing properties. |
| consume_helium | Activates helium speech when partial pressure gets high enough |
| consume_hypernoblium | Gain hypernob effects if we have enough of the stuff |
| consume_pluoxium | Behaves like Oxygen with 8X efficacy, but metabolizes into a reagent. |
| emit_breath_particle | Creates a particle effect off the mouth of the passed mob. |
| handle_helium_speech | React to speach while hopped up on the high pitched voice juice |
| handle_suffocation | Applies suffocation side-effects to a given Human, scaling based on ratio of required pressure VS "true" pressure. If pressure is greater than 0, the return value will represent the amount of gas successfully breathed. |
| heal_oxyloss_on_breath | Handles what happens when we breathe in something we need to live |
| lose_healium | Lose healium side effects |
| lose_helium | Lose helium high pitched voice |
| on_mob_insert | Simply exists so that you don't keep any alerts from your previous lack of lungs. |
| pre_breath_gas_handling | Handles what happens when we breathe in successfully, before we parse through the gases to determine specific side effects Returns a gas mixture, or null (to use the original breath) |
| remove_gas_relationship | Clears away a gas relationship. Takes the same args as the initial addition |
| safe_co2 | Handles NOT having too much co2. only relevant if safe_co2_max has a value |
| safe_miasma | We're free from the stick, clear out its impacts |
| safe_n2o | N2O side-effects. "Too much N2O!" |
| safe_oxygen | Handles NOT having too much o2. only relevant if safe_oxygen_max has a value |
| safe_plasma | Resets plasma side effects |
| set_received_pressure_mult | Setter proc for [received_pressure_mult]. Updates bronchodilation alerts. |
| too_much_bz | Too much funny gas, time to get brain damage |
| too_much_co2 | Maximum CO2 effects. "Too much CO2!" |
| too_much_freon | Breathing in refridgerator coolent, shit's caustic |
| too_much_halon | Breathing in halon, convert it to a reagent |
| too_much_miasma | Breathing in the stink gas |
| too_much_n2o | Causes random euphoria and giggling. Large amounts knock you down |
| too_much_oxygen | Maximum Oxygen effects. "Too much O2!" |
| too_much_plasma | Maximum Plasma effects. "Too much Plasma!" |
| too_much_tritium | Radioactive, green gas. Toxin damage, and a radiation chance |
| too_much_zauker | Really toxic stuff, very much trying to kill you |
| update_bronchodilation_alerts | Depending on [received_pressure_mult], gives either a bronchocontraction or bronchoconstriction alert to our owner (if we have one), or clears the alert if [received_pressure_mult] is near 1. |
Var Details
breath_lost 
Assoc list of procs to run when a gas is immediately removed from the breath, in the form gas id -> proc_path
breath_out 
Gas mixture to breath out when we're done processing a breath Will get emptied out when it's all done
breath_present 
Assoc list of procs to run while a gas is present, in the form gas id -> proc_path
breathe_always 
Assoc list of procs to always run, in the form gas_id -> proc_path
cold_damage_type 
Type of damage dealt by a cold breath
cold_level_damage 
Amount of damage dealt by a cold breath. Halved if at the hazard threshold
cold_level_danger_threshold 
At this threshold, a cold breath deals a moderate amount of damage
cold_level_hazard_threshold 
At this threshold, a cold breath deals a minor amount of damage
cold_level_warning_threshold 
At this threshold, a cold breath displays a warning message
cold_message 
Message displayed when breathing cold air
healium_para_min 
Minimum amount of healium to make you unconscious for 4 seconds
healium_sleep_min 
Minimum amount of healium to knock you down for good
heat_damage_type 
Type of damage dealt by a hot breath
heat_level_damage 
Amount of damage dealt by a hot breath. Halved if at the hazard threshold
heat_level_danger_threshold 
At this threshold, a hot breath deals a moderate amount of damage
heat_level_hazard_threshold 
At this threshold, a hot breath deals a minor amount of damage
heat_level_warning_threshold 
At this threshold, a hot breath displays a warning message
helium_speech_min 
Minimum amount of helium to affect speech
high_pressure_threshold 
Above this threshold, the mob lungs take damage due to the pressure difference
hot_message 
Message displayed when breathing hot air
last_partial_pressures 
Our previous breath's partial pressures, in the form gas id -> partial pressure
low_pressure_threshold 
Below this threshold, the mob lungs take damage due to the pressure difference This is guaranteed to be lower than the lowest breathable gas minimum
received_pressure_mult 
All incoming breaths will have their pressure multiplied against this. Higher values allow more air to be breathed at once, while lower values can cause suffocation in low pressure environments.
safe_plasma_max 
How much breath partial pressure is a safe amount of plasma. 0 means that we are immune to plasma.
suffers_miasma 
Whether these lungs react negatively to miasma
treat_as 
List of gas to treat as other gas, in the form list(inital_gas, treat_as, multiplier)
Proc Details
add_gas_reaction
Tells the lungs to pay attention to the passed in gas type We'll check for it when breathing, in a few possible ways Accepts 3 optional arguments:
proc/while_present * Called while the gas is present in our breath. Return BREATH_LOST to call on_loss afterwards proc/on_loss * Called after we have lost a gas from our breath. proc/always * Always called. Best suited for breathing procs, like oxygen
while_present and always get the same arguments (mob/living/carbon/breather, datum/gas_mixture/breath, pp, old_pp) on_loss is almost exactly the same, except it doesn't pass in a current partial pressure, since one isn't avalible
add_gas_relationship
Tells the lungs to treat the passed in gas type as another passed in gas type Takes the gas to check for as an argument, alongside the gas to convert and the multiplier to use These act in the order of insertion, use that how you will
adjust_received_pressure_mult
Adjusting proc for [received_pressure_mult]. Updates bronchodilation alerts.
breathe_gas_volume
Remove gas from breath. If output_gas is given, transfers the removed gas to the lung's gas_mixture. Removes 100% of the given gas type unless given a volume argument. Returns the amount of gas theoretically removed.
breathe_nitro
If the lungs need Nitrogen to breathe properly, N2 is exchanged with CO2.
breathe_oxygen
Handles oxygen breathing. Always called by things that need o2, no matter what
breathe_plasma
If the lungs need Plasma to breathe properly, Plasma is exchanged with CO2.
check_breath
This proc tests if the lungs can breathe, if they can breathe a given gas mixture, and throws/clears gas alerts. It does this by calling subprocs "registered" to pay attention to different gas types There's also support for gases that should always be checked for, and procs that should run when a gas is finished
Returns TRUE if the breath was successful, or FALSE if otherwise.
Arguments:
- breath: A gas mixture to test, or null.
- breather: A carbon mob that is using the lungs to breathe.
- skip_breath: Used to differentiate between a failed breath and a lack of breath.
consume_healium
Sleeping gas with healing properties.
consume_helium
Activates helium speech when partial pressure gets high enough
consume_hypernoblium
Gain hypernob effects if we have enough of the stuff
consume_pluoxium
Behaves like Oxygen with 8X efficacy, but metabolizes into a reagent.
emit_breath_particle
Creates a particle effect off the mouth of the passed mob.
handle_helium_speech
React to speach while hopped up on the high pitched voice juice
handle_suffocation
Applies suffocation side-effects to a given Human, scaling based on ratio of required pressure VS "true" pressure. If pressure is greater than 0, the return value will represent the amount of gas successfully breathed.
heal_oxyloss_on_breath
Handles what happens when we breathe in something we need to live
lose_healium
Lose healium side effects
lose_helium
Lose helium high pitched voice
on_mob_insert
Simply exists so that you don't keep any alerts from your previous lack of lungs.
pre_breath_gas_handling
Handles what happens when we breathe in successfully, before we parse through the gases to determine specific side effects Returns a gas mixture, or null (to use the original breath)
remove_gas_relationship
Clears away a gas relationship. Takes the same args as the initial addition
safe_co2
Handles NOT having too much co2. only relevant if safe_co2_max has a value
safe_miasma
We're free from the stick, clear out its impacts
safe_n2o
N2O side-effects. "Too much N2O!"
safe_oxygen
Handles NOT having too much o2. only relevant if safe_oxygen_max has a value
safe_plasma
Resets plasma side effects
set_received_pressure_mult
Setter proc for [received_pressure_mult]. Updates bronchodilation alerts.
too_much_bz
Too much funny gas, time to get brain damage
too_much_co2
Maximum CO2 effects. "Too much CO2!"
too_much_freon
Breathing in refridgerator coolent, shit's caustic
too_much_halon
Breathing in halon, convert it to a reagent
too_much_miasma
Breathing in the stink gas
too_much_n2o
Causes random euphoria and giggling. Large amounts knock you down
too_much_oxygen
Maximum Oxygen effects. "Too much O2!"
too_much_plasma
Maximum Plasma effects. "Too much Plasma!"
too_much_tritium
Radioactive, green gas. Toxin damage, and a radiation chance
too_much_zauker
Really toxic stuff, very much trying to kill you
update_bronchodilation_alerts
Depending on [received_pressure_mult], gives either a bronchocontraction or bronchoconstriction alert to our owner (if we have one), or clears the alert if [received_pressure_mult] is near 1.