From 64c8a4dd76f8e1e923628bc09e68ceea2b3fe108 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 3 Feb 2021 15:46:21 +0100 Subject: [PATCH] [MIRROR] adds vars for damage done by temp on simplemobs (#3042) * adds vars for damage done by temp on simplemobs (#56572) instead of heat and cold damage being handled by unsuitable_atmos_damage, instead its handled by unsuitable_heat_damage and unsuitable_cold_damage if these vars arent set on the mob, they are set by default to the value of unsuitable_atmos_damage * adds vars for damage done by temp on simplemobs Co-authored-by: Fikou --- code/modules/holiday/halloween.dm | 10 +++++----- .../simple_animal/friendly/drone/_drone.dm | 5 ++--- .../mob/living/simple_animal/hostile/alien.dm | 12 +----------- .../simple_animal/hostile/giant_spider.dm | 12 ++---------- .../hostile/mining_mobs/mining_mobs.dm | 11 +---------- .../simple_animal/hostile/retaliate/clown.dm | 11 +---------- .../mob/living/simple_animal/simple_animal.dm | 19 ++++++++++++++----- 7 files changed, 26 insertions(+), 54 deletions(-) diff --git a/code/modules/holiday/halloween.dm b/code/modules/holiday/halloween.dm index afaa6c9ebd1..f4b74981ad4 100644 --- a/code/modules/holiday/halloween.dm +++ b/code/modules/holiday/halloween.dm @@ -185,10 +185,13 @@ icon_dead = "scary_clown" icon_gib = "scary_clown" speak = list("...", ". . .") - maxHealth = 1e6 - health = 1e6 + maxHealth = INFINITY + health = INFINITY emote_see = list("silently stares") + atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) unsuitable_atmos_damage = 0 + minbodytemp = 0 + maxbodytemp = INFINITY var/timer /mob/living/simple_animal/hostile/clown_insane/Initialize() @@ -254,9 +257,6 @@ return return ..() -/mob/living/simple_animal/hostile/clown_insane/handle_temperature_damage() - return - ///////////////////////// // Spooky Uplink Items // ///////////////////////// diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index fcc8c038a4e..49a7fb61d0f 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -49,6 +49,8 @@ health = 30 maxHealth = 30 unsuitable_atmos_damage = 0 + minbodytemp = 0 + maxbodytemp = 0 wander = 0 speed = 0 ventcrawler = VENTCRAWLER_ALWAYS @@ -300,9 +302,6 @@ if(cleared) to_chat(src, "--- [class] alarm in [A.name] has been cleared.") -/mob/living/simple_animal/drone/handle_temperature_damage() - return - /mob/living/simple_animal/drone/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0) if(affect_silicon) return ..() diff --git a/code/modules/mob/living/simple_animal/hostile/alien.dm b/code/modules/mob/living/simple_animal/hostile/alien.dm index 2d2908d436d..12d3fce4d9a 100644 --- a/code/modules/mob/living/simple_animal/hostile/alien.dm +++ b/code/modules/mob/living/simple_animal/hostile/alien.dm @@ -23,10 +23,10 @@ a_intent = INTENT_HARM attack_sound = 'sound/weapons/bladeslice.ogg' atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0) - unsuitable_atmos_damage = 15 faction = list(ROLE_ALIEN) status_flags = CANPUSH minbodytemp = 0 + unsuitable_heat_damage = 20 see_in_dark = 8 lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE unique_name = 1 @@ -147,16 +147,6 @@ damage = 30 icon_state = "toxin" -/mob/living/simple_animal/hostile/alien/handle_temperature_damage() - if(bodytemperature < minbodytemp) - adjustBruteLoss(2) - throw_alert("temp", /atom/movable/screen/alert/cold, 1) - else if(bodytemperature > maxbodytemp) - adjustBruteLoss(20) - throw_alert("temp", /atom/movable/screen/alert/hot, 3) - else - clear_alert("temp") - /mob/living/simple_animal/hostile/alien/maid name = "lusty xenomorph maid" melee_damage_lower = 0 diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index c4b850bc536..38750ef13b1 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -55,6 +55,8 @@ maxHealth = 80 health = 80 damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 1, CLONE = 1, STAMINA = 1, OXY = 1) + unsuitable_cold_damage = 20 + unsuitable_heat_damage = 20 obj_damage = 30 melee_damage_lower = 20 melee_damage_upper = 25 @@ -99,16 +101,6 @@ GLOB.spidermobs -= src return ..() -/mob/living/simple_animal/hostile/poison/giant_spider/handle_temperature_damage() - if(bodytemperature < minbodytemp) - adjustBruteLoss(20) - throw_alert("temp", /atom/movable/screen/alert/cold, 3) - else if(bodytemperature > maxbodytemp) - adjustBruteLoss(20) - throw_alert("temp", /atom/movable/screen/alert/hot, 3) - else - clear_alert("temp") - /** * # Spider Hunter * diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm index f604fac9256..a3c143eb815 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/mining_mobs.dm @@ -8,6 +8,7 @@ environment_smash = ENVIRONMENT_SMASH_WALLS minbodytemp = 0 maxbodytemp = INFINITY + unsuitable_heat_damage = 20 response_harm_continuous = "strikes" response_harm_simple = "strike" status_flags = 0 @@ -59,13 +60,3 @@ /mob/living/simple_animal/hostile/asteroid/proc/spawn_crusher_loot() butcher_results[crusher_loot] = 1 - -/mob/living/simple_animal/hostile/asteroid/handle_temperature_damage() - if(bodytemperature < minbodytemp) - adjustBruteLoss(2) - throw_alert("temp", /atom/movable/screen/alert/cold, 1) - else if(bodytemperature > maxbodytemp) - adjustBruteLoss(20) - throw_alert("temp", /atom/movable/screen/alert/hot, 3) - else - clear_alert("temp") diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm index e1d0a390ba8..8b514e44c50 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/clown.dm @@ -33,21 +33,12 @@ minbodytemp = 270 maxbodytemp = 370 unsuitable_atmos_damage = 10 + unsuitable_heat_damage = 15 footstep_type = FOOTSTEP_MOB_SHOE var/banana_time = 0 // If there's no time set it won't spawn. var/banana_type = /obj/item/grown/bananapeel var/attack_reagent -/mob/living/simple_animal/hostile/retaliate/clown/handle_temperature_damage() - if(bodytemperature < minbodytemp) - adjustBruteLoss(10) - throw_alert("temp", /atom/movable/screen/alert/cold, 2) - else if(bodytemperature > maxbodytemp) - adjustBruteLoss(15) - throw_alert("temp", /atom/movable/screen/alert/hot, 3) - else - clear_alert("temp") - /mob/living/simple_animal/hostile/retaliate/clown/attack_hand(mob/living/carbon/human/M) ..() playsound(src.loc, 'sound/items/bikehorn.ogg', 50, TRUE) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 3b065a60ae0..7d727718e72 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -55,9 +55,14 @@ ///How much stamina the mob recovers per call of update_stamina var/stamina_recovery = 10 - ///Temperature effect. + ///Minimal body temperature without receiving damage var/minbodytemp = 250 + ///Maximal body temperature without receiving damage var/maxbodytemp = 350 + ///This damage is taken when the body temp is too cold. + var/unsuitable_cold_damage + ///This damage is taken when the body temp is too hot. + var/unsuitable_heat_damage ///Healable by medical stacks? Defaults to yes. var/healable = 1 @@ -198,6 +203,10 @@ damage_coeff = string_assoc_list(damage_coeff) if(footstep_type) AddComponent(/datum/component/footstep, footstep_type) + if(!unsuitable_cold_damage) + unsuitable_cold_damage = unsuitable_atmos_damage + if(!unsuitable_heat_damage) + unsuitable_heat_damage = unsuitable_atmos_damage /mob/living/simple_animal/Life() . = ..() @@ -396,8 +405,8 @@ /mob/living/simple_animal/proc/handle_temperature_damage() if(bodytemperature < minbodytemp) - adjustHealth(unsuitable_atmos_damage) - switch(unsuitable_atmos_damage) + adjustHealth(unsuitable_cold_damage) + switch(unsuitable_cold_damage) if(1 to 5) throw_alert("temp", /atom/movable/screen/alert/cold, 1) if(5 to 10) @@ -405,8 +414,8 @@ if(10 to INFINITY) throw_alert("temp", /atom/movable/screen/alert/cold, 3) else if(bodytemperature > maxbodytemp) - adjustHealth(unsuitable_atmos_damage) - switch(unsuitable_atmos_damage) + adjustHealth(unsuitable_heat_damage) + switch(unsuitable_heat_damage) if(1 to 5) throw_alert("temp", /atom/movable/screen/alert/hot, 1) if(5 to 10)