[MIRROR] Refactors some trauma code, fixes some trauma heals not working (#5955)
* Refactors some trauma code, fixes some trauma heals not working (#36093) * Refactors some trauma code, fixes some trauma heals not working * that too * fix indent * antur comments * Refactors some trauma code, fixes some trauma heals not working
This commit is contained in:
committed by
Poojawa
parent
31d988344a
commit
0bf1f7ce14
@@ -222,16 +222,21 @@
|
||||
/obj/item/organ/brain/proc/gain_trauma(datum/brain_trauma/trauma, resilience, list/arguments)
|
||||
if(!can_gain_trauma(trauma, resilience))
|
||||
return
|
||||
var/trauma_type
|
||||
if(ispath(trauma))
|
||||
trauma_type = trauma
|
||||
SSblackbox.record_feedback("tally", "traumas", 1, trauma_type)
|
||||
traumas += new trauma_type(arglist(list(src, resilience) + arguments))
|
||||
trauma = new(arglist(arguments))
|
||||
else
|
||||
SSblackbox.record_feedback("tally", "traumas", 1, trauma.type)
|
||||
traumas += trauma
|
||||
if(resilience)
|
||||
trauma.resilience = resilience
|
||||
if(trauma.brain) //we don't accept used traumas here
|
||||
WARNING("gain_trauma was given an already active trauma.")
|
||||
return
|
||||
|
||||
traumas += trauma
|
||||
trauma.brain = src
|
||||
if(owner)
|
||||
trauma.owner = owner
|
||||
trauma.on_gain()
|
||||
if(resilience)
|
||||
trauma.resilience = resilience
|
||||
SSblackbox.record_feedback("tally", "traumas", 1, trauma.type)
|
||||
|
||||
//Add a random trauma of a certain subtype
|
||||
/obj/item/organ/brain/proc/gain_trauma_type(brain_trauma_type = /datum/brain_trauma, resilience)
|
||||
|
||||
@@ -789,7 +789,7 @@
|
||||
update_handcuffed()
|
||||
if(reagents)
|
||||
reagents.addiction_list = list()
|
||||
cure_all_traumas(TRUE, TRAUMA_RESILIENCE_MAGIC)
|
||||
cure_all_traumas(TRAUMA_RESILIENCE_MAGIC)
|
||||
..()
|
||||
// heal ears after healing traits, since ears check TRAIT_DEAF trait
|
||||
// when healing.
|
||||
|
||||
Reference in New Issue
Block a user