Appearance
twine / MobStates
Interface: MobStates<S> โ
Defined in: spool/dist/plugins/mob/types.d.ts:32
A mob's state switch, handed to every body that runs as the mob.
Type Parameters โ
S โ
S extends string
Properties โ
clock โ
readonlyclock:Score
Defined in: spool/dist/plugins/mob/types.d.ts:44
Polls left in the current timed state, on @s - what phases within a state test.
Methods โ
byDifficulty() โ
byDifficulty(
ctx,body):void
Defined in: spool/dist/plugins/mob/types.d.ts:42
Runs body for the pack's difficulty level, e.g. damage(..., config[level].hitDamage).
Built once per level, so if (!config[level].shockwave) return drops a feature.
Parameters โ
ctx โ
FunctionContext
body โ
(ctx, level) => void
Returns โ
void
enter() โ
enter(
ctx,state):void
Defined in: spool/dist/plugins/mob/types.d.ts:34
Put this mob (@s) into state, running its onEnter.
Parameters โ
ctx โ
FunctionContext
state โ
S
Returns โ
void
leave() โ
leave(
ctx):void
Defined in: spool/dist/plugins/mob/types.d.ts:36
Take this mob (@s) out of any state.
Parameters โ
ctx โ
FunctionContext
Returns โ
void