From d5f4da3e39bbbac36d0b5533ba0d6b5724bb2681 Mon Sep 17 00:00:00 2001 From: FenodyreeAv Date: Sat, 4 Apr 2026 23:23:46 +0100 Subject: [PATCH] Fixes explosions only damaging the chest (#22145) Explosions used to randomly pick a limb, based on the weighted list of their size, then do a little damage to every limb. This broke when un-targetted damage was defaulted to the torso. This restores the random organ and fixes DAMAGE_FLAG_DISPERSED to disperse damage. --- code/modules/mob/living/carbon/human/human.dm | 10 ++++++---- code/modules/mob/living/carbon/human/human_damage.dm | 12 +++++++++++- html/changelogs/Fenodyree-ExplosionTorsoFix.yml | 6 ++++++ 3 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/Fenodyree-ExplosionTorsoFix.yml diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 15dc486d52e..6936e5de4c4 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -326,13 +326,15 @@ if (prob(50)) Paralyse(10) + var/target_zone = ran_zone() + // focus most of the blast on one organ - apply_damage(0.7 * b_loss, DAMAGE_BRUTE, null, DAMAGE_FLAG_EXPLODE, used_weapon = "Explosive blast") - apply_damage(0.7 * f_loss, DAMAGE_BURN, null, DAMAGE_FLAG_EXPLODE, used_weapon = "Explosive blast") + apply_damage(0.7 * b_loss, DAMAGE_BRUTE, target_zone, "Explosive blast", DAMAGE_FLAG_EXPLODE) + apply_damage(0.7 * f_loss, DAMAGE_BURN, target_zone, "Explosive blast", DAMAGE_FLAG_EXPLODE) // distribute the remaining 30% on all limbs equally (including the one already dealt damage) - apply_damage(0.3 * b_loss, DAMAGE_BRUTE, null, DAMAGE_FLAG_EXPLODE | DAMAGE_FLAG_DISPERSED, used_weapon = "Explosive blast") - apply_damage(0.3 * f_loss, DAMAGE_BURN, null, DAMAGE_FLAG_EXPLODE | DAMAGE_FLAG_DISPERSED, used_weapon = "Explosive blast") + apply_damage(0.3 * b_loss, DAMAGE_BRUTE, null, "Explosive blast", DAMAGE_FLAG_EXPLODE | DAMAGE_FLAG_DISPERSED) + apply_damage(0.3 * f_loss, DAMAGE_BURN, null, "Explosive blast", DAMAGE_FLAG_EXPLODE | DAMAGE_FLAG_DISPERSED) UpdateDamageIcon() diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 50e04998cef..62875c813b9 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -451,7 +451,17 @@ This function restores all organs. to_chat(src, SPAN_DANGER("You are now visible.")) set_invisibility(0) - var/obj/item/organ/external/organ = isorgan(def_zone) ? def_zone : (isnull(def_zone) ? get_organ(BP_CHEST) : get_organ(def_zone)) + var/obj/item/organ/external/organ + if(isorgan(def_zone)) + organ = def_zone + else if(isnull(def_zone)) + if(damage_flags & DAMAGE_FLAG_DISPERSED) + organ = null + else + organ = get_organ(BP_CHEST) //Default to the chest if there is no zone, and its not dispersed damage. + else + organ = get_organ(def_zone) + if(!organ) if(!def_zone) if(damage_flags & DAMAGE_FLAG_DISPERSED) diff --git a/html/changelogs/Fenodyree-ExplosionTorsoFix.yml b/html/changelogs/Fenodyree-ExplosionTorsoFix.yml new file mode 100644 index 00000000000..368cada02c5 --- /dev/null +++ b/html/changelogs/Fenodyree-ExplosionTorsoFix.yml @@ -0,0 +1,6 @@ +author: Fenodyree + +delete-after: True + +changes: + - bugfix: "Fixes explosions exclusively damaging the torso, and instead distributes damage across all limbs, with a focus on one random limb."