Fixes changeling void adaption (#91626)

This PR changes `TRAIT_SPACEBREATHING` from a lung trait to a mob trait,
and simultaneously renames it to the much less snappy but simultaneously
more specific `TRAIT_NO_BREATHLESS_DAMAGE`
This proc technically does not allow you to breathe specifically in
space, it only bypasses any checks for minimum levels of gases
regardless of if you are in space or not

At the same time I implemented it for basic mobs, just because I can. I
don't think they have any way of gaining it, but if some future dev was
going to make a temporary buff that lets something breathe in space now
it could also work on basic mobs.

This is how developers expected the trait to work and no longer requires
that the mob have lungs to be used

🆑
fix: Changelings with Void Adaption can once again breathe in space
/🆑
This commit is contained in:
Jacquerel
2025-06-19 00:20:09 -04:00
committed by Roxy
parent b119bf3791
commit ab163f6516
9 changed files with 28 additions and 29 deletions
+14 -5
View File
@@ -49,21 +49,30 @@
if(!isopenturf(target.loc))
return TRUE
var/can_breathe_vacuum = HAS_TRAIT(target, TRAIT_NO_BREATHLESS_DAMAGE)
var/min_oxy = can_breathe_vacuum ? 0 : atmos_requirements["min_oxy"]
var/min_plasma = can_breathe_vacuum ? 0 : atmos_requirements["min_plas"]
var/min_n2 = can_breathe_vacuum ? 0 : atmos_requirements["min_n2"]
var/min_co2 = can_breathe_vacuum ? 0 : atmos_requirements["min_co2"]
var/turf/open/open_turf = target.loc
if(isnull(open_turf.air))
if(atmos_requirements["min_oxy"] || atmos_requirements["min_plas"] || atmos_requirements["min_n2"] || atmos_requirements["min_co2"])
if (can_breathe_vacuum)
return TRUE
if(min_oxy || min_plasma || min_n2 || min_co2)
return FALSE
return TRUE
var/list/gases = get_atmos_req_list(open_turf)
if(!ISINRANGE(gases["oxy"], atmos_requirements["min_oxy"], (atmos_requirements["max_oxy"] || INFINITY)))
if(!ISINRANGE(gases["oxy"], min_oxy, (atmos_requirements["max_oxy"] || INFINITY)))
return FALSE
if(!ISINRANGE(gases["plas"], atmos_requirements["min_plas"], (atmos_requirements["max_plas"] || INFINITY)))
if(!ISINRANGE(gases["plas"], min_plasma, (atmos_requirements["max_plas"] || INFINITY)))
return FALSE
if(!ISINRANGE(gases["n2"], atmos_requirements["min_n2"], (atmos_requirements["max_n2"] || INFINITY)))
if(!ISINRANGE(gases["n2"], min_n2, (atmos_requirements["max_n2"] || INFINITY)))
return FALSE
if(!ISINRANGE(gases["co2"], atmos_requirements["min_co2"], (atmos_requirements["max_co2"] || INFINITY)))
if(!ISINRANGE(gases["co2"], min_co2, (atmos_requirements["max_co2"] || INFINITY)))
return FALSE
return TRUE