Nudges bodytemperature to your desired temperature (#23467)

* FINALLY

* m a t h
This commit is contained in:
DGamerL
2024-01-14 12:25:20 +00:00
committed by GitHub
parent dd5e951399
commit 537c5b2819
4 changed files with 12 additions and 10 deletions
-5
View File
@@ -23,11 +23,6 @@
prefs.active_character.autohiss_mode = AUTOHISS_OFF
to_chat(src, "Auto-hiss is now OFF.")
/datum/species
var/list/autohiss_basic_map = null
var/list/autohiss_extra_map = null
var/list/autohiss_exempt = null
/datum/species/unathi
autohiss_basic_map = list(
"s" = list("ss", "sss", "ssss")
@@ -212,7 +212,8 @@
// +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt.
if(bodytemperature > dna.species.heat_level_1)
//Body temperature is too hot.
if(status_flags & GODMODE) return 1 //godmode
if(status_flags & GODMODE)
return TRUE
var/mult = dna.species.heatmod * physiology.heat_mod
if(bodytemperature >= dna.species.heat_level_1 && bodytemperature <= dna.species.heat_level_2)
@@ -318,12 +319,15 @@
if(bodytemperature <= dna.species.cold_level_1) //260.15 is 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(bodytemperature >= dna.species.cold_level_1 && bodytemperature <= dna.species.heat_level_1)
bodytemperature += body_temperature_difference * metabolism_efficiency / BODYTEMP_AUTORECOVERY_DIVISOR
return
if(bodytemperature >= dna.species.heat_level_1) //360.15 is 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
// Our bodytemperature is +-50 degrees of our wanted body temperature
bodytemperature += ((body_temperature_difference * metabolism_efficiency) / max((BODYTEMP_AUTORECOVERY_LOW * (modulus(body_temperature_difference)) / 10), 2)) // We get back to safe our preferred bodytemp a lot faster, but slower when we are colder or hotter
//This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, UPPER_TORSO, LOWER_TORSO, etc. See setup.dm for the full list)
/mob/living/carbon/human/proc/get_heat_protection_flags(temperature) //Temperature is the temperature you're being exposed to.
@@ -874,8 +878,6 @@
AdjustLoseBreath(40 SECONDS, bound_lower = 0, bound_upper = 50 SECONDS)
adjustOxyLoss(20)
// Need this in species.
//#undef HUMAN_MAX_OXYLOSS
//#undef HUMAN_CRIT_MAX_OXYLOSS
@@ -195,6 +195,10 @@
/// Whether the presence of a body accessory on this species is optional or not.
var/optional_body_accessory = TRUE
var/list/autohiss_basic_map = null
var/list/autohiss_extra_map = null
var/list/autohiss_exempt = null
/datum/species/New()
unarmed = new unarmed_type()
if(!sprite_sheet_name)