From d5990c31d2be03fa5e07162afc034386d8a3f5fd Mon Sep 17 00:00:00 2001 From: Afevis Date: Sat, 8 Jun 2024 19:19:03 -0400 Subject: [PATCH] Implements some unused mood events into their relevant phobias. (#83796) Implements some unused mood events found in #83741 :cl: ShizCalev fix: Seeing heretical stuff while having the heresy phobia will now apply the heresy mood event. fix: Seeing skeletons while having the skeleton phobia will now apply the spooked (by skeletons) mood event. /:cl: --- code/datums/brain_damage/phobia.dm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/datums/brain_damage/phobia.dm b/code/datums/brain_damage/phobia.dm index cf97c2e6e85..9394bc98f57 100644 --- a/code/datums/brain_damage/phobia.dm +++ b/code/datums/brain_damage/phobia.dm @@ -10,6 +10,9 @@ /// Cooldown for freakouts to prevent permastunning. COOLDOWN_DECLARE(scare_cooldown) + ///What mood event to apply when we see the thing & freak out. + var/datum/mood_event/mood_event_type + var/regex/trigger_regex //instead of cycling every atom, only cycle the relevant types var/list/trigger_mobs @@ -34,6 +37,10 @@ trigger_species = GLOB.phobia_species[phobia_type] ..() +/datum/brain_trauma/mild/phobia/on_lose(silent) + owner.clear_mood_event("phobia_[phobia_type]") + return ..() + /datum/brain_trauma/mild/phobia/on_life(seconds_per_tick, times_fired) ..() if(HAS_TRAIT(owner, TRAIT_FEARLESS)) @@ -107,6 +114,8 @@ COOLDOWN_START(src, scare_cooldown, 12 SECONDS) if(owner.stat == DEAD) return + if(mood_event_type) + owner.add_mood_event("phobia_[phobia_type]", mood_event_type) var/message = pick("spooks you to the bone", "shakes you up", "terrifies you", "sends you into a panic", "sends chills down your spine") if(reason) to_chat(owner, span_userdanger("Seeing [span_phobia(reason.name)] [message]!")) @@ -193,6 +202,7 @@ /datum/brain_trauma/mild/phobia/heresy phobia_type = "heresy" + mood_event_type = /datum/mood_event/heresy random_gain = FALSE /datum/brain_trauma/mild/phobia/insects @@ -217,6 +227,7 @@ /datum/brain_trauma/mild/phobia/skeletons phobia_type = "skeletons" + mood_event_type = /datum/mood_event/spooked random_gain = FALSE /datum/brain_trauma/mild/phobia/snakes