From 36c7d2c110d3f6a383489feee7b8be2c509ad2f4 Mon Sep 17 00:00:00 2001 From: coiax Date: Thu, 11 Feb 2021 04:26:50 +0000 Subject: [PATCH] Move Jolly and Depression into mood handling (#56580) The Jolly and Depression quirks are much more active. You can expect the positive/negative moodlets to affect you around 50% of the time. Previously, the probability of the Jolly/Depression moodlet firing was so low, you only have a less than 1/3 chance of seeing the 2 minute moodlet in an hour of play. Now they will be far more active. Depression's hardcore point value has increased, since it is far more negative now. The quirks now just add the TRAIT_JOLLY and TRAIT_DEPRESSION, which is then used by the mood component to have a chance of triggering the corresponding mood episode. Gonbolas now have an always on positive mood message, rather than applying a do nothing TRAIT_JOLLY trait. To demonstrate how the mood traits are independent of the quirks, There is now a "jolly grey cap", which gives you TRAIT_JOLLY while it is being worn. --- code/datums/components/mood.dm | 9 +++++++++ .../datums/mood_events/generic_positive_events.dm | 4 ++++ code/datums/quirks/good.dm | 4 ---- code/datums/quirks/negative.dm | 6 +----- code/datums/status_effects/debuffs.dm | 15 ++++++++------- code/modules/clothing/head/soft_caps.dm | 9 +++++++++ 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index 0162879efc3..696d2c079e4 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -194,6 +194,15 @@ setSanity(sanity+0.6*delta_time, SANITY_NEUTRAL, SANITY_MAXIMUM) HandleNutrition() + // 0.416% is 15 successes / 3600 seconds. Calculated with 2 minute + // mood runtime, so 50% average uptime across the hour. + if(HAS_TRAIT(parent, TRAIT_DEPRESSION) && DT_PROB(0.416, delta_time)) + add_event(null, "depression_mild", /datum/mood_event/depression_mild) + + if(HAS_TRAIT(parent, TRAIT_JOLLY) && DT_PROB(0.416, delta_time)) + add_event(null, "jolly", /datum/mood_event/jolly) + + ///Sets sanity to the specified amount and applies effects. /datum/component/mood/proc/setSanity(amount, minimum=SANITY_INSANE, maximum=SANITY_GREAT, override = FALSE) // If we're out of the acceptable minimum-maximum range move back towards it in steps of 0.7 diff --git a/code/datums/mood_events/generic_positive_events.dm b/code/datums/mood_events/generic_positive_events.dm index 93bd0473d77..9ee7ffedc36 100644 --- a/code/datums/mood_events/generic_positive_events.dm +++ b/code/datums/mood_events/generic_positive_events.dm @@ -224,6 +224,10 @@ mood_change = 3 timeout = 90 SECONDS +/datum/mood_event/gondola + description = "I feel at peace and feel no need to make any sudden or rash actions.\n" + mood_change = 6 + /datum/mood_event/kiss description = "Someone blew a kiss at me, I must be a real catch!\n" mood_change = 1.5 diff --git a/code/datums/quirks/good.dm b/code/datums/quirks/good.dm index 0f4e14ce76b..52374440f84 100644 --- a/code/datums/quirks/good.dm +++ b/code/datums/quirks/good.dm @@ -126,10 +126,6 @@ mood_quirk = TRUE medical_record_text = "Patient demonstrates constant euthymia irregular for environment. It's a bit much, to be honest." -/datum/quirk/jolly/on_process(delta_time) - if(DT_PROB(0.05, delta_time)) - SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "jolly", /datum/mood_event/jolly) - /datum/quirk/light_step name = "Light Step" desc = "You walk with a gentle step; footsteps and stepping on sharp objects is quieter and less painful." diff --git a/code/datums/quirks/negative.dm b/code/datums/quirks/negative.dm index 0f9b145daae..3421b5f550c 100644 --- a/code/datums/quirks/negative.dm +++ b/code/datums/quirks/negative.dm @@ -116,11 +116,7 @@ lose_text = "You no longer feel depressed." //if only it were that easy! medical_record_text = "Patient has a mild mood disorder causing them to experience acute episodes of depression." mood_quirk = TRUE - hardcore_value = 1 - -/datum/quirk/depression/on_process(delta_time) - if(DT_PROB(0.05, delta_time)) - SEND_SIGNAL(quirk_holder, COMSIG_ADD_MOOD_EVENT, "depression_mild", /datum/mood_event/depression_mild) + hardcore_value = 2 /datum/quirk/family_heirloom name = "Family Heirloom" diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 2bf28f8e1c6..2037462bfef 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -634,16 +634,17 @@ alert_type = null /datum/status_effect/gonbola_pacify/on_apply() - ADD_TRAIT(owner, TRAIT_PACIFISM, "gonbolaPacify") - ADD_TRAIT(owner, TRAIT_MUTE, "gonbolaMute") - ADD_TRAIT(owner, TRAIT_JOLLY, "gonbolaJolly") + . = ..() + ADD_TRAIT(owner, TRAIT_PACIFISM, type) + ADD_TRAIT(owner, TRAIT_MUTE, type) + SEND_SIGNAL(owner, COMSIG_ADD_MOOD_EVENT, type, /datum/mood_event/gondola) to_chat(owner, "You suddenly feel at peace and feel no need to make any sudden or rash actions...") - return ..() /datum/status_effect/gonbola_pacify/on_remove() - REMOVE_TRAIT(owner, TRAIT_PACIFISM, "gonbolaPacify") - REMOVE_TRAIT(owner, TRAIT_MUTE, "gonbolaMute") - REMOVE_TRAIT(owner, TRAIT_JOLLY, "gonbolaJolly") + REMOVE_TRAIT(owner, TRAIT_PACIFISM, type) + REMOVE_TRAIT(owner, TRAIT_MUTE, type) + SEND_SIGNAL(owner, COMSIG_CLEAR_MOOD_EVENT, type) + return ..() /datum/status_effect/trance id = "trance" diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm index 4c6a6db3f87..2f49cabc025 100644 --- a/code/modules/clothing/head/soft_caps.dm +++ b/code/modules/clothing/head/soft_caps.dm @@ -77,6 +77,15 @@ soft_type = "grey" dog_fashion = null +/* A grey baseball cap that grants TRAIT_JOLLY when it's on your head. + * Used for testing that gaining and losing the JOLLY trait behaves properly. + * Also a perfectly valid weird admin reward. + */ +/obj/item/clothing/head/soft/grey/jolly + name = "jolly grey cap" + desc = "It's a baseball hat in a sublime grey colour. Why, wearing this alone would boost a person's spirits!" + clothing_traits = list(TRAIT_JOLLY) + /obj/item/clothing/head/soft/orange name = "orange cap" desc = "It's a baseball hat in a tasteless orange colour."