EntityAIClass
Index
Interfaces
Interfaces
EntityAIPrototype
Object used to register entity AI prototypes.
optionaldata
Object containing the state of the AI type.
optionalparams
Default parameters set.
optionalattackedBy
Called when entity is attacked by player.
Parameters
attacker: number
player that attacked this entity
Returns void
optionaldeath
Called when entity is dead.
Parameters
attacker: number
entity that damaged this entity, or -1 if damage source is not an entity
Returns void
optionalexecute
Defines main logic of the AI type.
Returns void
optionalexecutionEnded
Called when AI type execution ends.
Returns void
optionalexecutionPaused
Called when AI type execution is paused.
Returns void
optionalexecutionResumed
Called when AI type execution is resumed.
Returns void
optionalexecutionStarted
Called when AI type execution starts.
Parameters
optionalextra: any
additional data passed from EntityAIClass.enableAI method
Returns void
optionalgetDefaultName
Returns string
AI type's default name.
optionalgetDefaultPriority
Returns number
AI type's default priority.
optionalhurtBy
Called when entity gets hurt.
Parameters
attacker: number
entity that damaged this entity, or -1 if damage source is not an entity
damage: number
amount of damage
Returns void
optionalprojectileHit
Called when a projectile hits the entity.
Parameters
projectile: number
projectile entity ID
Returns void
WanderLikeAIPrototype
Object used to register entity AI prototypes.
optionalangular_speed
Entity speed when turning.
optionaldata
Object containing the state of the AI type.
optionalparams
Default parameters set.
optionalspeed
Entity movement speed when AI is executed.
optionalattackedBy
Called when entity is attacked by player.
Parameters
attacker: number
player that attacked this entity
Returns void
optionaldeath
Called when entity is dead.
Parameters
attacker: number
entity that damaged this entity, or -1 if damage source is not an entity
Returns void
optionalexecute
Defines main logic of the AI type.
Returns void
optionalexecutionEnded
Called when AI type execution ends.
Returns void
optionalexecutionPaused
Called when AI type execution is paused.
Returns void
optionalexecutionResumed
Called when AI type execution is resumed.
Returns void
optionalexecutionStarted
Called when AI type execution starts.
Parameters
optionalextra: any
additional data passed from EntityAIClass.enableAI method
Returns void
optionalgetDefaultName
Returns string
AI type's default name.
optionalgetDefaultPriority
Returns number
AI type's default priority.
optionalhurtBy
Called when entity gets hurt.
Parameters
attacker: number
entity that damaged this entity, or -1 if damage source is not an entity
damage: number
amount of damage
Returns void
optionalprojectileHit
Called when a projectile hits the entity.
Parameters
projectile: number
projectile entity ID
Returns void