Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different parts of the brain can now cause different kinds of brain damage #37312

Open
wants to merge 22 commits into
base: Bleeding-Edge
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/datums/gamemode/factions/bloodcult/bloodcult_runes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ var/list/rune_appearances_cache = list()
to_chat(user, "<span class='danger'>You don't have the ability to perform rituals without voicing the incantations, there has to be some way...</span>")
return

if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss("intelligence")))
return fizzle(user)

add_hiddenprint(user)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/gamemode/factions/legacy_cult/ritual.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var/runedec = 0 // Rune cap ?
if(user.wear_mask?.is_muzzle)
to_chat(user, "You are unable to speak the words of the rune.")
return
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss()))
if(!word1 || !word2 || !word3 || prob(user.getBrainLoss("intelligence")))
return fizzle()
// if(!src.visibility)
// src.visibility=1
Expand Down
6 changes: 5 additions & 1 deletion code/game/machinery/adv_med.dm
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@
"disabilities" = H.sdisabilities,
"tg_diseases_list" = H.viruses,
"lung_ruptured" = H.is_lung_ruptured(),
"brain_issues" = H.format_brain_issues(),
"external_organs" = H.organs.Copy(),
"internal_organs" = H.internal_organs.Copy(),
"blood_type" = H.dna.b_type,
Expand Down Expand Up @@ -487,6 +488,7 @@
var/lung_ruptured = ""
var/e_cancer = ""
var/bone_strengthened = ""
var/brain_issues = ""

dat += "<tr>"

Expand All @@ -496,6 +498,8 @@
break
if(istype(e, /datum/organ/external/chest) && occ["lung_ruptured"])
lung_ruptured = "Lung ruptured:"
if(istype(e, /datum/organ/external/head))
brain_issues = occ["brain_issues"]
if(e.status & ORGAN_SPLINTED)
splint = "Splinted:"
if(e.status & ORGAN_BLEEDING)
Expand Down Expand Up @@ -553,7 +557,7 @@
if(e.status & ORGAN_DESTROYED)
dat += "<td>[e.display_name]</td><td>-</td><td>-</td><td><font color='red'>Not Found</font></td>"
else
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][e_cancer][internal_bleeding][lung_ruptured][bone_strengthened]</td>"
dat += "<td>[e.display_name]</td><td>[e.burn_dam]</td><td>[e.brute_dam]</td><td>[robot][bled][AN][splint][open][infected][imp][e_cancer][internal_bleeding][lung_ruptured][bone_strengthened][brain_issues]</td>"
dat += "</tr>"

var/list/organs_to_list = list(
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/airlock_electronics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= 60)
if(H.getBrainLoss("intelligence") >= 60)
return

