diff --git a/code/__DEFINES/atmospherics/atmos_mob_interaction.dm b/code/__DEFINES/atmospherics/atmos_mob_interaction.dm index 14552ebd1ef1..636eb201d6bf 100644 --- a/code/__DEFINES/atmospherics/atmos_mob_interaction.dm +++ b/code/__DEFINES/atmospherics/atmos_mob_interaction.dm @@ -90,7 +90,8 @@ #define BODYTEMP_COLD_DAMAGE_LIMIT CELCIUS_TO_KELVIN(-0.5 CELCIUS) /// The maximum temperature of Lavaland -#define LAVALAND_MAX_TEMPERATURE 350 +#define LAVALAND_MAX_TEMPERATURE CELCIUS_TO_KELVIN(76.85 CELCIUS)// 350 KELVIN +#define ICEBOX_MIN_TEMPERATURE CELCIUS_TO_KELVIN(-93.15 CELCIUS) /// A temperature limit which is above the maximum lavaland temperature #define BODYTEMP_HEAT_LAVALAND_SAFE (LAVALAND_MAX_TEMPERATURE + 5 KELVIN) diff --git a/code/datums/atmosphere/planetary.dm b/code/datums/atmosphere/planetary.dm index 3fa845b144cd..868658f04226 100644 --- a/code/datums/atmosphere/planetary.dm +++ b/code/datums/atmosphere/planetary.dm @@ -47,8 +47,8 @@ minimum_pressure = HAZARD_LOW_PRESSURE + 10 maximum_pressure = LAVALAND_EQUIPMENT_EFFECT_PRESSURE - 1 - minimum_temp = 180 - maximum_temp = 180 + minimum_temp = ICEBOX_MIN_TEMPERATURE + maximum_temp = ICEBOX_MIN_TEMPERATURE /datum/atmosphere/oshan id = OSHAN_DEFAULT_ATMOS diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm index a9314df68dc7..a067831eac12 100644 --- a/code/modules/mob/living/life.dm +++ b/code/modules/mob/living/life.dm @@ -111,21 +111,26 @@ var/temp_delta = loc_temp - bodytemperature if(temp_delta == 0) return - if(temp_delta < 0 && on_fire) // do not reduce body temp when on fire + if(temp_delta < 0 && on_fire) return - // Get the insulation value based on the area's temp var/thermal_protection = get_insulation(loc_temp) var/protection_modifier = 1 if(bodytemperature > standard_body_temperature + 2 KELVIN) - // we are overheating and sweaty - insulation is not as good reducing thermal protection protection_modifier = 0.7 - var/temp_sign = SIGN(temp_delta) - var/temp_change = temp_sign * (1 - (thermal_protection * protection_modifier)) * ((0.1 * max(1, abs(temp_delta))) ** 1.8) * temperature_normalization_speed + // Calculate the equilibrium temperature considering insulation + var/equilibrium_temp = get_insulated_equilibrium_temperature(loc_temp, thermal_protection * protection_modifier) + + var/temp_change = (equilibrium_temp - bodytemperature) * temperature_normalization_speed * seconds_per_tick + // Cap increase and decrease temp_change = temp_change < 0 ? max(temp_change, BODYTEMP_HOMEOSTASIS_COOLING_MAX) : min(temp_change, BODYTEMP_HOMEOSTASIS_HEATING_MAX) - adjust_bodytemperature(temp_change * seconds_per_tick) // no use_insulation beacuse we account for it manually + + adjust_bodytemperature(temp_change * seconds_per_tick) // No use_insulation because we manually account for it + +/mob/living/proc/get_insulated_equilibrium_temperature(environment_temp, insulation) + return environment_temp + (standard_body_temperature - environment_temp) * insulation /mob/living/silicon/handle_environment(datum/gas_mixture/environment, seconds_per_tick, times_fired) return // Not yet diff --git a/monkestation/code/modules/temperature_overhaul/living_procs.dm b/monkestation/code/modules/temperature_overhaul/living_procs.dm index a80e47146651..917430838e9a 100644 --- a/monkestation/code/modules/temperature_overhaul/living_procs.dm +++ b/monkestation/code/modules/temperature_overhaul/living_procs.dm @@ -91,9 +91,6 @@ // Body temperature is too cold, and we do not have resist traits if(feels_like < cold_threshold_low && !HAS_TRAIT(src, TRAIT_RESISTCOLD)) clear_mood_event("hot") - // Only apply slowdown if the body is cold rather than the skin - if(bodytemperature < cold_threshold_medium) - add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/cold, multiplicative_slowdown = ((BODYTEMP_COLD_WARNING_2 - bodytemperature) / COLD_SLOWDOWN_FACTOR)) if(feels_like < cold_threshold_high) throw_alert(ALERT_TEMPERATURE, /atom/movable/screen/alert/cold, 3) add_mood_event("cold", /datum/mood_event/freezing) @@ -104,12 +101,15 @@ throw_alert(ALERT_TEMPERATURE, /atom/movable/screen/alert/cold, 1) add_mood_event("cold", /datum/mood_event/chilly) temp_alerts = TRUE + // Only apply slowdown if the body is cold rather than the skin + if(bodytemperature < cold_threshold_medium && !HAS_TRAIT(src, TRAIT_RESISTCOLD)) + add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/cold, multiplicative_slowdown = ((cold_threshold_medium - bodytemperature) / COLD_SLOWDOWN_FACTOR)) + else if(LAZYACCESS(movespeed_modification, /datum/movespeed_modifier/cold)) + remove_movespeed_modifier(/datum/movespeed_modifier/cold) // We are not to hot or cold, remove status and moods if(temp_alerts && (feels_like < hot_threshold_low || HAS_TRAIT(src, TRAIT_RESISTHEAT)) && (feels_like > cold_threshold_low || HAS_TRAIT(src, TRAIT_RESISTCOLD))) clear_alert(ALERT_TEMPERATURE) - if(bodytemperature > cold_threshold_medium) - remove_movespeed_modifier(/datum/movespeed_modifier/cold) clear_mood_event("cold") clear_mood_event("hot") temp_alerts = FALSE diff --git a/monkestation/code/modules/temperature_overhaul/temperature_proc.dm b/monkestation/code/modules/temperature_overhaul/temperature_proc.dm index fcf14ebea796..87b53b0a0b63 100644 --- a/monkestation/code/modules/temperature_overhaul/temperature_proc.dm +++ b/monkestation/code/modules/temperature_overhaul/temperature_proc.dm @@ -70,8 +70,6 @@ amount *= (1 - get_insulation(bodytemperature + amount)) if(amount == 0) return FALSE - amount = round(amount, 0.01) - if(amount == 0) return 0 amount = round(amount, 0.01) diff --git a/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/_color_pallette.dm b/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/_color_pallette.dm index b5e294153d09..cf83f9a104b1 100644 --- a/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/_color_pallette.dm +++ b/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/_color_pallette.dm @@ -20,7 +20,6 @@ retrieved_var = vars[mainvar] if(retrieved_var) return retrieved_var - stack_trace("return_color called with a bad varname.") return default_color return retrieved_var diff --git a/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/ornithids.dm b/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/ornithids.dm index 4399251f874d..9e7d108562d2 100644 --- a/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/ornithids.dm +++ b/monkestation/code/modules/the_fabled_dna_changes/species_color_pallettes/ornithids.dm @@ -11,7 +11,7 @@ /datum/color_palette/ornithids/apply_prefs(datum/preferences/incoming) feather_main = incoming.read_preference(/datum/preference/color/feather_color) feather_secondary = incoming.read_preference(/datum/preference/color/feather_color_secondary) - feather_tri = incoming.read_preference(/datum/preferences/color/feather_color_tri) + feather_tri = incoming.read_preference(/datum/preference/color/feather_color_tri) plummage = incoming.read_preference(/datum/preference/color/plummage_color) tail = incoming.read_preference(/datum/preference/color/feather_tail_color)