[reviewpls] Adds moodlets to the game - [Please give suggestions for trait additions in comments]

This commit is contained in:
Qustinnus
2018-03-08 02:15:57 +01:00
committed by CitadelStationBot
parent 4d0b7133c8
commit a96a28f3d6
86 changed files with 1220 additions and 43 deletions
+7 -1
View File
@@ -43,6 +43,9 @@
/datum/brain_trauma/mild/dumbness/on_gain()
owner.add_trait(TRAIT_DUMB, TRAUMA_TRAIT)
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
if(mood)
mood.add_event("dumb", /datum/mood_event/oblivious)
..()
/datum/brain_trauma/mild/dumbness/on_life()
@@ -56,6 +59,9 @@
/datum/brain_trauma/mild/dumbness/on_lose()
owner.remove_trait(TRAIT_DUMB, TRAUMA_TRAIT)
owner.derpspeech = 0
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
if(mood)
mood.clear_event("dumb")
..()
/datum/brain_trauma/mild/speech_impediment
@@ -211,4 +217,4 @@
to_chat(owner, "<span class='warning'>Your arm spasms!</span>")
log_attack("[key_name(owner)] threw [I] due to a Muscle Spasm.")
owner.throw_item(pick(targets))
..()
..()
+122
View File
@@ -0,0 +1,122 @@
/datum/component/mood
var/mood //Real happiness
var/shown_mood //Shown happiness, this is what others can see when they try to examine you, prevents antag checking by noticing traitors are always very happy.
var/mood_level //To track what stage of moodies they're on
var/mood_modifier = 1 //Modifier to allow certain mobs to be less affected by moodlets
var/datum/mood_event/list/mood_events = list()
var/mob/living/owner
/datum/component/mood/Initialize()
if(!isliving(parent))
. = COMPONENT_INCOMPATIBLE
CRASH("Some good for nothing loser put a mood component on something that isn't even a living mob.")
START_PROCESSING(SSmood, src)
owner = parent
/datum/component/mood/Destroy()
STOP_PROCESSING(SSmood, src)
return ..()
/datum/component/mood/proc/print_mood()
var/msg = "<span class='info'>*---------*\n<EM>Your current mood</EM>\n"
for(var/i in mood_events)
var/datum/mood_event/event = mood_events[i]
msg += event.description
to_chat(owner, msg)
/datum/component/mood/proc/update_mood() //Called whenever a mood event is added or removed
mood = 0
shown_mood = 0
for(var/i in mood_events)
var/datum/mood_event/event = mood_events[i]
mood += event.mood_change
if(!event.hidden)
shown_mood += event.mood_change
mood *= mood_modifier
shown_mood *= mood_modifier
switch(mood)
if(-INFINITY to MOOD_LEVEL_SAD4)
mood_level = 1
if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
mood_level = 2
if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
mood_level = 3
if(MOOD_LEVEL_SAD2 to MOOD_LEVEL_SAD1)
mood_level = 4
if(MOOD_LEVEL_SAD1 to MOOD_LEVEL_HAPPY1)
mood_level = 5
if(MOOD_LEVEL_HAPPY1 to MOOD_LEVEL_HAPPY2)
mood_level = 6
if(MOOD_LEVEL_HAPPY2 to MOOD_LEVEL_HAPPY3)
mood_level = 7
if(MOOD_LEVEL_HAPPY3 to MOOD_LEVEL_HAPPY4)
mood_level = 8
if(MOOD_LEVEL_HAPPY4 to INFINITY)
mood_level = 9
if(owner.client && owner.hud_used)
owner.hud_used.mood.icon_state = "mood[mood_level]"
/datum/component/mood/process() //Called on SSmood process
switch(mood)
if(-INFINITY to MOOD_LEVEL_SAD4)
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 3)
if(MOOD_LEVEL_SAD4 to MOOD_LEVEL_SAD3)
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 2)
if(MOOD_LEVEL_SAD3 to MOOD_LEVEL_SAD2)
owner.overlay_fullscreen("depression", /obj/screen/fullscreen/depression, 1)
if(MOOD_LEVEL_SAD2 to INFINITY)
owner.clear_fullscreen("depression")
if(owner.has_trait(TRAIT_DEPRESSION))
if(prob(0.1))
add_event("depression", /datum/mood_event/depression)
clear_event("jolly")
if(owner.has_trait(TRAIT_JOLLY))
if(prob(0.1))
add_event("jolly", /datum/mood_event/jolly)
clear_event("depression")
/datum/component/mood/proc/add_event(category, type, param) //Category will override any events in the same category, should be unique unless the event is based on the same thing like hunger.
var/datum/mood_event/the_event
if(mood_events[category])
the_event = mood_events[category]
if(the_event.type != type)
clear_event(category)
return .()
else
return 0 //Don't have to update the event.
else
the_event = new type(src, param)
mood_events[category] = the_event
update_mood()
if(the_event.timeout)
addtimer(CALLBACK(src, .proc/clear_event, category), the_event.timeout)
/datum/component/mood/proc/clear_event(category)
var/datum/mood_event/event = mood_events[category]
if(!event)
return 0
mood_events -= category
qdel(event)
update_mood()
/datum/component/mood/proc/update_beauty(var/area/A)
if(A.outdoors) //if we're outside, we don't care.
clear_event("area_beauty")
return FALSE
switch(A.beauty)
if(-INFINITY to BEAUTY_LEVEL_HORRID)
add_event("area_beauty", /datum/mood_event/disgustingroom)
if(BEAUTY_LEVEL_HORRID to BEAUTY_LEVEL_BAD)
add_event("area_beauty", /datum/mood_event/grossroom)
if(BEAUTY_LEVEL_BAD to BEAUTY_LEVEL_GOOD)
clear_event("area_beauty")
if(BEAUTY_LEVEL_GOOD to BEAUTY_LEVEL_GREAT)
add_event("area_beauty", /datum/mood_event/niceroom)
if(BEAUTY_LEVEL_GREAT to INFINITY)
add_event("area_beauty", /datum/mood_event/greatroom)
+39
View File
@@ -0,0 +1,39 @@
/datum/mood_event/drugs/high
mood_change = 6
description = "<span class='nicegreen'>Woooow duudeeeeee...I'm tripping baaalls...</span>\n"
/datum/mood_event/drugs/smoked
description = "<span class='nicegreen'>I have had a smoke recently.</span>\n"
mood_change = 2
timeout = 3600
/datum/mood_event/drugs/overdose
mood_change = -8
timeout = 3000
/datum/mood_event/drugs/overdose/add_effects(drug_name)
description = "<span class='warning'>I think I took a bit too much of that [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_light
mood_change = -2
/datum/mood_event/drugs/withdrawal_light/add_effects(drug_name)
description = "<span class='warning'>I could use some [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_medium
mood_change = -5
/datum/mood_event/drugs/withdrawal_medium/add_effects(drug_name)
description = "<span class='warning'>I really need [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_severe
mood_change = -8
/datum/mood_event/drugs/withdrawal_severe/add_effects(drug_name)
description = "<span class='boldwarning'>Oh god I need some [drug_name]</span>\n"
/datum/mood_event/drugs/withdrawal_critical
mood_change = -10
/datum/mood_event/drugs/withdrawal_critical/add_effects(drug_name)
description = "<span class='boldwarning'>[drug_name]! [drug_name]! [drug_name]!</span>\n"
@@ -0,0 +1,115 @@
/datum/mood_event/handcuffed
description = "<span class='warning'>I guess my antics have finally caught up with me..</span>\n"
mood_change = -1
/datum/mood_event/broken_vow //Used for when mimes break their vow of silence
description = "<span class='boldwarning'>I have brought shame upon my name, and betrayed my fellow mimes by breaking our sacred vow...</span>\n"
mood_change = -8
/datum/mood_event/on_fire
description = "<span class='boldwarning'>I'M ON FIRE!!!</span>\n"
mood_change = -8
/datum/mood_event/suffocation
description = "<span class='boldwarning'>CAN'T... BREATHE...</span>\n"
mood_change = -6
/datum/mood_event/burnt_thumb
description = "<span class='warning'>I shouldn't play with lighters...</span>\n"
mood_change = -1
timeout = 1200
/datum/mood_event/cold
description = "<span class='warning'>It's way too cold in here.</span>\n"
mood_change = -2
/datum/mood_event/hot
description = "<span class='warning'>It's getting hot in here.</span>\n"
mood_change = -2
/datum/mood_event/creampie
description = "<span class='warning'>I've been creamed. Tastes like pie flavor.</span>\n"
mood_change = -2
timeout = 1800
/datum/mood_event/slipped
description = "<span class='warning'>I slipped. I should be more careful next time...</span>\n"
mood_change = -3
timeout = 1800
/datum/mood_event/eye_stab
description = "<span class='boldwarning'>I used to be an adventurer like you, until I took a screwdriver to the eye.</span>\n"
mood_change = -6
timeout = 2400
/datum/mood_event/delam //SM delamination
description = "<span class='boldwarning'>Those God damn engineers can't do anything right...</span>\n"
mood_change = -6
timeout = 3000
/datum/mood_event/depression
description = "<span class='warning'>I feel sad for no particular reason.</span>\n"
mood_change = -6
timeout = 1200
/datum/mood_event/shameful_suicide //suicide_acts that return SHAME, like sord
description = "<span class='boldwarning'>I can't even end it all!</span>\n"
mood_change = -10
timeout = 600
/datum/mood_event/dismembered
description = "<span class='boldwarning'>AHH! I WAS USING THAT LIMB!</span>\n"
mood_change = -8
timeout = 3000
/datum/mood_event/noshoes
description = "<span class='warning'>I am a disgrace to comedy everywhere!</span>\n"
mood_change = -3
/datum/mood_event/tased
description = "<span class='warning'>There's no \"z\" in \"taser\". It's in the zap.</span>\n"
mood_change = -4
timeout = 1200
/datum/mood_event/embedded
description = "<span class='boldwarning'>Pull it out!</span>\n"
mood_change = -6
/datum/mood_event/table
description = "<span class='warning'>Someone threw me on a table!</span>\n"
mood_change = -2
timeout = 1200
/datum/mood_event/brain_damage
mood_change = -3
/datum/mood_event/brain_damage/add_effects()
var/damage_message = pick_list_replacements("brain_damage_lines.json", "brain_damage")
description = "<span class='warning'>Hurr durr... [damage_message]</span>\n"
/datum/mood_event/hulk //Entire duration of having the hulk mutation
description = "<span class='warning'>HULK SMASH!</span>\n"
mood_change = -4
/datum/mood_event/epilepsy //Only when the mutation causes a seizure
description = "<span class='warning'>I should have paid attention to the epilepsy warning.</span>\n"
mood_change = -3
timeout = 3000
/datum/mood_event/grossroom
description = "<span class='warning'>This room is kind of dirty...</span>\n"
mood_change = -3
/datum/mood_event/disgustingroom
description = "<span class='warning'>This room is disgusting!</span>\n"
mood_change = -5
//These are unused so far but I want to remember them to use them later
/datum/mood_event/cloned_corpse
description = "<span class='boldwarning'>I recently saw my own corpse...</span>\n"
mood_change = -6
/datum/mood_event/surgery
description = "<span class='boldwarning'>HE'S CUTTING ME OPEN!!</span>\n"
mood_change = -8
@@ -0,0 +1,71 @@
/datum/mood_event/hug
description = "<span class='nicegreen'>Hugs are nice.</span>\n"
mood_change = 1
timeout = 1200
/datum/mood_event/arcade
description = "<span class='nicegreen'>I beat the arcade game!</span>\n"
mood_change = 3
timeout = 3000
/datum/mood_event/blessing
description = "<span class='nicegreen'>I've been blessed.</span>\n"
mood_change = 3
timeout = 3000
/datum/mood_event/book_nerd
description = "<span class='nicegreen'>I have recently read a book.</span>\n"
mood_change = 3
timeout = 3000
/datum/mood_event/pet_corgi
description = "<span class='nicegreen'>Corgis are adorable! I can't stop petting them!</span>\n"
mood_change = 3
timeout = 3000
/datum/mood_event/honk
description = "<span class='nicegreen'>Maybe clowns aren't so bad after all. Honk!</span>\n"
mood_change = 2
timeout = 2400
/datum/mood_event/perform_cpr
description = "<span class='nicegreen'>It feels good to save a life.</span>\n"
mood_change = 6
timeout = 3000
/datum/mood_event/oblivious
description = "<span class='nicegreen'>What a lovely day.</span>\n"
mood_change = 3
/datum/mood_event/happytable
description = "<span class='nicegreen'>They want to play on the table!</span>\n"
mood_change = 2
timeout = 1200
/datum/mood_event/jolly
description = "<span class='nicegreen'>I feel happy for no particular reason.</span>\n"
mood_change = 6
timeout = 1200
/datum/mood_event/focused
description = "<span class='nicegreen'>I have a goal, and I will reach it, whatever it takes!</span>\n" //Used for syndies, nukeops etc so they can focus on their goals
mood_change = 12
hidden = TRUE
/datum/mood_event/revolution
description = "<span class='nicegreen'>VIVA LA REVOLUTION!</span>\n"
mood_change = 3
hidden = TRUE
/datum/mood_event/cult
description = "<span class='nicegreen'>I have seen the truth, praise the almighty one!</span>\n"
mood_change = 40 //maybe being a cultist isnt that bad after all
hidden = TRUE
/datum/mood_event/niceroom
description = "<span class='nicegreen'>This room looks really pretty!</span>\n"
mood_change = 4
/datum/mood_event/greatroom
description = "<span class='nicegreen'>This room is beautiful!</span>\n"
mood_change = 7
+19
View File
@@ -0,0 +1,19 @@
/datum/mood_event
var/description ///For descriptions, use the span classes bold nicegreen, nicegreen, none, warning and boldwarning in order from great to horrible.
var/mood_change = 0
var/timeout = 0
var/hidden = FALSE//Not shown on examine
var/mob/owner
/datum/mood_event/New(mob/M, param)
owner = M
add_effects(param)
/datum/mood_event/Destroy()
remove_effects()
/datum/mood_event/proc/add_effects(param)
return
/datum/mood_event/proc/remove_effects()
return
+54
View File
@@ -0,0 +1,54 @@
//nutrition
/datum/mood_event/nutrition/fat
description = "<span class='warning'><B>I'm so fat..</B></span>\n" //muh fatshaming
mood_change = -4
/datum/mood_event/nutrition/wellfed
description = "<span class='nicegreen'>My belly feels round and full.</span>\n"
mood_change = 6
/datum/mood_event/nutrition/fed
description = "<span class='nicegreen'>I have recently had some food.</span>\n"
mood_change = 3
/datum/mood_event/nutrition/hungry
description = "<span class='warning'>I'm getting a bit hungry.</span>\n"
mood_change = -8
/datum/mood_event/nutrition/starving
description = "<span class='boldwarning'>I'm starving!</span>\n"
mood_change = -15
//Disgust
/datum/mood_event/disgust/gross
description = "<span class='warning'>I saw something gross.</span>\n"
mood_change = -2
/datum/mood_event/disgust/verygross
description = "<span class='warning'>I think I'm going to puke...</span>\n"
mood_change = -5
/datum/mood_event/disgust/disgusted
description = "<span class='boldwarning'>Oh god that's disgusting...</span>\n"
mood_change = -8
//Generic needs events
/datum/mood_event/favorite_food
description = "<span class='nicegreen'>I really enjoyed eating that.</span>\n"
mood_change = 3
timeout = 2400
/datum/mood_event/gross_food
description = "<span class='nicegreen'>I really didn't like that food.</span>\n"
mood_change = -2
timeout = 2400
/datum/mood_event/disgusting_food
description = "<span class='nicegreen'>That food was disgusting!</span>\n"
mood_change = -4
timeout = 2400
/datum/mood_event/nice_shower
description = "<span class='nicegreen'>I have recently had a nice shower.</span>\n"
mood_change = 2
timeout = 1800
+3
View File
@@ -11,6 +11,9 @@
owner.visible_message("<span class='danger'>[owner] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
owner.Unconscious(200)
owner.Jitter(1000)
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
if(mood)
mood.add_event("epilepsy", /datum/mood_event/epilepsy)
addtimer(CALLBACK(src, .proc/jitter_less, owner), 90)
/datum/mutation/human/epilepsy/proc/jitter_less(mob/living/carbon/human/owner)
+7 -1
View File
@@ -14,6 +14,9 @@
owner.add_trait(TRAIT_STUNIMMUNE, TRAIT_HULK)
owner.add_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK)
owner.update_body_parts()
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
if(mood)
mood.add_event("hulk", /datum/mood_event/hulk)
/datum/mutation/human/hulk/on_attack_hand(mob/living/carbon/human/owner, atom/target, proximity)
if(proximity) //no telekinetic hulk attack
@@ -30,7 +33,10 @@
owner.remove_trait(TRAIT_STUNIMMUNE, TRAIT_HULK)
owner.remove_trait(TRAIT_PUSHIMMUNE, TRAIT_HULK)
owner.update_body_parts()
GET_COMPONENT_FROM(mood, /datum/component/mood, owner)
if(mood)
mood.clear_event("hulk")
/datum/mutation/human/hulk/say_mod(message)
if(message)
message = "[uppertext(replacetext(message, ".", "!"))]!!"
+23
View File
@@ -81,3 +81,26 @@
mob_trait = TRAIT_VORACIOUS
gain_text = "<span class='notice'>You feel HONGRY.</span>"
lose_text = "<span class='danger'>You no longer feel HONGRY.</span>"
/datum/trait/jolly
name = "Jolly"
desc = "You sometimes just feel happy, for no reason at all."
value = 1
mob_trait = TRAIT_JOLLY
/datum/trait/apathetic
name = "Apathetic"
desc = "You just don't care as much as other people, that's nice to have in a place like this, I guess."
value = 1
/datum/trait/apathetic/add()
GET_COMPONENT_FROM(mood, /datum/component/mood, trait_holder)
if(mood)
mood.mood_modifier = 0.8
/datum/trait/apathetic/remove()
GET_COMPONENT_FROM(mood, /datum/component/mood, trait_holder)
if(mood)
mood.mood_modifier = 1 //Change this once/if species get their own mood modifiers.
+9
View File
@@ -154,3 +154,12 @@
else if(prob(0.5) && dumb_thing)
to_chat(H, "<span class='danger'>You think of a dumb thing you said a long time ago and scream internally.</span>")
dumb_thing = FALSE //only once per life
/datum/trait/depression
name = "Depression"
desc = "You sometimes just hate life."
mob_trait = TRAIT_DEPRESSION
value = -1
gain_text = "<span class='danger'>You start feeling depressed.</span>"
lose_text = "<span class='notice'>You no longer feel depressed.</span>" //if only it were that easy!
medical_record_text = "Patient has a severe mood disorder causing them to experience sudden moments of sadness."