Amagiri: Hollow Bell — the shared interface.
Every slice of the game talks through this module and nothing else.
It holds the world anchors, the vocabularies (emotions, resonances,
characters, endings), the run state, an event bus, and the three
registries the slices hand content to each other through.
It owns no entities, no UI and no behaviour. It is the contract.
on(event: string, fn: (any) → void
| arg | type | description |
|---|
| event | string | |
| fn | (any | |
emit(event: string, payload: any) → void
| arg | type | description |
|---|
| event | string | |
| payload | any | |
clearHandlersFor(_owner: string) → void
Drop every handler a slice registered, so a rebuild does not double-fire.
Called for you by Game.rebuild / Game.boot before a slice's build() runs.
| arg | type | description |
|---|
| _owner | string | |
registerInteractable(spec: any) → void
spec: { id, position = {x,y,z}, radius?, label, kind? }
kind is free text; "dialogue" and "bell" are the two this game uses.
| arg | type | description |
|---|
| spec | any | |
unregisterInteractable(id: string) → void
| arg | type | description |
|---|
| id | string | |
setInteractableEnabled(id: string, on: boolean) → void
| arg | type | description |
|---|
| id | string | |
| on | boolean | |
interactables( ) → void
An array copy, so the caller may iterate while a slice re-registers.
registerDialogue(id: string, script: any) → void
| arg | type | description |
|---|
| id | string | |
| script | any | |
dialogue(id: string) → any
| arg | type | description |
|---|
| id | string | |
registerPortrait(key: string, spec: any) → void
| arg | type | description |
|---|
| key | string | |
| spec | any | |
portrait(key: string) → any
| arg | type | description |
|---|
| key | string | |
setDialogueRunner(fn: (string) → void
Dialogue driving
`vn` installs the runner; `traversal` calls Game.startDialogue on interact.
| arg | type | description |
|---|
| fn | (string | |
startDialogue(id: string) → boolean
| arg | type | description |
|---|
| id | string | |
setInputLock(on: boolean) → void
| arg | type | description |
|---|
| on | boolean | |
grantResonance(id: string) → void
Run state mutation
| arg | type | description |
|---|
| id | string | |
hasResonance(id: string) → boolean
| arg | type | description |
|---|
| id | string | |
resonanceCount( ) → number
setFading(t: number) → void
| arg | type | description |
|---|
| t | number | |
flags(characterId: string) → any
| arg | type | description |
|---|
| characterId | string | |
endRun(ending: string) → void
| arg | type | description |
|---|
| ending | string | |
resetRun( ) → void
Put the run back at its start. Any slice may call it; each slice resets
its own view by listening for "run:reset".
sliceRoot(name: string, fresh: boolean?) → any
The entity a slice parents its content under. `fresh` despawns whatever
the slice made last time, so build() is idempotent for free.
| arg | type | description |
|---|
| name | string | |
| fresh | boolean? | |
loadSlice(name: string) → any
| arg | type | description |
|---|
| name | string | |
rebuild(name: string) → boolean
| arg | type | description |
|---|
| name | string | |
tick(dt: number, mode: string?) → void
| arg | type | description |
|---|
| dt | number | |
| mode | string? | |