Merge branch 'master' into upstream-merge-34686

This commit is contained in:
deathride58
2018-01-21 22:38:47 +00:00
committed by GitHub
83 changed files with 882 additions and 1372 deletions
@@ -74,6 +74,8 @@
/datum/emote/living/carbon/human/wag/run_emote(mob/user, params)
. = ..()
if(!.)
return
var/mob/living/carbon/human/H = user
if(!H.is_wagging_tail())
H.startTailWag()
+21 -16
View File
@@ -1623,24 +1623,29 @@ GLOBAL_LIST_EMPTY(roundstart_races)
var/loc_temp = H.get_temperature(environment)
//Body temperature is adjusted in two steps. First, your body tries to stabilize itself a bit.
if(H.stat != DEAD)
H.natural_bodytemperature_stabilization()
//Then, it reacts to the surrounding atmosphere based on your thermal protection
//Body temperature is adjusted in two parts: first there your body tries to naturally preserve homeostasis (shivering/sweating), then it reacts to the surrounding environment
//Thermal protection (insulation) has mixed benefits in two situations (hot in hot places, cold in hot places)
if(!H.on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < H.bodytemperature)
//Place is colder than we are
var/thermal_protection = H.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)
H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX)
else
//Place is hotter than we are
var/thermal_protection = H.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)
H.bodytemperature += min((1-thermal_protection) * ((loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX)
if((abs(BODYTEMP_NORMAL - H.bodytemperature) <= 5) && (abs(BODYTEMP_NORMAL - loc_temp) <= 25))
return //Performance saver
var/natural = 0
if(H.stat != DEAD)
natural = H.natural_bodytemperature_stabilization()
var/thermal_protection = 1
if(loc_temp < H.bodytemperature) //Place is colder than we are
thermal_protection -= H.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(H.bodytemperature < BODYTEMP_NORMAL) //we're cold, insulation helps us retain body heat and will reduce the heat we lose to the environment
H.bodytemperature += (thermal_protection+1)*natural + max(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_COLD_DIVISOR, BODYTEMP_COOLING_MAX)
else //we're sweating, insulation hinders our ability to reduce heat - and it will reduce the amount of cooling you get from the environment
H.bodytemperature += natural*(1/(thermal_protection+1)) + max((thermal_protection * (loc_temp - H.bodytemperature) + BODYTEMP_NORMAL - H.bodytemperature) / BODYTEMP_COLD_DIVISOR , BODYTEMP_COOLING_MAX) //Extra calculation for hardsuits to bleed off heat
else //Place is hotter than we are
thermal_protection -= H.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(H.bodytemperature < BODYTEMP_NORMAL) //and we're cold, insulation enhances our ability to retain body heat but reduces the heat we get from the environment
H.bodytemperature += (thermal_protection+1)*natural + min(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX)
else //we're sweating, insulation hinders out ability to reduce heat - but will reduce the amount of heat we get from the environment
H.bodytemperature += natural*(1/(thermal_protection+1)) + min(thermal_protection * (loc_temp - H.bodytemperature) / BODYTEMP_HEAT_DIVISOR, BODYTEMP_HEATING_MAX)
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
// +/- 50 degrees from 310K is the 'safe' zone, where no damage is dealt.
if(H.bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT && !(RESISTHOT in species_traits))
//Body temperature is too hot.
var/burn_damage
+8 -9
View File
@@ -396,15 +396,14 @@
/mob/living/carbon/proc/natural_bodytemperature_stabilization()
var/body_temperature_difference = BODYTEMP_NORMAL - bodytemperature
switch(bodytemperature)
if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //BODYTEMP_COLD_DAMAGE_LIMIT is BODYTEMP_NORMAL(310.15) - 50, the temperature where you start to feel effects.
bodytemperature += max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
if(-INFINITY to BODYTEMP_COLD_DAMAGE_LIMIT) //Cold damage limit is 50 below the default, the temperature where you start to feel effects.
return max((body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
if(BODYTEMP_COLD_DAMAGE_LIMIT to BODYTEMP_NORMAL)
bodytemperature += max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_NORMAL to BODYTEMP_HEAT_DAMAGE_LIMIT)
bodytemperature += min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_HEAT_DAMAGE_LIMIT to INFINITY) //BODYTEMP_HEAT_DAMAGE_LIMIT is BODYTEMP_NORMAL(310.15) + 50, the temperature where you start to feel effects.
//We totally need a sweat system cause it totally makes sense...~
bodytemperature += min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
return max(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, min(body_temperature_difference, BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_NORMAL to BODYTEMP_HEAT_DAMAGE_LIMIT) // Heat damage limit is 50 above the default, the temperature where you start to feel effects.
return min(body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR, max(body_temperature_difference, -BODYTEMP_AUTORECOVERY_MINIMUM/4))
if(BODYTEMP_HEAT_DAMAGE_LIMIT to INFINITY)
return min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
/////////
//LIVER//
/////////
@@ -460,4 +459,4 @@
death()
var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN)
if(B)
B.damaged_brain = TRUE
B.damaged_brain = TRUE
@@ -66,7 +66,7 @@
var/loc_temp = get_temperature(environment)
if(stat != DEAD)
natural_bodytemperature_stabilization()
bodytemperature += natural_bodytemperature_stabilization()
if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases
if(loc_temp < bodytemperature)
@@ -247,7 +247,7 @@
if(prob(75))
var/turf/open/T = loc
if(istype(T))
T.MakeSlippery(min_wet_time = 20, wet_time_to_add = 15)
T.MakeSlippery(TURF_WET_WATER, min_wet_time = 20, wet_time_to_add = 15)
else
visible_message("<span class='danger'>[src] whirs and bubbles violently, before releasing a plume of froth!</span>")
new /obj/effect/particle_effect/foam(loc)
@@ -231,7 +231,7 @@
var/atom/A = src.loc
if(isturf(A))
var/areatemp = get_temperature(environment)
if( abs(areatemp - bodytemperature) > 40 )
if( abs(areatemp - bodytemperature) > 5)
var/diff = areatemp - bodytemperature
diff = diff / 5
bodytemperature += diff
@@ -339,6 +339,14 @@
if(L in Friends) // No eating friends!
continue
var/ally = FALSE
for(var/F in faction)
if(F in L.faction)
ally = TRUE
break
if(ally)
continue
if(issilicon(L) && (rabid || attacked)) // They can't eat silicons, but they can glomp them in defence
targets += L // Possible target found!
+7 -3
View File
@@ -212,9 +212,13 @@
R.stun(20)
return
if(stepTurf.flags_1 & NOJAUNT_1)
to_chat(L, "<span class='warning'>Holy energies block your path.</span>")
else
L.loc = get_step(L, direct)
to_chat(L, "<span class='warning'>Some strange aura is blocking the way.</span>")
return
if (locate(/obj/effect/blessing, stepTurf))
to_chat(L, "<span class='warning'>Holy energies block your path!</span>")
return
L.loc = get_step(L, direct)
L.setDir(direct)
return TRUE