Lung cleanup ft. minor suffocation tweak (#96659)

## About The Pull Request

### Notable changes

Before: When taking suffocation damage, 3 oxyloss damage is dealt, or
0.66 damage if below 0 health (soft crit threshold). If below 0 hp, and
you have `NOCRITDAMAGE`, gets nullified.
After: When taking suffocation damage, 3 oxyloss damage is dealt,
reduced if you had a partially successful breath (i.e. 75% of a breath =
0.25x damage) or are in soft crit or hard crit (0.22x less damage). If
in crit, and you have `NOCRITDAMAGE`, gets nullified.

Before: You skip 1 in every 4 breaths when your health is below 0 (soft
crit threshold), and skip every breath when your health is below -30
(hard crit threshold)
After: You skip 1 in every 4 breaths when in soft crit, and skip every
breath when in hard crit

Before: You don't heal from successful breaths when below 0 health (soft
crit threshold)
After: You don't heal from successful breaths when in soft or hard crit

### Other changes

- Removed `gasp` from losebreath processing, ie removed chance to gasp
twice in one tick when choking.
- Deletes `respiration_type`s
- Deletes `crit_stabilizing_reagent`
- Deletes species `breathid`, replaces it with `get_breath_type` that
checks the species' lungs

## Why It's Good For The Game

- There was a strange inconsistency where being in crit would
drastically reduce the amount of suffocation damage you were dealt, but
only if you were not breathing. If you were somehow breathing, you took
the full damage. I thought this was a little obtuse, so I wanted to
change it to be consistent: Being in crit is just a multiplier.

- Making them check for `stat` instead of `health` means they affect
people with `NO_SOFTCRIT` or `NO_HARDCRIT` nicer.

- See above.

- Really just to be cleaner, handle gasping in one place.

- I'm not sure why we have `respiration_type`. The only time they're
(practically) referred to is in reagent handling, but there are no
reagents that set it anything but `ALL`. All it does is make our oxyloss
handling made more complicated and harder to read for no purpose. So I
decided to axe it - I think anything special handing that should arise
should just have some bespoke checks instead.

- Nothing set this value to anything else. And guess what, if you
changed it, epinephrine still worked because it applies `NO_CRITDAMAGE`.

- Species de-hardcoding. Makes it easier to add new breath types. 


## Changelog

🆑 Melbert
balance: Suffocation damage is slightly more consistent now: You take 3
oxyloss per suffocation tick, reduced for partially successful breaths
and or if you are in crit. Alternatively, if you are in crit and you
have epinephrine/atropine in your system, it gets nullified entirely.
code: Cleaned up lungs a bit, particularly relating to abnormal lungs
like plasmamen or fish, report any oddities with them.
del: You no longer have a chance to gasp twice in one suffocation tick.
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
This commit is contained in:
MrMelbert
2026-07-02 01:59:27 +00:00
committed by GitHub
co-authored by Ghom san7890
parent 94ecd1d5a6
commit cb87e54d93
24 changed files with 119 additions and 178 deletions
+1 -1
View File
@@ -198,7 +198,7 @@
prompt_fail = tgui_alert(user, prompt, buttons = list("Yes", "No"), timeout = 10 SECONDS) != "Yes"
var/species_pref = user.client.prefs.read_preference(/datum/preference/choiced/species) || /datum/species/human
if(!prompt_fail && user.started_as_observer && allow_custom_character && (GLOB.species_prototypes[species_pref].inherent_respiration_type & RESPIRATION_OXYGEN))
if(!prompt_fail && user.started_as_observer && allow_custom_character && (GLOB.species_prototypes[species_pref].get_breath_type() == GAS_O2))
var/static_prompt = "Because you haven't taken a role so far, you may spawn in as \
[((allow_custom_character & GHOSTROLE_TAKE_PREFS_SPECIES) || species_pref == /datum/species/human) ? "" : "a human version of"] \
your customized character with a random name. Would you like to?"