Add immunity checks for atmos traits for simple/basic mobs (#96554)

## About The Pull Request

Slightly refactor the code to include heat/cold/breathing checks inside
the atmos elements.

Fun fact: there doesn't appear to be any way for basic/simple mobs to
take pressure damage, but I still went ahead and added the relevant
pressure protection just in case it changes in the future.

## Why It's Good For The Game

Better code.

## Changelog
🆑
code: Add immunity checks for atmos traits for simple/basic mobs
/🆑
This commit is contained in:
Tim
2026-06-19 01:12:14 +02:00
committed by GitHub
parent a3ec226266
commit 424c07e648
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
if(!isopenturf(target.loc))
return TRUE
var/can_breathe_vacuum = HAS_TRAIT(target, TRAIT_NO_BREATHLESS_DAMAGE)
var/can_breathe_vacuum = HAS_TRAIT(target, TRAIT_NO_BREATHLESS_DAMAGE) || HAS_TRAIT(target, TRAIT_NOBREATH)
var/min_oxy = can_breathe_vacuum ? 0 : atmos_requirements["min_oxy"]
var/min_plasma = can_breathe_vacuum ? 0 : atmos_requirements["min_plas"]
+2 -2
View File
@@ -49,7 +49,7 @@
var/mob/living/living_mob = target
var/gave_alert = FALSE
if(living_mob.bodytemperature < min_body_temp)
if(living_mob.bodytemperature < min_body_temp && !HAS_TRAIT(living_mob, TRAIT_RESISTCOLD))
living_mob.adjust_fire_loss(cold_damage * seconds_per_tick, forced = TRUE)
if(!living_mob.has_status_effect(/datum/status_effect/inebriated))
switch(cold_damage)
@@ -61,7 +61,7 @@
living_mob.throw_alert(ALERT_TEMPERATURE, /atom/movable/screen/alert/cold, 3)
gave_alert = TRUE
else if(living_mob.bodytemperature > max_body_temp)
else if(living_mob.bodytemperature > max_body_temp && !HAS_TRAIT(living_mob, TRAIT_RESISTHEAT))
living_mob.adjust_fire_loss(heat_damage * seconds_per_tick, forced = TRUE)
switch(heat_damage)
if(1 to 5)