interact(user)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var/list/all_doors = list()
/obj/machinery/door/proc/headbutt_check(mob/user, var/stun_time = 0, var/knockdown_time = 0, var/damage = 0) //This is going to be an airlock proc until someone makes headbutting a more official thing
if(prob(HEADBUTT_PROBABILITY) && density && ishuman(user))
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= BRAINLOSS_FOR_HEADBUTT)
if(H.getBrainLoss("coordination") >= BRAINLOSS_FOR_HEADBUTT)
playsound(src, 'sound/effects/bang.ogg', 25, 1)
H.visible_message("<span class='warning'>[user] headbutts the airlock.</span>")
if(!istype(H.head, /obj/item/clothing/head/helmet))
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,10 @@ Class Procs:
*/
if (ishuman(user) && !ignore_brain_damage)
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= 60)
if(H.getBrainLoss("intelligence") >= 60)
visible_message("<span class='warning'>[H] stares cluelessly at [src] and drools.</span>")
return 1
else if(prob(H.getBrainLoss()) || (H.undergoing_hypothermia() == MODERATE_HYPOTHERMIA && prob(25)))
else if(prob(H.getBrainLoss("intelligence")) || (H.undergoing_hypothermia() == MODERATE_HYPOTHERMIA && prob(25)))
to_chat(user, "<span class='warning'>You momentarily forget how to use [src].</span>")
return 1

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/crayons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var/global/list/all_graffitis = list(
var/list/graffitis = list("Random" = "graffiti") + all_graffitis
if(istype(user,/mob/living/carbon/human))
var/mob/living/carbon/human/M=user
if(M.getBrainLoss() >= 60)
if(M.getBrainLoss("intelligence") >= 60)
graffitis = list(
"Cancel"="cancel",
"Dick"="dick[rand(1,3)]",
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
add_fingerprint(user)
if(on && user.zone_sel.selecting == "eyes")

if((clumsy_check(user) || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly
if((clumsy_check(user) || user.getBrainLoss("intelligence") >= 60) && prob(50)) //too dumb to use flashlight properly
return ..() //just hit them in the head

if (!user.dexterity_check())
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/vehicles/vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
if(mykey && mykey != W)
to_chat(user, "<span class='warning'>\The [src] is paired to a different key.</span>")
return
if(((M_CLUMSY in user.mutations) || user.getBrainLoss() >= 60) && prob(50))
if(((M_CLUMSY in user.mutations) || user.getBrainLoss("coordination") >= 60) && prob(50))
to_chat(user, "<span class='warning'>You try to insert \the [W] to \the [src]'s ignition but you miss the slot!</span>")
return
if(user.drop_item(W, src))
Expand Down
4 changes: 2 additions & 2 deletions code/modules/assembly/mousetrap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
if(!armed)
to_chat(user, "<span class='notice'>You arm [src].</span>")
else
if(((user.getBrainLoss() >= 60 || clumsy_check(user)) && prob(50)))
if(((user.getBrainLoss("coordination") >= 60 || clumsy_check(user)) && prob(50)))

var/datum/organ/external/OE = user.get_active_hand_organ()

Expand All @@ -72,7 +72,7 @@

/obj/item/device/assembly/mousetrap/attack_hand(mob/living/user as mob)
if(armed)
if(((user.getBrainLoss() >= 60 || (M_CLUMSY in user.mutations))) && prob(50))
if(((user.getBrainLoss("coordination") >= 60 || (M_CLUMSY in user.mutations))) && prob(50))
var/datum/organ/external/OE = user.get_active_hand_organ()
triggered(user, OE.name)
user.visible_message("<span class='warning'>[user] accidentally sets off [src], breaking their fingers.</span>", \
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@
msg += "<span class='warning'><b>[src] has \a [implant] sticking out of [t_his] flesh!</span>\n"

if(!is_destroyed["head"])
if(getBrainLoss() >= 60)
if(getBrainLoss("intelligence") >= 60)
msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n"

if(distance <= 3)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,9 @@
decapitated = null

qdel(B)
else
for(var/damage in BBrain.specific_damages)
BBrain.specific_damages[damage] = 0

for(var/datum/organ/internal/I in internal_organs)
I.damage = 0
Expand Down Expand Up @@ -1768,7 +1771,7 @@ var/datum/record_organ //This is just a dummy proc, not storing any variables he
var/obj/item/clothing/gloves/G = gloves
if(!G.dexterity_check())//some gloves might make it harder to interact with complex technologies, or fit your index in a gun's trigger
return FALSE
if(getBrainLoss() >= 60)
if(getBrainLoss("intelligence") >= 60)
if(!(reagents.has_reagent(METHYLIN) || is_dexterous))//methylin and the is_dextrous var supercede brain damage, but not uncomfortable gloves
return FALSE
return TRUE//humans are dexterous enough by default
Expand Down
23 changes: 22 additions & 1 deletion code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ChangeToHusk()
return

/mob/living/carbon/human/getBrainLoss()
/mob/living/carbon/human/getBrainLoss(var/type)
var/res = brainloss
if(species && species.has_organ["brain"])
var/datum/organ/internal/brain/sponge = internal_organs_by_name["brain"]
Expand All @@ -30,10 +30,23 @@
if (sponge.is_broken())
res += 50

if(type && (type in sponge.specific_damages))
res += sponge.specific_damages[type]
res = min(res,maxHealth*2)
return res
return 0

/mob/living/carbon/human/proc/format_brain_issues()
var/datum/organ/internal/brain/B = internal_organs_by_name["brain"]
if(B)
var/list/issues = list()
for(var/damage in B.specific_damages)
if(B.specific_damages[damage] > 0)
issues += get_key_by_element(partstobraindamagetype,damage)
if(issues.len)
return "Brain cut on [english_list(issues)]"
return ""

//These procs fetch a cumulative total damage from all organs
/mob/living/carbon/human/getBruteLoss(var/ignore_inorganic = FALSE)
var/amount = 0
Expand Down Expand Up @@ -130,6 +143,14 @@
return
..()

// the following heals the compartmentalised stuff in surgery
/*/mob/living/carbon/human/adjustBrainLoss(var/amount)
if(..() && amount < 0 && species && species.has_organ["brain"])
var/datum/organ/internal/brain/sponge = internal_organs_by_name["brain"]
if(sponge)
for(var/damage in sponge.specific_damages)
sponge.specific_damages[damage] = max(sponge.specific_damages[damage] + (amount * brain_damage_modifier), 0)*/

/mob/living/carbon/human/adjustCloneLoss(var/amount)
..()

Expand Down
140 changes: 76 additions & 64 deletions code/modules/mob/living/carbon/human/life/handle_disabilities.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,70 +67,82 @@
if(prob(10))
Jitter(10)

if(getBrainLoss() >= 60 && prob(3))
say(pick("IM A PONY NEEEEEEIIIIIIIIIGH", \
"without oxigen blob don't evoluate?", \
"CAPTAINS A COMDOM", \
"[pick("", "that traitor")] [pick("joerge", "george", "gorge", "gdoruge")] [pick("mellens", "melons", "mwrlins")] is grifing me HAL;P!!!", \
"can u give me [pick("telikesis","halk","eppilapse")]?", \
"THe saiyans screwed", \
"Bi is THE BEST OF BOTH WORLDS>", \
"I WANNA PET TEH monkeyS", \
"stop grifing me!!!!", \
"SOTP IT#", \
"based and redpilled",\
"ho now talking like a milenian piece of shit is too unralistic in the fucking",\
"FUS RO DAH", \
"fucking 4rries!", \
"stat me", \
">my face", \
"roll it easy!", \
"waaaaaagh!!!", \
"red wonz go fasta", \
"FOR TEH EMPRAH", \
"lol2cat", \
"dem dwarfs man, dem dwarfs", \
"SPESS MAHREENS", \
"hwee did eet fhor khayosss", \
"lifelike texture ;_;", \
"luv can bloooom", \
"PACKETS!!!", \
"SARAH HALE DID IT!!!", \
"Don't tell Chase", \
"WOAH MAMA", \
"not so tough now huh", \
"WERE NOT BAY!!", \
"IF YOU DONT LIKE THE CYBORGS OR SLIMES WHY DONT YU O JUST MAKE YORE OWN!", \
"DONT TALK TO ME ABOUT BALANCE!!!!", \
"YOU AR JUS LAZY AND DUMB JAMITORS AND SERVICE ROLLS", \
"BLAME HOSHI!!!", \
"ARRPEE IZ DED!!!", \
"THERE ALL JUS MEATAFRIENDS!", \
"SOTP MESING WITH THE ROUNS SHITMAN!!!", \
"SKELINGTON IS 4 SHITERS!", \
"MOMMSI R THE WURST SCUM!!", \
"How do we engiener=", \
"try to live freely and automatically good bye", \
"why woud i take a pin pointner??", \
"FUCK IT; KISSYOUR ASSES GOOD BYE DEAD MEN! I AM SELFDESTRUCKTING THE STATION!!!!", \
"How do I set up the. SHow do I set u p the Singu. how I the scrungularity????", \
"OMG I SED LAW 2 U FAG MOMIM LAW 2!!!", \
"I AM BASTE", \
"TEH TRAITOR THEY KILL PEEPLE BUT I RESPAWN!!!", \
"whats a keeper"))
else if(getBrainLoss() >= 60 && prob(3))
if(getBrainLoss("speech") >= 60 && prob(3))
say_gibberish()
else if(getBrainLoss("intelligence") >= 60 && prob(3))
emote("drool")
if(getBrainLoss() > 50 && prob(1.5))
if(canmove)
to_chat(src, "<span class='warning'>Your legs won't respond properly, you fall down.</span>")
Knockdown(3)
else if(getBrainLoss() > 35 && prob(1.5))
if(get_active_hand())
to_chat(src, "<span class='warning'>Your hand won't respond properly, you drop what you're holding.</span>")
drop_item()
else if(getBrainLoss() > 15 && prob(1.5))
if(eye_blurry <= 0)
to_chat(src, "<span class='warning'>It becomes hard to see for some reason.</span>")
eye_blurry = 10
if(getBrainLoss("motor") > 50 && prob(1.5))
legfail()
else if(getBrainLoss("motor") > 35 && prob(1.5))
handfail()
else if(getBrainLoss("sight") > 15 && prob(1.5))
brain_eyeblur()
else if(getBrainLoss() > 0 && prob(2))
custom_pain("Your head feels numb and painful.")

/mob/living/carbon/human/proc/legfail()
if(canmove)
to_chat(src, "<span class='warning'>Your legs won't respond properly, you fall down.</span>")
Knockdown(3)

/mob/living/carbon/human/proc/handfail()
if(get_active_hand())
to_chat(src, "<span class='warning'>Your hand won't respond properly, you drop what you're holding.</span>")
drop_item()

/mob/living/carbon/human/proc/brain_eyeblur()
if(eye_blurry <= 0)
to_chat(src, "<span class='warning'>It becomes hard to see for some reason.</span>")
eye_blurry = 10

/mob/living/carbon/human/proc/say_gibberish()
say(pick("IM A PONY NEEEEEEIIIIIIIIIGH", \
"without oxigen blob don't evoluate?", \
"CAPTAINS A COMDOM", \
"[pick("", "that traitor")] [pick("joerge", "george", "gorge", "gdoruge")] [pick("mellens", "melons", "mwrlins")] is grifing me HAL;P!!!", \
"can u give me [pick("telikesis","halk","eppilapse")]?", \
"THe saiyans screwed", \
"Bi is THE BEST OF BOTH WORLDS>", \
"I WANNA PET TEH monkeyS", \
"stop grifing me!!!!", \
"SOTP IT#", \
"based and redpilled",\
"ho now talking like a milenian piece of shit is too unralistic in the fucking",\
"FUS RO DAH", \
"fucking 4rries!", \
"stat me", \
">my face", \
"roll it easy!", \
"waaaaaagh!!!", \
"red wonz go fasta", \
"FOR TEH EMPRAH", \
"lol2cat", \
"dem dwarfs man, dem dwarfs", \
"SPESS MAHREENS", \
"hwee did eet fhor khayosss", \
"lifelike texture ;_;", \
"luv can bloooom", \
"PACKETS!!!", \
"SARAH HALE DID IT!!!", \
"Don't tell Chase", \
"WOAH MAMA", \
"not so tough now huh", \
"WERE NOT BAY!!", \
"IF YOU DONT LIKE THE CYBORGS OR SLIMES WHY DONT YU O JUST MAKE YORE OWN!", \
"DONT TALK TO ME ABOUT BALANCE!!!!", \
"YOU AR JUS LAZY AND DUMB JAMITORS AND SERVICE ROLLS", \
"BLAME HOSHI!!!", \
"ARRPEE IZ DED!!!", \
"THERE ALL JUS MEATAFRIENDS!", \
"SOTP MESING WITH THE ROUNS SHITMAN!!!", \
"SKELINGTON IS 4 SHITERS!", \
"MOMMSI R THE WURST SCUM!!", \
"How do we engiener=", \
"try to live freely and automatically good bye", \
"why woud i take a pin pointner??", \
"FUCK IT; KISSYOUR ASSES GOOD BYE DEAD MEN! I AM SELFDESTRUCKTING THE STATION!!!!", \
"How do I set up the. SHow do I set u p the Singu. how I the scrungularity????", \
"OMG I SED LAW 2 U FAG MOMIM LAW 2!!!", \
"I AM BASTE", \
"TEH TRAITOR THEY KILL PEEPLE BUT I RESPAWN!!!", \
"whats a keeper"))
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
return "stammers, [text]";
if(isliving(src))
var/mob/living/L = src
if (L.getBrainLoss() >= 60)
if (L.getBrainLoss("speech") >= 60)
return "gibbers, [text]";
var/ending = copytext(text, length(text))
if (ending == "?")
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
return 0 //godmode
cloneloss = amount

/mob/living/proc/getBrainLoss()
/mob/living/proc/getBrainLoss(var/type)
return brainloss

/mob/living/proc/adjustBrainLoss(var/amount)
Expand All @@ -338,6 +338,7 @@
return 0

brainloss = min(max(brainloss + (amount * brain_damage_modifier), 0),(maxHealth*2))
return 1

/mob/living/proc/setBrainLoss(var/amount)
if(status_flags & GODMODE)
Expand Down
Loading
Loading