Files
Bubberstation/code/datums/components/fearful/terror_handler.dm
SmArtKar 107188c51e Terror Unification: Converts all "fear" quirks and traumas (except item phobias) to use a unified handler (#90217)
## About The Pull Request

This PR adds the fearful component which acts as a unified handler for
terror effects. This currently includes nyctophobia and claustrophobia
quirks, terrified status effect from nightmare's spell, and the
monophobia brain trauma. The component processes terror handler datums
which act both as terror sources and effects - jittering, stuttering,
vomiting, panic attacks, etc.
This means that nyctophobia and claustrophobia now act more like
terrified status/monophobia - causing jitters, stuttering, periodic
panic attacks, etc, and their effects stack (i.e. being in a closet in
the dark will increase your fear much quicker).

Closes #37492
Closes #57121
Closes #69684

## Why It's Good For The Game

Terrified status is very immersive and its effects perfectly fit
nycto/claustrophobia quirks, enough to be impactful to owner's gameplay,
but not roleplaying for them, which is what we want quirks to be. It
also makes them share their stress, which is how you'd expect them to
act. (I would also love to see monophobia moved from a brain trauma to a
quirk, as it perfectly fits latter instead of former, and acts as a
great incentive to interact with other people instead of doing autism
projects by yourself.)
I haven't moved phobias to this system yet, but it could be done in the
future without too many issues - should make phobias less painful to
deal with, and maybe make people actually interested in playing around
them instead of rushing a lobotomy because of how debilitating they are
(currently only interaction is getting hugged by someone you're afraid
of, which will increase your terror)

## Changelog
🆑
add: Nyctophobia and Claustrophobia quirks now have proper terror
effects instead of making you walk/suffocate. Immersion!
refactor: All sources of "terror"/"fear" now use a common component,
meaning they share their counters.
/🆑
2025-03-27 21:01:23 +01:00

28 lines
1.1 KiB
Plaintext

/// Terror handlers, aka datums which determine current fear behaviors.
/// Separated into two groups, fear sources and fear effects, latter processing after all former are finished
/datum/terror_handler
/// Owner of this fear handler
var/mob/living/owner
/// Component which "houses" this handler
var/datum/component/fearful/component
/// Type of this handler, determines if it should run in the first or second batch
var/handler_type = TERROR_HANDLER_SOURCE
/// Is this a "default" handler? If so, it will be added to any fearful component unless its initialized with add_defaults = FALSE
var/default = FALSE
/// Other effects which should be disabled while this one is running
var/list/overrides
/datum/terror_handler/New(mob/living/new_owner, datum/component/fearful/new_component)
. = ..()
owner = new_owner
component = new_component
/datum/terror_handler/Destroy(force)
owner = null
component = null
return ..()
/// Single tick of terror handler, returns adjustment to terror buildup
/datum/terror_handler/proc/tick(seconds_per_tick, terror_buildup)
return 0