Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/game/gamemodes/gameticker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ var/global/datum/controller/gameticker/ticker
collect_minds()
equip_characters()
data_core.manifest()
assign_disorders() //Rolls mental disorders for all characters. See modules/urist/mental.dm
current_state = GAME_STATE_PLAYING

spawn(0)//Forking here so we dont have to wait for this to finish
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,13 @@

var/mob/living/carbon/human/character = create_character() //creates the human and transfers vars and mind
job_master.EquipRank(character, rank, 1) //equips the human

character.loc = pick(latejoin)
character.lastarea = get_area(loc)

if(character.mind.assigned_role != "Cyborg")
data_core.manifest_inject(character)
character.roll_disorder() //roll for mental disorders; see modules/urist/mental.dm
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
AnnounceArrival(character, rank)
else
Expand Down
159 changes: 159 additions & 0 deletions code/modules/urist/mental.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/*
Mental Illness are invisible, non-contagious diseases that the Psychologist can treat.
*/

#define DISORDER_CHANCE 5 //The percent chance a new crewmember will have a random mental disorder
#define RANDOM_DISORDER 0 //If 0, a player selected for a disorder can choose which one they receive

/datum/disease/mental //Stuff that's common to all mental illnesses
form = "Mental Illness"
affected_species = list("Human")
spread_type = NON_CONTAGIOUS
longevity = 0
curable = 0
can_carry = 0
hidden = list(1, 1)

/*Define the disorders themselves
They all need to have defined max_stages, cure, and cure_id variables, as well as a stage_act() proc.
Since they don't show up on health scanners, anything else is just fluff for the moment.
*/

/datum/disease/mental/sad //Basically just a placeholder
name = "Space Affective Disorder"
desc = "Spending a long time away from a planetary environment can cause minor despression"
severity = "Minor"
max_stages = 4
cure = "citalopram"
cure_id = "citalopram"
//cure_list = list("citalopram", "paroxetine") //ToDo: figure out how cure_list works

/datum/disease/mental/sad/stage_act()
..()
switch(stage)//Latent in the early stages
if(3)
if(prob(1))
affected_mob << "\red You feel unhappy."
if(prob(1))
affected_mob.emote(pick("sigh","frown"))
if(4)
if(prob(2))
affected_mob << "\red You feel SAD!"
if(prob(2))
affected_mob.emote(pick("sigh","frown"))

/datum/disease/mental/depression //A serious mood disorder
name = "Space Depression"
desc = "Depression in SPAAAAACE!"
severity = "Major"
max_stages = 6
cure = "citalopram"
cure_id = null //Space depression has no cure, but it can be treated
stage_prob = 2 //Should advance pretty slowly

/datum/disease/mental/depression/stage_act()
..()
switch(stage)//Stages 1-3 are latent, with no adverse symptons
if(4)//Stage 4 gives messages and is treatable
if(affected_mob.reagents.has_reagent("citalopram")||affected_mob.reagents.has_reagent("paroxetine")) //Treatable, but ultimately incurable
stage = 1
return
if(prob(2))
affected_mob.emote(pick("sigh","frown","mumble"))
if(prob(2))
affected_mob << "\red [pick("You feel empty inside.","You feel sad for no reason.",\
"You're starting to lose interest in the world.")]"

if(5)//Various bad things start to happen at stage 5
if(affected_mob.reagents.has_reagent("citalopram")||affected_mob.reagents.has_reagent("paroxetine")) //Treatable, but ultimately incurable
stage = 1
return
if(prob(1))
affected_mob.halloss += rand(1,8)
affected_mob << "\red Your [pick("body","head")] aches."
if(prob(3))
affected_mob.bodytemperature -= rand(10,20)
if(prob(1))
affected_mob.nutrition -= rand(50,100)
if(prob(3))
affected_mob.emote(pick("sigh","frown","mumble","groan","stare"))
if(prob(3))
affected_mob << "\red [pick("You feel empty inside.","You feel down in the dumps.",\
"You don't really care about anything anymore.","You want to lay down and cry.")]"
if(6)
if(affected_mob.reagents.has_reagent("citalopram")||affected_mob.reagents.has_reagent("paroxetine"))
stage = 1
return
if(prob(2))
affected_mob.halloss += rand(5,15)
affected_mob << "\red Your [pick("body","head")] aches."
return
if(prob(5))
affected_mob.bodytemperature -= rand(20,30)
return
if(prob(2))
affected_mob.nutrition -= rand(100,200)
if(prob(4))
affected_mob.emote(pick("sigh","frown","mumble","groan","stare","whimper","cry"))
if(prob(4))
affected_mob << "\red [pick("You can't do anything right, can you?", "Aren't you just worthless?",\
"Why don't you kill yourself already?", "You feel empty inside.",\
"You feel crushing despair.", "You don't really care about anything anymore.",\
"You want to lay down and cry.")]"



