Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit329
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
//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).
|
||||
// but keep the quirks, until repaired by neurine, surgery, lobotomy or magic; depending on the resilience
|
||||
// of the trauma.
|
||||
|
||||
/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/scan_desc = "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 = "<span class='notice'>You feel traumatized.</span>"
|
||||
@@ -12,15 +14,21 @@
|
||||
var/can_gain = TRUE
|
||||
var/random_gain = TRUE //can this be gained through random traumas?
|
||||
var/resilience = TRAUMA_RESILIENCE_BASIC //how hard is this to cure?
|
||||
var/clonable = TRUE // will this transfer if the brain is cloned?
|
||||
|
||||
/datum/brain_trauma/Destroy()
|
||||
brain.traumas -= src
|
||||
if(brain && brain.traumas)
|
||||
brain.traumas -= src
|
||||
if(owner)
|
||||
on_lose()
|
||||
brain = null
|
||||
owner = null
|
||||
return ..()
|
||||
|
||||
/datum/brain_trauma/proc/on_clone()
|
||||
if(clonable)
|
||||
return new type
|
||||
|
||||
//Called on life ticks
|
||||
/datum/brain_trauma/proc/on_life()
|
||||
return
|
||||
@@ -33,17 +41,24 @@
|
||||
/datum/brain_trauma/proc/on_gain()
|
||||
to_chat(owner, gain_text)
|
||||
RegisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech)
|
||||
RegisterSignal(owner, COMSIG_MOVABLE_HEAR, .proc/handle_hearing)
|
||||
|
||||
//Called when removed from a mob
|
||||
/datum/brain_trauma/proc/on_lose(silent)
|
||||
if(!silent)
|
||||
to_chat(owner, lose_text)
|
||||
UnregisterSignal(owner, COMSIG_MOB_SAY)
|
||||
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
|
||||
|
||||
//Called when hearing a spoken message
|
||||
/datum/brain_trauma/proc/on_hear(message, speaker, message_language, raw_message, radio_freq)
|
||||
return message
|
||||
/datum/brain_trauma/proc/handle_hearing(datum/source, list/hearing_args)
|
||||
UnregisterSignal(owner, COMSIG_MOVABLE_HEAR)
|
||||
|
||||
//Called when speaking
|
||||
/datum/brain_trauma/proc/handle_speech(datum/source, list/speech_args)
|
||||
UnregisterSignal(owner, COMSIG_MOB_SAY)
|
||||
|
||||
|
||||
//Called when hugging. expand into generally interacting, where future coders could switch the intent?
|
||||
/datum/brain_trauma/proc/on_hug(mob/living/hugger, mob/living/hugged)
|
||||
return
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
gain_text = ""
|
||||
lose_text = ""
|
||||
resilience = TRAUMA_RESILIENCE_SURGERY
|
||||
|
||||
var/hypnotic_phrase = ""
|
||||
var/regex/target_phrase
|
||||
|
||||
@@ -44,18 +45,17 @@
|
||||
"You feel a part of your mind repeating this over and over. You need to follow these words.",\
|
||||
"Something about this sounds... right, for some reason. You feel like you should follow these words.",\
|
||||
"These words keep echoing in your mind. You find yourself completely fascinated by them.")]</span>")
|
||||
if(!HAS_TRAIT(owner, "hypnotherapy"))
|
||||
to_chat(owner, "<span class='boldwarning'>You've been hypnotized by this sentence. You must follow these words. If it isn't a clear order, you can freely interpret how to do so,\
|
||||
to_chat(owner, "<span class='boldwarning'>You've been hypnotized by this sentence. You must follow these words. If it isn't a clear order, you can freely interpret how to do so,\
|
||||
as long as you act like the words are your highest priority.</span>")
|
||||
else
|
||||
to_chat(owner, "<span class='boldwarning'>You've been hypnotized by this sentence. You feel an incredible desire to follow these words, but are able to resist it somewhat. If it isn't a clear order, you can freely interpret how to do so,\
|
||||
however this does not take precedence over your other objectives.</span>")
|
||||
var/obj/screen/alert/hypnosis/hypno_alert = owner.throw_alert("hypnosis", /obj/screen/alert/hypnosis)
|
||||
hypno_alert.desc = "\"[hypnotic_phrase]\"... your mind seems to be fixated on this concept."
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_lose()
|
||||
message_admins("[ADMIN_LOOKUPFLW(owner)] is no longer hypnotized with the phrase '[hypnotic_phrase]'.")
|
||||
log_game("[key_name(owner)] is no longer hypnotized with the phrase '[hypnotic_phrase]'.")
|
||||
to_chat(owner, "<span class='userdanger'>You suddenly snap out of your fixation. The phrase '[hypnotic_phrase]' no longer feels important to you.</span>")
|
||||
to_chat(owner, "<span class='userdanger'>You suddenly snap out of your hypnosis. The phrase '[hypnotic_phrase]' no longer feels important to you.</span>")
|
||||
owner.clear_alert("hypnosis")
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_life()
|
||||
@@ -67,6 +67,5 @@
|
||||
if(2)
|
||||
new /datum/hallucination/chat(owner, TRUE, FALSE, "<span class='hypnophrase'>[hypnotic_phrase]</span>")
|
||||
|
||||
/datum/brain_trauma/hypnosis/on_hear(message, speaker, message_language, raw_message, radio_freq)
|
||||
message = target_phrase.Replace(message, "<span class='hypnophrase'>$1</span>")
|
||||
return message
|
||||
/datum/brain_trauma/hypnosis/handle_hearing(datum/source, list/hearing_args)
|
||||
hearing_args[HEARING_MESSAGE] = target_phrase.Replace(hearing_args[HEARING_MESSAGE], "<span class='hypnophrase'>$1</span>")
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
var/friend_initialized = FALSE
|
||||
|
||||
/datum/brain_trauma/special/imaginary_friend/on_gain()
|
||||
var/mob/living/M = owner
|
||||
if(M.stat == DEAD || !M.client)
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
make_friend()
|
||||
get_ghost()
|
||||
@@ -43,7 +47,7 @@
|
||||
|
||||
/datum/brain_trauma/special/imaginary_friend/proc/get_ghost()
|
||||
set waitfor = FALSE
|
||||
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s imaginary friend?", ROLE_PAI, null, null, 75, friend)
|
||||
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s imaginary friend?", ROLE_PAI, null, null, 75, friend, POLL_IGNORE_IMAGINARYFRIEND)
|
||||
if(LAZYLEN(candidates))
|
||||
var/mob/dead/observer/C = pick(candidates)
|
||||
C.transfer_ckey(friend, FALSE)
|
||||
@@ -74,26 +78,34 @@
|
||||
|
||||
/mob/camera/imaginary_friend/Login()
|
||||
..()
|
||||
to_chat(src, "<span class='notice'><b>You are the imaginary friend of [owner]!</b></span>")
|
||||
to_chat(src, "<span class='notice'>You are absolutely loyal to your friend, no matter what.</span>")
|
||||
to_chat(src, "<span class='notice'>You cannot directly influence the world around you, but you can see what [owner] cannot.</span>")
|
||||
greet()
|
||||
Show()
|
||||
|
||||
/mob/camera/imaginary_friend/proc/greet()
|
||||
to_chat(src, "<span class='notice'><b>You are the imaginary friend of [owner]!</b></span>")
|
||||
to_chat(src, "<span class='notice'>You are absolutely loyal to your friend, no matter what.</span>")
|
||||
to_chat(src, "<span class='notice'>You cannot directly influence the world around you, but you can see what [owner] cannot.</span>")
|
||||
|
||||
/mob/camera/imaginary_friend/Initialize(mapload, _trauma)
|
||||
. = ..()
|
||||
var/gender = pick(MALE, FEMALE)
|
||||
real_name = random_unique_name(gender)
|
||||
name = real_name
|
||||
|
||||
trauma = _trauma
|
||||
owner = trauma.owner
|
||||
copy_known_languages_from(owner, TRUE)
|
||||
human_image = get_flat_human_icon(null, pick(SSjob.occupations))
|
||||
|
||||
setup_friend()
|
||||
|
||||
join = new
|
||||
join.Grant(src)
|
||||
hide = new
|
||||
hide.Grant(src)
|
||||
|
||||
/mob/camera/imaginary_friend/proc/setup_friend()
|
||||
var/gender = pick(MALE, FEMALE)
|
||||
real_name = random_unique_name(gender)
|
||||
name = real_name
|
||||
human_image = get_flat_human_icon(null, pick(SSjob.occupations))
|
||||
|
||||
/mob/camera/imaginary_friend/proc/Show()
|
||||
if(!client) //nobody home
|
||||
return
|
||||
@@ -132,7 +144,7 @@
|
||||
if(client.prefs.muted & MUTE_IC)
|
||||
to_chat(src, "You cannot send IC messages (muted).")
|
||||
return
|
||||
if (src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
if (!(ignore_spam || forced) && src.client.handle_spam_prevention(message,MUTE_IC))
|
||||
return
|
||||
|
||||
friend_talk(message)
|
||||
@@ -218,4 +230,42 @@
|
||||
var/mob/camera/imaginary_friend/I = owner
|
||||
I.hidden = !I.hidden
|
||||
I.Show()
|
||||
update_status()
|
||||
update_status()
|
||||
|
||||
//down here is the trapped mind
|
||||
//like imaginary friend but a lot less imagination and more like mind prison//
|
||||
|
||||
/datum/brain_trauma/special/imaginary_friend/trapped_owner
|
||||
name = "Trapped Victim"
|
||||
desc = "Patient appears to be targeted by an invisible entity."
|
||||
gain_text = ""
|
||||
lose_text = ""
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/special/imaginary_friend/trapped_owner/make_friend()
|
||||
friend = new /mob/camera/imaginary_friend/trapped(get_turf(owner), src)
|
||||
|
||||
/datum/brain_trauma/special/imaginary_friend/trapped_owner/reroll_friend() //no rerolling- it's just the last owner's hell
|
||||
if(friend.client) //reconnected
|
||||
return
|
||||
friend_initialized = FALSE
|
||||
QDEL_NULL(friend)
|
||||
qdel(src)
|
||||
|
||||
/datum/brain_trauma/special/imaginary_friend/trapped_owner/get_ghost() //no randoms
|
||||
return
|
||||
|
||||
/mob/camera/imaginary_friend/trapped
|
||||
name = "figment of imagination?"
|
||||
real_name = "figment of imagination?"
|
||||
desc = "The previous host of this body."
|
||||
|
||||
/mob/camera/imaginary_friend/trapped/greet()
|
||||
to_chat(src, "<span class='notice'><b>You have managed to hold on as a figment of the new host's imagination!</b></span>")
|
||||
to_chat(src, "<span class='notice'>All hope is lost for you, but at least you may interact with your host. You do not have to be loyal to them.</span>")
|
||||
to_chat(src, "<span class='notice'>You cannot directly influence the world around you, but you can see what the host cannot.</span>")
|
||||
|
||||
/mob/camera/imaginary_friend/trapped/setup_friend()
|
||||
real_name = "[owner.real_name]?"
|
||||
name = real_name
|
||||
human_image = icon('icons/mob/lavaland/lavaland_monsters.dmi', icon_state = "curseblob")
|
||||
|
||||
@@ -64,21 +64,21 @@
|
||||
name = "Speech Impediment"
|
||||
desc = "Patient is unable to form coherent sentences."
|
||||
scan_desc = "communication disorder"
|
||||
gain_text = "" //mutation will handle the text
|
||||
lose_text = ""
|
||||
gain_text = "<span class='danger'>You can't seem to form any coherent thoughts!</span>"
|
||||
lose_text = "<span class='danger'>Your mind feels more clear.</span>"
|
||||
|
||||
/datum/brain_trauma/mild/speech_impediment/on_gain()
|
||||
ADD_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, TRAUMA_TRAIT)
|
||||
. = ..()
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/speech_impediment/on_lose()
|
||||
REMOVE_TRAIT(owner, TRAIT_UNINTELLIGIBLE_SPEECH, TRAUMA_TRAIT)
|
||||
. = ..()
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/concussion
|
||||
name = "Concussion"
|
||||
desc = "Patient's brain is concussed."
|
||||
scan_desc = "a concussion"
|
||||
scan_desc = "concussion"
|
||||
gain_text = "<span class='warning'>Your head hurts!</span>"
|
||||
lose_text = "<span class='notice'>The pressure inside your head starts fading.</span>"
|
||||
|
||||
@@ -157,54 +157,108 @@
|
||||
gain_text = "<span class='warning'>Your muscles feel oddly faint.</span>"
|
||||
lose_text = "<span class='notice'>You feel in control of your muscles again.</span>"
|
||||
|
||||
/datum/brain_trauma/mild/muscle_spasms/on_life()
|
||||
if(prob(7))
|
||||
switch(rand(1,5))
|
||||
if(1)
|
||||
if(owner.canmove && !isspaceturf(owner.loc))
|
||||
to_chat(owner, "<span class='warning'>Your leg spasms!</span>")
|
||||
step(owner, pick(GLOB.cardinals))
|
||||
if(2)
|
||||
if(owner.incapacitated())
|
||||
return
|
||||
var/obj/item/I = owner.get_active_held_item()
|
||||
if(I)
|
||||
to_chat(owner, "<span class='warning'>Your fingers spasm!</span>")
|
||||
owner.log_message("used [I] due to a Muscle Spasm", LOG_ATTACK)
|
||||
I.attack_self(owner)
|
||||
if(3)
|
||||
var/prev_intent = owner.a_intent
|
||||
owner.a_intent = INTENT_HARM
|
||||
|
||||
var/range = 1
|
||||
if(istype(owner.get_active_held_item(), /obj/item/gun)) //get targets to shoot at
|
||||
range = 7
|
||||
|
||||
var/list/mob/living/targets = list()
|
||||
for(var/mob/M in oview(owner, range))
|
||||
if(isliving(M))
|
||||
targets += M
|
||||
if(LAZYLEN(targets))
|
||||
to_chat(owner, "<span class='warning'>Your arm spasms!</span>")
|
||||
owner.log_message(" attacked someone due to a Muscle Spasm") //the following attack will log itself
|
||||
owner.ClickOn(pick(targets))
|
||||
owner.a_intent = prev_intent
|
||||
if(4)
|
||||
var/prev_intent = owner.a_intent
|
||||
owner.a_intent = INTENT_HARM
|
||||
to_chat(owner, "<span class='warning'>Your arm spasms!</span>")
|
||||
owner.log_message("attacked [owner.p_them()]self to a Muscle Spasm", LOG_ATTACK)
|
||||
owner.ClickOn(owner)
|
||||
owner.a_intent = prev_intent
|
||||
if(5)
|
||||
if(owner.incapacitated())
|
||||
return
|
||||
var/obj/item/I = owner.get_active_held_item()
|
||||
var/list/turf/targets = list()
|
||||
for(var/turf/T in oview(owner, 3))
|
||||
targets += T
|
||||
if(LAZYLEN(targets) && I)
|
||||
to_chat(owner, "<span class='warning'>Your arm spasms!</span>")
|
||||
owner.log_message("threw [I] due to a Muscle Spasm", LOG_ATTACK)
|
||||
owner.throw_item(pick(targets))
|
||||
/datum/brain_trauma/mild/muscle_spasms/on_gain()
|
||||
owner.apply_status_effect(STATUS_EFFECT_SPASMS)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/muscle_spasms/on_lose()
|
||||
owner.remove_status_effect(STATUS_EFFECT_SPASMS)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/nervous_cough
|
||||
name = "Nervous Cough"
|
||||
desc = "Patient feels a constant need to cough."
|
||||
scan_desc = "nervous cough"
|
||||
gain_text = "<span class='warning'>Your throat itches incessantly...</span>"
|
||||
lose_text = "<span class='notice'>Your throat stops itching.</span>"
|
||||
|
||||
/datum/brain_trauma/mild/nervous_cough/on_life()
|
||||
if(prob(12) && !HAS_TRAIT(owner, TRAIT_SOOTHED_THROAT))
|
||||
if(prob(5))
|
||||
to_chat(owner, "<span notice='warning'>[pick("You have a coughing fit!", "You can't stop coughing!")]</span>")
|
||||
owner.Stun(20)
|
||||
owner.emote("cough")
|
||||
addtimer(CALLBACK(owner, /mob/.proc/emote, "cough"), 6)
|
||||
addtimer(CALLBACK(owner, /mob/.proc/emote, "cough"), 12)
|
||||
owner.emote("cough")
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/mild/expressive_aphasia
|
||||
name = "Expressive Aphasia"
|
||||
desc = "Patient is affected by partial loss of speech leading to a reduced vocabulary."
|
||||
scan_desc = "inability to form complex sentences"
|
||||
gain_text = "<span class='warning'>You lose your grasp on complex words.</span>"
|
||||
lose_text = "<span class='notice'>You feel your vocabulary returning to normal again.</span>"
|
||||
|
||||
var/static/list/common_words = world.file2list("strings/1000_most_common.txt")
|
||||
|
||||
/datum/brain_trauma/mild/expressive_aphasia/handle_speech(datum/source, list/speech_args)
|
||||
var/message = speech_args[SPEECH_MESSAGE]
|
||||
if(message)
|
||||
var/list/message_split = splittext(message, " ")
|
||||
var/list/new_message = list()
|
||||
|
||||
for(var/word in message_split)
|
||||
var/suffix = copytext(word,-1)
|
||||
|
||||
// Check if we have a suffix and break it out of the word
|
||||
if(suffix in list("." , "," , ";" , "!" , ":" , "?"))
|
||||
word = copytext(word,1,-1)
|
||||
else
|
||||
suffix = ""
|
||||
|
||||
word = html_decode(word)
|
||||
|
||||
if(lowertext(word) in common_words)
|
||||
new_message += word + suffix
|
||||
else
|
||||
if(prob(30) && message_split.len > 2)
|
||||
new_message += pick("uh","erm")
|
||||
break
|
||||
else
|
||||
var/list/charlist = string2charlist(word) // Stupid shit code
|
||||
shuffle_inplace(charlist)
|
||||
charlist.len = round(charlist.len * 0.5,1)
|
||||
new_message += html_encode(jointext(charlist,"")) + suffix
|
||||
|
||||
message = jointext(new_message, " ")
|
||||
|
||||
speech_args[SPEECH_MESSAGE] = trim(message)
|
||||
|
||||
/datum/brain_trauma/mild/mind_echo
|
||||
name = "Mind Echo"
|
||||
desc = "Patient's language neurons do not terminate properly, causing previous speech patterns to occasionally resurface spontaneously."
|
||||
scan_desc = "looping neural pattern"
|
||||
gain_text = "<span class='warning'>You feel a faint echo of your thoughts...</span>"
|
||||
lose_text = "<span class='notice'>The faint echo fades away.</span>"
|
||||
var/list/hear_dejavu = list()
|
||||
var/list/speak_dejavu = list()
|
||||
|
||||
/datum/brain_trauma/mild/mind_echo/handle_hearing(datum/source, list/hearing_args)
|
||||
if(owner == hearing_args[HEARING_SPEAKER])
|
||||
return
|
||||
if(hear_dejavu.len >= 5)
|
||||
if(prob(25))
|
||||
var/deja_vu = pick_n_take(hear_dejavu)
|
||||
var/static/regex/quoted_spoken_message = regex("\".+\"", "gi")
|
||||
hearing_args[HEARING_MESSAGE] = quoted_spoken_message.Replace(hearing_args[HEARING_MESSAGE], "\"[deja_vu]\"") //Quotes included to avoid cases where someone says part of their name
|
||||
return
|
||||
if(hear_dejavu.len >= 15)
|
||||
if(prob(50))
|
||||
popleft(hear_dejavu) //Remove the oldest
|
||||
hear_dejavu += hearing_args[HEARING_RAW_MESSAGE]
|
||||
else
|
||||
hear_dejavu += hearing_args[HEARING_RAW_MESSAGE]
|
||||
|
||||
/datum/brain_trauma/mild/mind_echo/handle_speech(datum/source, list/speech_args)
|
||||
if(speak_dejavu.len >= 5)
|
||||
if(prob(25))
|
||||
var/deja_vu = pick_n_take(speak_dejavu)
|
||||
speech_args[SPEECH_MESSAGE] = deja_vu
|
||||
return
|
||||
if(speak_dejavu.len >= 15)
|
||||
if(prob(50))
|
||||
popleft(speak_dejavu) //Remove the oldest
|
||||
speak_dejavu += speech_args[SPEECH_MESSAGE]
|
||||
else
|
||||
speak_dejavu += speech_args[SPEECH_MESSAGE]
|
||||
@@ -2,8 +2,8 @@
|
||||
name = "Phobia"
|
||||
desc = "Patient is unreasonably afraid of something."
|
||||
scan_desc = "phobia"
|
||||
gain_text = ""
|
||||
lose_text = ""
|
||||
gain_text = "<span class='warning'>You start finding default values very unnerving...</span>"
|
||||
lose_text = "<span class='notice'>You no longer feel afraid of default values.</span>"
|
||||
var/phobia_type
|
||||
var/next_check = 0
|
||||
var/next_scare = 0
|
||||
@@ -14,8 +14,10 @@
|
||||
var/list/trigger_turfs
|
||||
var/list/trigger_species
|
||||
|
||||
/datum/brain_trauma/mild/phobia/New(specific_type)
|
||||
phobia_type = specific_type
|
||||
/datum/brain_trauma/mild/phobia/New(new_phobia_type)
|
||||
if(new_phobia_type)
|
||||
phobia_type = new_phobia_type
|
||||
|
||||
if(!phobia_type)
|
||||
phobia_type = pick(SStraumas.phobia_types)
|
||||
|
||||
@@ -29,6 +31,11 @@
|
||||
trigger_species = SStraumas.phobia_species[phobia_type]
|
||||
..()
|
||||
|
||||
|
||||
/datum/brain_trauma/mild/phobia/on_clone()
|
||||
if(clonable)
|
||||
return new type(phobia_type)
|
||||
|
||||
/datum/brain_trauma/mild/phobia/on_life()
|
||||
..()
|
||||
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
|
||||
@@ -44,6 +51,12 @@
|
||||
if(is_type_in_typecache(O, trigger_objs))
|
||||
freak_out(O)
|
||||
return
|
||||
for(var/mob/living/carbon/human/HU in seen_atoms) //check equipment for trigger items
|
||||
for(var/X in HU.get_all_slots() | HU.held_items)
|
||||
var/obj/I = X
|
||||
if(!QDELETED(I) && is_type_in_typecache(I, trigger_objs))
|
||||
freak_out(I)
|
||||
return
|
||||
|
||||
if(LAZYLEN(trigger_turfs))
|
||||
for(var/turf/T in seen_atoms)
|
||||
@@ -51,45 +64,41 @@
|
||||
freak_out(T)
|
||||
return
|
||||
|
||||
if(LAZYLEN(trigger_mobs) || LAZYLEN(trigger_objs))
|
||||
seen_atoms -= owner //make sure they aren't afraid of themselves.
|
||||
if(LAZYLEN(trigger_mobs) || LAZYLEN(trigger_species))
|
||||
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
|
||||
else if(ishuman(M)) //check their species
|
||||
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)
|
||||
return
|
||||
|
||||
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)
|
||||
/datum/brain_trauma/mild/phobia/handle_hearing(datum/source, list/hearing_args)
|
||||
if(!owner.can_hear() || world.time < next_scare) //words can't trigger you if you can't hear them *taps head*
|
||||
return message
|
||||
return
|
||||
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
|
||||
return message
|
||||
return
|
||||
for(var/word in trigger_words)
|
||||
var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
|
||||
var/regex/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
|
||||
|
||||
if(findtext(raw_message, reg))
|
||||
if(findtext(hearing_args[HEARING_RAW_MESSAGE], reg))
|
||||
addtimer(CALLBACK(src, .proc/freak_out, null, word), 10) //to react AFTER the chat message
|
||||
hearing_args[HEARING_MESSAGE] = reg.Replace(hearing_args[HEARING_MESSAGE], "<span class='phobia'>$1</span>")
|
||||
break
|
||||
return message
|
||||
|
||||
/datum/brain_trauma/mild/phobia/handle_speech(datum/source, list/speech_args)
|
||||
if(HAS_TRAIT(owner, TRAIT_FEARLESS))
|
||||
return
|
||||
for(var/word in trigger_words)
|
||||
var/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
|
||||
var/regex/reg = regex("(\\b|\\A)[REGEX_QUOTE(word)]'?s*(\\b|\\Z)", "i")
|
||||
|
||||
if(findtext(speech_args[SPEECH_MESSAGE], reg))
|
||||
to_chat(owner, "<span class='warning'>You can't bring yourself to say the word \"[word]\"!</span>")
|
||||
to_chat(owner, "<span class='warning'>You can't bring yourself to say the word \"<span class='phobia'>[word]</span>\"!</span>")
|
||||
speech_args[SPEECH_MESSAGE] = ""
|
||||
|
||||
/datum/brain_trauma/mild/phobia/proc/freak_out(atom/reason, trigger_word)
|
||||
@@ -125,6 +134,76 @@
|
||||
owner.Jitter(10)
|
||||
owner.stuttering += 10
|
||||
|
||||
// Defined phobia types for badminry, not included in the RNG trauma pool to avoid diluting.
|
||||
|
||||
/datum/brain_trauma/mild/phobia/spiders
|
||||
phobia_type = "spiders"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/space
|
||||
phobia_type = "space"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/security
|
||||
phobia_type = "security"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/clowns
|
||||
phobia_type = "clowns"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/greytide
|
||||
phobia_type = "greytide"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/lizards
|
||||
phobia_type = "lizards"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/skeletons
|
||||
phobia_type = "skeletons"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/snakes
|
||||
phobia_type = "snakes"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/robots
|
||||
phobia_type = "robots"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/doctors
|
||||
phobia_type = "doctors"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/authority
|
||||
phobia_type = "authority"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/supernatural
|
||||
phobia_type = "the supernatural"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/aliens
|
||||
phobia_type = "aliens"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/strangers
|
||||
phobia_type = "strangers"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/birds
|
||||
phobia_type = "birds"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/falling
|
||||
phobia_type = "falling"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/anime
|
||||
phobia_type = "anime"
|
||||
random_gain = FALSE
|
||||
|
||||
/datum/brain_trauma/mild/phobia/conspiracies
|
||||
phobia_type = "conspiracies"
|
||||
random_gain = FALSE
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
owner.update_disabled_bodyparts()
|
||||
|
||||
/datum/brain_trauma/severe/paralysis/paraplegic
|
||||
//can_gain = FALSE maybe breaks.
|
||||
random_gain = FALSE
|
||||
paralysis_type = "legs"
|
||||
resilience = TRAUMA_RESILIENCE_ABSOLUTE
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
/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"
|
||||
scan_desc = "monophobia"
|
||||
gain_text = ""
|
||||
lose_text = "<span class='notice'>You feel like you could be safe on your own.</span>"
|
||||
var/stress = 0
|
||||
@@ -168,7 +168,7 @@
|
||||
if(stress > 10 && (prob(5)))
|
||||
stress_reaction()
|
||||
else
|
||||
stress -= 4
|
||||
stress = max(stress - 4, 0)
|
||||
|
||||
/datum/brain_trauma/severe/monophobia/proc/check_alone()
|
||||
if(HAS_TRAIT(owner, TRAIT_BLIND))
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
else
|
||||
speak("neutral", prob(25))
|
||||
|
||||
/datum/brain_trauma/special/godwoken/on_gain()
|
||||
ADD_TRAIT(owner, TRAIT_HOLY, TRAUMA_TRAIT)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/special/godwoken/on_lose()
|
||||
REMOVE_TRAIT(owner, TRAIT_HOLY, TRAUMA_TRAIT)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/special/godwoken/proc/speak(type, include_owner = FALSE)
|
||||
var/message
|
||||
switch(type)
|
||||
@@ -36,7 +44,7 @@
|
||||
else
|
||||
message = pick_list_replacements(BRAIN_DAMAGE_FILE, "god_neutral")
|
||||
|
||||
playsound(get_turf(owner), 'sound/magic/clockwork/invoke_general.ogg', 200, 1, 5)
|
||||
playsound(get_turf(owner), 'sound/magic/clockwork/invoke_general.ogg', 200, TRUE, 5)
|
||||
voice_of_god(message, owner, list("colossus","yell"), 2.5, include_owner, FALSE)
|
||||
|
||||
/datum/brain_trauma/special/bluespace_prophet
|
||||
@@ -134,7 +142,101 @@
|
||||
|
||||
/datum/brain_trauma/special/psychotic_brawling/bath_salts
|
||||
name = "Chemical Violent Psychosis"
|
||||
random_gain = FALSE
|
||||
clonable = FALSE
|
||||
|
||||
/datum/brain_trauma/special/tenacity
|
||||
name = "Tenacity"
|
||||
desc = "Patient is psychologically unaffected by pain and injuries, and can remain standing far longer than a normal person."
|
||||
scan_desc = "traumatic neuropathy"
|
||||
gain_text = "<span class='warning'>You suddenly stop feeling pain.</span>"
|
||||
lose_text = "<span class='warning'>You realize you can feel pain again.</span>"
|
||||
|
||||
/datum/brain_trauma/special/tenacity/on_gain()
|
||||
ADD_TRAIT(owner, TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
|
||||
ADD_TRAIT(owner, TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/special/tenacity/on_lose()
|
||||
REMOVE_TRAIT(owner, TRAIT_NOSOFTCRIT, TRAUMA_TRAIT)
|
||||
REMOVE_TRAIT(owner, TRAIT_NOHARDCRIT, TRAUMA_TRAIT)
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/special/death_whispers
|
||||
name = "Functional Cerebral Necrosis"
|
||||
desc = "Patient's brain is stuck in a functional near-death state, causing occasional moments of lucid hallucinations, which are often interpreted as the voices of the dead."
|
||||
scan_desc = "chronic functional necrosis"
|
||||
gain_text = "<span class='warning'>You feel dead inside.</span>"
|
||||
lose_text = "<span class='notice'>You feel alive again.</span>"
|
||||
var/active = FALSE
|
||||
|
||||
/datum/brain_trauma/special/death_whispers/on_life()
|
||||
..()
|
||||
if(!active && prob(2))
|
||||
whispering()
|
||||
|
||||
/datum/brain_trauma/special/death_whispers/on_lose()
|
||||
if(active)
|
||||
cease_whispering()
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/special/death_whispers/proc/whispering()
|
||||
ADD_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
|
||||
active = TRUE
|
||||
addtimer(CALLBACK(src, .proc/cease_whispering), rand(50, 300))
|
||||
|
||||
/datum/brain_trauma/special/death_whispers/proc/cease_whispering()
|
||||
REMOVE_TRAIT(owner, TRAIT_SIXTHSENSE, TRAUMA_TRAIT)
|
||||
active = FALSE
|
||||
|
||||
/datum/brain_trauma/special/existential_crisis
|
||||
name = "Existential Crisis"
|
||||
desc = "Patient's hold on reality becomes faint, causing occasional bouts of non-existence."
|
||||
scan_desc = "existential crisis"
|
||||
gain_text = "<span class='notice'>You feel less real.</span>"
|
||||
lose_text = "<span class='warning'>You feel more substantial again.</span>"
|
||||
var/obj/effect/abstract/sync_holder/veil/veil
|
||||
var/next_crisis = 0
|
||||
|
||||
/datum/brain_trauma/special/existential_crisis/on_life()
|
||||
..()
|
||||
if(!veil && world.time > next_crisis && prob(3))
|
||||
if(isturf(owner.loc))
|
||||
fade_out()
|
||||
|
||||
/datum/brain_trauma/special/existential_crisis/on_lose()
|
||||
if(veil)
|
||||
fade_in()
|
||||
..()
|
||||
|
||||
/datum/brain_trauma/special/existential_crisis/proc/fade_out()
|
||||
if(veil)
|
||||
return
|
||||
var/duration = rand(50, 450)
|
||||
veil = new(owner.drop_location())
|
||||
to_chat(owner, "<span class='warning'>[pick("You stop thinking for a moment. Therefore you are not.",\
|
||||
"To be or not to be...",\
|
||||
"Why exist?",\
|
||||
"You stop keeping it real.",\
|
||||
"Your grip on existence slips.",\
|
||||
"Do you even exist?",\
|
||||
"You simply fade away.")]</span>")
|
||||
owner.forceMove(veil)
|
||||
SEND_SIGNAL(owner, COMSIG_MOVABLE_SECLUDED_LOCATION)
|
||||
for(var/thing in owner)
|
||||
var/atom/movable/AM = thing
|
||||
SEND_SIGNAL(AM, COMSIG_MOVABLE_SECLUDED_LOCATION)
|
||||
next_crisis = world.time + 600
|
||||
addtimer(CALLBACK(src, .proc/fade_in), duration)
|
||||
|
||||
/datum/brain_trauma/special/existential_crisis/proc/fade_in()
|
||||
QDEL_NULL(veil)
|
||||
to_chat(owner, "<span class='notice'>You fade back into reality.</span>")
|
||||
next_crisis = world.time + 600
|
||||
|
||||
//base sync holder is in desynchronizer.dm
|
||||
/obj/effect/abstract/sync_holder/veil
|
||||
name = "non-existence"
|
||||
desc = "Existence is just a state of mind."
|
||||
|
||||
/datum/brain_trauma/special/beepsky
|
||||
name = "Criminal"
|
||||
@@ -142,6 +244,7 @@
|
||||
scan_desc = "criminal mind"
|
||||
gain_text = "<span class='warning'>Justice is coming for you.</span>"
|
||||
lose_text = "<span class='notice'>You were absolved for your crimes.</span>"
|
||||
clonable = FALSE
|
||||
random_gain = FALSE
|
||||
var/obj/effect/hallucination/simple/securitron/beepsky
|
||||
|
||||
@@ -201,4 +304,4 @@
|
||||
|
||||
/obj/effect/hallucination/simple/securitron/Destroy()
|
||||
STOP_PROCESSING(SSfastprocess,src)
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
var/mob/living/split_personality/owner_backseat
|
||||
|
||||
/datum/brain_trauma/severe/split_personality/on_gain()
|
||||
var/mob/living/M = owner
|
||||
if(M.stat == DEAD) //No use assigning people to a corpse
|
||||
qdel(src)
|
||||
return
|
||||
..()
|
||||
make_backseats()
|
||||
get_ghost()
|
||||
@@ -23,7 +27,7 @@
|
||||
|
||||
/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?", ROLE_PAI, null, null, 75, stranger_backseat)
|
||||
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [owner]'s split personality?", ROLE_PAI, null, null, 75, stranger_backseat, POLL_IGNORE_SPLITPERSONALITY)
|
||||
if(LAZYLEN(candidates))
|
||||
var/mob/dead/observer/C = pick(candidates)
|
||||
C.transfer_ckey(stranger_backseat, FALSE)
|
||||
@@ -191,13 +195,13 @@
|
||||
/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(HAS_TRAIT(owner, TRAIT_DEAF) || owner == speaker)
|
||||
return message
|
||||
/datum/brain_trauma/severe/split_personality/brainwashing/handle_hearing(datum/source, list/hearing_args)
|
||||
if(HAS_TRAIT(owner, TRAIT_DEAF) || owner == hearing_args[HEARING_SPEAKER])
|
||||
return
|
||||
var/message = hearing_args[HEARING_MESSAGE]
|
||||
if(findtext(message, codeword))
|
||||
message = replacetext(message, codeword, "<span class='warning'>[codeword]</span>")
|
||||
hearing_args[HEARING_MESSAGE] = replacetext(message, codeword, "<span class='warning'>[codeword]</span>")
|
||||
addtimer(CALLBACK(src, /datum/brain_trauma/severe/split_personality.proc/switch_personalities), 10)
|
||||
return message
|
||||
|
||||
/datum/brain_trauma/severe/split_personality/brainwashing/handle_speech(datum/source, list/speech_args)
|
||||
if(findtext(speech_args[SPEECH_MESSAGE], codeword))
|
||||
|
||||
Reference in New Issue
Block a user