diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index 37ad0b48af6..37ff68de533 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -20,7 +20,8 @@ var/mob/living/carbon/brain/brainmob = null var/const/damage_threshold_count = 10 var/damage_threshold_value - var/healed_threshold = 1 + // When TRUE - next Life() tick will trigger severe damage effects. Basically exists as a sort of a cooldown. + var/healed_threshold = TRUE var/oxygen_reserve = 6 /obj/item/organ/internal/brain/New(mob/living/carbon/holder) @@ -44,14 +45,13 @@ handle_severe_brain_damage() if(damage < (max_damage / 4)) - healed_threshold = 1 + healed_threshold = TRUE handle_disabilities() handle_damage_effects() // Brain damage from low oxygenation or lack of blood. if(owner.should_have_organ(BP_HEART)) - // No heart? You are going to have a very bad time. Not 100% lethal because heart transplants should be a thing. var/blood_volume = owner.get_blood_oxygenation() if(blood_volume < BLOOD_VOLUME_SURVIVE) @@ -61,51 +61,52 @@ oxygen_reserve = min(initial(oxygen_reserve), oxygen_reserve+1) if(!oxygen_reserve) //(hardcrit) owner.Paralyse(3) - var/can_heal = damage && damage < max_damage && (damage % damage_threshold_value || owner.chem_effects[CE_BRAIN_REGEN] || (!past_damage_threshold(3) && owner.chem_effects[CE_STABLE])) + var/can_heal = damage && damage < max_damage && (!past_damage_threshold(6) || owner.chem_effects[CE_BRAIN_REGEN]) var/damprob //Effects of bloodloss switch(blood_volume) - if(BLOOD_VOLUME_SAFE to INFINITY) if(can_heal) - damage = max(damage-1, 0) + heal_damage(1) if(BLOOD_VOLUME_OKAY to BLOOD_VOLUME_SAFE) if(prob(1)) - to_chat(owner, "You feel [pick("dizzy","woozy","faint")]...") - damprob = owner.chem_effects[CE_STABLE] ? 30 : 60 + to_chat(owner, SPAN_WARNING("You feel [pick("dizzy","woozy","faint")]...")) + damprob = owner.chem_effects[CE_STABLE] ? 15 : 60 if(!past_damage_threshold(2) && prob(damprob)) - take_internal_damage(1) + take_internal_damage(0.25) if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY) owner.eye_blurry = max(owner.eye_blurry,6) - damprob = owner.chem_effects[CE_STABLE] ? 40 : 80 + damprob = owner.chem_effects[CE_STABLE] ? 20 : 80 if(!past_damage_threshold(4) && prob(damprob)) - take_internal_damage(1) + take_internal_damage(0.5) if(!owner.paralysis && prob(10)) owner.Paralyse(rand(1,3)) - to_chat(owner, "You feel extremely [pick("dizzy","woozy","faint")]...") + to_chat(owner, SPAN_WARNING("You feel extremely [pick("dizzy","woozy","faint")]...")) if(BLOOD_VOLUME_SURVIVE to BLOOD_VOLUME_BAD) owner.eye_blurry = max(owner.eye_blurry,6) - damprob = owner.chem_effects[CE_STABLE] ? 60 : 100 + damprob = owner.chem_effects[CE_STABLE] ? 22 : 90 if(!past_damage_threshold(6) && prob(damprob)) take_internal_damage(1) if(!owner.paralysis && prob(15)) owner.Paralyse(3,5) - to_chat(owner, "You feel extremely [pick("dizzy","woozy","faint")]...") + to_chat(owner, SPAN_DANGER("You feel extremely [pick("dizzy","woozy","faint")]...")) if(-(INFINITY) to BLOOD_VOLUME_SURVIVE) // Also see heart.dm, being below this point puts you into cardiac arrest. owner.eye_blurry = max(owner.eye_blurry,6) - damprob = owner.chem_effects[CE_STABLE] ? 80 : 100 + damprob = owner.chem_effects[CE_STABLE] ? 25 : 100 if(prob(damprob)) - take_internal_damage(1) - if(prob(damprob)) - take_internal_damage(1) - ..() + take_internal_damage(2) + // Alkysine and the like passively heal brain damage below certain threshold + var/brain_heal_effect = owner.chem_effects[CE_BRAIN_REGEN] + if(brain_heal_effect && !past_damage_threshold(7 + brain_heal_effect)) + heal_damage(brain_heal_effect) + return ..() /obj/item/organ/internal/brain/examine(mob/user) . = ..() if(brainmob && brainmob.client)//if thar be a brain inside... the brain. - to_chat(user, "You can feel the small spark of life still left in this one.") + to_chat(user, SPAN_NOTICE(SPAN_BOLD("You can feel the small spark of life still left in this one."))) else - to_chat(user, "This one seems particularly lifeless. Perhaps it will regain some of its luster later..") + to_chat(user, SPAN_DEADSAY("This one seems particularly lifeless. Perhaps it will regain some of its luster later..")) /obj/item/organ/internal/brain/removed(mob/living/user) if(!istype(owner)) @@ -139,7 +140,7 @@ /obj/item/organ/internal/brain/surgical_fix(mob/user) var/blood_volume = owner.get_blood_oxygenation() if(blood_volume < BLOOD_VOLUME_SURVIVE) - to_chat(user, "Parts of [src] didn't survive the procedure due to lack of air supply!") + to_chat(user, SPAN_DANGER("Parts of [src] didn't survive the procedure due to lack of air supply!")) set_max_damage(Floor(max_damage - 0.25*damage)) heal_damage(damage) @@ -196,7 +197,7 @@ if(H.mind) H.mind.transfer_to(brainmob) - to_chat(brainmob, "You feel slightly disoriented. That's normal when you're just \a [initial(src.name)].") + to_chat(brainmob, SPAN_NOTICE("You feel slightly disoriented. That's normal when you're just \a [initial(src.name)].")) callHook("debrain", list(brainmob)) /obj/item/organ/internal/brain/proc/get_current_damage_threshold() @@ -207,7 +208,7 @@ /obj/item/organ/internal/brain/proc/handle_severe_brain_damage() set waitfor = FALSE - healed_threshold = 0 + healed_threshold = FALSE to_chat(owner, "Where am I...?") sleep(5 SECONDS) if(!owner) @@ -244,17 +245,17 @@ /obj/item/organ/internal/brain/proc/handle_damage_effects() if(owner.stat) return - if(damage > 0 && prob(1)) + if(damage > 5 && prob(1)) owner.custom_pain("Your head feels numb and painful.",10) if(is_bruised() && prob(1) && owner.eye_blurry <= 0) - to_chat(owner, "It becomes hard to see for some reason.") + to_chat(owner, SPAN_WARNING("It becomes hard to see for some reason.")) owner.eye_blurry = 5 - if(damage >= 0.5*max_damage && prob(1) && owner.get_active_hand()) - to_chat(owner, "Your hand won't respond properly, and you drop what you are holding!") + if(damage >= 0.5 * max_damage && prob(1) && owner.get_active_hand()) + to_chat(owner, SPAN_DANGER("Your hand won't respond properly, and you drop what you are holding!")) owner.unequip_item() - if(damage >= 0.6*max_damage) + if(damage >= 0.75 * max_damage) owner.slurring = max(owner.slurring, 2) if(is_broken()) if(!owner.lying) - to_chat(owner, "You black out!") + to_chat(owner, SPAN_DANGER("You black out!")) owner.Paralyse(10)