aboutsummaryrefslogtreecommitdiff
path: root/engine/entities/routine.ts
blob: a7068c1029f12d34b22cc94aff979f9d61666581 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { GameTime } from '@hollowdark/time/gameTime'
import type { PersonId, RoutineId } from '@hollowdark/engine/entities/base'

export type RoutineCategory = 'work' | 'relationships' | 'self' | 'home' | 'play' | 'service'

/**
 * How a routine item modifies state each week. `targetSkill` and
 * `targetStatVariable` are mutually exclusive per effect — one effect
 * either grows a skill or nudges a state variable, not both.
 */
export interface RoutineEffect {
  readonly targetSkill: string | null
  readonly targetStatVariable: string | null
  readonly delta: number
}

export interface RoutineItem {
  readonly id: string
  readonly category: RoutineCategory
  readonly description: string
  readonly effects: readonly RoutineEffect[]
  readonly hoursPerWeek: number
  readonly startedAt: GameTime
  readonly endedAt: GameTime | null
}

/**
 * Persistent weekly commitments for a character. Routines run silently in
 * the flow stream — the player sets them once, they keep running until
 * changed.
 */
export interface Routine {
  readonly id: RoutineId
  readonly personId: PersonId
  readonly items: readonly RoutineItem[]
  readonly lastModifiedAt: GameTime
}