From 2f93947e5972b8999e46fcfdbc580bceaa227b4a Mon Sep 17 00:00:00 2001 From: Szunti Date: Sun, 17 Jan 2016 18:13:30 +0100 Subject: [PATCH] Simplify slime temperature damage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the damage-temperature curve is not continuous and isn't monotone. It's better to change it to constant 30 damage between -50°C and 50K. The exact shape of the function is not that important, because the slimes resistance is mostly due to its bodytemperature need time to change. --- code/modules/mob/living/carbon/metroid/life.dm | 10 ++++++---- code/modules/mob/living/carbon/metroid/metroid.dm | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/metroid/life.dm b/code/modules/mob/living/carbon/metroid/life.dm index 06b4bbae6ca..a885e50d9b8 100644 --- a/code/modules/mob/living/carbon/metroid/life.dm +++ b/code/modules/mob/living/carbon/metroid/life.dm @@ -54,11 +54,13 @@ if(bodytemperature < (T0C + 5)) // start calculating temperature damage etc - if(bodytemperature <= (T0C - 50)) // hurt temperature - if(bodytemperature <= 50) // sqrting negative numbers is bad + if(bodytemperature <= hurt_temperature) + if(bodytemperature <= die_temperature) adjustToxLoss(200) else - adjustToxLoss(round(sqrt(bodytemperature)) * 2) + // could be more fancy, but doesn't worth the complexity: when the slimes goes into a cold area + // the damage is mostly determined by how fast its body cools + adjustToxLoss(30) updatehealth() @@ -547,4 +549,4 @@ return 0 /mob/living/carbon/slime/slip() //Can't slip something without legs. - return 0 \ No newline at end of file + return 0 diff --git a/code/modules/mob/living/carbon/metroid/metroid.dm b/code/modules/mob/living/carbon/metroid/metroid.dm index c2e41118b5a..12105b466d2 100644 --- a/code/modules/mob/living/carbon/metroid/metroid.dm +++ b/code/modules/mob/living/carbon/metroid/metroid.dm @@ -49,6 +49,9 @@ var/SStun = 0 // NPC stun variable. Used to calm them down when they are attacked while feeding, or they will immediately re-attach var/Discipline = 0 // if a slime has been hit with a freeze gun, or wrestled/attacked off a human, they become disciplined and don't attack anymore for a while. The part about freeze gun is a lie + var/hurt_temperature = T0C-50 // slime keeps taking damage when its bodytemperature is below this + var/die_temperature = 50 // slime dies instantly when its bodytemperature is below this + ///////////TIME FOR SUBSPECIES var/colour = "grey" @@ -411,4 +414,4 @@ /mob/living/carbon/slime/cannot_use_vents() if(Victim) return "You cannot ventcrawl while feeding." - ..() \ No newline at end of file + ..()