Files
Aurora.3/code/datums/brain_damage/imaginary_friend.dm
LordFowl 1086e1fdb2 [Ready for Review] Unapologetic Psych Buffs - Now with 80% less Mike Pence! (#4377)
This PR removes brain surgery's ability to instantly cure all traumas. Now traumas have been roughly divided into four categories of treatment:
1: Chakra therapy cures traumas that directly affect physical behavior, such as tourettes or paralysis. It is accomplished via the crystal therapy pod available to the psychiatrist.

2: Hypnotic therapy cures traumas that directly affect mental behavior, such as phobias or confusions. It is accomplished via the mesmetron pocketwatch available to the psychiatrist.

3: Isolation therapy cures traumas that cause hallucinations. It is accomplished via the metronome and facilitated by the isolation room available to the psychiatrist.

4: Surgical therapy cures traumas that do not fit into the above categories. It is accomplished via brain surgery.

Using the crystal therapy pod's neural scan function will provide the psychiatrist the brain damage the patient suffers from in numerical form. It falls upon the psychiatrist to determine how much of this brain damage is being caused by mental traumas the crystal therapy pod is equipped to deal with. Excessive cycles will cause increasing amounts of radiation damage.

The mesmetron pocketwatch requires the patient to believe in hypnosis. It then puts the patient into a slumber, where the psychiatrist can hypnotically suggest new behavior, provided the patient continues to believe in hypnosis. Each suggestion cures a single hypnotic trauma.
The isolation room is equipped with a metronome. When active, the metronome will have a chance every ticktock of the metronome to cure an isolation trauma, provided the patient is totally alone.

The psychiatry office has been expanded into a complete mental health ward. The only thing it is lacking is beds, as I believe recovering mental health patients still belong in the recovery ward.

The chaplain can also cure isolation and chakra traumas by dispelling the demons within with his null rod. Staring at the supermatter unprotected has been known to hypnotize. Electricity applied by any source directly to the head is also known to sometimes cure electroshock trauma.
2018-04-08 16:29:33 +03:00

138 lines
3.8 KiB
Plaintext

/datum/brain_trauma/special/imaginary_friend
name = "Imaginary Friend"
desc = "Patient can see and hear an imaginary person."
scan_desc = "partial schizophrenia"
gain_text = "<span class='notice'>You feel in good company, for some reason.</span>"
lose_text = "<span class='warning'>You feel lonely again.</span>"
cure_type = CURE_SOLITUDE
var/mob/abstract/mental/friend/friend
/datum/brain_trauma/special/imaginary_friend/on_gain()
..()
make_friend()
get_ghost()
/datum/brain_trauma/special/imaginary_friend/on_life()
if(get_dist(owner, friend) > 9)
friend.yank()
if(!friend)
qdel(src)
/datum/brain_trauma/special/imaginary_friend/on_lose()
..()
QDEL_NULL(friend)
/datum/brain_trauma/special/imaginary_friend/proc/make_friend()
friend = new(get_turf(src), src)
/datum/brain_trauma/special/imaginary_friend/proc/get_ghost()
set waitfor = FALSE
var/datum/ghosttrap/G = get_ghost_trap("friend")
G.request_player(friend, "Would you like to play as [owner]'s imaginary friend?", 60 SECONDS)
addtimer(CALLBACK(src, .proc/reset_search), 60 SECONDS)
/datum/brain_trauma/special/imaginary_friend/proc/reset_search()
if(src.friend && src.friend.key)
return
else
qdel(src)
/mob/abstract/mental
universal_understand = 1
incorporeal_move = 1
density = 0
/mob/abstract/mental/friend
name = "imaginary friend"
real_name = "imaginary friend"
desc = "A wonderful yet fake friend."
see_in_dark = 0
see_invisible = SEE_INVISIBLE_LIVING
var/icon/human_image
var/image/current_image
var/mob/living/carbon/owner
var/datum/brain_trauma/special/imaginary_friend/trauma
/mob/abstract/mental/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>")
/mob/abstract/mental/friend/Initialize(mapload, _trauma)
. = ..()
trauma = _trauma
owner = trauma.owner
var/gender = pick(MALE, FEMALE)
real_name = owner.species.get_random_name(gender)
name = real_name
var/list/candidates = list()
for(var/mob/living/L in living_mob_list)
candidates += L
var/mob/abstract/buddy = pick(candidates)
human_image = getFlatIcon(buddy)
Show()
/mob/abstract/mental/friend/proc/Show()
if(owner.client)
owner.client.images.Remove(current_image)
if(client)
client.images.Remove(current_image)
current_image = image(human_image, src, null, MOB_LAYER)
current_image.override = TRUE
current_image.name = name
if(owner.client)
owner.client.images |= current_image
if(client)
client.images |= current_image
/mob/abstract/mental/friend/Destroy()
if(owner.client)
owner.client.images.Remove(human_image)
if(client)
client.images.Remove(human_image)
return ..()
/mob/abstract/mental/friend/proc/yank()
if(!client) //don't bother the user with a braindead ghost every few steps
return
forceMove(get_turf(owner))
/mob/abstract/mental/friend/say(message)
if (!message)
return
if (src.client)
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))
return
friend_talk(message)
/mob/abstract/mental/friend/proc/friend_talk(message)
message = trim(copytext(sanitize(message), 1, MAX_MESSAGE_LEN))
if(!message)
return
var/rendered = "<span class='game say'><span class='name'>[name] says,</span> <span class='message'>\"[message]\"</span></span>"
to_chat(owner, "[rendered]")
to_chat(src, "[rendered]")
/mob/abstract/mental/friend/emote(act,m_type=1,message = null)
return
/mob/abstract/mental/friend/Move(NewLoc, Dir = 0)
loc = NewLoc
dir = Dir
if(get_dist(src, owner) > 9)
yank()
return TRUE
return TRUE
/mob/abstract/mental/friend/movement_delay()
return 2