The way it seems to work is that you take damage if > 0.4% of the atmos is plasma, but the amount of damage is based on how much plasma there is.
maybe this will help explain it, i added a bunch of comments from the 2016 source including what appears to be at least two different bugs if not three
Update: I checked and replacing your internals with pure plasma is not lethal (but does immediately put you into crit). The pod thing has to be a bug or a weird interaction of code stuff.
Code:
(proc/handle_breath(datum/gas_mixture/breath))
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
// Partial pressure of the O2 in our breath
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
// Same, but for the toxins
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
if (O2_pp < safe_oxygen_min) // 17
// Not enough O2!
if (O2_pp > 0)
// But some, at least
// (17 / effective-oxygen-percent) * 5 damage
// BUG? This is backwards! Number *increases* as oxygen decreases...
// Should be (O2_pp / safe_oxygen_min)!
var/ratio = round( safe_oxygen_min / (O2_pp + 0.1) )
// Due to bug, "ratio" will always be > 1
// so 5 * ratio is always > 5!
// Effectively, this means you always take 5 OXY damage. Welp!
// Pretty sure this bug is still in the game since I always see people with OXY in increments of 5.
// Huh.
take_oxygen_deprivation( min( 5 * ratio, 5 ) )
oxygen_used = breath.oxygen*ratio/6
[...]
if (Toxins_pp > safe_toxins_max) // 0.4
// Partial percent of toxins > limit. That's too much!
// Note that unlike the above, this ratio isn't backwards...
// but it uses the actual amount of moles, not the partial percent!
// Effectively, the actual amount of toxins decides the damage, not the %,
// but you need at least 0.4% to start taking damage.
// Wonder if super-chilled plasma (lower pressure but higher mole count?)
// would insta-kill due to this
var/ratio = breath.toxins/safe_toxins_max
// BUG: take_toxin_damage doesn't take a second parameter.
// Was this supposed to be min( 325 * ratio, 15 ) like oxy?
// (If so you'd cap at 15 damage per tick rather than dying instantly)
take_toxin_damage(ratio * 325,15)
maybe this will help explain it, i added a bunch of comments from the 2016 source including what appears to be at least two different bugs if not three
Update: I checked and replacing your internals with pure plasma is not lethal (but does immediately put you into crit). The pod thing has to be a bug or a weird interaction of code stuff.