From 1ad10582dbe2d07cebc2e438d86d916969e00562 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Fri, 30 Apr 2021 14:03:48 +0200
Subject: [PATCH] [MIRROR] The shivering symptom now actually chills you like
it says it does instead of heating you up (#5342)
* The shivering symptom now actually chills you like it says it does instead of heating you up (#58181)
* ice ice baby
* broader species compatibility
* are you HAPPY NOW?
* should make the code compile
* Apply suggestions from code review
Co-authored-by: Aki Ito <11748095+ExcessiveUseOfCobblestone@ users.noreply.github.com>
* The shivering symptom now actually chills you like it says it does instead of heating you up
Co-authored-by: ATH1909 <42606352+ATH1909@users.noreply.github.com>
Co-authored-by: Aki Ito <11748095+ExcessiveUseOfCobblestone@ users.noreply.github.com>
---
.../symptoms/{shivering.dm => chills.dm} | 39 ++++++++++---------
.../datums/diseases/advance/symptoms/fever.dm | 11 +++---
.../antagonists/disease/disease_abilities.dm | 6 +--
code/modules/mob/living/carbon/human/life.dm | 6 +++
code/modules/mob/living/living.dm | 8 ++++
tgstation.dme | 2 +-
6 files changed, 44 insertions(+), 28 deletions(-)
rename code/datums/diseases/advance/symptoms/{shivering.dm => chills.dm} (55%)
diff --git a/code/datums/diseases/advance/symptoms/shivering.dm b/code/datums/diseases/advance/symptoms/chills.dm
similarity index 55%
rename from code/datums/diseases/advance/symptoms/shivering.dm
rename to code/datums/diseases/advance/symptoms/chills.dm
index bd80f0fb50b..ac53941f93f 100644
--- a/code/datums/diseases/advance/symptoms/shivering.dm
+++ b/code/datums/diseases/advance/symptoms/chills.dm
@@ -1,9 +1,9 @@
-#define SHIVERING_CHANGE "shivering"
+#define CHILLS_CHANGE "chills"
/*
//////////////////////////////////////
-Shivering
+Chills
No change to hidden.
Increases resistance.
@@ -17,8 +17,8 @@ Bonus
//////////////////////////////////////
*/
-/datum/symptom/shivering
- name = "Shivering"
+/datum/symptom/chills
+ name = "Chills"
desc = "The virus inhibits the body's thermoregulation, cooling the body down."
stealth = 0
resistance = 2
@@ -30,11 +30,11 @@ Bonus
symptom_delay_max = 30
var/unsafe = FALSE //over the cold threshold
threshold_descs = list(
- "Stage Speed 5" = "Increases cooling speed,; the host can fall below safe temperature levels.",
- "Stage Speed 10" = "Further increases cooling speed."
+ "Stage Speed 5" = "Increases the intensity of the cooling; the host can fall below safe temperature levels.",
+ "Stage Speed 10" = "Increases the intensity of the cooling even further."
)
-/datum/symptom/shivering/Start(datum/disease/advance/A)
+/datum/symptom/chills/Start(datum/disease/advance/A)
. = ..()
if(!.)
return
@@ -44,7 +44,7 @@ Bonus
if(A.totalStageSpeed() >= 10)
power = 2.5
-/datum/symptom/shivering/Activate(datum/disease/advance/A)
+/datum/symptom/chills/Activate(datum/disease/advance/A)
. = ..()
if(!.)
return
@@ -52,7 +52,7 @@ Bonus
if(!unsafe || A.stage < 4)
to_chat(M, "[pick("You feel cold.", "You shiver.")]")
else
- to_chat(M, "[pick("You feel your blood run cold.", "You feel ice in your veins.", "You feel like you can't heat up.", "You shiver violently." )]")
+ to_chat(M, "[pick("You feel your blood run cold.", "You feel ice in your veins.", "You feel like you can't heat up.", "You shiver violently.")]")
set_body_temp(A.affected_mob, A)
/**
@@ -63,23 +63,24 @@ Bonus
* * mob/living/M The mob to apply changes to
* * datum/disease/advance/A The disease applying the symptom
*/
-/datum/symptom/shivering/proc/set_body_temp(mob/living/M, datum/disease/advance/A)
- // Get the max amount of change allowed before going under cold damage limit, 5 over the cold damage limit
- var/change_limit = (BODYTEMP_HEAT_DAMAGE_LIMIT - 5) - M.get_body_temp_normal(apply_change=FALSE)
- if(unsafe) // when unsafe the shivers can cause (cold?)burn damage (not wounds)
- change_limit -= 20
- M.add_body_temperature_change(SHIVERING_CHANGE, max(-((6 * power) * A.stage), change_limit))
+/datum/symptom/chills/proc/set_body_temp(mob/living/M, datum/disease/advance/A)
+ if(unsafe) // when unsafe the shivers can cause cold damage
+ M.add_body_temperature_change(CHILLS_CHANGE, -6 * power * A.stage)
+ else
+ // Get the max amount of change allowed before going under cold damage limit, then cap the maximum allowed temperature change from safe chills to 5 over the cold damage limit
+ var/change_limit = min(M.get_body_temp_cold_damage_limit() + 5 - M.get_body_temp_normal(apply_change=FALSE), 0)
+ M.add_body_temperature_change(CHILLS_CHANGE, max(-6 * power * A.stage, change_limit))
/// Update the body temp change based on the new stage
-/datum/symptom/shivering/on_stage_change(datum/disease/advance/A)
+/datum/symptom/chills/on_stage_change(datum/disease/advance/A)
. = ..()
if(.)
set_body_temp(A.affected_mob, A)
/// remove the body temp change when removing symptom
-/datum/symptom/shivering/End(datum/disease/advance/A)
+/datum/symptom/chills/End(datum/disease/advance/A)
var/mob/living/carbon/M = A.affected_mob
if(M)
- M.remove_body_temperature_change(SHIVERING_CHANGE)
+ M.remove_body_temperature_change(CHILLS_CHANGE)
-#undef SHIVERING_CHANGE
+#undef CHILLS_CHANGE
diff --git a/code/datums/diseases/advance/symptoms/fever.dm b/code/datums/diseases/advance/symptoms/fever.dm
index 09add4c5d50..10c422bed35 100644
--- a/code/datums/diseases/advance/symptoms/fever.dm
+++ b/code/datums/diseases/advance/symptoms/fever.dm
@@ -65,11 +65,12 @@ Bonus
* * datum/disease/advance/A The disease applying the symptom
*/
/datum/symptom/fever/proc/set_body_temp(mob/living/M, datum/disease/advance/A)
- // Get the max amount of change allowed before going over heat damage limit, 5 under the heat damage limit
- var/change_limit = (BODYTEMP_HEAT_DAMAGE_LIMIT - 5) - M.get_body_temp_normal(apply_change=FALSE)
- if(unsafe) // when unsafe the fever can cause burn damage (not wounds)
- change_limit += 20
- M.add_body_temperature_change(FEVER_CHANGE, min((6 * power) * A.stage, change_limit))
+ if(unsafe) // when unsafe the fever can cause heat damage
+ M.add_body_temperature_change(FEVER_CHANGE, 6 * power * A.stage)
+ else
+ // Get the max amount of change allowed before going over heat damage limit, then cap the maximum allowed temperature change from a safe fever to 5 under the heat damage limit
+ var/change_limit = max(M.get_body_temp_heat_damage_limit() - 5 - M.get_body_temp_normal(apply_change=FALSE), 0)
+ M.add_body_temperature_change(FEVER_CHANGE, min(6 * power * A.stage, change_limit))
/// Update the body temp change based on the new stage
/datum/symptom/fever/on_stage_change(datum/disease/advance/A)
diff --git a/code/modules/antagonists/disease/disease_abilities.dm b/code/modules/antagonists/disease/disease_abilities.dm
index a07b75f546a..0cdb2b7f631 100644
--- a/code/modules/antagonists/disease/disease_abilities.dm
+++ b/code/modules/antagonists/disease/disease_abilities.dm
@@ -21,7 +21,7 @@ new /datum/disease_ability/symptom/medium/visionloss,
new /datum/disease_ability/symptom/medium/deafness,
new /datum/disease_ability/symptom/powerful/narcolepsy,
new /datum/disease_ability/symptom/medium/fever,
-new /datum/disease_ability/symptom/medium/shivering,
+new /datum/disease_ability/symptom/medium/chills,
new /datum/disease_ability/symptom/medium/headache,
new /datum/disease_ability/symptom/medium/nano_boost,
new /datum/disease_ability/symptom/medium/nano_destroy,
@@ -356,8 +356,8 @@ new /datum/disease_ability/symptom/powerful/youth
/datum/disease_ability/symptom/medium/fever
symptoms = list(/datum/symptom/fever)
-/datum/disease_ability/symptom/medium/shivering
- symptoms = list(/datum/symptom/shivering)
+/datum/disease_ability/symptom/medium/chills
+ symptoms = list(/datum/symptom/chills)
/datum/disease_ability/symptom/medium/headache
symptoms = list(/datum/symptom/headache)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index 0f1acc8eb8f..7d84cabcf42 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -148,6 +148,12 @@
return dna.species.bodytemp_normal
return dna.species.bodytemp_normal + get_body_temp_normal_change()
+/mob/living/carbon/human/get_body_temp_heat_damage_limit()
+ return dna.species.bodytemp_heat_damage_limit
+
+/mob/living/carbon/human/get_body_temp_cold_damage_limit()
+ return dna.species.bodytemp_cold_damage_limit
+
///FIRE CODE
/mob/living/carbon/human/handle_fire(delta_time, times_fired)
. = ..()
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index 1ea97d4c550..6272bce7f61 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -1629,6 +1629,14 @@
return BODYTEMP_NORMAL
return BODYTEMP_NORMAL + get_body_temp_normal_change()
+///Returns the body temperature at which this mob will start taking heat damage.
+/mob/living/proc/get_body_temp_heat_damage_limit()
+ return BODYTEMP_HEAT_DAMAGE_LIMIT
+
+///Returns the body temperature at which this mob will start taking cold damage.
+/mob/living/proc/get_body_temp_cold_damage_limit()
+ return BODYTEMP_COLD_DAMAGE_LIMIT
+
///Checks if the user is incapacitated or on cooldown.
/mob/living/proc/can_look_up()
return !(incapacitated(ignore_restraints = TRUE))
diff --git a/tgstation.dme b/tgstation.dme
index 815e1c7729c..d24ae67e0e4 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -658,6 +658,7 @@
#include "code\datums\diseases\advance\advance.dm"
#include "code\datums\diseases\advance\presets.dm"
#include "code\datums\diseases\advance\symptoms\beard.dm"
+#include "code\datums\diseases\advance\symptoms\chills.dm"
#include "code\datums\diseases\advance\symptoms\choking.dm"
#include "code\datums\diseases\advance\symptoms\confusion.dm"
#include "code\datums\diseases\advance\symptoms\cough.dm"
@@ -677,7 +678,6 @@
#include "code\datums\diseases\advance\symptoms\oxygen.dm"
#include "code\datums\diseases\advance\symptoms\sensory.dm"
#include "code\datums\diseases\advance\symptoms\shedding.dm"
-#include "code\datums\diseases\advance\symptoms\shivering.dm"
#include "code\datums\diseases\advance\symptoms\skin.dm"
#include "code\datums\diseases\advance\symptoms\sneeze.dm"
#include "code\datums\diseases\advance\symptoms\species.dm"