mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
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:
@@ -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"]
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user