Class default<DescriptionType, TypeType, TagType, CounterType>Abstract

Entity class that allows movement

Type Parameters

  • DescriptionType = unknown

  • TypeType extends number = number

  • TagType = unknown

  • CounterType = unknown

Hierarchy

Implements

Constructors

  • Type Parameters

    • DescriptionType = unknown

    • TypeType extends number = number

    • TagType = unknown

    • CounterType = unknown

    Parameters

    Returns default<DescriptionType, TypeType, TagType, CounterType>

Properties

_description?: DescriptionType
_movementTime?: {
    end: number;
    start: number;
}

Type declaration

  • end: number
  • start: number
allowSmartMovementClientside?: boolean
anim?: number
attackAnimationTime?: IMovementTime
attackAnimationType?: DamageType
direction?: default

undefined = Vector2.ZERO for this

entityType: EntityType
event: IEventEmitter<default<DescriptionType, TypeType, TagType, CounterType>, IEntityMovableEvents>
facingDirection?: East | North | West | South

undefined = Direction.None for this

fromX?: number

Note: This might not be a whole number.

fromY?: number

Note: This might not be a whole number.

id: number
isMoving?: boolean

Not guaranteed to be synced between the server and client for Human entities

islandId: `${number},${number}`
moveType?: MoveType
movementCompleteZ?: number

Only used for Human entities

movingClientside: MovingClientSide = MovingClientSide.NoInput

The state of what the client thinks is happening to this entity (regarding movement)

movingOptions?: IMoveToOptions
preventRendering?: boolean
referenceId?: number

Do not use this property directly, instead use `game.references.getReference()

renamed?: string | ISerializedTranslation
shouldSkipNextMovement?: true
shouldSkipNextUpdate?: true
tileUpdateType: TileUpdateType
type: TypeType
x: number
y: number

Accessors

  • get asCorpse(): undefined | default
  • Returns undefined | default

  • get asCreature(): undefined | default
  • Returns undefined | default

  • get asDoodad(): undefined | default
  • Returns undefined | default

  • get asEntity(): default<DescriptionType, TypeType, TagType, unknown>
  • Returns default<DescriptionType, TypeType, TagType, unknown>

  • get asEntityMovable(): default<DescriptionType, TypeType, TagType, unknown>
  • Returns default<DescriptionType, TypeType, TagType, unknown>

  • get asEntityWithStats(): undefined | default<DescriptionType, TypeType, TagType>
  • Returns undefined | default<DescriptionType, TypeType, TagType>

  • get asHuman(): undefined | default<number>
  • Returns undefined | default<number>

  • get asItem(): undefined | default
  • Returns undefined | default

  • get asLocalPlayer(): undefined | default
  • Returns undefined | default

  • get asNPC(): undefined | default
  • Returns undefined | default

  • get asTileEvent(): undefined | default
  • Returns undefined | default

  • get description(): undefined | DescriptionType
  • Get the entities description

    Returns undefined | DescriptionType

  • get facingTile(): default
  • Regular entities don't have a direction so this will be the same as getTile()

    Returns default

  • get isFlying(): boolean
  • Returns boolean

  • get point(): undefined | IVector3
  • Location of the entity on the world. Parent classes will probably mark this as always defined

    Returns undefined | IVector3

  • get reference(): undefined | Reference
  • Returns undefined | Reference

  • get tile(): undefined | default
  • Tile the entity is on in the world. Parent classes will probably mark this as always defined

    Returns undefined | default

  • get tilesAround(): undefined | default[]
  • Returns undefined | default[]

Methods

  • Adds a referenceId to the entity if it doesn't already have one

    Returns void

  • Parameters

    • tag: TagType

    Returns void

  • Parameters

    Returns void

  • Faces the target and animates a bump into effect

    Parameters

    Returns void

  • Parameters

    Returns boolean

  • Parameters

    • type: CanASeeBType
    • islandId: `${number},${number}`
    • x: number
    • y: number
    • z: number
    • fieldOfView: undefined | default = renderer.fieldOfView
    • Optional customRadius: number

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • entity: default<unknown, number, unknown, unknown>
    • source: undefined | string

    Returns boolean

  • Returns void

  • Gets a data

    Returns

    Data value or undefined if it wasn't found

    Type Parameters

    • T

    Parameters

    • key: string

      Data key

    Returns undefined | T

  • Called when filling out the entities description for the first time

    Returns undefined | DescriptionType

  • Returns string

  • Returns MoveType

  • Returns number

  • Parameters

    • timeStamp: number

    Returns IVector2

  • Gets movement progress and moves the state machine forward when the movement is completed

    Parameters

    • timeStamp: number

    Returns number

  • Gets the temperature produced by this object. Positive values are "heat", negative values are "cold". Refer to the values of the Temperature enum to see the possible range. If this method is not implemented, or it returns undefined, Temperature.Neutral is used.

    Returns undefined | number

  • Check if a data was set

    Returns

    True if the data exists, false if it doesn't

    Parameters

    • key: string

      Data key

    Returns boolean

  • Parameters

    • tag: TagType

    Returns boolean

  • Parameters

    • entity: default<DescriptionType, number, unknown, unknown>

    Returns boolean

  • Returns boolean

  • Checks if the entity is within the viewport bounds of one or more humans

    Returns boolean

  • Returns void

  • Parameters

    Returns void

  • Parameters

    • type: SfxType
    • Optional delay: number
    • Optional speed: number

    Returns void

  • Parameters

    • type: SfxType
    • Optional delay: number
    • Optional speed: number

    Returns void

  • Removes a data

    Returns

    True when the data is removed. False if the key wasn't set

    Parameters

    • key: string

      Data key

    Returns boolean

  • Parameters

    • tag: TagType

    Returns void

  • Sets a data

    Rturns

    The value

    Type Parameters

    • T

    Parameters

    • key: string

      Data key

    • value: T

      Data value

    Returns T

  • Parameters

    • fromX: number = ...
    • fromY: number = ...

    Returns void

  • Parameters

    Returns void

  • Parameters

    • fromX: number
    • fromY: number
    • Optional toZ: number
    • Optional options: IMoveToOptions

    Returns void

  • Skips the next movement for this creature / npc

    Returns void

  • Skips the next update for this creature / npc

    Returns void

  • Returns string

  • Faces the target tile

    Parameters

    Returns void

  • Called when the entity is about to move to another tile. This should update relevant properties on the tile and return true

    Returns

    False to block the move

    Parameters

    • fromTile: default

      Tile the entity was on

    • toTile: default

      Tile the entity is moving onto

    Returns boolean

Generated using TypeDoc