Brain fix
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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, "<span class='warning'>You feel lightheaded.</span>")
|
||||
brain_message = "<span class='warning'>You feel lightheaded.</span>"
|
||||
else if(prev_damage < BRAIN_DAMAGE_SEVERE && damage >= BRAIN_DAMAGE_SEVERE)
|
||||
to_chat(owner, "<span class='warning'>You feel less in control of your thoughts.</span>")
|
||||
brain_message = "<span class='warning'>You feel less in control of your thoughts.</span>"
|
||||
else if(prev_damage < (BRAIN_DAMAGE_DEATH - 20) && damage >= (BRAIN_DAMAGE_DEATH - 20))
|
||||
to_chat(owner, "<span class='warning'>You can feel your mind flickering on and off...</span>")
|
||||
//update our previous damage holder after we've checked our boundaries
|
||||
prev_damage = damage
|
||||
return
|
||||
brain_message = "<span class='warning'>You can feel your mind flickering on and off...</span>"
|
||||
|
||||
if(.)
|
||||
. += "\n[brain_message]"
|
||||
else
|
||||
return brain_message
|
||||
|
||||
/obj/item/organ/brain/Destroy() //copypasted from MMIs.
|
||||
if(brainmob)
|
||||
|
||||
Reference in New Issue
Block a user