//These procs assign a random mental disorder to new crewmembers based on the preset DISORDER_CHANCE
//They don't have any safety checks, so there might be some weird edge case that breaks them. ToDo: fix this, obviously

/mob/proc/roll_disorder() //If a certain low number is rolled, assign a mental disease to the mob and add a prescription to their backpack
if(prob(DISORDER_CHANCE))

//Pick a disorder
var/datum/disease/mental/D
if(RANDOM_DISORDER == 0)//Disorder choice is on
spawn(0)//I need to take another look at this. The selection should time out after a while? -CoZarctan
switch(input(src, "What kind of crazy are you?") in list("SAD", "Depression"))//Add new disorders to this list
if("SAD")
D = new /datum/disease/mental/sad
if("Depression")
D = new /datum/disease/mental/depression
src.give_disorder(D)
else
var/disorder_type = pick(/datum/disease/mental/sad, /datum/disease/mental/depression)//Add new disorders to this list so they'll be picked
D = new disorder_type
src.give_disorder(D)


/proc/assign_disorders()
for(var/mob/living/carbon/human/player in player_list)
player.roll_disorder()

/mob/proc/give_disorder(var/datum/disease/mental/D)
//Assign the disorder
var/mob/living/carbon/human/H = src
D.carrier = 0
D.holder = H
D.affected_mob = H
src.viruses += D

//Adds a note to medical records //Still have to get this working! -Cozarctan
/*
var/datum/data/record/R = find_record("mi_dis", "None", data_core.medical)
R.fields["ma_dis"] = "[D.name]"
R.fields["ma_dis_d"] = "Treat with [D.cure]."
*/

//Add an empty pill bottle to backpack if it exists.
switch(H.backbag)
if(1)
var/obj/item/weapon/storage/pill_bottle/prescription/B = new /obj/item/weapon/storage/pill_bottle(src)
B.name = "Bottle of [D.cure] pills"
src.equip_to_slot_or_del(B, slot_l_hand)
if(2 || 3)
var/obj/item/weapon/storage/backpack/BPK = src.get_item_by_slot(slot_back)
var/obj/item/weapon/storage/pill_bottle/prescription/B = new /obj/item/weapon/storage/pill_bottle/prescription
B.name = "[D.cure] prescription"
B.loc = BPK
B.on_enter_storage(BPK)

5 changes: 5 additions & 0 deletions code/modules/urist/uristpapers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Please keep it tidy, by which I mean put comments describing the item before the
name = "'Psychologist Medicine (READ THIS)'"
info = "<center>So You Want To Be A Psychologist? Part Two: Pills</center><Br><Br> <small>An important part of your job is prescribing the proper medication for a patient's mind. One pill should do the trick in most cases, but how do you know what pill to use? You have also been given Chemistry access in case those chemists turn out to be your patients, and will need to know how to make these drugs. This handy guide will help you do just that! <Br><Br>Methylphenidate<Br>Methylphenidate is a drug that will help improve a patient's concentration if they are having trouble focusing on their job. <Br>Made with 1 part mindbreaker and 1 part hydrogen. <Br><Br>Citalopram<Br>Citalopram is a mild anti-depressant that will also help stablilize a patient's mind. <Br>Made with 1 part mindbreaker and 1 part carbon. <Br><Br>Paroxetine<Br>Paroxetine is a strong anti-depressent that will also be very effective at stabilizing your patient's mind. However, the drug itself is unstable, and can lead to an extremely deterioated mental state and hallucinations. Use with caution. <Br>Made with 1 part mindbreaker, 1 part oxygen and 1 part inaprovaline.</small>"

//Note for crew that spawn with a mental illness
/obj/item/weapon/paper/prescriptionreminder
name = "Note to Self"
info = "Remember to get this prescription refilled."

//S-COM pamphlet

obj/item/weapon/paper/pamphlet/SCOM
Expand Down
9 changes: 9 additions & 0 deletions code/modules/urist/uristpills.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,12 @@ Please keep it tidy, by which I mean put comments describing the item before the
new /obj/item/weapon/reagent_containers/pill/methylphenidate( src )
new /obj/item/weapon/reagent_containers/pill/methylphenidate( src )

//Empty pill bottles for crew that spawn with a mental disorder
//This is kind of hacky, since pill bottles can't normally hold paper, so think of something better!
/obj/item/weapon/storage/pill_bottle/prescription
name = "bottle of prescribed pills"
desc = "Contains pills issued to crew members to treat chronic conditions."

New()
..()
new /obj/item/weapon/paper/prescriptionreminder( src )
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@
#include "code\modules\telesci\gps.dm"
#include "code\modules\telesci\telepad.dm"
#include "code\modules\telesci\telesci_computer.dm"
#include "code\modules\urist\mental.dm"
#include "code\modules\urist\necromorph.dm"
#include "code\modules\urist\policetape.dm"
#include "code\modules\urist\uristanimals.dm"
Expand Down