From 338c1cbe70b21fefafb5250b0f2b17051bcdfdbc Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Sat, 27 Jun 2020 16:36:11 +0200 Subject: [PATCH] Fixes species not respecting total_health (#9214) --- code/game/dna/dna_modifier.dm | 2 +- .../carbon/human/species/outsider/shadow.dm | 2 +- .../carbon/human/species/outsider/undead.dm | 6 +-- .../human/species/station/diona/diona.dm | 2 +- .../carbon/human/species/station/golem.dm | 2 +- .../carbon/human/species/station/ipc/ipc.dm | 2 +- html/changelogs/mattatlas-species.yml | 41 +++++++++++++++++++ 7 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 html/changelogs/mattatlas-species.yml diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 09c9ddfe0da..f3e4645171b 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -379,7 +379,7 @@ occupantData["isViableSubject"] = 0 occupantData["health"] = connected.occupant.health occupantData["maxHealth"] = connected.occupant.maxHealth - occupantData["minHealth"] = config.health_threshold_dead + occupantData["minHealth"] = connected.occupant.species.total_health occupantData["uniqueEnzymes"] = connected.occupant.dna.unique_enzymes occupantData["uniqueIdentity"] = connected.occupant.dna.uni_identity occupantData["structuralEnzymes"] = connected.occupant.dna.struc_enzymes diff --git a/code/modules/mob/living/carbon/human/species/outsider/shadow.dm b/code/modules/mob/living/carbon/human/species/outsider/shadow.dm index 9515a76fc2c..e9b06bc9854 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/shadow.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/shadow.dm @@ -114,6 +114,6 @@ return "grue" /datum/species/shadow/handle_death_check(var/mob/living/carbon/human/H) - if(H.get_total_health() <= config.health_threshold_dead) + if(H.get_total_health() <= total_health) return TRUE return FALSE \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/outsider/undead.dm b/code/modules/mob/living/carbon/human/species/outsider/undead.dm index fea39b2ba54..745258921e3 100644 --- a/code/modules/mob/living/carbon/human/species/outsider/undead.dm +++ b/code/modules/mob/living/carbon/human/species/outsider/undead.dm @@ -18,7 +18,7 @@ deform = 'icons/mob/human_races/r_skeleton.dmi' eyes = "blank_eyes" - total_health = 70 //gotta get headshots to kill them, so they're frail + total_health = 100 //skeletons are frail default_language = LANGUAGE_TCB language = LANGUAGE_CULT @@ -92,7 +92,7 @@ hud_type = /datum/hud_data/construct /datum/species/skeleton/handle_death_check(var/mob/living/carbon/human/H) - if(H.get_total_health() <= config.health_threshold_dead) + if(H.get_total_health() <= total_health) return TRUE return FALSE @@ -146,7 +146,7 @@ qdel(H) /datum/species/apparition/handle_death_check(var/mob/living/carbon/human/H) - if(H.get_total_health() <= config.health_threshold_dead) + if(H.get_total_health() <= total_health) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm index 11eec442ecb..fb79b2545ba 100644 --- a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm +++ b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm @@ -184,7 +184,7 @@ return current_flags /datum/species/diona/handle_death_check(var/mob/living/carbon/human/H) - if(H.get_total_health() <= config.health_threshold_dead) + if(H.get_total_health() <= total_health) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species/station/golem.dm b/code/modules/mob/living/carbon/human/species/station/golem.dm index 75930a9f64f..2d2810d960e 100644 --- a/code/modules/mob/living/carbon/human/species/station/golem.dm +++ b/code/modules/mob/living/carbon/human/species/station/golem.dm @@ -119,7 +119,7 @@ var/global/list/golem_types = list("Coal Golem", qdel(H) /datum/species/golem/handle_death_check(var/mob/living/carbon/human/H) - if(H.get_total_health() <= config.health_threshold_dead) + if(H.get_total_health() <= total_health) return TRUE return FALSE diff --git a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm index 726a45a1d2a..51597a03b8a 100644 --- a/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm +++ b/code/modules/mob/living/carbon/human/species/station/ipc/ipc.dm @@ -298,7 +298,7 @@ datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H) check_tag(H, H.client) /datum/species/machine/handle_death_check(var/mob/living/carbon/human/H) - if(H.get_total_health() <= config.health_threshold_dead) + if(H.get_total_health() <= total_health) return TRUE return FALSE diff --git a/html/changelogs/mattatlas-species.yml b/html/changelogs/mattatlas-species.yml new file mode 100644 index 00000000000..24e0662c06d --- /dev/null +++ b/html/changelogs/mattatlas-species.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Things that don't respect brainmed such as shadows and skeletons should now die when they're supposed to."