diff --git a/code/_globalvars/bitfields.dm b/code/_globalvars/bitfields.dm
index 3b32745b5c..3c8b60eb9b 100644
--- a/code/_globalvars/bitfields.dm
+++ b/code/_globalvars/bitfields.dm
@@ -177,4 +177,12 @@ GLOBAL_LIST_INIT(bitfields, list(
"CAN_CARRY" = CAN_CARRY,
"CAN_RESIST" = CAN_RESIST
),
- ))
\ No newline at end of file
+ "organ_flags" = list(
+ "ORGAN_SYNTHETIC" = ORGAN_SYNTHETIC,
+ "ORGAN_FROZEN" = ORGAN_FROZEN,
+ "ORGAN_FAILING" = ORGAN_FAILING,
+ "ORGAN_EXTERNAL" = ORGAN_EXTERNAL,
+ "ORGAN_VITAL" = ORGAN_VITAL,
+ "ORGAN_NO_SPOIL" = ORGAN_NO_SPOIL
+ ),
+ ))
diff --git a/code/modules/mob/living/brain/MMI.dm b/code/modules/mob/living/brain/MMI.dm
index e3d83ef5a6..d84ba0d7a1 100644
--- a/code/modules/mob/living/brain/MMI.dm
+++ b/code/modules/mob/living/brain/MMI.dm
@@ -57,7 +57,7 @@
newbrain.brainmob = null
brainmob.forceMove(src)
brainmob.container = src
- if(!newbrain.organ_flags & ORGAN_FAILING) // the brain organ hasn't been beaten to death.
+ if(!(newbrain.organ_flags & ORGAN_FAILING)) // the brain organ hasn't been beaten to death.
brainmob.stat = CONSCIOUS //we manually revive the brain mob
GLOB.dead_mob_list -= brainmob
GLOB.alive_mob_list += brainmob
diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm
index 52bef062fb..d635a4adb9 100644
--- a/code/modules/mob/living/brain/brain_item.dm
+++ b/code/modules/mob/living/brain/brain_item.dm
@@ -125,7 +125,7 @@
if(cached_Bdamage <= HEALTH_THRESHOLD_DEAD) //Fixing dead brains yeilds a trauma
if((cached_Bdamage <= HEALTH_THRESHOLD_DEAD) && (brainmob.health > HEALTH_THRESHOLD_DEAD))
- if(prob(90))
+ if(prob(80))
gain_trauma_type(BRAIN_TRAUMA_MILD)
else if(prob(50))
gain_trauma_type(BRAIN_TRAUMA_SEVERE)
@@ -252,11 +252,15 @@
if(damage <= BRAIN_DAMAGE_DEATH) //rip
brain_death = FALSE
-/obj/item/organ/brain/process() //needs to run in life AND death
+
+/obj/item/organ/brain/applyOrganDamage(var/d, var/maximum = maxHealth)
..()
+
+
+/obj/item/organ/brain/check_damage_thresholds(mob/M)
+ . = ..()
//if we're not more injured than before, return without gambling for a trauma
if(damage <= prev_damage)
- prev_damage = damage
return
damage_delta = damage - prev_damage
if(damage > BRAIN_DAMAGE_MILD)
@@ -271,15 +275,18 @@
if (owner)
if(owner.stat < UNCONSCIOUS) //conscious or soft-crit
+ var/brain_message
if(prev_damage < BRAIN_DAMAGE_MILD && damage >= BRAIN_DAMAGE_MILD)
- to_chat(owner, "You feel lightheaded.")
+ brain_message = "You feel lightheaded."
else if(prev_damage < BRAIN_DAMAGE_SEVERE && damage >= BRAIN_DAMAGE_SEVERE)
- to_chat(owner, "You feel less in control of your thoughts.")
+ brain_message = "You feel less in control of your thoughts."
else if(prev_damage < (BRAIN_DAMAGE_DEATH - 20) && damage >= (BRAIN_DAMAGE_DEATH - 20))
- to_chat(owner, "You can feel your mind flickering on and off...")
- //update our previous damage holder after we've checked our boundaries
- prev_damage = damage
- return
+ brain_message = "You can feel your mind flickering on and off..."
+
+ if(.)
+ . += "\n[brain_message]"
+ else
+ return brain_message
/obj/item/organ/brain/Destroy() //copypasted from MMIs.
if(brainmob)