diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm index d3dd3fabe3..5297fb9835 100644 --- a/code/__DEFINES/DNA.dm +++ b/code/__DEFINES/DNA.dm @@ -24,7 +24,7 @@ #define MUT_MUTE "Mute" #define SMILE "Smile" #define STONER "Stoner" -#define UNINTELLIGABLE "Unintelligable" +#define UNINTELLIGIBLE "Unintelligible" #define SWEDISH "Swedish" #define CHAV "Chav" #define ELVIS "Elvis" @@ -69,6 +69,7 @@ #define DNA_GENDER_BLOCK 5 #define DNA_FACIAL_HAIR_STYLE_BLOCK 6 #define DNA_HAIR_STYLE_BLOCK 7 +<<<<<<< HEAD #define DNA_EYE_COLOR_TWO_BLOCK 8 #define DNA_EYE_COLOR_SWITCH_BLOCK 9 #define DNA_EYE_COLOR_BLOCK 10 @@ -83,6 +84,10 @@ #define DNA_MUTANTWING_BLOCK 18 #define DNA_WINGCOLOR_BLOCK 19 #define DNA_STRUC_ENZYMES_BLOCKS 19 +======= + +#define DNA_STRUC_ENZYMES_BLOCKS 18 +>>>>>>> 550d711... Brain Traumas (#31727) #define DNA_UNIQUE_ENZYMES_LEN 32 //Transformation proc stuff diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index f5cb701290..fdc63d1df6 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -491,6 +491,9 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE #define RIDING_OFFSET_ALL "ALL" +//text files +#define BRAIN_DAMAGE_FILE "brain_damage_lines.json" + //Fullscreen overlay resolution in tiles. #define FULLSCREEN_OVERLAY_RESOLUTION_X 15 #define FULLSCREEN_OVERLAY_RESOLUTION_Y 15 diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 69596e7a0f..49e3c996fe 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -51,6 +51,17 @@ #define DEVIL_BODYPART "devil" /*see __DEFINES/inventory.dm for bodypart bitflag defines*/ +//Brain Damage defines +#define BRAIN_DAMAGE_MILD 50 +#define BRAIN_DAMAGE_SEVERE 120 +#define BRAIN_DAMAGE_DEATH 200 + +#define BRAIN_TRAUMA_MILD /datum/brain_trauma/mild +#define BRAIN_TRAUMA_SEVERE /datum/brain_trauma/severe +#define BRAIN_TRAUMA_SPECIAL /datum/brain_trauma/special + +#define BRAIN_DAMAGE_INTEGRITY_MULTIPLIER 0.5 + //Health hud screws for carbon mobs #define SCREWYHUD_NONE 0 #define SCREWYHUD_CRIT 1 diff --git a/code/__DEFINES/stat.dm b/code/__DEFINES/stat.dm index 5dbe99a9c5..df295f6e12 100644 --- a/code/__DEFINES/stat.dm +++ b/code/__DEFINES/stat.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /* Used with the various stat variables (mob, machines) */ @@ -29,3 +30,38 @@ #define POWER_REQ_NONE 0 #define POWER_REQ_ALL 1 #define POWER_REQ_CLOCKCULT 2 +======= +/* + Used with the various stat variables (mob, machines) +*/ + +//mob/var/stat things +#define CONSCIOUS 0 +#define SOFT_CRIT 1 +#define UNCONSCIOUS 2 +#define DEAD 3 + +//mob disabilities stat + +#define BLIND 1 +#define MUTE 2 +#define DEAF 4 +#define NEARSIGHT 8 +#define FAT 32 +#define HUSK 64 +#define NOCLONE 128 +#define CLUMSY 256 +#define DUMB 512 +#define MONKEYLIKE 1024 //sets IsAdvancedToolUser to FALSE + +// bitflags for machine stat variable +#define BROKEN 1 +#define NOPOWER 2 +#define MAINT 4 // under maintaince +#define EMPED 8 // temporary broken by EMP pulse + +//ai power requirement defines +#define POWER_REQ_NONE 0 +#define POWER_REQ_ALL 1 +#define POWER_REQ_CLOCKCULT 2 +>>>>>>> 550d711... Brain Traumas (#31727) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index 56cd1d8e4c..859c957a43 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -135,6 +135,6 @@ var/attack_message = "[src] has been [message_verb][message_hit_area] with [I]." if(user in viewers(src, null)) attack_message = "[user] has [message_verb] [src][message_hit_area] with [I]!" - visible_message("[attack_message]", \ + visible_message("[attack_message]",\ "[attack_message]", null, COMBAT_MESSAGE_RANGE) - return 1 \ No newline at end of file + return 1 diff --git a/code/controllers/subsystem/traumas.dm b/code/controllers/subsystem/traumas.dm new file mode 100644 index 0000000000..14f15a4b89 --- /dev/null +++ b/code/controllers/subsystem/traumas.dm @@ -0,0 +1,52 @@ +SUBSYSTEM_DEF(traumas) + name = "Traumas" + flags = SS_NO_FIRE + var/list/phobia_types + var/list/phobia_words + var/list/phobia_mobs + var/list/phobia_objs + var/list/phobia_turfs + var/list/phobia_species + +#define PHOBIA_FILE "phobia.json" + +/datum/controller/subsystem/traumas/Initialize() + phobia_types = list("spiders", "space", "security", "clowns", "greytide", "lizards", "skeletons") + + phobia_words = list("spiders" = strings(PHOBIA_FILE, "spiders"), + "space" = strings(PHOBIA_FILE, "space"), + "security" = strings(PHOBIA_FILE, "security"), + "clowns" = strings(PHOBIA_FILE, "clowns"), + "greytide" = strings(PHOBIA_FILE, "greytide"), + "lizards" = strings(PHOBIA_FILE, "lizards"), + "skeletons" = strings(PHOBIA_FILE, "skeletons"), + ) + + phobia_mobs = list("spiders" = typecacheof(list(/mob/living/simple_animal/hostile/poison/giant_spider)), + "security" = typecacheof(list(/mob/living/simple_animal/bot/secbot)), + "lizards" = typecacheof(list(/mob/living/simple_animal/hostile/lizard)) + ) + + phobia_objs = list("spiders" = typecacheof(list(/obj/structure/spider)), + "security" = typecacheof(list(/obj/item/clothing/under/rank/security, /obj/item/clothing/under/rank/warden, + /obj/item/clothing/under/rank/head_of_security, /obj/item/clothing/under/rank/det, + /obj/item/melee/baton, /obj/item/gun/energy/taser, /obj/item/restraints/handcuffs, + /obj/machinery/door/airlock/security)), + "clowns" = typecacheof(list(/obj/item/clothing/under/rank/clown, /obj/item/clothing/shoes/clown_shoes, + /obj/item/clothing/mask/gas/clown_hat, /obj/item/device/instrument/bikehorn, + /obj/item/device/pda/clown, /obj/item/grown/bananapeel)), + "greytide" = typecacheof(list(/obj/item/clothing/under/color/grey, /obj/item/melee/baton/cattleprod, + /obj/item/twohanded/spear, /obj/item/clothing/mask/gas)), + "lizards" = typecacheof(list(/obj/item/toy/plush/lizardplushie, /obj/item/reagent_containers/food/snacks/kebab/tail, + /obj/item/organ/tail/lizard, /obj/item/reagent_containers/food/drinks/bottle/lizardwine)), + "skeletons" = typecacheof(list(/obj/item/organ/tongue/bone, /obj/item/clothing/suit/armor/bone, /obj/item/stack/sheet/bone, + /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/skeleton, + /obj/effect/decal/remains/human)) + ) + phobia_turfs = list("space" = typecacheof(list(/turf/open/space, /turf/open/floor/holofloor/space, /turf/open/floor/fakespace))) + + phobia_species = list("lizards" = typecacheof(list(/datum/species/lizard)), + "skeletons" = typecacheof(list(/datum/species/skeleton, /datum/species/plasmaman)) + ) + +#undef PHOBIA_FILE diff --git a/code/datums/brain_damage/brain_trauma.dm b/code/datums/brain_damage/brain_trauma.dm new file mode 100644 index 0000000000..53b0fbe056 --- /dev/null +++ b/code/datums/brain_damage/brain_trauma.dm @@ -0,0 +1,49 @@ +//Brain Traumas are the new actual brain damage. Brain damage itself acts as a way to acquire traumas: every time brain damage is dealt, there's a chance of receiving a trauma. +//This chance gets higher the higher the mob's brainloss is. Removing traumas is a separate thing from removing brain damage: you can get restored to full brain operativity, +//but keep the quirks, until repaired by mannitol (for mild/special ones) or brain surgery (for severe ones). +/datum/brain_trauma + var/name = "Brain Trauma" + var/desc = "A trauma caused by brain damage, which causes issues to the patient." + var/scan_desc = "a generic brain trauma" //description when detected by a health scanner + var/mob/living/carbon/owner //the poor bastard + var/obj/item/organ/brain/brain //the poor bastard's brain + var/gain_text = "You feel traumatized." + var/lose_text = "You no longer feel traumatized." + var/can_gain = TRUE //can this be gained through random traumas? + var/permanent = FALSE //can this be cured? + +/datum/brain_trauma/New(obj/item/organ/brain/B, _permanent) + brain = B + owner = B.owner + permanent = _permanent + if(owner) + on_gain() + +/datum/brain_trauma/Destroy() + brain.traumas -= src + if(owner) + on_lose() + brain = null + owner = null + return ..() + +//Called on life ticks +/datum/brain_trauma/proc/on_life() + return + +//Called when given to a mob +/datum/brain_trauma/proc/on_gain() + to_chat(owner, gain_text) + +//Called when removed from a mob +/datum/brain_trauma/proc/on_lose(silent) + if(!silent) + to_chat(owner, lose_text) + +//Called when hearing a spoken message +/datum/brain_trauma/proc/on_hear(message, speaker, message_language, raw_message, radio_freq) + return message + +//Called when speaking +/datum/brain_trauma/proc/on_say(message) + return message diff --git a/code/datums/brain_damage/mild.dm b/code/datums/brain_damage/mild.dm new file mode 100644 index 0000000000..6bfa149aa7 --- /dev/null +++ b/code/datums/brain_damage/mild.dm @@ -0,0 +1,135 @@ +//Mild traumas are the most common; they are generally minor annoyances. +//They can be cured with mannitol and patience, although brain surgery still works. +//Most of the old brain damage effects have been transferred to the dumbness trauma. + +/datum/brain_trauma/mild + +/datum/brain_trauma/mild/hallucinations + name = "Hallucinations" + desc = "Patient suffers constant hallucinations." + scan_desc = "schizophrenia" + gain_text = "You feel your grip on reality slipping..." + lose_text = "You feel more grounded." + +/datum/brain_trauma/mild/hallucinations/on_life() + owner.hallucination = min(owner.hallucination + 10, 50) + ..() + +/datum/brain_trauma/mild/hallucinations/on_lose() + owner.hallucination = 0 + ..() + +/datum/brain_trauma/mild/stuttering + name = "Stuttering" + desc = "Patient can't speak properly." + scan_desc = "reduced mouth coordination" + gain_text = "Speaking clearly is getting harder." + lose_text = "You feel in control of your speech." + +/datum/brain_trauma/mild/stuttering/on_life() + owner.stuttering = min(owner.stuttering + 5, 25) + ..() + +/datum/brain_trauma/mild/stuttering/on_lose() + owner.stuttering = 0 + ..() + +/datum/brain_trauma/mild/dumbness + name = "Dumbness" + desc = "Patient has reduced brain activity, making them less intelligent." + scan_desc = "reduced brain activity" + gain_text = "You feel dumber." + lose_text = "You feel smart again." + +/datum/brain_trauma/mild/dumbness/on_gain() + owner.disabilities |= DUMB + ..() + +/datum/brain_trauma/mild/dumbness/on_life() + owner.derpspeech = min(owner.derpspeech + 5, 25) + if(prob(3)) + owner.emote("drool") + else if(owner.stat == CONSCIOUS && prob(3)) + owner.say(pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage")) + ..() + +/datum/brain_trauma/mild/dumbness/on_lose() + owner.disabilities &= ~DUMB + owner.derpspeech = 0 + ..() + +/datum/brain_trauma/mild/speech_impediment + name = "Speech Impediment" + desc = "Patient is unable to form coherent sentences." + scan_desc = "communication disorder" + gain_text = "" //mutation will handle the text + lose_text = "" + +/datum/brain_trauma/mild/speech_impediment/on_gain() + owner.dna.add_mutation(UNINTELLIGIBLE) + ..() + +//no fiddling with genetics to get out of this one +/datum/brain_trauma/mild/speech_impediment/on_life() + if(!(GLOB.mutations_list[UNINTELLIGIBLE] in owner.dna.mutations)) + on_gain() + ..() + +/datum/brain_trauma/mild/speech_impediment/on_lose() + owner.dna.remove_mutation(UNINTELLIGIBLE) + ..() + +/datum/brain_trauma/mild/concussion + name = "Concussion" + desc = "Patient's brain is concussed." + scan_desc = "a concussion" + gain_text = "Your head hurts!" + lose_text = "The pressure inside your head starts fading." + +/datum/brain_trauma/mild/concussion/on_life() + if(prob(5)) + switch(rand(1,11)) + if(1) + owner.vomit() + if(2,3) + owner.dizziness += 10 + if(4,5) + owner.confused += 10 + owner.blur_eyes(10) + if(6 to 9) + owner.slurring += 30 + if(10) + to_chat(owner, "You forget for a moment what you were doing.") + owner.Stun(20) + if(11) + to_chat(owner, "You faint.") + owner.Unconscious(80) + + ..() + +/datum/brain_trauma/mild/muscle_weakness + name = "Muscle Weakness" + desc = "Patient experiences occasional bouts of muscle weakness." + scan_desc = "weak motor nerve signal" + gain_text = "Your muscles feel oddly faint." + lose_text = "You feel in control of your muscles again." + +/datum/brain_trauma/mild/muscle_weakness/on_life() + var/fall_chance = 1 + if(owner.m_intent == MOVE_INTENT_RUN) + fall_chance += 2 + if(prob(fall_chance) && !owner.lying && !owner.buckled) + to_chat(owner, "Your leg gives out!") + owner.Knockdown(35) + + else if(owner.get_active_held_item()) + var/drop_chance = 1 + var/obj/item/I = owner.get_active_held_item() + drop_chance += I.w_class + if(prob(drop_chance) && owner.dropItemToGround(I)) + to_chat(owner, "You drop [I]!") + + else if(prob(3)) + to_chat(owner, "You feel a sudden weakness in your muscles!") + owner.adjustStaminaLoss(50) + ..() diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm new file mode 100644 index 0000000000..313b693436 --- /dev/null +++ b/code/datums/brain_damage/phobia.dm @@ -0,0 +1,115 @@ +/datum/brain_trauma/mild/phobia + name = "Phobia" + desc = "Patient is unreasonably afraid of something." + scan_desc = "phobia" + gain_text = "" + lose_text = "" + var/phobia_type + var/next_check = 0 + var/next_scare = 0 + var/list/trigger_words + //instead of cycling every atom, only cycle the relevant types + var/list/trigger_mobs + var/list/trigger_objs //also checked in mob equipment + var/list/trigger_turfs + var/list/trigger_species + +/datum/brain_trauma/mild/phobia/New(mob/living/carbon/C, _permanent, specific_type) + phobia_type = specific_type + if(!phobia_type) + phobia_type = pick(SStraumas.phobia_types) + + gain_text = "You start finding [phobia_type] very unnerving..." + lose_text = "You no longer feel afraid of [phobia_type]." + scan_desc += " of [phobia_type]" + trigger_words = SStraumas.phobia_words[phobia_type] + trigger_mobs = SStraumas.phobia_mobs[phobia_type] + trigger_objs = SStraumas.phobia_objs[phobia_type] + trigger_turfs = SStraumas.phobia_turfs[phobia_type] + trigger_species = SStraumas.phobia_species[phobia_type] + ..() + +/datum/brain_trauma/mild/phobia/on_life() + ..() + if(owner.eye_blind) + return + if(world.time > next_check && world.time > next_scare) + next_check = world.time + 50 + var/list/seen_atoms = view(7, owner) + + if(LAZYLEN(trigger_objs)) + for(var/obj/O in seen_atoms) + if(is_type_in_typecache(O, trigger_objs)) + freak_out(O) + return + + if(LAZYLEN(trigger_turfs)) + for(var/turf/T in seen_atoms) + if(is_type_in_typecache(T, trigger_turfs)) + freak_out(T) + return + + if(LAZYLEN(trigger_mobs) || LAZYLEN(trigger_objs)) + for(var/mob/M in seen_atoms) + if(is_type_in_typecache(M, trigger_mobs)) + freak_out(M) + return + + else if(ishuman(M)) //check their equipment for trigger items + var/mob/living/carbon/human/H = M + + if(LAZYLEN(trigger_species) && H.dna && H.dna.species && is_type_in_typecache(H.dna.species, trigger_species)) + freak_out(H) + + for(var/X in H.get_all_slots() | H.held_items) + var/obj/I = X + if(!QDELETED(I) && is_type_in_typecache(I, trigger_objs)) + freak_out(I) + return + +/datum/brain_trauma/mild/phobia/on_hear(message, speaker, message_language, raw_message, radio_freq) + if(owner.disabilities & DEAF || world.time < next_scare) //words can't trigger you if you can't hear them *taps head* + return message + for(var/word in trigger_words) + if(findtext(message, word)) + addtimer(CALLBACK(src, .proc/freak_out, null, word), 10) //to react AFTER the chat message + break + return message + +/datum/brain_trauma/mild/phobia/on_say(message) + for(var/word in trigger_words) + if(findtext(message, word)) + to_chat(owner, "You can't bring yourself to say the word \"[word]\"!") + return "" + return message + +/datum/brain_trauma/mild/phobia/proc/freak_out(atom/reason, trigger_word) + next_scare = world.time + 120 + var/message = pick("spooks you to the bone", "shakes you up", "terrifies you", "sends you into a panic", "sends chills down your spine") + if(reason) + to_chat(owner, "Seeing [reason] [message]!") + else if(trigger_word) + to_chat(owner, "Hearing \"[trigger_word]\" [message]!") + else + to_chat(owner, "Something [message]!") + var/reaction = rand(1,4) + switch(reaction) + if(1) + to_chat(owner, "You are paralyzed with fear!") + owner.Stun(70) + owner.Jitter(8) + if(2) + owner.emote("scream") + owner.Jitter(5) + owner.say("AAAAH!!") + if(reason) + owner.pointed(reason) + if(3) + to_chat(owner, "You shut your eyes in terror!") + owner.Jitter(5) + owner.blind_eyes(10) + if(4) + owner.dizziness += 10 + owner.confused += 10 + owner.Jitter(10) + owner.stuttering += 10 \ No newline at end of file diff --git a/code/datums/brain_damage/severe.dm b/code/datums/brain_damage/severe.dm new file mode 100644 index 0000000000..505112bdcf --- /dev/null +++ b/code/datums/brain_damage/severe.dm @@ -0,0 +1,179 @@ +//Severe traumas, when your brain gets abused way too much. +//These range from very annoying to completely debilitating. +//They cannot be cured with chemicals, and require brain surgery to solve. + +/datum/brain_trauma/severe + +/datum/brain_trauma/severe/mute + name = "Mutism" + desc = "Patient is completely unable to speak." + scan_desc = "extensive damage to the brain's language center" + gain_text = "You forget how to speak!" + lose_text = "You suddenly remember how to speak." + +/datum/brain_trauma/severe/mute/on_gain() + owner.disabilities |= MUTE + ..() + +//no fiddling with genetics to get out of this one +/datum/brain_trauma/severe/mute/on_life() + if(!(owner.disabilities & MUTE)) + on_gain() + ..() + +/datum/brain_trauma/severe/mute/on_lose() + owner.disabilities &= ~MUTE + ..() + +/datum/brain_trauma/severe/blindness + name = "Cerebral Blindness" + desc = "Patient's brain is no longer connected to its eyes." + scan_desc = "extensive damage to the brain's frontal lobe" + gain_text = "You can't see!" + lose_text = "Your vision returns." + +/datum/brain_trauma/severe/blindness/on_gain() + owner.become_blind() + ..() + +//no fiddling with genetics to get out of this one +/datum/brain_trauma/severe/blindness/on_life() + if(!(owner.disabilities & BLIND)) + on_gain() + ..() + +/datum/brain_trauma/severe/blindness/on_lose() + owner.cure_blind() + ..() + +/datum/brain_trauma/severe/paralysis + name = "Paralysis" + desc = "Patient's brain can no longer control its motor functions." + scan_desc = "cerebral paralysis" + gain_text = "You can't feel your body anymore!" + lose_text = "You can feel your limbs again!" + +/datum/brain_trauma/severe/paralysis/on_life() + owner.Knockdown(200, ignore_canknockdown = TRUE) + ..() + +/datum/brain_trauma/severe/paralysis/on_lose() + owner.SetKnockdown(0) + ..() + +/datum/brain_trauma/severe/narcolepsy + name = "Narcolepsy" + desc = "Patient may involuntarily fall asleep during normal activities." + scan_desc = "traumatic narcolepsy" + gain_text = "You have a constant feeling of drowsiness..." + lose_text = "You feel awake and aware again." + +/datum/brain_trauma/severe/narcolepsy/on_life() + ..() + if(owner.IsSleeping()) + return + var/sleep_chance = 1 + if(owner.m_intent == MOVE_INTENT_RUN) + sleep_chance += 2 + if(owner.drowsyness) + sleep_chance += 3 + if(prob(sleep_chance)) + to_chat(owner, "You fall asleep.") + owner.Sleeping(60) + else if(!owner.drowsyness && prob(sleep_chance * 2)) + to_chat(owner, "You feel tired...") + owner.drowsyness += 10 + +/datum/brain_trauma/severe/monophobia + name = "Monophobia" + desc = "Patient feels sick and distressed when not around other people, leading to potentially lethal levels of stress." + scan_desc = "severe monophobia" + gain_text = "" + lose_text = "You feel like you could be safe on your own." + var/stress = 0 + +/datum/brain_trauma/severe/monophobia/on_gain() + ..() + if(check_alone()) + to_chat(owner, "You feel really lonely...") + else + to_chat(owner, "You feel safe, as long as you have people around you.") + +/datum/brain_trauma/severe/monophobia/on_life() + ..() + if(check_alone()) + stress = min(stress + 0.5, 100) + if(stress > 10 && (prob(5))) + stress_reaction() + else + stress -= 4 + +/datum/brain_trauma/severe/monophobia/proc/check_alone() + if(owner.disabilities & BLIND) + return TRUE + for(var/mob/M in oview(owner, 7)) + if(!isliving(M)) //ghosts ain't people + continue + if((istype(M, /mob/living/simple_animal/pet)) || M.ckey) + return FALSE + return TRUE + +/datum/brain_trauma/severe/monophobia/proc/stress_reaction() + if(owner.stat != CONSCIOUS) + return + + var/high_stress = (stress > 60) //things get psychosomatic from here on + switch(rand(1,6)) + if(1) + if(!high_stress) + to_chat(owner, "You feel sick...") + else + to_chat(owner, "You feel really sick at the thought of being alone!") + addtimer(CALLBACK(owner, /mob/living/carbon.proc/vomit, high_stress), 50) //blood vomit if high stress + if(2) + if(!high_stress) + to_chat(owner, "You can't stop shaking...") + owner.dizziness += 20 + owner.confused += 20 + owner.Jitter(20) + else + to_chat(owner, "You feel weak and scared! If only you weren't alone...") + owner.dizziness += 20 + owner.confused += 20 + owner.Jitter(20) + owner.adjustStaminaLoss(50) + + if(3, 4) + if(!high_stress) + to_chat(owner, "You feel really lonely...") + else + to_chat(owner, "You're going mad with loneliness!") + owner.hallucination += 20 + + if(5) + if(!high_stress) + to_chat(owner, "Your heart skips a beat.") + owner.adjustOxyLoss(8) + else + if(prob(15) && ishuman(owner)) + var/mob/living/carbon/human/H = owner + H.set_heartattack(TRUE) + to_chat(H, "You feel a stabbing pain in your heart!") + else + to_chat(owner, "You feel your heart lurching in your chest...") + owner.adjustOxyLoss(8) + +/datum/brain_trauma/severe/discoordination + name = "Discoordination" + desc = "Patient is unable to use complex tools or machinery." + scan_desc = "extreme discoordination" + gain_text = "You can barely control your hands!" + lose_text = "You feel in control of your hands again." + +/datum/brain_trauma/severe/discoordination/on_gain() + owner.disabilities |= MONKEYLIKE + ..() + +/datum/brain_trauma/severe/discoordination/on_lose() + owner.disabilities &= ~MONKEYLIKE + ..() diff --git a/code/datums/brain_damage/special.dm b/code/datums/brain_damage/special.dm new file mode 100644 index 0000000000..fd7aa1445d --- /dev/null +++ b/code/datums/brain_damage/special.dm @@ -0,0 +1,114 @@ +//Brain traumas that are rare and/or somewhat beneficial; +//they are the easiest to cure, which means that if you want +//to keep them, you can't cure your other traumas +/datum/brain_trauma/special + +/datum/brain_trauma/special/godwoken + name = "Godwoken Syndrome" + desc = "Patient occasionally and uncontrollably channels an eldritch god when speaking." + scan_desc = "god delusion" + gain_text = "You feel a higher power inside your mind..." + lose_text = "The divine presence leaves your head, no longer interested." + var/next_speech = 0 + +/datum/brain_trauma/special/godwoken/on_say(message) + if(world.time > next_speech && prob(10)) + playsound(get_turf(owner), 'sound/magic/clockwork/invoke_general.ogg', 300, 1, 5) + var/cooldown = voice_of_god(message, owner, list("colossus","yell"), 2) + cooldown *= 0.33 + next_speech = world.time + cooldown + return "" + else + return message + +/datum/brain_trauma/special/bluespace_prophet + name = "Bluespace Prophecy" + desc = "Patient can sense the bob and weave of bluespace around them, showing them passageways no one else can see." + scan_desc = "bluespace attunement" + gain_text = "You feel the bluespace pulsing around you..." + lose_text = "The faint pulsing of bluespace fades into silence." + var/next_portal = 0 + +/datum/brain_trauma/special/bluespace_prophet/on_life() + if(world.time > next_portal) + next_portal = world.time + 100 + var/list/turf/possible_turfs = list() + for(var/turf/T in range(owner, 8)) + if(!T.density) + var/clear = TRUE + for(var/obj/O in T) + if(O.density) + clear = FALSE + break + if(clear) + possible_turfs += T + + if(!LAZYLEN(possible_turfs)) + return + + var/turf/first_turf = pick(possible_turfs) + if(!first_turf) + return + + possible_turfs -= (possible_turfs & range(first_turf, 3)) + + var/turf/second_turf = pick(possible_turfs) + if(!second_turf) + return + + var/obj/effect/hallucination/simple/bluespace_stream/first = new(first_turf, owner) + var/obj/effect/hallucination/simple/bluespace_stream/second = new(second_turf, owner) + + first.linked_to = second + second.linked_to = first + first.seer = owner + second.seer = owner + +/obj/effect/hallucination/simple/bluespace_stream + name = "bluespace stream" + desc = "You see a hidden pathway through bluespace..." + image_icon = 'icons/effects/effects.dmi' + image_state = "bluestream" + image_layer = ABOVE_MOB_LAYER + var/obj/effect/hallucination/simple/bluespace_stream/linked_to + var/mob/living/carbon/seer + +/obj/effect/hallucination/simple/bluespace_stream/Initialize() + . = ..() + QDEL_IN(src, 300) + +/obj/effect/hallucination/simple/bluespace_stream/attack_hand(mob/user) + if(user != seer || !linked_to) + return + var/slip_in_message = pick("slides sideways in an odd way, and disappears", "jumps into an unseen dimension",\ + "sticks one leg straight out, wiggles [user.p_their()] foot, and is suddenly gone", "stops, then blinks out of reality", \ + "is pulled into an invisible vortex, vanishing from sight") + var/slip_out_message = pick("silently fades in", "leaps out of thin air","appears", "walks out of an invisible doorway",\ + "slides out of a fold in spacetime") + to_chat(user, "You try to align with the bluespace stream...") + if(do_after(user, 20, target = src)) + new /obj/effect/temp_visual/bluespace_fissure(get_turf(src)) + new /obj/effect/temp_visual/bluespace_fissure(get_turf(linked_to)) + user.forceMove(get_turf(linked_to)) + user.visible_message("[user] [slip_in_message].", ignored_mob = user) + user.visible_message("[user] [slip_out_message].", "...and find your way to the other side.") + +/datum/brain_trauma/special/psychotic_brawling + name = "Violent Psychosis" + desc = "Patient fights in unpredictable ways, ranging from helping his target to hitting them with brutal strength." + scan_desc = "violent psychosis" + gain_text = "You feel unhinged..." + lose_text = "You feel more balanced." + var/datum/martial_art/psychotic_brawling/psychotic_brawling + +/datum/brain_trauma/special/psychotic_brawling/on_gain() + ..() + psychotic_brawling = new(null) + if(!psychotic_brawling.teach(owner, TRUE)) + to_chat(owner, "But your martial knowledge keeps you grounded.") + qdel(src) + +/datum/brain_trauma/special/psychotic_brawling/on_lose() + ..() + psychotic_brawling.remove(owner) + QDEL_NULL(psychotic_brawling) \ No newline at end of file diff --git a/code/datums/brain_damage/split_personality.dm b/code/datums/brain_damage/split_personality.dm new file mode 100644 index 0000000000..d48392f276 --- /dev/null +++ b/code/datums/brain_damage/split_personality.dm @@ -0,0 +1,218 @@ +#define OWNER 0 +#define STRANGER 1 + +/datum/brain_trauma/severe/split_personality + name = "Split Personality" + desc = "Patient's brain is split into two personalities, which randomly switch control of the body." + scan_desc = "complete lobe separation" + gain_text = "You feel like your mind was split in two." + lose_text = "You feel alone again." + var/current_controller = OWNER + var/initialized = FALSE //to prevent personalities deleting themselves while we wait for ghosts + var/mob/living/split_personality/stranger_backseat //there's two so they can swap without overwriting + var/mob/living/split_personality/owner_backseat + +/datum/brain_trauma/severe/split_personality/on_gain() + ..() + make_backseats() + get_ghost() + +/datum/brain_trauma/severe/split_personality/proc/make_backseats() + stranger_backseat = new(owner, src) + owner_backseat = new(owner, src) + +/datum/brain_trauma/severe/split_personality/proc/get_ghost() + set waitfor = FALSE + var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s split personality?", null, null, null, 75, stranger_backseat) + if(LAZYLEN(candidates)) + var/client/C = pick(candidates) + stranger_backseat.key = C.key + else + qdel(src) + +/datum/brain_trauma/severe/split_personality/on_life() + if(owner.stat == DEAD) + if(current_controller != OWNER) + switch_personalities() + qdel(src) + else if(prob(3)) + switch_personalities() + ..() + +/datum/brain_trauma/severe/split_personality/on_lose() + if(current_controller != OWNER) //it would be funny to cure a guy only to be left with the other personality, but it seems too cruel + switch_personalities() + QDEL_NULL(stranger_backseat) + QDEL_NULL(owner_backseat) + ..() + +/datum/brain_trauma/severe/split_personality/proc/switch_personalities() + if(QDELETED(owner) || owner.stat == DEAD || QDELETED(stranger_backseat) || QDELETED(owner_backseat)) + return + + var/mob/living/split_personality/current_backseat + var/mob/living/split_personality/free_backseat + if(current_controller == OWNER) + current_backseat = stranger_backseat + free_backseat = owner_backseat + else + current_backseat = owner_backseat + free_backseat = stranger_backseat + + log_game("[current_backseat]/([current_backseat.ckey]) assumed control of [owner]/([owner.ckey] due to [src]. (Original owner: [current_controller == OWNER ? owner.ckey : current_backseat.ckey])") + to_chat(owner, "You feel your control being taken away... your other personality is in charge now!") + to_chat(current_backseat, "You manage to take control of your body!") + + //Body to backseat + + var/h2b_id = owner.computer_id + var/h2b_ip= owner.lastKnownIP + owner.computer_id = null + owner.lastKnownIP = null + + free_backseat.ckey = owner.ckey + + free_backseat.name = owner.name + + if(owner.mind) + free_backseat.mind = owner.mind + + if(!free_backseat.computer_id) + free_backseat.computer_id = h2b_id + + if(!free_backseat.lastKnownIP) + free_backseat.lastKnownIP = h2b_ip + + //Backseat to body + + var/s2h_id = current_backseat.computer_id + var/s2h_ip= current_backseat.lastKnownIP + current_backseat.computer_id = null + current_backseat.lastKnownIP = null + + owner.ckey = current_backseat.ckey + owner.mind = current_backseat.mind + + if(!owner.computer_id) + owner.computer_id = s2h_id + + if(!owner.lastKnownIP) + owner.lastKnownIP = s2h_ip + + current_controller = !current_controller + + +/mob/living/split_personality + name = "split personality" + real_name = "unknown conscience" + var/mob/living/carbon/body + var/datum/brain_trauma/severe/split_personality/trauma + +/mob/living/split_personality/Initialize(mapload, _trauma) + if(iscarbon(loc)) + body = loc + name = body.real_name + real_name = body.real_name + trauma = _trauma + return ..() + +/mob/living/split_personality/Life() + if(QDELETED(body)) + qdel(src) //in case trauma deletion doesn't already do it + + if((body.stat == DEAD && trauma.owner_backseat == src)) + trauma.switch_personalities() + qdel(trauma) + + //if one of the two ghosts, the other one stays permanently + if(!body.client && trauma.initialized) + trauma.switch_personalities() + qdel(trauma) + + ..() + +/mob/living/split_personality/Login() + ..() + to_chat(src, "As a split personality, you cannot do anything but observe. However, you will eventually gain control of your body, switching places with the current personality.") + +/mob/living/split_personality/say(message) + to_chat(src, "You cannot speak, your other self is controlling your body!") + return FALSE + +/mob/living/split_personality/emote(message) + return + +///////////////BRAINWASHING//////////////////// + +/datum/brain_trauma/severe/split_personality/brainwashing + name = "Split Personality" + desc = "Patient's brain is split into two personalities, which randomly switch control of the body." + scan_desc = "complete lobe separation" + gain_text = "" + lose_text = "You are free of your brainwashing." + can_gain = FALSE + var/codeword + var/objective + +/datum/brain_trauma/severe/split_personality/brainwashing/New(obj/item/organ/brain/B, _permanent, _codeword, _objective) + ..() + if(_codeword) + codeword = _codeword + else + codeword = pick(strings("ion_laws.json", "ionabstract")\ + | strings("ion_laws.json", "ionobjects")\ + | strings("ion_laws.json", "ionadjectives")\ + | strings("ion_laws.json", "ionthreats")\ + | strings("ion_laws.json", "ionfood")\ + | strings("ion_laws.json", "iondrinks")) + +/datum/brain_trauma/severe/split_personality/brainwashing/on_gain() + ..() + var/mob/living/split_personality/traitor/traitor_backseat = stranger_backseat + traitor_backseat.codeword = codeword + traitor_backseat.objective = objective + +/datum/brain_trauma/severe/split_personality/brainwashing/make_backseats() + stranger_backseat = new /mob/living/split_personality/traitor(owner, src, codeword, objective) + owner_backseat = new(owner, src) + +/datum/brain_trauma/severe/split_personality/brainwashing/get_ghost() + set waitfor = FALSE + var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s brainwashed mind?", null, null, null, 75, stranger_backseat) + if(LAZYLEN(candidates)) + var/client/C = pick(candidates) + stranger_backseat.key = C.key + else + qdel(src) + +/datum/brain_trauma/severe/split_personality/brainwashing/on_life() + return //no random switching + +/datum/brain_trauma/severe/split_personality/brainwashing/on_hear(message, speaker, message_language, raw_message, radio_freq) + if(owner.disabilities & DEAF || owner == speaker) + return message + if(findtext(message, codeword)) + message = replacetext(message, codeword, "[codeword]") + addtimer(CALLBACK(src, /datum/brain_trauma/severe/split_personality.proc/switch_personalities), 10) + return message + +/datum/brain_trauma/severe/split_personality/brainwashing/on_say(message) + if(findtext(message, codeword)) + return "" //oh hey did you want to tell people about the secret word to bring you back? + return message + +/mob/living/split_personality/traitor + name = "split personality" + real_name = "unknown conscience" + var/objective + var/codeword + +/mob/living/split_personality/traitor/Login() + ..() + to_chat(src, "As a brainwashed personality, you cannot do anything yet but observe. However, you may gain control of your body if you hear the special codeword, switching places with the current personality.") + to_chat(src, "Your activation codeword is: [codeword]") + if(objective) + to_chat(src, "Your master left you an objective: [objective]. Follow it at all costs when in control.") + +#undef OWNER +#undef STRANGER diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index 2984987103..fc2aa1533c 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -962,6 +962,42 @@ manipulate_organs(C) href_list["datumrefresh"] = href_list["editorgans"] + else if(href_list["givetrauma"]) + if(!check_rights(0)) + return + + var/mob/living/carbon/C = locate(href_list["givetrauma"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + var/list/traumas = subtypesof(/datum/brain_trauma) + var/result = input(usr, "Choose the brain trauma to apply","Traumatize") as null|anything in traumas + var/permanent = alert("Do you want to make the trauma unhealable?", "Permanently Traumatize", "Yes", "No") + if(!usr) + return + if(QDELETED(C)) + to_chat(usr, "Mob doesn't exist anymore") + return + + if(result) + C.gain_trauma(result, permanent) + + href_list["datumrefresh"] = href_list["givetrauma"] + + else if(href_list["curetraumas"]) + if(!check_rights(0)) + return + + var/mob/living/carbon/C = locate(href_list["curetraumas"]) in GLOB.mob_list + if(!istype(C)) + to_chat(usr, "This can only be done to instances of type /mob/living/carbon") + return + + C.cure_all_traumas(TRUE, TRUE) + + href_list["datumrefresh"] = href_list["curetraumas"] + else if(href_list["hallucinate"]) if(!check_rights(0)) return diff --git a/code/datums/diseases/advance/symptoms/confusion.dm b/code/datums/diseases/advance/symptoms/confusion.dm index 04418610e5..209c7b0bf6 100644 --- a/code/datums/diseases/advance/symptoms/confusion.dm +++ b/code/datums/diseases/advance/symptoms/confusion.dm @@ -54,8 +54,8 @@ Bonus else to_chat(M, "You can't think straight!") M.confused = min(100 * power, M.confused + 8) - if(brain_damage && M.getBrainLoss()<=80) - M.adjustBrainLoss(5 * power) + if(brain_damage) + M.adjustBrainLoss(3 * power, 80) M.updatehealth() return diff --git a/code/datums/diseases/advance/symptoms/sensory.dm b/code/datums/diseases/advance/symptoms/sensory.dm index df6bda1729..08160b6719 100644 --- a/code/datums/diseases/advance/symptoms/sensory.dm +++ b/code/datums/diseases/advance/symptoms/sensory.dm @@ -27,7 +27,9 @@ Bonus symptom_delay_max = 10 var/purge_alcohol = FALSE var/brain_heal = FALSE + var/trauma_heal = FALSE threshold_desc = "Resistance 6: Heals brain damage.
\ + Resistance 9: Heals brain traumas.
\ Transmission 8: Purges alcohol in the bloodstream." /datum/symptom/mind_restoration/Start(datum/disease/advance/A) @@ -35,6 +37,8 @@ Bonus return if(A.properties["resistance"] >= 6) //heal brain damage brain_heal = TRUE + if(A.properties["resistance"] >= 9) //heal brain traumas + trauma_heal = TRUE if(A.properties["transmittable"] >= 8) //purge alcohol purge_alcohol = TRUE @@ -66,3 +70,12 @@ Bonus if(brain_heal && A.stage >= 5) M.adjustBrainLoss(-3) +<<<<<<< HEAD +======= + if(trauma_heal && iscarbon(M)) + var/mob/living/carbon/C = M + if(prob(30) && C.has_trauma_type(BRAIN_TRAUMA_SPECIAL)) + C.cure_trauma_type(BRAIN_TRAUMA_SPECIAL) + if(prob(10) && C.has_trauma_type(BRAIN_TRAUMA_MILD)) + C.cure_trauma_type(BRAIN_TRAUMA_MILD) +>>>>>>> 550d711... Brain Traumas (#31727) diff --git a/code/datums/diseases/brainrot.dm b/code/datums/diseases/brainrot.dm index 576518b955..49f8afcaff 100644 --- a/code/datums/diseases/brainrot.dm +++ b/code/datums/diseases/brainrot.dm @@ -24,15 +24,15 @@ if(prob(2)) to_chat(affected_mob, "You don't feel like yourself.") if(prob(5)) - affected_mob.adjustBrainLoss(1) + affected_mob.adjustBrainLoss(1, 170) affected_mob.updatehealth() if(3) if(prob(2)) affected_mob.emote("stare") if(prob(2)) affected_mob.emote("drool") - if(prob(10) && affected_mob.getBrainLoss()<=98)//shouldn't retard you to death now - affected_mob.adjustBrainLoss(2) + if(prob(10)) + affected_mob.adjustBrainLoss(2, 170) affected_mob.updatehealth() if(prob(2)) to_chat(affected_mob, "Your try to remember something important...but can't.") @@ -42,8 +42,8 @@ affected_mob.emote("stare") if(prob(2)) affected_mob.emote("drool") - if(prob(15) && affected_mob.getBrainLoss()<=98) //shouldn't retard you to death now - affected_mob.adjustBrainLoss(3) + if(prob(15)) + affected_mob.adjustBrainLoss(3, 170) affected_mob.updatehealth() if(prob(2)) to_chat(affected_mob, "Strange buzzing fills your head, removing all thoughts.") diff --git a/code/datums/martial/cqc.dm b/code/datums/martial/cqc.dm index 8974c388b1..b4b49dc81b 100644 --- a/code/datums/martial/cqc.dm +++ b/code/datums/martial/cqc.dm @@ -58,7 +58,7 @@ "[A] kicks your head, knocking you out!") playsound(get_turf(A), 'sound/weapons/genhit1.ogg', 50, 1, -1) D.SetSleeping(300) - D.adjustBrainLoss(25) + D.adjustBrainLoss(15, 150) return 1 /datum/martial_art/cqc/proc/Pressure(mob/living/carbon/human/A, mob/living/carbon/human/D) diff --git a/code/datums/martial/psychotic_brawl.dm b/code/datums/martial/psychotic_brawl.dm new file mode 100644 index 0000000000..0d6a85359d --- /dev/null +++ b/code/datums/martial/psychotic_brawl.dm @@ -0,0 +1,68 @@ +/datum/martial_art/psychotic_brawling + name = "Psychotic Brawling" + +/datum/martial_art/psychotic_brawling/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) + return psycho_attack(A,D) + +/datum/martial_art/psychotic_brawling/grab_act(mob/living/carbon/human/A, mob/living/carbon/human/D) + return psycho_attack(A,D) + +/datum/martial_art/psychotic_brawling/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D) + return psycho_attack(A,D) + +/datum/martial_art/psychotic_brawling/proc/psycho_attack(mob/living/carbon/human/A, mob/living/carbon/human/D) + var/atk_verb + switch(rand(1,8)) + if(1) + D.help_shake_act(A) + atk_verb = "helped" + if(2) + A.emote("cry") + A.Stun(20) + atk_verb = "cried looking at" + if(3) + if(A.grab_state >= GRAB_AGGRESSIVE) + D.grabbedby(A, 1) + else + A.start_pulling(D, 1) + if(A.pulling) + D.drop_all_held_items() + D.stop_pulling() + if(A.a_intent == INTENT_GRAB) + add_logs(A, D, "grabbed", addition="aggressively") + D.visible_message("[A] violently grabs [D]!", \ + "[A] violently grabs you!") + A.grab_state = GRAB_AGGRESSIVE //Instant aggressive grab + else + add_logs(A, D, "grabbed", addition="passively") + A.grab_state = GRAB_PASSIVE + if(4) + A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) + atk_verb = "headbutts" + D.visible_message("[A] [atk_verb] [D]!", \ + "[A] [atk_verb] you!") + playsound(get_turf(D), 'sound/weapons/punch1.ogg', 40, 1, -1) + D.apply_damage(rand(5,10), BRUTE, "head") + A.apply_damage(rand(5,10), BRUTE, "head") + if(!istype(A.head,/obj/item/clothing/head/helmet/) && !istype(A.head,/obj/item/clothing/head/hardhat)) + A.adjustBrainLoss(5) + if(!istype(D.head,/obj/item/clothing/head/helmet/) && !istype(D.head,/obj/item/clothing/head/hardhat)) + D.adjustBrainLoss(5) + A.Stun(rand(5,30)) + D.Stun(rand(5,30)) + if(5,6) + A.do_attack_animation(D, ATTACK_EFFECT_PUNCH) + atk_verb = pick("punches", "kicks", "hits", "slams into") + D.visible_message("[A] [atk_verb] [D] with inhuman strength, sending [D.p_them()] flying backwards!", \ + "[A] [atk_verb] you with inhuman strength, sending you flying backwards!") + D.apply_damage(rand(15,30), BRUTE) + playsound(get_turf(D), 'sound/effects/meteorimpact.ogg', 25, 1, -1) + var/throwtarget = get_edge_target_turf(A, get_dir(A, get_step_away(D, A))) + D.throw_at(throwtarget, 4, 2, A)//So stuff gets tossed around at the same time. + D.Knockdown(60) + if(7,8) + basic_hit(A,D) + + if(atk_verb) + add_logs(A, D, "[atk_verb] (Psychotic Brawling)") + return 1 \ No newline at end of file diff --git a/code/datums/martial/sleeping_carp.dm b/code/datums/martial/sleeping_carp.dm index ed46910148..f3a1f53dd2 100644 --- a/code/datums/martial/sleeping_carp.dm +++ b/code/datums/martial/sleeping_carp.dm @@ -240,7 +240,7 @@ H.visible_message("[user] delivers a heavy hit to [H]'s head, knocking them out cold!", \ "[user] knocks you unconscious!") H.SetSleeping(600) - H.adjustBrainLoss(25) + H.adjustBrainLoss(15, 150) else return ..() diff --git a/code/datums/mutations/speech.dm b/code/datums/mutations/speech.dm index 2959c73125..091c3abedf 100644 --- a/code/datums/mutations/speech.dm +++ b/code/datums/mutations/speech.dm @@ -95,13 +95,13 @@ return trim(message) -/datum/mutation/human/unintelligable - name = "Unintelligable" +/datum/mutation/human/unintelligible + name = "Unintelligible" quality = NEGATIVE text_gain_indication = "You can't seem to form any coherent thoughts!" text_lose_indication = "Your mind feels more clear." -/datum/mutation/human/unintelligable/say_mod(message) +/datum/mutation/human/unintelligible/say_mod(message) if(message) var/prefix=copytext(message,1,2) if(prefix == ";") @@ -123,7 +123,7 @@ suffix = copytext(cword,length(cword)-1,length(cword) ) if(length(cword)) rearranged += cword - message = "[prefix][uppertext(jointext(rearranged," "))]!!" + message ="[prefix][jointext(rearranged," ")]" return message diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm index da445b94ce..c3a591a278 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm @@ -183,6 +183,7 @@ to_chat(H, "You feel intensely watched.") sleep(5) to_chat(H, "Your mind snaps!") + H.gain_trauma_type(BRAIN_TRAUMA_MILD) to_chat(H, "You can't remember how you got here...") var/objtype = (prob(75) ? /datum/objective/abductee/random : pick(subtypesof(/datum/objective/abductee/) - /datum/objective/abductee/random)) var/datum/objective/abductee/O = new objtype() diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 58f37e5945..2f97bc458b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -680,7 +680,7 @@ if(ishuman(user) && prob(40) && src.density) var/mob/living/carbon/human/H = user - if(H.getBrainLoss() >= 60 && Adjacent(user)) + if((H.disabilities & DUMB) && Adjacent(user)) playsound(src.loc, 'sound/effects/bang.ogg', 25, 1) if(!istype(H.head, /obj/item/clothing/head/helmet)) H.visible_message("[user] headbutts the airlock.", \ diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm index 1099095b46..abec0c2641 100644 --- a/code/game/mecha/equipment/tools/medical_tools.dm +++ b/code/game/mecha/equipment/tools/medical_tools.dm @@ -169,6 +169,7 @@ Burn Severity: [patient.getFireLoss()]%
[patient.getCloneLoss() ? "Subject appears to have cellular damage." : ""]
[patient.getBrainLoss() ? "Significant brain damage detected." : ""]
+ [length(patient.get_traumas()) ? "Brain Traumas detected." : ""]
"} /obj/item/mecha_parts/mecha_equipment/medical/sleeper/proc/get_patient_reagents() diff --git a/code/game/objects/effects/temporary_visuals/miscellaneous.dm b/code/game/objects/effects/temporary_visuals/miscellaneous.dm index 835738255e..0928fd9ca6 100644 --- a/code/game/objects/effects/temporary_visuals/miscellaneous.dm +++ b/code/game/objects/effects/temporary_visuals/miscellaneous.dm @@ -246,6 +246,11 @@ duration = 8 randomdir = 0 +/obj/effect/temp_visual/bluespace_fissure + name = "bluespace fissure" + icon_state = "bluestream_fade" + duration = 9 + /obj/effect/temp_visual/gib_animation icon = 'icons/mob/mob.dmi' duration = 15 diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 51a81c46aa..7c0f4dd99b 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -165,10 +165,6 @@ ARCD if (!ishuman(usr) && !usr.has_unlimited_silicon_privilege) return ..(usr) - var/mob/living/carbon/human/H = usr - if(H.getBrainLoss() >= 60) - return - var/t1 = text("") diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm index 358ffd3e10..bdde32fb8a 100644 --- a/code/game/objects/items/defib.dm +++ b/code/game/objects/items/defib.dm @@ -547,7 +547,7 @@ H.emote("gasp") H.Jitter(100) if(tplus > tloss) - H.setBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100)))) + H.adjustBrainLoss( max(0, min(99, ((tlimit - tplus) / tlimit * 100))), 150) add_logs(user, H, "revived", defib) if(req_defib) defib.deductcharge(revivecost) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index fd56c6283f..18e64c3639 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -48,7 +48,7 @@ add_fingerprint(user) if(istype(M) && on && user.zone_selected in list("eyes", "mouth")) - if((user.disabilities & CLUMSY || user.getBrainLoss() >= 60) && prob(50)) //too dumb to use flashlight properly + if((user.disabilities & (CLUMSY | DUMB)) && prob(50)) //too dumb to use flashlight properly return ..() //just hit them in the head if(!user.IsAdvancedToolUser()) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index a5dbb71924..635151acf1 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -87,7 +87,7 @@ GAS ANALYZER /obj/item/device/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user) // Clumsiness/brain damage check - if ((user.disabilities & CLUMSY || user.getBrainLoss() >= 60) && prob(50)) + if ((user.disabilities & (CLUMSY | DUMB)) && prob(50)) to_chat(user, "You stupidly try to analyze the floor's vitals!") user.visible_message("[user] has analyzed the floor's vitals!") to_chat(user, "Analyzing results for The floor:\n\tOverall status: Healthy") @@ -152,14 +152,21 @@ GAS ANALYZER to_chat(user, "\tSubject appears to have [M.getCloneLoss() > 30 ? "severe" : "minor"] cellular damage.") if(advanced) to_chat(user, "\tCellular Damage Level: [M.getCloneLoss()].") - if (M.getBrainLoss() >= 100 || !M.getorgan(/obj/item/organ/brain)) + if (M.getBrainLoss() >= 200 || !M.getorgan(/obj/item/organ/brain)) to_chat(user, "\tSubject brain function is non-existent.") - else if (M.getBrainLoss() >= 60) - to_chat(user, "\tSevere brain damage detected. Subject likely to have mental retardation.") - else if (M.getBrainLoss() >= 10) - to_chat(user, "\tBrain damage detected. Subject may have had a concussion.") + else if (M.getBrainLoss() >= 120) + to_chat(user, "\tSevere brain damage detected. Subject likely to have mental traumas.") + else if (M.getBrainLoss() >= 45) + to_chat(user, "\tBrain damage detected.") + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(LAZYLEN(C.get_traumas())) + var/list/trauma_text = list() + for(var/datum/brain_trauma/B in C.get_traumas()) + trauma_text += B.scan_desc + to_chat(user, "\tCerebral traumas detected: subjects appears to be suffering from [english_list(trauma_text)].") if(advanced) - to_chat(user, "\tBrain Activity Level: [100 - M.getBrainLoss()]%.") + to_chat(user, "\tBrain Activity Level: [(200 - M.getBrainLoss())/2]%.") if (M.radiation) to_chat(user, "\tSubject is irradiated.") if(advanced) diff --git a/code/game/objects/items/dna_injector.dm b/code/game/objects/items/dna_injector.dm index d76bc6856a..c2c6c491f2 100644 --- a/code/game/objects/items/dna_injector.dm +++ b/code/game/objects/items/dna_injector.dm @@ -265,13 +265,13 @@ name = "\improper DNA injector (Smile)" add_mutations_static = list(SMILE) -/obj/item/dnainjector/unintelligablemut - name = "\improper DNA injector (Unintelligable)" - add_mutations_static = list(UNINTELLIGABLE) +/obj/item/dnainjector/unintelligiblemut + name = "\improper DNA injector (Unintelligible)" + add_mutations_static = list(UNINTELLIGIBLE) -/obj/item/dnainjector/antiunintelligable - name = "\improper DNA injector (Anti-Unintelligable)" - remove_mutations_static = list(UNINTELLIGABLE) +/obj/item/dnainjector/antiunintelligible + name = "\improper DNA injector (Anti-Unintelligible)" + remove_mutations_static = list(UNINTELLIGIBLE) /obj/item/dnainjector/swedishmut name = "\improper DNA injector (Swedish)" diff --git a/code/game/objects/items/storage/book.dm b/code/game/objects/items/storage/book.dm index a00e97b8fe..ef04fc48f5 100644 --- a/code/game/objects/items/storage/book.dm +++ b/code/game/objects/items/storage/book.dm @@ -124,7 +124,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "bible", else if(iscarbon(M)) var/mob/living/carbon/C = M if(!istype(C.head, /obj/item/clothing/head/helmet)) - C.adjustBrainLoss(10) + C.adjustBrainLoss(5, 60) to_chat(C, "You feel dumber.") if(smack) diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 79b6554fec..0753f942dc 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -437,7 +437,7 @@ SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Mass Braindamage") for(var/mob/living/carbon/human/H in GLOB.player_list) to_chat(H, "You suddenly feel stupid.") - H.setBrainLoss(60) + H.adjustBrainLoss(60, 80) message_admins("[key_name_admin(usr)] made everybody retarded") if("eagles")//SCRAW diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index bf12b3eb66..a4e26e5c9a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1221,7 +1221,7 @@ GLOBAL_LIST_EMPTY(custom_outfits) //Admin created outfits target.electrocution_animation(40) to_chat(target, "The gods have punished you for your sins!") if(ADMIN_PUNISHMENT_BRAINDAMAGE) - target.adjustBrainLoss(75) + target.adjustBrainLoss(199, 199) if(ADMIN_PUNISHMENT_GIB) target.gib(FALSE) if(ADMIN_PUNISHMENT_BSA) diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm index 06d4c4deb9..5a0c59d73c 100644 --- a/code/modules/assembly/mousetrap.dm +++ b/code/modules/assembly/mousetrap.dm @@ -1,3 +1,4 @@ +<<<<<<< HEAD /obj/item/device/assembly/mousetrap name = "mousetrap" desc = "A handy little spring-loaded trap for catching pesty rodents." @@ -141,3 +142,147 @@ /obj/item/device/assembly/mousetrap/armed icon_state = "mousetraparmed" armed = 1 +======= +/obj/item/device/assembly/mousetrap + name = "mousetrap" + desc = "A handy little spring-loaded trap for catching pesty rodents." + icon_state = "mousetrap" + materials = list(MAT_METAL=100) + attachable = 1 + var/armed = 0 + + +/obj/item/device/assembly/mousetrap/examine(mob/user) + ..() + if(armed) + to_chat(user, "The mousetrap is armed!") + else + to_chat(user, "The mousetrap is not armed.") + +/obj/item/device/assembly/mousetrap/activate() + if(..()) + armed = !armed + if(!armed) + if(ishuman(usr)) + var/mob/living/carbon/human/user = usr + if((user.disabilities & (CLUMSY | DUMB)) && prob(50)) + to_chat(user, "Your hand slips, setting off the trigger!") + pulse(0) + update_icon() + if(usr) + playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) + +/obj/item/device/assembly/mousetrap/describe() + return "The pressure switch is [armed?"primed":"safe"]." + +/obj/item/device/assembly/mousetrap/update_icon() + if(armed) + icon_state = "mousetraparmed" + else + icon_state = "mousetrap" + if(holder) + holder.update_icon() + +/obj/item/device/assembly/mousetrap/proc/triggered(mob/target, type = "feet") + if(!armed) + return + var/obj/item/bodypart/affecting = null + if(ishuman(target)) + var/mob/living/carbon/human/H = target + if(PIERCEIMMUNE in H.dna.species.species_traits) + playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) + armed = 0 + update_icon() + pulse(0) + return 0 + switch(type) + if("feet") + if(!H.shoes) + affecting = H.get_bodypart(pick("l_leg", "r_leg")) + H.Knockdown(60) + if("l_hand", "r_hand") + if(!H.gloves) + affecting = H.get_bodypart(type) + H.Stun(60) + if(affecting) + if(affecting.receive_damage(1, 0)) + H.update_damage_overlays() + else if(ismouse(target)) + var/mob/living/simple_animal/mouse/M = target + visible_message("SPLAT!") + M.splat() + playsound(src.loc, 'sound/effects/snap.ogg', 50, 1) + armed = 0 + update_icon() + pulse(0) + + +/obj/item/device/assembly/mousetrap/attack_self(mob/living/carbon/human/user) + if(!armed) + to_chat(user, "You arm [src].") + else + if((user.disabilities & (CLUMSY | DUMB)) && prob(50)) + var/which_hand = "l_hand" + if(!(user.active_hand_index % 2)) + which_hand = "r_hand" + triggered(user, which_hand) + user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + return + to_chat(user, "You disarm [src].") + armed = !armed + update_icon() + playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3) + + +/obj/item/device/assembly/mousetrap/attack_hand(mob/living/carbon/human/user) + if(armed) + if((user.disabilities & (CLUMSY | DUMB)) && prob(50)) + var/which_hand = "l_hand" + if(!(user.active_hand_index % 2)) + which_hand = "r_hand" + triggered(user, which_hand) + user.visible_message("[user] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + return + ..() + + +/obj/item/device/assembly/mousetrap/Crossed(atom/movable/AM as mob|obj) + if(armed) + if(ismob(AM)) + var/mob/MM = AM + if(!(MM.movement_type & FLYING)) + if(ishuman(AM)) + var/mob/living/carbon/H = AM + if(H.m_intent == MOVE_INTENT_RUN) + triggered(H) + H.visible_message("[H] accidentally steps on [src].", \ + "You accidentally step on [src]") + else if(ismouse(MM)) + triggered(MM) + else if(AM.density) // For mousetrap grenades, set off by anything heavy + triggered(AM) + ..() + + +/obj/item/device/assembly/mousetrap/on_found(mob/finder) + if(armed) + finder.visible_message("[finder] accidentally sets off [src], breaking their fingers.", \ + "You accidentally trigger [src]!") + triggered(finder, (finder.active_hand_index % 2 == 0) ? "r_hand" : "l_hand") + return 1 //end the search! + return 0 + + +/obj/item/device/assembly/mousetrap/hitby(A as mob|obj) + if(!armed) + return ..() + visible_message("[src] is triggered by [A].") + triggered(null) + + +/obj/item/device/assembly/mousetrap/armed + icon_state = "mousetraparmed" + armed = 1 +>>>>>>> 550d711... Brain Traumas (#31727) diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index d95591b6fd..194edd77b1 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -454,7 +454,7 @@ GLOBAL_LIST_INIT(hallucinations_major, list( var/list/image/delusions = list() cost = 50 -/datum/hallucination/delusion/New(mob/living/carbon/T, forced, force_kind = null , duration = 300,skip_nearby = 1, custom_icon = null, custom_icon_file = null) +/datum/hallucination/delusion/New(mob/living/carbon/T, forced, force_kind = null , duration = 300,skip_nearby = 1, custom_icon = null, custom_icon_file = null, custom_name = null) . = ..() var/image/A = null var/kind = force_kind ? force_kind : pick("monkey","corgi","carp","skeleton","demon","zombie") @@ -467,23 +467,31 @@ GLOBAL_LIST_INIT(hallucinations_major, list( switch(kind) if("monkey")//Monkey A = image('icons/mob/monkey.dmi',H,"monkey1") + A.name = "Monkey ([rand(1,999)])" if("carp")//Carp A = image('icons/mob/animal.dmi',H,"carp") + A.name = "Space Carp" if("corgi")//Corgi A = image('icons/mob/pets.dmi',H,"corgi") + A.name = "Corgi" if("skeleton")//Skeletons A = image('icons/mob/human.dmi',H,"skeleton") + A.name = "Skeleton" if("zombie")//Zombies A = image('icons/mob/human.dmi',H,"zombie") + A.name = "Zombie" if("demon")//Demon A = image('icons/mob/mob.dmi',H,"daemon") + A.name = "Demon" if("custom") A = image(custom_icon_file, H, custom_icon) + A.name = custom_name A.override = 1 if(target.client) delusions |= A target.client.images |= A - QDEL_IN(src, duration) + if(duration) + QDEL_IN(src, duration) /datum/hallucination/delusion/Destroy() for(var/image/I in delusions) diff --git a/code/modules/jobs/job_types/civilian_chaplain.dm b/code/modules/jobs/job_types/civilian_chaplain.dm index aefb6f48ae..7f7fdca900 100644 --- a/code/modules/jobs/job_types/civilian_chaplain.dm +++ b/code/modules/jobs/job_types/civilian_chaplain.dm @@ -68,7 +68,7 @@ Chaplain B.name = "Guys Gone Wild" if("lol", "wtf", "gay", "penis", "ass", "poo", "badmin", "shitmin", "deadmin", "cock", "cocks", "meme", "memes") B.name = pick("Woodys Got Wood: The Aftermath", "War of the Cocks", "Sweet Bro and Hella Jef: Expanded Edition") - H.setBrainLoss(100) // starts off retarded as fuck + H.adjustBrainLoss(100) // starts off retarded as fuck if("science") B.name = pick("Principle of Relativity", "Quantum Enigma: Physics Encounters Consciousness", "Programming the Universe", "Quantum Physics and Theology", "String Theory for Dummies", "How To: Build Your Own Warp Drive", "The Mysteries of Bluespace", "Playing God: Collector's Edition") else diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 55f0c0b681..3f67171e80 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -14,6 +14,8 @@ var/damaged_brain = FALSE //whether the brain organ is damaged. var/decoy_override = FALSE //I apologize to the security players, and myself, who abused this, but this is going to go. + var/list/datum/brain_trauma/traumas = list() + /obj/item/organ/brain/changeling_brain vital = FALSE decoy_override = TRUE @@ -41,11 +43,21 @@ QDEL_NULL(brainmob) + for(var/X in traumas) + var/datum/brain_trauma/BT = X + BT.owner = owner + BT.on_gain() + //Update the body's icon so it doesnt appear debrained anymore C.update_hair() /obj/item/organ/brain/Remove(mob/living/carbon/C, special = 0, no_id_transfer = FALSE) ..() + for(var/X in traumas) + var/datum/brain_trauma/BT = X + BT.on_lose(TRUE) + BT.owner = null + if((!gc_destroyed || (owner && !owner.gc_destroyed)) && !no_id_transfer) transfer_identity(C) C.update_hair() @@ -134,6 +146,30 @@ else ..() +/obj/item/organ/brain/proc/get_brain_damage() + var/brain_damage_threshold = max_integrity * BRAIN_DAMAGE_INTEGRITY_MULTIPLIER + var/offset_integrity = obj_integrity - (max_integrity - brain_damage_threshold) + . = (1 - (offset_integrity / brain_damage_threshold)) * BRAIN_DAMAGE_DEATH + +/obj/item/organ/brain/proc/adjust_brain_damage(amount, maximum) + var/adjusted_amount + if(amount >= 0 && maximum) + var/brainloss = get_brain_damage() + var/new_brainloss = Clamp(brainloss + amount, 0, maximum) + if(brainloss > new_brainloss) //brainloss is over the cap already + return 0 + adjusted_amount = new_brainloss - brainloss + else + adjusted_amount = amount + + adjusted_amount *= BRAIN_DAMAGE_INTEGRITY_MULTIPLIER + if(adjusted_amount) + if(adjusted_amount >= 0.1) + take_damage(adjusted_amount) + else if(adjusted_amount <= -0.1) + obj_integrity = min(max_integrity, obj_integrity-adjusted_amount) + . = adjusted_amount + /obj/item/organ/brain/Destroy() //copypasted from MMIs. if(brainmob) qdel(brainmob) @@ -144,4 +180,50 @@ name = "alien brain" desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?" icon_state = "brain-x" +<<<<<<< HEAD origin_tech = "biotech=6" +======= + + +////////////////////////////////////TRAUMAS//////////////////////////////////////// + +/obj/item/organ/brain/proc/has_trauma_type(brain_trauma_type, consider_permanent = FALSE) + for(var/X in traumas) + var/datum/brain_trauma/BT = X + if(istype(BT, brain_trauma_type) && (consider_permanent || !BT.permanent)) + return BT + + +//Add a specific trauma +/obj/item/organ/brain/proc/gain_trauma(datum/brain_trauma/trauma, permanent = FALSE, list/arguments) + var/trauma_type + if(ispath(trauma)) + trauma_type = trauma + traumas += new trauma_type(arglist(list(src, permanent) + arguments)) + else + traumas += trauma + trauma.permanent = permanent + +//Add a random trauma of a certain subtype +/obj/item/organ/brain/proc/gain_trauma_type(brain_trauma_type = /datum/brain_trauma, permanent = FALSE) + var/list/datum/brain_trauma/possible_traumas = list() + for(var/T in subtypesof(brain_trauma_type)) + var/datum/brain_trauma/BT = T + if(initial(BT.can_gain)) + possible_traumas += BT + + var/trauma_type = pick(possible_traumas) + traumas += new trauma_type(src, permanent) + +//Cure a random trauma of a certain subtype +/obj/item/organ/brain/proc/cure_trauma_type(brain_trauma_type, cure_permanent = FALSE) + var/datum/brain_trauma/trauma = has_trauma_type(brain_trauma_type) + if(trauma && (cure_permanent || !trauma.permanent)) + qdel(trauma) + +/obj/item/organ/brain/proc/cure_all_traumas(cure_permanent = FALSE) + for(var/X in traumas) + var/datum/brain_trauma/trauma = X + if(cure_permanent || !trauma.permanent) + qdel(trauma) +>>>>>>> 550d711... Brain Traumas (#31727) diff --git a/code/modules/mob/living/brain/status_procs.dm b/code/modules/mob/living/brain/status_procs.dm index c5e01efcf9..2baea2e7cd 100644 --- a/code/modules/mob/living/brain/status_procs.dm +++ b/code/modules/mob/living/brain/status_procs.dm @@ -22,4 +22,4 @@ return /mob/living/brain/set_blurriness() - return + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index ff815776f5..e2ae973d43 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -112,7 +112,8 @@ take_bodypart_damage(10) victim.Knockdown(20) Knockdown(20) - visible_message("[src] crashes into [victim], knocking them both over!", "You violently crash into [victim]!") + visible_message("[src] crashes into [victim], knocking them both over!",\ + "You violently crash into [victim]!") playsound(src,'sound/weapons/punch1.ogg',50,1) @@ -765,6 +766,7 @@ update_handcuffed() if(reagents) reagents.addiction_list = list() + cure_all_traumas(TRUE, TRUE) ..() // heal ears after healing disabilities, since ears check DEAF disability // when healing. @@ -849,3 +851,5 @@ .["Modify bodypart"] = "?_src_=vars;[HrefToken()];editbodypart=[REF(src)]" .["Modify organs"] = "?_src_=vars;[HrefToken()];editorgans=[REF(src)]" .["Hallucinate"] = "?_src_=vars;[HrefToken()];hallucinate=[REF(src)]" + .["Give brain trauma"] = "?_src_=vars;[HrefToken()];givetrauma=[REF(src)]" + .["Cure brain traumas"] = "?_src_=vars;[HrefToken()];curetraumas=[REF(src)]" diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm index 9cccd4418d..0bfa287a09 100644 --- a/code/modules/mob/living/carbon/carbon_defense.dm +++ b/code/modules/mob/living/carbon/carbon_defense.dm @@ -229,7 +229,7 @@ "[src] was shocked by \the [source]!", \ "You feel a powerful shock coursing through your body!", \ "You hear a heavy electrical crack." \ - ) + ) jitteriness += 1000 //High numbers for violent convulsions do_jitter_animation(jitteriness) stuttering += 2 diff --git a/code/modules/mob/living/carbon/damage_procs.dm b/code/modules/mob/living/carbon/damage_procs.dm index ebf1d6284d..aecf966350 100644 --- a/code/modules/mob/living/carbon/damage_procs.dm +++ b/code/modules/mob/living/carbon/damage_procs.dm @@ -196,3 +196,37 @@ staminaloss = amount if(updating_stamina) update_stamina() + +/mob/living/carbon/getBrainLoss() + . = BRAIN_DAMAGE_DEATH + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.get_brain_damage() + +//Some sources of brain damage shouldn't be deadly +/mob/living/carbon/adjustBrainLoss(amount, maximum = BRAIN_DAMAGE_DEATH) + if(status_flags & GODMODE) + return 0 + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(!B) + return + B.adjust_brain_damage(amount, maximum) + if(amount <= 0) //cut this early + return + var/brainloss = getBrainLoss() + if(brainloss > BRAIN_DAMAGE_MILD && !has_trauma_type(BRAIN_TRAUMA_MILD)) + if(prob((amount * 2) + ((brainloss - BRAIN_DAMAGE_MILD) / 5))) //1 damage|50 brain damage = 4% chance + gain_trauma_type(BRAIN_TRAUMA_MILD) + if(brainloss > BRAIN_DAMAGE_SEVERE && !has_trauma_type(BRAIN_TRAUMA_SEVERE) && !has_trauma_type(BRAIN_TRAUMA_SPECIAL)) + if(prob(amount + ((brainloss - BRAIN_DAMAGE_SEVERE) / 15))) //1 damage|150 brain damage = 3% chance + if(prob(20)) + gain_trauma_type(BRAIN_TRAUMA_SPECIAL) + else + gain_trauma_type(BRAIN_TRAUMA_SEVERE) + +/mob/living/carbon/setBrainLoss(amount) + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + var/adjusted_amount = amount - B.get_brain_damage() + B.adjust_brain_damage(adjusted_amount, null) + diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm index 53b087d768..8c97bc71a3 100644 --- a/code/modules/mob/living/carbon/examine.dm +++ b/code/modules/mob/living/carbon/examine.dm @@ -69,7 +69,7 @@ else msg += "[t_He] [t_is] severely deformed!\n" - if(getBrainLoss() > 60) + if(disabilities & DUMB) msg += "[t_He] seem[p_s()] to be clumsy and unable to think.\n" if(fire_stacks > 0) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 2dc4236652..6ed9291b83 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -7,7 +7,7 @@ var/t_has = p_have() var/t_is = p_are() - var/msg = "*---------*\nThis is [src.name]!\n" + var/msg = "*---------*\nThis is [name]!\n" var/list/obscured = check_obscured_slots() var/skipface = (wear_mask && (wear_mask.flags_inv & HIDEFACE)) || (head && (head.flags_inv & HIDEFACE)) @@ -284,7 +284,7 @@ if(stat == UNCONSCIOUS) msg += "[t_He] [t_is]n't responding to anything around [t_him] and seem[p_s()] to be asleep.\n" else - if(getBrainLoss() >= 60) + if(disabilities & DUMB) msg += "[t_He] [t_has] a stupid expression on [t_his] face.\n" if(InCritical()) msg += "[t_He] [t_is] barely conscious.\n" diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index b5f8ab7c81..d1d657652b 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -103,7 +103,9 @@ /mob/living/carbon/human/IsAdvancedToolUser() - return 1//Humans can use guns and such + if(disabilities & MONKEYLIKE) + return FALSE + return TRUE//Humans can use guns and such /mob/living/carbon/human/reagent_check(datum/reagent/R) return dna.species.handle_chemicals(R,src) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 67843b3e64..cca672d3d8 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -20,8 +20,6 @@ #define COLD_GAS_DAMAGE_LEVEL_2 1.5 //Amount of damage applied when the current breath's temperature passes the 200K point #define COLD_GAS_DAMAGE_LEVEL_3 3 //Amount of damage applied when the current breath's temperature passes the 120K point -#define BRAIN_DAMAGE_FILE "brain_damage_lines.json" - /mob/living/carbon/human/Life() set invisibility = 0 set background = BACKGROUND_ENABLED @@ -74,14 +72,6 @@ else if(eye_blurry) //blurry eyes heal slowly adjust_blurriness(-1) - if (getBrainLoss() >= 60 && stat == CONSCIOUS) - if(prob(3)) - if(prob(25)) - emote("drool") - else - say(pick_list_replacements(BRAIN_DAMAGE_FILE, "brain_damage")) - - /mob/living/carbon/human/handle_mutations_and_radiation() if(!dna || !dna.species.handle_mutations_and_radiation(src)) ..() @@ -430,7 +420,7 @@ All effects don't start immediately, but rather get worse over time; the rate is to_chat(src, "Maybe you should lie down for a bit...") if(drunkenness >= 91) - adjustBrainLoss(0.4) + adjustBrainLoss(0.4, 60) if(prob(20) && !stat) if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && (z in GLOB.station_z_levels)) //QoL mainly to_chat(src, "You're so tired... but you can't miss that shuttle...") diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 5072880c01..31f1678428 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1359,8 +1359,13 @@ GLOBAL_LIST_EMPTY(roundstart_races) target.apply_damage(damage, BRUTE, affecting, armor_block) add_logs(user, target, "punched") if((target.stat != DEAD) && damage >= user.dna.species.punchstunthreshold) +<<<<<<< HEAD target.visible_message("[user] has weakened [target]!", \ "[user] has weakened [target]!") +======= + target.visible_message("[user] has knocked [target] down!", \ + "[user] has knocked [target] down!", null, COMBAT_MESSAGE_RANGE) +>>>>>>> 550d711... Brain Traumas (#31727) target.apply_effect(80, KNOCKDOWN, armor_block) target.forcesay(GLOB.hit_appends) else if(target.lying) @@ -1404,7 +1409,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(randn <= 60) var/obj/item/I = null if(target.pulling) - to_chat(target, "[user] has broken [target]'s grip on [target.pulling]!") + target.visible_message("[user] has broken [target]'s grip on [target.pulling]!") target.stop_pulling() else I = target.get_active_held_item() @@ -1509,7 +1514,10 @@ GLOBAL_LIST_EMPTY(roundstart_races) H.visible_message("[H] has been knocked senseless!", \ "[H] has been knocked senseless!") H.confused = max(H.confused, 20) + H.adjustBrainLoss(20) H.adjust_blurriness(10) + if(prob(20)) + H.gain_trauma(/datum/brain_trauma/mild/concussion) if(prob(I.force + ((100 - H.health)/2)) && H != user) var/datum/antagonist/rev/rev = H.mind.has_antag_datum(/datum/antagonist/rev) diff --git a/code/modules/mob/living/carbon/human/status_procs.dm b/code/modules/mob/living/carbon/human/status_procs.dm index 0e009bcd7b..aca6973355 100644 --- a/code/modules/mob/living/carbon/human/status_procs.dm +++ b/code/modules/mob/living/carbon/human/status_procs.dm @@ -3,11 +3,11 @@ amount = dna.species.spec_stun(src,amount) return ..() -/mob/living/carbon/human/Knockdown(amount, updating = 1, ignore_canstun = 0) +/mob/living/carbon/human/Knockdown(amount, updating = 1, ignore_canknockdown = 0) amount = dna.species.spec_stun(src,amount) return ..() -/mob/living/carbon/human/Unconscious(amount, updating = 1, ignore_canstun = 0) +/mob/living/carbon/human/Unconscious(amount, updating = 1, ignore_canunconscious = 0) amount = dna.species.spec_stun(src,amount) return ..() diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 44613a9036..77bc8fbfc0 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -13,9 +13,17 @@ handle_blood() if(stat != DEAD) +<<<<<<< HEAD for(var/V in internal_organs) var/obj/item/organ/O = V O.on_life() +======= + handle_brain_damage() + + if(stat != DEAD) + handle_liver() + +>>>>>>> 550d711... Brain Traumas (#31727) if(stat == DEAD) stop_sound_channel(CHANNEL_HEARTBEAT) @@ -437,3 +445,20 @@ adjustToxLoss(8) if(prob(30)) to_chat(src, "You feel confused and nauseous...")//actual symptoms of liver failure + + +//////////////// +//BRAIN DAMAGE// +//////////////// + +/mob/living/carbon/proc/handle_brain_damage() + for(var/T in get_traumas()) + var/datum/brain_trauma/BT = T + BT.on_life() + + if(getBrainLoss() >= BRAIN_DAMAGE_DEATH) //rip + to_chat(src, "The last spark of life in your brain fizzles out...") + death() + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + B.damaged_brain = TRUE \ No newline at end of file diff --git a/code/modules/mob/living/carbon/say.dm b/code/modules/mob/living/carbon/say.dm index 526a2ea09b..a3c8042442 100644 --- a/code/modules/mob/living/carbon/say.dm +++ b/code/modules/mob/living/carbon/say.dm @@ -1,4 +1,6 @@ /mob/living/carbon/treat_message(message) + for(var/datum/brain_trauma/trauma in get_traumas()) + message = trauma.on_say(message) message = ..(message) var/obj/item/organ/tongue/T = getorganslot(ORGAN_SLOT_TONGUE) if(!T) //hoooooouaah! @@ -34,4 +36,16 @@ if(T) . = T.could_speak_in_language(dt) else +<<<<<<< HEAD . = initial(dt.flags_1) & TONGUELESS_SPEECH +======= + . = initial(dt.flags) & TONGUELESS_SPEECH + +/mob/living/carbon/Hear(message, atom/movable/speaker, datum/language/message_language, raw_message, radio_freq, list/spans, message_mode) + if(!client) + return + for(var/T in get_traumas()) + var/datum/brain_trauma/trauma = T + message = trauma.on_hear(message, speaker, message_language, raw_message, radio_freq) + return ..() +>>>>>>> 550d711... Brain Traumas (#31727) diff --git a/code/modules/mob/living/carbon/status_procs.dm b/code/modules/mob/living/carbon/status_procs.dm index ccd5f7296b..e46ae2f8e6 100644 --- a/code/modules/mob/living/carbon/status_procs.dm +++ b/code/modules/mob/living/carbon/status_procs.dm @@ -101,3 +101,35 @@ status_flags |= DISFIGURED //makes them unknown update_body() return 1 + +/mob/living/carbon/proc/get_traumas() + . = list() + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.traumas + +/mob/living/carbon/proc/has_trauma_type(brain_trauma_type, consider_permanent = FALSE) + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.has_trauma_type(brain_trauma_type, consider_permanent) + +/mob/living/carbon/proc/gain_trauma(datum/brain_trauma/trauma, permanent = FALSE, list/arguments) + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.gain_trauma(trauma, permanent, arguments) + +/mob/living/carbon/proc/gain_trauma_type(brain_trauma_type = /datum/brain_trauma, permanent = FALSE) + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.gain_trauma_type(brain_trauma_type, permanent) + +/mob/living/carbon/proc/cure_trauma_type(brain_trauma_type, cure_permanent = FALSE) + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.cure_trauma_type(brain_trauma_type, cure_permanent) + +/mob/living/carbon/proc/cure_all_traumas(cure_permanent = FALSE) + var/obj/item/organ/brain/B = getorganslot(ORGAN_SLOT_BRAIN) + if(B) + . = B.cure_all_traumas(cure_permanent) + diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 8401d92676..dbc8da5a05 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -231,17 +231,13 @@ return amount /mob/living/proc/getBrainLoss() - return brainloss + . = 0 -/mob/living/proc/adjustBrainLoss(amount) - if(status_flags & GODMODE) - return 0 - brainloss = Clamp((brainloss + (amount * CONFIG_GET(number/damage_multiplier))), 0, maxHealth * 2) +/mob/living/proc/adjustBrainLoss(amount, maximum = BRAIN_DAMAGE_DEATH) + return /mob/living/proc/setBrainLoss(amount) - if(status_flags & GODMODE) - return 0 - brainloss = amount + return /mob/living/proc/getStaminaLoss() return staminaloss diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index ff3ebadf15..3b5ae247df 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -15,7 +15,6 @@ var/toxloss = 0 //Toxic damage caused by being poisoned or radiated var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt. var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims - var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot. var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are knocked down if it gets too high. Holodeck and hallucinations deal this. diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 7781fd5df6..b1d0484086 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -326,7 +326,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( return null /mob/living/proc/treat_message(message) - if(getBrainLoss() >= 60) + if(derpspeech) message = derpspeech(message, stuttering) if(stuttering) @@ -373,7 +373,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( . = "[verb_whisper] in [p_their()] last breath" else if(stuttering) . = "stammers" - else if(getBrainLoss() >= 60) + else if(derpspeech) . = "gibbers" else . = ..() diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index bed14bdff4..ddedf1a1ee 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -33,7 +33,16 @@ sync_mind() +<<<<<<< HEAD client.sethotkeys() //set mob specific hotkeys +======= + //Reload alternate appearances + for(var/v in GLOB.active_alternate_appearances) + if(!v) + continue + var/datum/atom_hud/alternate_appearance/AA = v + AA.onNewMob(src) +>>>>>>> 550d711... Brain Traumas (#31727) update_client_colour() if(client) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 20509329bb..b19af6342c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -400,6 +400,7 @@ pulling = null grab_state = 0 update_pull_hud_icon() + if(isliving(ex_pulled)) var/mob/living/L = ex_pulled L.update_canmove()// mob gets up if it was lyng down in a chokehold diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index d9dd2a0eee..edbf11654b 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -44,6 +44,7 @@ var/stuttering = 0 //Carbon var/slurring = 0 //Carbon var/cultslurring = 0 //Carbon + var/derpspeech = 0 //Carbon var/real_name = null var/spacewalk = FALSE var/druggy = 0 //Carbon diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 85a8ed5448..f763c3ea86 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -79,6 +79,9 @@ O.setBrainLoss(getBrainLoss(), 0) O.updatehealth() O.radiation = radiation + for(var/T in get_traumas()) + var/datum/brain_trauma/BT = T + O.gain_trauma(BT.type, BT.permanent) //re-add implants to new mob if (tr_flags & TR_KEEPIMPLANTS) @@ -238,6 +241,9 @@ O.setBrainLoss(getBrainLoss(), 0) O.updatehealth() O.radiation = radiation + for(var/T in get_traumas()) + var/datum/brain_trauma/BT = T + O.gain_trauma(BT.type, BT.permanent) //re-add implants to new mob if (tr_flags & TR_KEEPIMPLANTS) diff --git a/code/modules/paperwork/contract.dm b/code/modules/paperwork/contract.dm index a02e98ed2b..867c33e32a 100644 --- a/code/modules/paperwork/contract.dm +++ b/code/modules/paperwork/contract.dm @@ -45,11 +45,6 @@ to_chat(M, "You feel that your soul has returned to its rightful owner, Nanotrasen.") M.return_soul() else - if(ishuman(M)) - var/mob/living/carbon/human/N = M - if(!istype(N.head, /obj/item/clothing/head/helmet)) - N.adjustBrainLoss(10) - to_chat(N, "You feel dumber.") M.visible_message("[user] beats [M] over the head with [src]!", \ "[user] beats [M] over the head with [src]!") return ..() @@ -207,7 +202,7 @@ if(!user.mind.hasSoul) to_chat(user, "You do not possess a soul.") return 0 - if(prob(user.getBrainLoss())) + if(user.disabilities & DUMB) to_chat(user, "You quickly scrawl 'your name' on the contract.") signIncorrectly() return 0 diff --git a/code/modules/reagents/chemistry/reagents/drug_reagents.dm b/code/modules/reagents/chemistry/reagents/drug_reagents.dm index 60d1f64754..534cf515d9 100644 --- a/code/modules/reagents/chemistry/reagents/drug_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drug_reagents.dm @@ -99,7 +99,7 @@ . = 1 /datum/reagent/drug/crank/addiction_act_stage4(mob/living/M) - M.adjustBrainLoss(5*REM) + M.adjustBrainLoss(3*REM) M.adjustToxLoss(5*REM, 0) M.adjustBruteLoss(5*REM, 0) ..() diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 08db315b7d..a3c0d2c034 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -628,7 +628,7 @@ . = 1 if(prob(20)) M.losebreath += 4 - M.adjustBrainLoss(2*REM) + M.adjustBrainLoss(2*REM, 150) M.adjustToxLoss(3*REM,0) M.adjustStaminaLoss(10*REM,0) M.blur_eyes(5) diff --git a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm index 7547a0834c..ddb08db032 100644 --- a/code/modules/reagents/chemistry/reagents/medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/medicine_reagents.dm @@ -59,6 +59,7 @@ M.confused = 0 M.SetSleeping(0, 0) M.jitteriness = 0 + M.cure_all_traumas(TRUE, TRUE) for(var/thing in M.viruses) var/datum/disease/D = thing if(D.severity == VIRUS_SEVERITY_POSITIVE) @@ -792,7 +793,13 @@ color = "#DCDCFF" /datum/reagent/medicine/mannitol/on_mob_life(mob/living/M) - M.adjustBrainLoss(-3*REM) + M.adjustBrainLoss(-2*REM) + if(iscarbon(M)) + var/mob/living/carbon/C = M + if(prob(30) && C.has_trauma_type(BRAIN_TRAUMA_SPECIAL)) + C.cure_trauma_type(BRAIN_TRAUMA_SPECIAL) + if(prob(10) && C.has_trauma_type(BRAIN_TRAUMA_MILD)) + C.cure_trauma_type(BRAIN_TRAUMA_MILD) ..() /datum/reagent/medicine/mutadone @@ -1016,7 +1023,7 @@ M.adjustFireLoss(-3 * REM, 0) M.adjustOxyLoss(-15 * REM, 0) M.adjustToxLoss(-3 * REM, 0) - M.adjustBrainLoss(2 * REM) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that! + M.adjustBrainLoss(2 * REM, 150) //This does, after all, come from ambrosia, and the most powerful ambrosia in existence, at that! M.adjustCloneLoss(-1 * REM, 0) M.adjustStaminaLoss(-30 * REM, 0) M.jitteriness = min(max(0, M.jitteriness + 3), 30) @@ -1047,7 +1054,7 @@ if (M.hallucination >= 5) M.hallucination -= 5 if(prob(20)) - M.adjustBrainLoss(1*REM) + M.adjustBrainLoss(1*REM, 50) M.adjustStaminaLoss(2.5*REM, 0) ..() . = 1 diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index aab8491249..f6e57d57ca 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -261,7 +261,7 @@ M.adjustBruteLoss(-2, 0) M.adjustFireLoss(-2, 0) else - M.adjustBrainLoss(3) + M.adjustBrainLoss(3, 150) M.adjustToxLoss(1, 0) M.adjustFireLoss(2, 0) M.adjustOxyLoss(2, 0) @@ -280,7 +280,7 @@ M.IgniteMob() //Only problem with igniting people is currently the commonly availible fire suits make you immune to being on fire M.adjustToxLoss(1, 0) M.adjustFireLoss(1, 0) //Hence the other damages... ain't I a bastard? - M.adjustBrainLoss(5) + M.adjustBrainLoss(5, 150) holder.remove_reagent(src.id, 1) /datum/reagent/medicine/omnizine/godblood @@ -676,7 +676,7 @@ step(M, pick(GLOB.cardinals)) if(prob(5)) M.emote(pick("twitch","drool","moan")) - M.adjustBrainLoss(2) + M.adjustBrainLoss(1) ..() /datum/reagent/sulfur @@ -1029,7 +1029,7 @@ /datum/reagent/impedrezene/on_mob_life(mob/living/M) M.jitteriness = max(M.jitteriness-5,0) if(prob(80)) - M.adjustBrainLoss(1*REM) + M.adjustBrainLoss(2*REM) if(prob(50)) M.drowsyness = max(M.drowsyness, 3) if(prob(10)) diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm index fd7d5750f1..711c333896 100644 --- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm @@ -455,13 +455,12 @@ toxpwr = 0 /datum/reagent/toxin/neurotoxin2/on_mob_life(mob/living/M) - if(M.brainloss + M.toxloss <= 60) - M.adjustBrainLoss(1*REM) + M.adjustBrainLoss(3*REM, 150) + . = 1 + if(M.toxloss <= 60) M.adjustToxLoss(1*REM, 0) - . = 1 if(current_cycle >= 18) M.Sleeping(40, 0) - . = 1 ..() /datum/reagent/toxin/cyanide diff --git a/code/modules/spells/spell_types/voice_of_god.dm b/code/modules/spells/spell_types/voice_of_god.dm index a5b44b8e0f..eb8950086c 100644 --- a/code/modules/spells/spell_types/voice_of_god.dm +++ b/code/modules/spells/spell_types/voice_of_god.dm @@ -31,9 +31,8 @@ ..() /obj/effect/proc_holder/spell/voice_of_god/cast(list/targets, mob/user = usr) - user.say(uppertext(command), spans = spans, sanitize = FALSE) playsound(get_turf(user), speech_sound, 300, 1, 5) - var/cooldown = voice_of_god(command, user, spans, base_multiplier = power_mod) + var/cooldown = voice_of_god(uppertext(command), user, spans, base_multiplier = power_mod) charge_max = (cooldown * cooldown_mod) /obj/effect/proc_holder/spell/voice_of_god/clown diff --git a/code/modules/surgery/brain_surgery.dm b/code/modules/surgery/brain_surgery.dm new file mode 100644 index 0000000000..b22b45efce --- /dev/null +++ b/code/modules/surgery/brain_surgery.dm @@ -0,0 +1,42 @@ +/datum/surgery/brain_surgery + name = "brain surgery" + steps = list( + /datum/surgery_step/incise, + /datum/surgery_step/retract_skin, + /datum/surgery_step/saw, + /datum/surgery_step/clamp_bleeders, + /datum/surgery_step/fix_brain, + /datum/surgery_step/close) + + species = list(/mob/living/carbon/human, /mob/living/carbon/monkey) + possible_locs = list("head") + requires_bodypart_type = 0 + +/datum/surgery_step/fix_brain + name = "fix brain" + implements = list(/obj/item/hemostat = 85, /obj/item/screwdriver = 35, /obj/item/pen = 15) //don't worry, pouring some alcohol on their open brain will get that chance to 100 + time = 120 //long and complicated + +/datum/surgery/brain_surgery/can_start(mob/user, mob/living/carbon/target) + var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN) + if(!B) + to_chat(user, "It's hard to do surgery on someone's brain when they don't have one.") + return FALSE + return TRUE + +/datum/surgery_step/fix_brain/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] begins to fix [target]'s brain.", "You begin to fix [target]'s brain...") + +/datum/surgery_step/fix_brain/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] successfully fixes [target]'s brain!", "You succeed in fixing [target]'s brain.") + target.adjustBrainLoss(-60) + target.cure_all_traumas() + return TRUE + +/datum/surgery_step/fix_brain/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(target.getorganslot(ORGAN_SLOT_BRAIN)) + user.visible_message("[user] screws up, causing more damage!", "You screw up, causing more damage!") + target.adjustBrainLoss(80) + else + user.visible_message("[user] suddenly notices that the brain [user.p_they()] [user.p_were()] working on is not there anymore.", "You suddenly notice that the brain you were working on is not there anymore.") + return FALSE \ No newline at end of file diff --git a/code/modules/surgery/eye_surgery.dm b/code/modules/surgery/eye_surgery.dm index 6c340b61f5..c8a47d2096 100644 --- a/code/modules/surgery/eye_surgery.dm +++ b/code/modules/surgery/eye_surgery.dm @@ -16,6 +16,7 @@ if(!E) to_chat(user, "It's hard to do surgery on someone's eyes when they don't have any.") return FALSE + return TRUE /datum/surgery_step/fix_eyes/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) user.visible_message("[user] begins to fix [target]'s eyes.", "You begin to fix [target]'s eyes...") @@ -32,7 +33,7 @@ /datum/surgery_step/fix_eyes/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) if(target.getorgan(/obj/item/organ/brain)) user.visible_message("[user] accidentally stabs [target] right in the brain!", "You accidentally stab [target] right in the brain!") - target.adjustBrainLoss(100) + target.adjustBrainLoss(70) else user.visible_message("[user] accidentally stabs [target] right in the brain! Or would have, if [target] had a brain.", "You accidentally stab [target] right in the brain! Or would have, if [target] had a brain.") return FALSE \ No newline at end of file diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 30825f46bb..bc85d9c46e 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -63,9 +63,13 @@ H.stop_sound_channel(CHANNEL_HEARTBEAT) beat = BEAT_NONE - if(H.jitteriness && H.health > HEALTH_THRESHOLD_FULLCRIT && (!beat || beat == BEAT_SLOW)) - H.playsound_local(get_turf(H),fastbeat,40,0, channel = CHANNEL_HEARTBEAT) - beat = BEAT_FAST + if(H.jitteriness) + if(H.health > HEALTH_THRESHOLD_FULLCRIT && (!beat || beat == BEAT_SLOW)) + H.playsound_local(get_turf(H),fastbeat,40,0, channel = CHANNEL_HEARTBEAT) + beat = BEAT_FAST + else if(beat == BEAT_FAST) + H.stop_sound_channel(CHANNEL_HEARTBEAT) + beat = BEAT_NONE /obj/item/organ/heart/cursed name = "cursed heart" diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 2ed2c2107e..9e364e49d8 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -249,7 +249,7 @@ if(bz_pp > BZ_trip_balls_min) H.hallucination += 20 if(prob(33)) - H.adjustBrainLoss(3) + H.adjustBrainLoss(3, 150) else if(bz_pp > 0.01) H.hallucination += 5//Removed at 2 per tick so this will slowly build up diff --git a/code/modules/surgery/organs/vocal_cords.dm b/code/modules/surgery/organs/vocal_cords.dm index 755d35435d..78f258be67 100644 --- a/code/modules/surgery/organs/vocal_cords.dm +++ b/code/modules/surgery/organs/vocal_cords.dm @@ -108,12 +108,11 @@ return TRUE /obj/item/organ/vocal_cords/colossus/handle_speech(message) - owner.say(uppertext(message), spans = spans, sanitize = FALSE) playsound(get_turf(owner), 'sound/magic/clockwork/invoke_general.ogg', 300, 1, 5) return //voice of god speaks for us /obj/item/organ/vocal_cords/colossus/speak_with(message) - var/cooldown = voice_of_god(message, owner, spans, base_multiplier) + var/cooldown = voice_of_god(uppertext(message), owner, spans, base_multiplier) next_command = world.time + (cooldown * cooldown_mod) ////////////////////////////////////// @@ -135,6 +134,8 @@ else span_list = list() + user.say(message, spans = span_list, sanitize = FALSE) + message = lowertext(message) var/mob/living/list/listeners = list() for(var/mob/living/L in get_hearers_in_view(8, user)) diff --git a/code/modules/tgui/states/default.dm b/code/modules/tgui/states/default.dm index e61f61bc4a..0e4844dced 100644 --- a/code/modules/tgui/states/default.dm +++ b/code/modules/tgui/states/default.dm @@ -23,9 +23,6 @@ GLOBAL_DATUM_INIT(default_state, /datum/ui_state/default, new) . = shared_ui_interaction(src_object) if(. > UI_CLOSE) . = min(., shared_living_ui_distance(src_object)) // Check the distance... - // Derp a bit if we have brain loss. - if(prob(getBrainLoss())) - return UI_UPDATE /mob/living/silicon/robot/default_can_use_topic(src_object) . = shared_ui_interaction(src_object) diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index 9771e9bc06..3451915c09 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ diff --git a/icons/mob/simple_human.dmi b/icons/mob/simple_human.dmi index f3345c0825..597ee94d72 100644 Binary files a/icons/mob/simple_human.dmi and b/icons/mob/simple_human.dmi differ diff --git a/strings/phobia.json b/strings/phobia.json new file mode 100644 index 0000000000..343a475b56 --- /dev/null +++ b/strings/phobia.json @@ -0,0 +1,63 @@ +{ + "spiders": [ + "spider", + "web", + "arachnid" + ], + + "space": [ + "space", + "star", + "universe", + "void", + "galaxy", + "spess" + ], + + "security": [ + " sec ", + "security", + "shitcurity", + "baton", + "taser", + "beepsky", + "hos", + "brig", + "gulag" + ], + + "clowns": [ + "clown", + "honk", + "banana", + "slip" + ], + + "greytide": [ + "assistant", + "grey", + "gasmask", + "gas mask", + "stunprod", + "spear", + "revolution", + "viva" + ], + + "lizards": [ + "lizard", + "ligger", + "hiss", + "wag" + ], + + "skeletons": [ + "skeleton", + "milk", + "xylophone", + "bone", + "calcium", + "the ride never ends", + "doot" + ] +} \ No newline at end of file diff --git a/tgstation.dme b/tgstation.dme index e8b81cbbb8..a678fe8a1b 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -270,6 +270,7 @@ #include "code\controllers\subsystem\time_track.dm" #include "code\controllers\subsystem\timer.dm" #include "code\controllers\subsystem\title.dm" +#include "code\controllers\subsystem\traumas.dm" #include "code\controllers\subsystem\vote.dm" #include "code\controllers\subsystem\weather.dm" #include "code\controllers\subsystem\processing\circuit.dm" @@ -332,6 +333,12 @@ #include "code\datums\antagonists\pirate.dm" #include "code\datums\antagonists\revolution.dm" #include "code\datums\antagonists\wizard.dm" +#include "code\datums\brain_damage\brain_trauma.dm" +#include "code\datums\brain_damage\mild.dm" +#include "code\datums\brain_damage\phobia.dm" +#include "code\datums\brain_damage\severe.dm" +#include "code\datums\brain_damage\special.dm" +#include "code\datums\brain_damage\split_personality.dm" #include "code\datums\components\_component.dm" #include "code\datums\components\archaeology.dm" #include "code\datums\components\chasm.dm" @@ -415,6 +422,7 @@ #include "code\datums\martial\cqc.dm" #include "code\datums\martial\krav_maga.dm" #include "code\datums\martial\plasma_fist.dm" +#include "code\datums\martial\psychotic_brawl.dm" #include "code\datums\martial\sleeping_carp.dm" #include "code\datums\martial\wrestling.dm" #include "code\datums\mutations\body.dm" @@ -2327,6 +2335,7 @@ #include "code\modules\stock_market\stockmarket.dm" #include "code\modules\stock_market\stocks.dm" #include "code\modules\surgery\amputation.dm" +#include "code\modules\surgery\brain_surgery.dm" #include "code\modules\surgery\cavity_implant.dm" #include "code\modules\surgery\core_removal.dm" #include "code\modules\surgery\dental_implant.dm"