diff --git a/code/__DEFINES/atmospherics/atmos_mob_interaction.dm b/code/__DEFINES/atmospherics/atmos_mob_interaction.dm index 0d175710116..b050c221c58 100644 --- a/code/__DEFINES/atmospherics/atmos_mob_interaction.dm +++ b/code/__DEFINES/atmospherics/atmos_mob_interaction.dm @@ -99,11 +99,12 @@ /// Beyond this temperature, being on fire will increase body temperature by less and less #define BODYTEMP_FIRE_TEMP_SOFTCAP 1200 -/// The amount of pressure damage someone takes is equal to (pressure / HAZARD_HIGH_PRESSURE)*PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE +/// The amount of pressure damage someone takes in a high pressure damage is equal to (pressure / HAZARD_HIGH_PRESSURE) * PRESSURE_DAMAGE_COEFFICIENT, with the maximum of MAX_PRESSURE_DAMAGE #define PRESSURE_DAMAGE_COEFFICIENT 2 #define MAX_HIGH_PRESSURE_DAMAGE 2 -/// The amount of damage someone takes when in a low pressure area (The pressure threshold is so low that it doesn't make sense to do any calculations, so it just applies this flat value). -#define LOW_PRESSURE_DAMAGE 4 +/// The amount of damage someone takes when in a low pressure area scales up over time, starting at BASE_LOW_PRESSURE_DAMAGE, up to MAX_LOW_PRESSURE_DAMAGE. +#define BASE_LOW_PRESSURE_DAMAGE 2 +#define MAX_LOW_PRESSURE_DAMAGE (BASE_LOW_PRESSURE_DAMAGE * 2.5) /// Humans are slowed by the difference between bodytemp and BODYTEMP_COLD_DAMAGE_LIMIT divided by this #define COLD_SLOWDOWN_FACTOR 20 diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index d15215a79c5..406b3eb8e26 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -1324,6 +1324,7 @@ GLOBAL_LIST_EMPTY(features_by_species) // No pressure issues here clear pressure alerts if(WARNING_LOW_PRESSURE to WARNING_HIGH_PRESSURE) H.clear_alert(ALERT_PRESSURE) + H.seconds_in_low_pressure = 0 // Low pressure here, show an alert if(HAZARD_LOW_PRESSURE to WARNING_LOW_PRESSURE) @@ -1332,6 +1333,7 @@ GLOBAL_LIST_EMPTY(features_by_species) H.clear_alert(ALERT_PRESSURE) else H.throw_alert(ALERT_PRESSURE, /atom/movable/screen/alert/lowpressure, 1) + H.seconds_in_low_pressure = 0 // Very low pressure, show an alert and take damage else @@ -1339,9 +1341,10 @@ GLOBAL_LIST_EMPTY(features_by_species) if(HAS_TRAIT(H, TRAIT_RESISTLOWPRESSURE)) H.clear_alert(ALERT_PRESSURE) else - var/pressure_damage = LOW_PRESSURE_DAMAGE * H.physiology.pressure_mod * H.physiology.brute_mod * seconds_per_tick + var/pressure_damage = min(round(1 + (H.seconds_in_low_pressure / 80 SECONDS), 0.05) * BASE_LOW_PRESSURE_DAMAGE, MAX_LOW_PRESSURE_DAMAGE) * H.physiology.pressure_mod * H.physiology.brute_mod * seconds_per_tick H.adjust_brute_loss(pressure_damage, required_bodytype = BODYTYPE_ORGANIC) H.throw_alert(ALERT_PRESSURE, /atom/movable/screen/alert/lowpressure, 2) + H.seconds_in_low_pressure += seconds_per_tick /** * Handles exposure to the skin of various gases. diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 5c6445fbf27..b62b0f347aa 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -703,6 +703,7 @@ if(heal_flags & HEAL_TEMP) set_coretemperature(get_body_temp_normal(apply_change = FALSE)) heat_exposure_stacks = 0 + seconds_in_low_pressure = 0 return ..() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index c377632f2f4..67e6185d28e 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -90,3 +90,6 @@ VAR_PRIVATE/base_mob_height = HUMAN_HEIGHT_MEDIUM /// Actual height of the mob. Don't touch this one, it is set via update_mob_height() VAR_FINAL/mob_height = HUMAN_HEIGHT_MEDIUM + + /// Tracks how long in seconds we've been in a low pressure environment + VAR_FINAL/seconds_in_low_pressure = 0