Fix SAD not transferring wounds (#3167)

## About The Pull Request

Add code to `/datum/component/damage_tracker/human` to keep track of
wounds and reapply them as needed.

## Why It's Good For The Game

Fixes #3162

## Proof Of Testing

I tested with both the permanent limp quirk and breaking one of my arms
with force and both wounds stayed after using the SAD

## Changelog

🆑
fix: fixed the SAD deleting wounds
/🆑
This commit is contained in:
Roxy
2025-02-26 18:29:43 -08:00
committed by GitHub
parent 6e8b24264d
commit 76878341e0
@@ -76,6 +76,9 @@
/// What brain traumas does the owner currently have?
var/list/trauma_list = list()
/// What wounds does the owner currently have?
var/list/wound_list = list()
/datum/component/damage_tracker/human/update_damage_values()
. = ..()
var/mob/living/carbon/human/human_parent = parent
@@ -86,6 +89,12 @@
if(length(current_trauma_list))
trauma_list = current_trauma_list.Copy()
for(var/obj/item/bodypart/limb as anything in human_parent.get_wounded_bodyparts())
for(var/datum/wound/limb_wound as anything in limb.wounds)
if(!islist(wound_list[limb.type]))
wound_list[limb.type] = list()
wound_list[limb.type] |= limb_wound.type
heart_damage = human_parent.check_organ_damage(/obj/item/organ/internal/heart)
liver_damage = human_parent.check_organ_damage(/obj/item/organ/internal/liver)
lung_damage = human_parent.check_organ_damage(/obj/item/organ/internal/lungs)
@@ -121,6 +130,14 @@
human_brain.gain_trauma(trauma_to_add)
for(var/obj/item/bodypart/limb_type as anything in wound_list)
var/obj/item/bodypart/limb_instance = locate(limb_type) in human_parent.bodyparts
if(!limb_instance)
continue
for(var/datum/wound/wound_type as anything in wound_list[limb_type])
var/datum/wound/new_wound = new wound_type()
new_wound.apply_wound(limb_instance, TRUE)
return TRUE
/datum/component/damage_tracker/human/Initialize(...)