exists(id: string?) → boolean
| arg | type | description |
|---|
| id | string? | |
pos(id: string?) → void
| arg | type | description |
|---|
| id | string? | |
localPlayerId( ) → string
on(evt: string, fn: ?) → number
| arg | type | description |
|---|
| evt | string | |
| fn | ? | |
off(h: number) → void
| arg | type | description |
|---|
| h | number | |
emit(evt: string, payload: ?) → void
| arg | type | description |
|---|
| evt | string | |
| payload | ? | |
note(text: string) → void
| arg | type | description |
|---|
| text | string | |
expose(id: ?, spec: ?) → void
Make an entity rewritable. See README for the spec.
| arg | type | description |
|---|
| id | ? | |
| spec | ? | |
field(id: ?, key: string) → void
| arg | type | description |
|---|
| id | ? | |
| key | string | |
value(id: ?, key: string) → void
| arg | type | description |
|---|
| id | ? | |
| key | string | |
setValue(id: ?, key: string, v: ?) → void
Set a field's shown value on this peer without a rewrite (an adapter mirroring synced state).
| arg | type | description |
|---|
| id | ? | |
| key | string | |
| v | ? | |
hasRead(playerId: string, id: ?) → boolean
| arg | type | description |
|---|
| playerId | string | |
| id | ? | |
linesFor(rec: ?, playerId: string) → void
| arg | type | description |
|---|
| rec | ? | |
| playerId | string | |
useTargeting(fn: ?) → void
useResource(get: ?, spend: ?) → void
| arg | type | description |
|---|
| get | ? | |
| spend | ? | |
useGlitchChance(fn: ?) → void
useLocalPlayer(fn: ?) → void
usePosition(fn: ?) → void
pool(pid: string) → void
| arg | type | description |
|---|
| pid | string | |
resource(pid: string) → void
| arg | type | description |
|---|
| pid | string | |
spend(pid: string, amount: number) → boolean
| arg | type | description |
|---|
| pid | string | |
| amount | number | |
grant(pid: string, amount: number) → void
Give (or with a negative amount, take) built-in resource; authority only.
| arg | type | description |
|---|
| pid | string | |
| amount | number | |
setMaxResource(pid: string, max: number) → void
| arg | type | description |
|---|
| pid | string | |
| max | number | |
costOf(rec: ?, f: ?, value: ?) → number
| arg | type | description |
|---|
| rec | ? | |
| f | ? | |
| value | ? | |
glitchChanceFor(pid: string, rec: ?, f: ?) → number
| arg | type | description |
|---|
| pid | string | |
| rec | ? | |
| f | ? | |
allowed(f: ?, value: ?) → boolean
| arg | type | description |
|---|
| f | ? | |
| value | ? | |
inRange(pid: string, rec: ?) → boolean
| arg | type | description |
|---|
| pid | string | |
| rec | ? | |
fail(pid: string, id: string, key: string?, reason: string, from: number?) → void
| arg | type | description |
|---|
| pid | string | |
| id | string | |
| key | string? | |
| reason | string | |
| from | number? | |
applyValue(rec: ?, f: ?, value: ?, pid: string) → void
| arg | type | description |
|---|
| rec | ? | |
| f | ? | |
| value | ? | |
| pid | string | |
doRead(pid: string, id: string, from: number?) → void
| arg | type | description |
|---|
| pid | string | |
| id | string | |
| from | number? | |
doCommit(pid: string, id: string, key: string, value: ?, from: number?) → void
| arg | type | description |
|---|
| pid | string | |
| id | string | |
| key | string | |
| value | ? | |
| from | number? | |
read(playerId: string, id: ?) → void
READ `id` as `playerId`. On a non-authority peer this sends a request and answers true.
| arg | type | description |
|---|
| playerId | string | |
| id | ? | |
commit(playerId: string, id: ?, key: string, value: ?) → void
REWRITE field `key` of `id` to `value` as `playerId`.
| arg | type | description |
|---|
| playerId | string | |
| id | ? | |
| key | string | |
| value | ? | |
force(id: ?, key: string, value: ?) → void
Force a value from game code on the authority (no cost, no glitch), shown to everyone.
| arg | type | description |
|---|
| id | ? | |
| key | string | |
| value | ? | |
_handle(msg: ?, applied: boolean?) → void
every peer: apply an outcome to the local registry and fire events
| arg | type | description |
|---|
| msg | ? | |
| applied | boolean? | |
tick(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
teamOf(id: string) → string
| arg | type | description |
|---|
| id | string | |
damage(targetId: string, amount: number, sourceId: string?, element: string?) → void
Deal damage through the game's hook, or the kit's own HP on an Enemy adapter.
| arg | type | description |
|---|
| targetId | string | |
| amount | number | |
| sourceId | string? | |
| element | string? | |
registerHealth(id: string, fn: ?) → void
| arg | type | description |
|---|
| id | string | |
| fn | ? | |
markPlayer(id: string, on: boolean) → void
| arg | type | description |
|---|
| id | string | |
| on | boolean | |
onReq(from: ?, msg: ?) → void
| arg | type | description |
|---|
| from | ? | |
| msg | ? | |
onEvt(_from: ?, msg: ?) → void
| arg | type | description |
|---|
| _from | ? | |
| msg | ? | |