From 032061522b8f2dbedb1ebeab5c4b434d250656a7 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Fri, 20 Jun 2014 13:37:07 -0400 Subject: [PATCH] Body temperature damage now uses species values --- code/modules/mob/living/carbon/human/life.dm | 27 +++++++++----------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c7cbbf5965f..666b3a9e917 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -677,50 +677,46 @@ if(adjusted_pressure < species.warning_low_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.phoron < MOLES_PHORON_VISIBLE) return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp - //Body temperature is adjusted in two steps. Firstly your body tries to stabilize itself a bit. - if(stat != 2) - stabilize_temperature_from_calories() - - //After then, it reacts to the surrounding atmosphere based on your thermal protection - if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //Place is colder than we are + //Body temperature adjusts depending on surrounding atmosphere based on your thermal protection + if(loc_temp < species.cold_level_1) //Place is colder than we are var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. if(thermal_protection < 1) var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) bodytemperature += amt - else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //Place is hotter than we are + else if (loc_temp > species.heat_level_1) //Place is hotter than we are var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. if(thermal_protection < 1) var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) bodytemperature += amt // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. - if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT) + if(bodytemperature > species.heat_level_1) //Body temperature is too hot. fire_alert = max(fire_alert, 1) if(status_flags & GODMODE) return 1 //godmode switch(bodytemperature) - if(360 to 400) + if(species.heat_level_1 to species.heat_level_2) apply_damage(HEAT_DAMAGE_LEVEL_1, BURN, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) - if(400 to 1000) + if(species.heat_level_2 to species.heat_level_3) apply_damage(HEAT_DAMAGE_LEVEL_2, BURN, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) - if(1000 to INFINITY) + if(species.heat_level_3 to INFINITY) apply_damage(HEAT_DAMAGE_LEVEL_3, BURN, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) - else if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT) + else if(bodytemperature < species.cold_level_1) fire_alert = max(fire_alert, 1) if(status_flags & GODMODE) return 1 //godmode if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) switch(bodytemperature) - if(200 to 260) + if(species.cold_level_2 to species.cold_level_1) apply_damage(COLD_DAMAGE_LEVEL_1, BURN, used_weapon = "Low Body Temperature") fire_alert = max(fire_alert, 1) - if(120 to 200) + if(species.cold_level_3 to species.cold_level_2) apply_damage(COLD_DAMAGE_LEVEL_2, BURN, used_weapon = "Low Body Temperature") fire_alert = max(fire_alert, 1) - if(-INFINITY to 120) + if(-INFINITY to species.cold_level_3) apply_damage(COLD_DAMAGE_LEVEL_3, BURN, used_weapon = "Low Body Temperature") fire_alert = max(fire_alert, 1) @@ -1091,6 +1087,7 @@ else //ALIVE. LIGHTS ARE ON updatehealth() //TODO if(!in_stasis) + stabilize_temperature_from_calories() //Body temperature adjusts itself handle_organs() //Optimized. handle_blood()