diff options
| author | Bobby <[email protected]> | 2026-04-22 07:17:45 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-04-22 07:17:45 +0530 |
| commit | 26e0faa0c5d84705b67016d38ccdcca3fa601756 (patch) | |
| tree | 989e2f711e47be991b96f04c26b3d139835e7961 /engine/state | |
| parent | d7679cff3a0e54e27e4415e5b340b16afeedbf86 (diff) | |
| download | hollowdark-26e0faa0c5d84705b67016d38ccdcca3fa601756.tar.xz hollowdark-26e0faa0c5d84705b67016d38ccdcca3fa601756.zip | |
Define core entity interfaces
Diffstat (limited to 'engine/state')
| -rw-r--r-- | engine/state/dependency.ts | 25 | ||||
| -rw-r--r-- | engine/state/index.ts | 4 | ||||
| -rw-r--r-- | engine/state/mood.ts | 13 | ||||
| -rw-r--r-- | engine/state/satisfaction.ts | 10 | ||||
| -rw-r--r-- | engine/state/scar.ts | 14 |
5 files changed, 66 insertions, 0 deletions
diff --git a/engine/state/dependency.ts b/engine/state/dependency.ts new file mode 100644 index 0000000..53ab4de --- /dev/null +++ b/engine/state/dependency.ts @@ -0,0 +1,25 @@ +import type { GameTime } from 'time' + +/** + * A substance or behavioural dependency at a given stage of progression. + * Stages mirror docs/08-mental-health.md §"Addiction modeled honestly": + * experimentation → regular use → problem use → dependence → crisis → + * recovery | chronic | death. + */ +export type DependencyStage = + | 'experimentation' + | 'regular_use' + | 'problem_use' + | 'dependence' + | 'crisis' + | 'in_recovery' + | 'chronic' + +export interface Dependency { + readonly id: string + readonly substance: string + readonly stage: DependencyStage + readonly severity: number + readonly startedAt: GameTime + readonly lastRelapseAt: GameTime | null +} diff --git a/engine/state/index.ts b/engine/state/index.ts new file mode 100644 index 0000000..1641d3b --- /dev/null +++ b/engine/state/index.ts @@ -0,0 +1,4 @@ +export type { Dependency, DependencyStage } from './dependency' +export type { MoodState } from './mood' +export type { SatisfactionProfile } from './satisfaction' +export type { Scar } from './scar' diff --git a/engine/state/mood.ts b/engine/state/mood.ts new file mode 100644 index 0000000..1686292 --- /dev/null +++ b/engine/state/mood.ts @@ -0,0 +1,13 @@ +import type { GameTime } from 'time' + +/** + * Current-week emotional state on the valence × arousal plane. + * valence -1 (negative) to +1 (positive) + * arousal -1 (calm) to +1 (activated) + * See docs/08-mental-health.md §"Separate variables". + */ +export interface MoodState { + readonly valence: number + readonly arousal: number + readonly lastUpdated: GameTime +} diff --git a/engine/state/satisfaction.ts b/engine/state/satisfaction.ts new file mode 100644 index 0000000..a10421b --- /dev/null +++ b/engine/state/satisfaction.ts @@ -0,0 +1,10 @@ +/** + * Life satisfaction split into hedonic (day-to-day pleasure) and eudaimonic + * (sense of meaning / purpose). They can diverge, and eudaimonic matters + * more for end-of-life peace (docs/13-spirituality.md §"Life satisfaction + * is distinct from happiness"). Each 0–1. + */ +export interface SatisfactionProfile { + readonly hedonic: number + readonly eudaimonic: number +} diff --git a/engine/state/scar.ts b/engine/state/scar.ts new file mode 100644 index 0000000..3cd682a --- /dev/null +++ b/engine/state/scar.ts @@ -0,0 +1,14 @@ +import type { GameTime } from 'time' + +/** + * A lasting mark left by a high-weight event. Scars don't decay the way + * mood or stress do — they persist and colour future trait drift, + * relationship patterns, and event eligibility. + */ +export interface Scar { + readonly id: string + readonly kind: string + readonly occurredAt: GameTime + readonly severity: number + readonly summary: string +} |
