From 1a4cedd412fb0fa04322f54ebf824562fb84b9de Mon Sep 17 00:00:00 2001 From: mwerezak Date: Mon, 2 Mar 2015 13:24:52 -0500 Subject: [PATCH 1/2] Fixes #7363 --- code/modules/mob/living/carbon/human/life.dm | 69 ++++++++++---------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 72c281a1f2d..1aae456ae06 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -608,25 +608,28 @@ if(prob(20)) src << "You feel your face burning and a searing heat in your lungs!" - switch(breath.temperature) - if(-INFINITY to species.cold_level_3) - apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold") - fire_alert = max(fire_alert, 1) - if(species.cold_level_3 to species.cold_level_2) - apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold") - fire_alert = max(fire_alert, 1) - if(species.cold_level_2 to species.cold_level_1) - apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold") - fire_alert = max(fire_alert, 1) - if(species.heat_level_1 to species.heat_level_2) + if(breath.temperature > species.heat_level_1) + if(breath.temperature <= species.heat_level_2) apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) - if(species.heat_level_2 to species.heat_level_3) + else if(breath.temperature <= species.heat_level_3) apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) - if(species.heat_level_3 to INFINITY) + else apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) + + else if(breath.temperature < species.cold_level_1) + if(breath.temperature >= species.cold_level_2) + apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold") + fire_alert = max(fire_alert, 1) + else if(breath.temperature >= species.cold_level_3) + apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold") + fire_alert = max(fire_alert, 1) + else + apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold") + fire_alert = max(fire_alert, 1) + //breathing in hot/cold air also heats/cools you a bit var/temp_adj = breath.temperature - bodytemperature @@ -704,31 +707,31 @@ //Body temperature is too hot. fire_alert = max(fire_alert, 1) if(status_flags & GODMODE) return 1 //godmode - switch(bodytemperature) - if(species.heat_level_1 to species.heat_level_2) - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") - fire_alert = max(fire_alert, 2) - if(species.heat_level_2 to species.heat_level_3) - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") - fire_alert = max(fire_alert, 2) - if(species.heat_level_3 to INFINITY) - take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") - fire_alert = max(fire_alert, 2) + + if(bodytemperature <= species.heat_level_2) + take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") + fire_alert = max(fire_alert, 2) + else if(bodytemperature <= species.heat_level_3) + take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") + fire_alert = max(fire_alert, 2) + else + take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") + fire_alert = max(fire_alert, 2) 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(species.cold_level_2 to species.cold_level_1) - take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") - fire_alert = max(fire_alert, 1) - if(species.cold_level_3 to species.cold_level_2) - take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") - fire_alert = max(fire_alert, 1) - if(-INFINITY to species.cold_level_3) - take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") - fire_alert = max(fire_alert, 1) + if(bodytemperature >= species.cold_level_2) + take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") + fire_alert = max(fire_alert, 1) + else if(bodytemperature >= species.cold_level_3) + take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") + fire_alert = max(fire_alert, 1) + else + take_overall_damage(burn=COLD_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") + fire_alert = max(fire_alert, 1) // Account for massive pressure differences. Done by Polymorph // Made it possible to actually have something that can protect against high pressure... Done by Errorage. Polymorph now has an axe sticking from his head for his previous hardcoded nonsense! From f8831fa51348c50f750dadfc9617a87b5e6ae20e Mon Sep 17 00:00:00 2001 From: mwerezak Date: Tue, 3 Mar 2015 18:52:35 -0500 Subject: [PATCH 2/2] Adjusts human temperature damage intervals --- code/modules/mob/living/carbon/human/life.dm | 37 +++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 1aae456ae06..8657ef06a26 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -599,31 +599,31 @@ adjustOxyLoss(-5) // Hot air hurts :( - if( (breath.temperature < species.cold_level_1 || breath.temperature > species.heat_level_1) && !(COLD_RESISTANCE in mutations)) + if( (breath.temperature <= species.cold_level_1 || breath.temperature >= species.heat_level_1) && !(COLD_RESISTANCE in mutations)) - if(breath.temperature < species.cold_level_1) + if(breath.temperature <= species.cold_level_1) if(prob(20)) src << "You feel your face freezing and icicles forming in your lungs!" - else if(breath.temperature > species.heat_level_1) + else if(breath.temperature >= species.heat_level_1) if(prob(20)) src << "You feel your face burning and a searing heat in your lungs!" - if(breath.temperature > species.heat_level_1) - if(breath.temperature <= species.heat_level_2) + if(breath.temperature >= species.heat_level_1) + if(breath.temperature < species.heat_level_2) apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) - else if(breath.temperature <= species.heat_level_3) + else if(breath.temperature < species.heat_level_3) apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) else apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat") fire_alert = max(fire_alert, 2) - else if(breath.temperature < species.cold_level_1) - if(breath.temperature >= species.cold_level_2) + else if(breath.temperature <= species.cold_level_1) + if(breath.temperature > species.cold_level_2) apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold") fire_alert = max(fire_alert, 1) - else if(breath.temperature >= species.cold_level_3) + else if(breath.temperature > species.cold_level_3) apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold") fire_alert = max(fire_alert, 1) else @@ -695,38 +695,33 @@ //Use heat transfer as proportional to the gas density. However, we only care about the relative density vs standard 101 kPa/20 C air. Therefore we can use mole ratios var/relative_density = environment.total_moles / MOLES_CELLSTANDARD - temp_adj *= relative_density - - if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX - if (temp_adj < BODYTEMP_COOLING_MAX) temp_adj = BODYTEMP_COOLING_MAX - //world << "Environment: [loc_temp], [src]: [bodytemperature], Adjusting: [temp_adj]" - bodytemperature += temp_adj + bodytemperature += between(BODYTEMP_COOLING_MAX, temp_adj*relative_density, BODYTEMP_HEATING_MAX) // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. - if(bodytemperature > species.heat_level_1) + if(bodytemperature >= species.heat_level_1) //Body temperature is too hot. fire_alert = max(fire_alert, 1) if(status_flags & GODMODE) return 1 //godmode - if(bodytemperature <= species.heat_level_2) + if(bodytemperature < species.heat_level_2) take_overall_damage(burn=HEAT_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) - else if(bodytemperature <= species.heat_level_3) + else if(bodytemperature < species.heat_level_3) take_overall_damage(burn=HEAT_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) else take_overall_damage(burn=HEAT_DAMAGE_LEVEL_3, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 2) - else if(bodytemperature < species.cold_level_1) + 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)) - if(bodytemperature >= species.cold_level_2) + if(bodytemperature > species.cold_level_2) take_overall_damage(burn=COLD_DAMAGE_LEVEL_1, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 1) - else if(bodytemperature >= species.cold_level_3) + else if(bodytemperature > species.cold_level_3) take_overall_damage(burn=COLD_DAMAGE_LEVEL_2, used_weapon = "High Body Temperature") fire_alert = max(fire_alert, 1) else