[MIRROR] Fixes many basic mobs not being vulnerable to extreme atmospheres and temperatures by making it the default [MDB IGNORE] (#18029)

* Fixes many basic mobs not being vulnerable to extreme atmospheres and temperatures by making it the default

* borgi update

Co-authored-by: kawoppi <94711066+kawoppi@users.noreply.github.com>
Co-authored-by: tastyfish <crazychris32@gmail.com>
This commit is contained in:
SkyratBot
2022-12-13 00:02:37 +01:00
committed by GitHub
parent 10ac371e8d
commit df8dbcdab4
9 changed files with 43 additions and 68 deletions
+22
View File
@@ -85,6 +85,20 @@
///Sentience type, for slime potions. SHOULD BE AN ELEMENT BUT I DONT CARE ABOUT IT FOR NOW
var/sentience_type = SENTIENCE_ORGANIC
///Leaving something at 0 means it's off - has no maximum.
var/list/habitable_atmos = list("min_oxy" = 5, "max_oxy" = 0, "min_plas" = 0, "max_plas" = 1, "min_co2" = 0, "max_co2" = 5, "min_n2" = 0, "max_n2" = 0)
///This damage is taken when atmos doesn't fit all the requirements above. Set to 0 to avoid adding the atmos_requirements element.
var/unsuitable_atmos_damage = 1
///Minimal body temperature without receiving damage
var/minimum_survivable_temperature = 250
///Maximal body temperature without receiving damage
var/maximum_survivable_temperature = 350
///This damage is taken when the body temp is too cold. Set both this and unsuitable_heat_damage to 0 to avoid adding the basic_body_temp_sensitive element.
var/unsuitable_cold_damage = 1
///This damage is taken when the body temp is too hot. Set both this and unsuitable_cold_damage to 0 to avoid adding the basic_body_temp_sensitive element.
var/unsuitable_heat_damage = 1
/mob/living/basic/Initialize(mapload)
. = ..()
@@ -102,6 +116,14 @@
if(speak_emote)
speak_emote = string_list(speak_emote)
if(unsuitable_atmos_damage != 0)
//String assoc list returns a cached list, so this is like a static list to pass into the element below.
habitable_atmos = string_assoc_list(habitable_atmos)
AddElement(/datum/element/atmos_requirements, habitable_atmos, unsuitable_atmos_damage)
if(unsuitable_cold_damage != 0 && unsuitable_heat_damage != 0)
AddElement(/datum/element/basic_body_temp_sensitive, minimum_survivable_temperature, maximum_survivable_temperature, unsuitable_cold_damage, unsuitable_heat_damage)
/mob/living/basic/Life(delta_time = SSMOBS_DT, times_fired)
. = ..()
///Automatic stamina re-gain