From 8ec16df2e41893fd539f543452436c6e55486c9d Mon Sep 17 00:00:00 2001 From: Ashe Higgs Date: Wed, 28 Mar 2018 09:14:08 -0400 Subject: [PATCH] Adds the Family Heirloom, Nyctophobia, and Monochromacy traits, and rebalances Social Anxiety (#36426) * Adds some more traits * April Fools' heirlooms * Fixes the detective sound * Refactor to use signals --- code/__HELPERS/unsorted.dm | 6 +- .../mood_events/generic_negative_events.dm | 8 ++ .../mood_events/generic_positive_events.dm | 4 + code/datums/traits/good.dm | 48 +++---- code/datums/traits/negative.dm | 119 ++++++++++++++++-- code/datums/traits/neutral.dm | 19 +++ code/game/objects/items/storage/toolbox.dm | 9 ++ .../clock_scriptures/scripture_drivers.dm | 6 +- code/modules/client/client_colour.dm | 7 +- 9 files changed, 187 insertions(+), 39 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index a63ff6bdf0..dfcc7a0eb8 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1301,8 +1301,12 @@ GLOBAL_REAL_VAR(list/stack_trace_storage) if(!istype(C)) return + var/animate_color = initial(C.color) + var/datum/client_colour/CC = C.mob.client_colours[1] + if(CC) + animate_color = CC.colour C.color = flash_color - animate(C, color = initial(C.color), time = flash_time) + animate(C, color = animate_color, time = flash_time) #define RANDOM_COLOUR (rgb(rand(0,255),rand(0,255),rand(0,255))) diff --git a/code/datums/mood_events/generic_negative_events.dm b/code/datums/mood_events/generic_negative_events.dm index 95161f4f39..3ee3e9b048 100644 --- a/code/datums/mood_events/generic_negative_events.dm +++ b/code/datums/mood_events/generic_negative_events.dm @@ -105,6 +105,14 @@ mood_change = -3 timeout = 3000 +/datum/mood_event/nyctophobia + description = "It sure is dark around here...\n" + mood_change = -3 + +/datum/mood_event/family_heirloom_missing + description = "I'm missing my family heirloom...\n" + mood_change = -4 + //These are unused so far but I want to remember them to use them later /datum/mood_event/cloned_corpse description = "I recently saw my own corpse...\n" diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index e96567cf9d..54eb74f10f 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -56,3 +56,7 @@ description = "I have seen the truth, praise the almighty one!\n" mood_change = 40 //maybe being a cultist isnt that bad after all hidden = TRUE + +/datum/mood_event/family_heirloom + description = "My family heirloom is safe with me.\n" + mood_change = 1 diff --git a/code/datums/traits/good.dm b/code/datums/traits/good.dm index 1bad7b3352..26c689e092 100644 --- a/code/datums/traits/good.dm +++ b/code/datums/traits/good.dm @@ -11,6 +11,23 @@ +/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. + + + /datum/trait/freerunning name = "Freerunning" desc = "You're great at quick moves! You can climb tables more quickly." @@ -21,6 +38,14 @@ +/datum/trait/jolly + name = "Jolly" + desc = "You sometimes just feel happy, for no reason at all." + value = 1 + mob_trait = TRAIT_JOLLY + + + /datum/trait/light_step name = "Light Step" desc = "You walk with a gentle step, making stepping on sharp objects quieter and less painful." @@ -81,26 +106,3 @@ mob_trait = TRAIT_VORACIOUS gain_text = "You feel HONGRY." lose_text = "You no longer feel HONGRY." - - -/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. diff --git a/code/datums/traits/negative.dm b/code/datums/traits/negative.dm index 59957ef2bc..2865877fce 100644 --- a/code/datums/traits/negative.dm +++ b/code/datums/traits/negative.dm @@ -1,5 +1,82 @@ //predominantly negative traits +/datum/trait/depression + name = "Depression" + desc = "You sometimes just hate life." + mob_trait = TRAIT_DEPRESSION + value = -1 + gain_text = "You start feeling depressed." + lose_text = "You no longer feel depressed." //if only it were that easy! + medical_record_text = "Patient has a severe mood disorder causing them to experience sudden moments of sadness." + + + +/datum/trait/family_heirloom + name = "Family Heirloom" + desc = "You are the current owner of an heirloom. passed down for generations. You have to keep it safe!" + value = -1 + var/obj/item/heirloom + var/where_text + +/datum/trait/family_heirloom/on_spawn() + var/mob/living/carbon/human/H = trait_holder + var/obj/item/heirloom_type + if(SSevents.holidays && SSevents.holidays[APRIL_FOOLS]) //on april fools, pick from any item in the game + var/list/heirlooms = subtypesof(/obj/item) + for(var/V in heirlooms) + var/obj/item/I = V + if((!initial(I.icon_state)) || (!initial(I.item_state)) || (initial(I.flags_1) & ABSTRACT_1)) + heirlooms -= V + heirloom_type = pick(heirlooms) + else + switch(trait_holder.mind.assigned_role) + if("Clown") + heirloom_type = /obj/item/bikehorn/golden + if("Mime") + heirloom_type = /obj/item/reagent_containers/food/snacks/baguette + if("Lawyer") + heirloom_type = /obj/item/gavelhammer + if("Janitor") + heirloom_type = /obj/item/mop + if("Security Officer") + heirloom_type = /obj/item/book/manual/wiki/security_space_law + if("Scientist") + heirloom_type = /obj/item/toy/plush/slimeplushie + if("Assistant") + heirloom_type = /obj/item/storage/toolbox/mechanical/old/heirloom + if(!heirloom_type) + heirloom_type = pick( + /obj/item/toy/cards/deck, + /obj/item/lighter, + /obj/item/dice/d20) + heirloom = new heirloom_type(get_turf(trait_holder)) + var/list/slots = list( + "in your backpack" = slot_in_backpack, + "in your left pocket" = slot_l_store, + "in your right pocket" = slot_r_store + ) + var/where = H.equip_in_one_of_slots(heirloom, slots) + if(!where) + where = "at your feet" + if(where == "in your backpack") + var/obj/item/storage/B = H.back + B.orient2hud(trait_holder) + B.show_to(trait_holder) + where_text = "There is a precious family [heirloom.name] [where], passed down from generation to generation. Keep it safe!" + +/datum/trait/family_heirloom/post_add() + to_chat(trait_holder, where_text) + var/list/family_name = splittext(trait_holder.real_name, " ") + heirloom.name = "\improper [family_name[family_name.len]] family [heirloom.name]" + +/datum/trait/family_heirloom/process() + if(heirloom in trait_holder.GetAllContents()) + trait_holder.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "family_heirloom_missing") + trait_holder.SendSignal(COMSIG_ADD_MOOD_EVENT, "family_heirloom", /datum/mood_event/family_heirloom) + else + trait_holder.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "family_heirloom") + trait_holder.SendSignal(COMSIG_ADD_MOOD_EVENT, "family_heirloom_missing", /datum/mood_event/family_heirloom_missing) + /datum/trait/heavy_sleeper @@ -44,6 +121,27 @@ +/datum/trait/nyctophobia + name = "Nyctophobia" + desc = "As far as you can remember, you've always been afraid of the dark. While in the dark without a light source, you instinctually act careful, and constantly feel a sense of dread." + value = -1 + +/datum/trait/nyctophobia/on_process() + var/mob/living/carbon/human/H = trait_holder + if(H.dna.species.id in list("shadow", "nightmare")) + return //we're tied with the dark, so we don't get scared of it; don't cleanse outright to avoid cheese + var/turf/T = get_turf(trait_holder) + var/lums = T.get_lumcount() + if(lums <= 0.2) + if(trait_holder.m_intent == MOVE_INTENT_RUN) + to_chat(trait_holder, "Easy, easy, take it slow... you're in the dark...") + trait_holder.toggle_move_intent() + trait_holder.SendSignal(COMSIG_ADD_MOOD_EVENT, "nyctophobia", /datum/mood_event/nyctophobia) + else + trait_holder.SendSignal(COMSIG_CLEAR_MOOD_EVENT, "nyctophobia") + + + /datum/trait/nonviolent name = "Pacifist" desc = "The thought of violence makes you sick. So much so, in fact, that you can't hurt anyone." @@ -156,21 +254,18 @@ var/dumb_thing = TRUE /datum/trait/social_anxiety/on_process() + var/nearby_people = 0 + for(var/mob/living/carbon/human/H in view(5, trait_holder)) + if(H.client) + nearby_people++ var/mob/living/carbon/human/H = trait_holder - if(prob(5)) + if(prob(2 + nearby_people)) H.stuttering = max(3, H.stuttering) - else if(prob(1) && !H.silent) + else if(prob(min(3, nearby_people)) && !H.silent) to_chat(H, "You retreat into yourself. You really don't feel up to talking.") H.silent = max(10, H.silent) else if(prob(0.5) && dumb_thing) - to_chat(H, "You think of a dumb thing you said a long time ago and scream internally.") + to_chat(H, "You think of a dumb thing you said a long time ago and scream internally.") 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 = "You start feeling depressed." - lose_text = "You no longer feel depressed." //if only it were that easy! - medical_record_text = "Patient has a severe mood disorder causing them to experience sudden moments of sadness." + if(prob(1)) + new/obj/item/reagent_containers/food/snacks/pastatomato(get_turf(H)) //now that's what I call spaghetti code diff --git a/code/datums/traits/neutral.dm b/code/datums/traits/neutral.dm index 140b751fd8..5b0fbefe10 100644 --- a/code/datums/traits/neutral.dm +++ b/code/datums/traits/neutral.dm @@ -31,3 +31,22 @@ var/datum/species/species = H.dna.species species.liked_food = initial(species.liked_food) species.disliked_food = initial(species.disliked_food) + + + +/datum/trait/monochromatic + name = "Monochromacy" + desc = "You suffer from full colorblindness, and perceive nearly the entire world in blacks and whites." + value = 0 + medical_record_text = "Patient is afflicted with almost complete color blindness." + +/datum/trait/monochromatic/add() + trait_holder.add_client_colour(/datum/client_colour/monochrome) + +/datum/trait/monochromatic/post_add() + if(trait_holder.mind.assigned_role == "Detective") + to_chat(trait_holder, "Mmm. Nothing's ever clear on this station. It's all shades of gray...") + trait_holder.playsound_local(trait_holder, 'sound/ambience/ambidet1.ogg', 50, FALSE) + +/datum/trait/monochromatic/remove() + trait_holder.remove_client_colour(/datum/client_colour/monochrome) diff --git a/code/game/objects/items/storage/toolbox.dm b/code/game/objects/items/storage/toolbox.dm index 454eabf058..74c559117f 100644 --- a/code/game/objects/items/storage/toolbox.dm +++ b/code/game/objects/items/storage/toolbox.dm @@ -78,6 +78,15 @@ icon_state = "toolbox_blue_old" has_latches = FALSE +/obj/item/storage/toolbox/mechanical/old/heirloom + name = "toolbox" //this will be named "X family toolbox" + desc = "It's seen better days." + force = 5 + w_class = WEIGHT_CLASS_NORMAL + +/obj/item/storage/toolbox/mechanical/old/heirloom/PopulateContents() + return + /obj/item/storage/toolbox/electrical name = "electrical toolbox" icon_state = "yellow" diff --git a/code/modules/antagonists/clockcult/clock_scriptures/scripture_drivers.dm b/code/modules/antagonists/clockcult/clock_scriptures/scripture_drivers.dm index 28ce2ccf60..ad4062598e 100644 --- a/code/modules/antagonists/clockcult/clock_scriptures/scripture_drivers.dm +++ b/code/modules/antagonists/clockcult/clock_scriptures/scripture_drivers.dm @@ -184,6 +184,7 @@ important = TRUE quickbind = TRUE quickbind_desc = "Returns you to Reebe." + var/client_color /datum/clockwork_scripture/abscond/check_special_requirements() if(is_reebe(invoker.z)) @@ -192,6 +193,7 @@ return TRUE /datum/clockwork_scripture/abscond/recital() + client_color = invoker.client.color animate(invoker.client, color = "#AF0AAF", time = 50) . = ..() @@ -214,11 +216,11 @@ invoker.pulling.forceMove(T) invoker.forceMove(T) if(invoker.client) - animate(invoker.client, color = initial(invoker.client.color), time = 25) + animate(invoker.client, color = client_color, time = 25) /datum/clockwork_scripture/abscond/scripture_fail() if(invoker && invoker.client) - animate(invoker.client, color = initial(invoker.client.color), time = 10) + animate(invoker.client, color = client_color, time = 10) //Replicant: Creates a new clockwork slab. diff --git a/code/modules/client/client_colour.dm b/code/modules/client/client_colour.dm index 7e78032f46..f1477fb4d2 100644 --- a/code/modules/client/client_colour.dm +++ b/code/modules/client/client_colour.dm @@ -105,4 +105,9 @@ colour = "#ff99ff" /datum/client_colour/glass_colour/gray - colour = "#cccccc" \ No newline at end of file + colour = "#cccccc" + + +/datum/client_colour/monochrome + colour = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) + priority = INFINITY //we can't see colors anyway!