Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Entity

Hierarchy

Implements

Index

Constructors

constructor

  • Returns Entity

Properties

anim

anim: number

attackAnimationEndTime

attackAnimationEndTime: number | undefined

attackAnimationType

attackAnimationType: DamageType | undefined

entityType

entityType: EntityType

Readonly event

event: IEventEmitter<this, IEntityEvents> = new EventEmitter<this, E>(this)

facingDirection

facingDirection: Cardinal | None

fromX

fromX: number

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

fromY

fromY: number

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

id

id: number

moveType

moveType: MoveType | undefined

properties

properties: IProperties | undefined

Optional referenceId

referenceId: undefined | number

Optional renamed

renamed: string | ISerializedTranslation

Readonly stat

stat: Stats<this> = new Stats(this)

stats

stats: IStats

status

status: IStatus

stopNextMovement

stopNextMovement: boolean

x

x: number

y

y: number

z

z: number

Accessors

asCreature

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

asEntity

  • Returns Entity

asHuman

  • get asHuman(): Human | undefined
  • Returns Human | undefined

asNPC

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

asPlayer

  • get asPlayer(): Player | undefined
  • Returns Player | undefined

Methods

addProperty

  • addProperty(property: Property, value: any): void
  • Parameters

    Returns void

animateAttack

  • animateAttack(damageType: DamageType[] | undefined): void
  • Parameters

    Returns void

animateBumpTowards

  • animateBumpTowards(x: number, y: number): void
  • Faces the target and animates a bump into effect

    Parameters

    • x: number
    • y: number

    Returns void

canSeeObject

  • Parameters

    Returns boolean

canSeePosition

  • canSeePosition(type: CanASeeBType, tileX: number, tileY: number, tileZ: number): boolean
  • Parameters

    • type: CanASeeBType
    • tileX: number
    • tileY: number
    • tileZ: number

    Returns boolean

Abstract damage

  • damage(damageInfoOrAmount: IDamageInfo | number): number | undefined
  • Parameters

    Returns number | undefined

getActiveStatuses

  • Generator for status effects on the entity.

    Returns StatusEffect[]

Protected Abstract getApplicableStatusEffects

  • Returns Set<StatusType>

getCraftingDifficulty

  • Parameters

    Returns number

getFacingPoint

  • Returns IVector3

getFacingTile

  • Returns ITile

getInspectionId

  • getInspectionId(): string

getMoveType

  • Returns MoveType

getMovementFinishTime

  • getMovementFinishTime(_timeStamp: number): number | undefined
  • Parameters

    • _timeStamp: number

    Returns number | undefined

getMovementPoint

  • getMovementPoint(timeStamp: number): IVector2
  • Parameters

    • timeStamp: number

    Returns IVector2

getMovementProgress

  • getMovementProgress(timeStamp: number): number
  • Parameters

    • timeStamp: number

    Returns number

Abstract getName

  • Returns Translation

getPoint

  • Returns IVector3

getProducedTemperature

  • getProducedTemperature(): number | undefined
  • Returns number | undefined

getProperty

  • getProperty<T>(property: Property): T | undefined
  • Type parameters

    • T

    Parameters

    Returns T | undefined

getStatus

  • Returns the handler for this status effect, whether or not this entity currently has the effect.

    Type parameters

    Parameters

    Returns undefined | S

getStatuses

  • Generator for status effects on the entity.

    Returns StatusEffect[]

getTile

  • Returns ITile

getTileUpdateType

hasProperty

  • hasProperty(property: Property): boolean
  • Parameters

    Returns boolean

hasStatus

  • Returns whether the entity has the given StatusType

    Parameters

    Returns boolean

isInFov

  • isInFov(): boolean
  • Returns boolean

isNearby

  • isNearby(entity: Entity): boolean
  • Parameters

    Returns boolean

isOnFire

  • Returns FireType

moveTo

  • moveTo(x: number, y: number, z: number): boolean
  • Parameters

    • x: number
    • y: number
    • z: number

    Returns boolean

notifyItem

notifyStat

  • Parameters

    Returns void

onUnserialized

  • onUnserialized(): void

queueSoundEffect

  • queueSoundEffect(type: SfxType, delay?: number, speed?: number, noPosition?: boolean): void
  • Parameters

    • type: SfxType
    • Default value delay: number = 0
    • Default value speed: number = 1
    • Default value noPosition: boolean = false

    Returns void

queueSoundEffectInFront

  • queueSoundEffectInFront(type: SfxType, delay?: number, speed?: number, noPosition?: boolean): void
  • Parameters

    • type: SfxType
    • Default value delay: number = 0
    • Default value speed: number = 1
    • Default value noPosition: boolean = false

    Returns void

removeProperty

  • removeProperty(property: Property): boolean
  • Parameters

    Returns boolean

setInFov

  • setInFov(inFov: boolean): void
  • Parameters

    • inFov: boolean

    Returns void

setMoveType

  • Parameters

    Returns void

setStatus

  • Sets whether the entity has the given StatusType. Emits EntityEvent.StatusChange.

    Parameters

    Returns void

toString

  • toString(): string
  • Returns string

Object literals

direction

direction: object

x

x: number = 0

y

y: number = 0

Generated using TypeDoc