aboutsummaryrefslogtreecommitdiff
path: root/engine/entities/world-event.ts
blob: ca158ccee91f77e5198acb5457cc2d9141f9781c (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
38
39
import type { GameTime } from '@hollowdark/time/gameTime'
import type { BaseEntity, PersonId, PlaceId, WorldEventId } from '@hollowdark/engine/entities/base'

export type EventCategory =
  | 'pandemic'
  | 'war'
  | 'economic'
  | 'political'
  | 'natural_disaster'
  | 'cultural'
  | 'scientific'
  | 'religious'
  | 'social_movement'
  | 'crime'
  | 'notable_individual'

export type SeverityLevel = 'mild' | 'moderate' | 'severe' | 'catastrophic'

/**
 * A named macro event decorating the timeline — a pandemic, war, cultural
 * shift, economic crash. Character-level impact is applied per-person via
 * templates referenced by contentRef; this entity is the world-scale record.
 */
export interface WorldEvent extends BaseEntity<WorldEventId, 'world_event'> {
  readonly contentRef: string
  readonly nameFormal: string
  readonly nameColloquial: string
  readonly category: EventCategory

  readonly startedAt: GameTime
  readonly endedAt: GameTime | null

  readonly affectedRegions: ReadonlyMap<PlaceId, SeverityLevel>

  readonly description: string

  /** IDs of people who have had this event's per-person impact applied. */
  readonly impactsApplied: readonly PersonId[]
}