|
|
|
|
@@ -591,7 +591,14 @@
|
|
|
|
|
pl_effects()
|
|
|
|
|
break
|
|
|
|
|
|
|
|
|
|
if(!istype(get_turf(src), /turf/space)) //space is not meant to change your body temperature.
|
|
|
|
|
if(istype(get_turf(src), /turf/space))
|
|
|
|
|
//Don't bother if the temperature drop is less than 0.1 anyways. Hopefully BYOND is smart enough to turn this constant expression into a constant
|
|
|
|
|
if(bodytemperature > (0.1 * HUMAN_HEAT_CAPACITY/(HUMAN_EXPOSED_SURFACE_AREA*STEFAN_BOLTZMANN_CONSTANT))**(1/4) + COSMIC_RADIATION_TEMPERATURE)
|
|
|
|
|
//Thermal radiation into space
|
|
|
|
|
var/heat_loss = HUMAN_EXPOSED_SURFACE_AREA * STEFAN_BOLTZMANN_CONSTANT * ((bodytemperature - COSMIC_RADIATION_TEMPERATURE)**4)
|
|
|
|
|
var/temperature_loss = heat_loss/HUMAN_HEAT_CAPACITY
|
|
|
|
|
bodytemperature -= temperature_loss
|
|
|
|
|
else
|
|
|
|
|
var/loc_temp = T0C
|
|
|
|
|
if(istype(loc, /obj/mecha))
|
|
|
|
|
var/obj/mecha/M = loc
|
|
|
|
|
@@ -605,7 +612,7 @@
|
|
|
|
|
pressure_alert = 0
|
|
|
|
|
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
|
|
|
|
|
|
|
|
|
|
//Body temperature adjusts depending on surrounding atmosphere based on your thermal protection
|
|
|
|
|
//Body temperature adjusts depending on surrounding atmosphere based on your thermal protection (convection)
|
|
|
|
|
var/temp_adj = 0
|
|
|
|
|
if(loc_temp < bodytemperature) //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.
|
|
|
|
|
@@ -698,13 +705,15 @@
|
|
|
|
|
/mob/living/carbon/human/proc/stabilize_body_temperature()
|
|
|
|
|
if (species.passive_temp_gain) // We produce heat naturally.
|
|
|
|
|
bodytemperature += species.passive_temp_gain
|
|
|
|
|
if (species.body_temperature == null)
|
|
|
|
|
return //this species doesn't have metabolic thermoregulation
|
|
|
|
|
|
|
|
|
|
var/body_temperature_difference = species.body_temperature - bodytemperature
|
|
|
|
|
|
|
|
|
|
if (abs(body_temperature_difference) < 0.5)
|
|
|
|
|
return //fuck this precision
|
|
|
|
|
if (on_fire)
|
|
|
|
|
return //too busy for pesky convection
|
|
|
|
|
return //too busy for pesky metabolic regulation
|
|
|
|
|
|
|
|
|
|
if(bodytemperature < species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
|
|
|
|
|
if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up.
|
|
|
|
|
@@ -1324,31 +1333,36 @@
|
|
|
|
|
if(260 to 280) bodytemp.icon_state = "temp-3"
|
|
|
|
|
else bodytemp.icon_state = "temp-4"
|
|
|
|
|
else
|
|
|
|
|
//TODO: precalculate all of this stuff when the species datum is created
|
|
|
|
|
var/base_temperature = species.body_temperature
|
|
|
|
|
if(base_temperature == null) //some species don't have a set metabolic temperature
|
|
|
|
|
base_temperature = (species.heat_level_1 + species.cold_level_1)/2
|
|
|
|
|
|
|
|
|
|
var/temp_step
|
|
|
|
|
if (bodytemperature >= species.body_temperature)
|
|
|
|
|
temp_step = (species.heat_level_1 - species.body_temperature)/4
|
|
|
|
|
if (bodytemperature >= base_temperature)
|
|
|
|
|
temp_step = (species.heat_level_1 - base_temperature)/4
|
|
|
|
|
|
|
|
|
|
if (bodytemperature >= species.heat_level_1)
|
|
|
|
|
bodytemp.icon_state = "temp4"
|
|
|
|
|
else if (bodytemperature >= species.body_temperature + temp_step*3)
|
|
|
|
|
else if (bodytemperature >= base_temperature + temp_step*3)
|
|
|
|
|
bodytemp.icon_state = "temp3"
|
|
|
|
|
else if (bodytemperature >= species.body_temperature + temp_step*2)
|
|
|
|
|
else if (bodytemperature >= base_temperature + temp_step*2)
|
|
|
|
|
bodytemp.icon_state = "temp2"
|
|
|
|
|
else if (bodytemperature >= species.body_temperature + temp_step*1)
|
|
|
|
|
else if (bodytemperature >= base_temperature + temp_step*1)
|
|
|
|
|
bodytemp.icon_state = "temp1"
|
|
|
|
|
else
|
|
|
|
|
bodytemp.icon_state = "temp0"
|
|
|
|
|
|
|
|
|
|
else if (bodytemperature < species.body_temperature)
|
|
|
|
|
temp_step = (species.body_temperature - species.cold_level_1)/4
|
|
|
|
|
else if (bodytemperature < base_temperature)
|
|
|
|
|
temp_step = (base_temperature - species.cold_level_1)/4
|
|
|
|
|
|
|
|
|
|
if (bodytemperature <= species.cold_level_1)
|
|
|
|
|
bodytemp.icon_state = "temp-4"
|
|
|
|
|
else if (bodytemperature <= species.body_temperature - temp_step*3)
|
|
|
|
|
else if (bodytemperature <= base_temperature - temp_step*3)
|
|
|
|
|
bodytemp.icon_state = "temp-3"
|
|
|
|
|
else if (bodytemperature <= species.body_temperature - temp_step*2)
|
|
|
|
|
else if (bodytemperature <= base_temperature - temp_step*2)
|
|
|
|
|
bodytemp.icon_state = "temp-2"
|
|
|
|
|
else if (bodytemperature <= species.body_temperature - temp_step*1)
|
|
|
|
|
else if (bodytemperature <= base_temperature - temp_step*1)
|
|
|
|
|
bodytemp.icon_state = "temp-1"
|
|
|
|
|
else
|
|
|
|
|
bodytemp.icon_state = "temp0"
|
|
|
|
|
|