Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICreatureOld

Hierarchy

Implements

Index

Constructors

constructor

  • new ICreatureOld(creatureType?: CreatureType, x?: number, y?: number, z?: number, aberrant?: undefined | false | true): ICreatureOld
  • Parameters

    • Optional creatureType: CreatureType
    • Default value x: number = 0
    • Default value y: number = 0
    • Default value z: number = 0
    • Optional aberrant: undefined | false | true

    Returns ICreatureOld

Properties

Optional aberrant

aberrant: undefined | false | true

ai

ai: AiType

anim

anim: number

attackAnimationEndTime

attackAnimationEndTime: number | undefined

attackAnimationType

attackAnimationType: DamageType | undefined

Optional chickenEggCounter

chickenEggCounter: undefined | number

Optional enemy

enemy: undefined | number

Optional enemyAttacks

enemyAttacks: undefined | number

Optional enemyAttempts

enemyAttempts: undefined | number

Optional enemyIsPlayer

enemyIsPlayer: undefined | false | true

Readonly entityType

entityType: Creature = EntityType.Creature

event

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

Optional goatMilkCounter

goatMilkCounter: undefined | number

Optional happiness

happiness: undefined | number

Optional hitchedTo

hitchedTo: undefined | number

hp

hp: number

id

id: number

maxhp

maxhp: number

moveType

moveType: MoveType | undefined

Readonly objectType

objectType: Creature

originalMoveType

originalMoveType: MoveType | undefined

properties

properties: IProperties | undefined

Optional referenceId

referenceId: undefined | number

Optional renamed

renamed: string | ISerializedTranslation

Optional respawned

respawned: undefined | false | true

shouldSkipNextUpdate

shouldSkipNextUpdate: boolean

Readonly stat

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

stats

stats: IStats

status

status: IStatus

stopNextMovement

stopNextMovement: boolean

type

x

x: number

y

y: number

z

z: number

Accessors

asCreature

asEntity

asHuman

  • get asHuman(): undefined

asNPC

  • get asNPC(): undefined
  • Returns undefined

asPlayer

  • get asPlayer(): undefined

Methods

addProperty

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

animateAttack

  • animateAttack(damageType: DamageType[] | undefined): 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

canSeePosition

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

canSwapWith

  • canSwapWith(player: Player, source: string | undefined): boolean
  • Check if this creature can swap with the player in the event that the player is moving into them

    Parameters

    • player: Player

      Player object

    • source: string | undefined

      Source string. Set to undefined if this is being called from the clientside

    Returns boolean

checkForBurn

  • checkForBurn(moveType?: MoveType): boolean
  • Parameters

    • Default value moveType: MoveType = this.getMoveType()

    Returns boolean

checkUnder

  • checkUnder(x?: number, y?: number): boolean
  • Checks under the creature for getting burned, setting off traps, eating items off the ground, and more

    Parameters

    • Default value x: number = this.x
    • Default value y: number = this.y

    Returns boolean

    Returns whether the creature can keep moving (in the case of creatures with >= 2 speed)

damage

  • damage(damageInfo: IDamageInfo): number | undefined
  • damage(damageInfo: IDamageInfo, creatureX?: undefined | number, creatureY?: undefined | number, creatureZ?: undefined | number): number | undefined
  • Parameters

    Returns number | undefined

  • Parameters

    • damageInfo: IDamageInfo
    • Optional creatureX: undefined | number
    • Optional creatureY: undefined | number
    • Optional creatureZ: undefined | number

    Returns number | undefined

description

findPath

  • findPath(target: IVector2, maxNodesChecked?: undefined | number, ignorePlayer?: Player): IVector2[] | undefined
  • Parameters

    • target: IVector2
    • Optional maxNodesChecked: undefined | number
    • Optional ignorePlayer: Player

    Returns IVector2[] | undefined

getActiveStatuses

Protected getApplicableStatusEffects

getCraftingDifficulty

getFacingPoint

getFacingTile

getInspectionId

  • getInspectionId(): string

getMoveType

getMovementFinishTime

  • getMovementFinishTime(_timeStamp: number): number | undefined

getMovementPoint

  • getMovementPoint(timeStamp: number): IVector2

getMovementProgress

  • getMovementProgress(timeStamp: number): number

getName

  • getName(article?: undefined | false | true, count?: undefined | number): Translation
  • Parameters

    • Optional article: undefined | false | true

      Whether to include an article for the name of the creature. Uses the article rules on the language. Defaults to true.

    • Optional count: undefined | number

      The number of this creature that you're getting the name of. Defaults to 1.

      Examples:

      • creature.getName() // "an acid spitter demon"
      • creature.getName(false) // "acid spitter demon"
      • creature.getName(undefined, 3) // "acid spitter demons"

    Returns Translation

getOwner

  • getOwner(): Player | undefined
  • Returns Player | undefined

getPoint

getProducedTemperature

  • getProducedTemperature(): undefined | number

getProperty

  • getProperty<T>(property: Property): 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

getTile

getTileUpdateType

hasAi

  • hasAi(aiType: AiType): boolean
  • Parameters

    Returns boolean

hasProperty

  • hasProperty(property: Property): boolean

hasStatus

  • Returns whether the entity has the given StatusType

    Parameters

    Returns boolean

increaseTamedCount

  • increaseTamedCount(): void

increaseWaste

  • increaseWaste(item: Item): void
  • Parameters

    Returns void

initializeStats

  • initializeStats(hp: number, maxhp?: undefined | number): void
  • Initializes the creature's stats. Used in the constructor & save conversion.

    Parameters

    • hp: number
    • Optional maxhp: undefined | number

    Returns void

isDefender

  • isDefender(): boolean
  • Returns boolean

isHidden

  • isHidden(): boolean
  • Returns boolean

isInFov

  • isInFov(): boolean

isNearby

  • isNearby(entity: Entity): boolean

isOnFire

isTamed

  • isTamed(): boolean
  • Returns boolean

isValid

  • isValid(): boolean
  • Returns boolean

moveTo

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

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

    Returns boolean

notifyItem

notifyStat

offer

  • offer(items: Item[]): Item | undefined
  • Parameters

    Returns Item | undefined

Protected onStatChange

onUnserialized

  • onUnserialized(): void

Protected preMove

  • preMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile): boolean | void | undefined
  • Parameters

    • fromX: number
    • fromY: number
    • fromZ: number
    • fromTile: ITile
    • toX: number
    • toY: number
    • toZ: number
    • toTile: ITile

    Returns boolean | void | undefined

preventNextMovement

  • preventNextMovement(): void

processAttack

processSpecialAbilities

  • processSpecialAbilities(enemy: Player | Creature | undefined, bypass?: undefined | false | true): boolean

queueSoundEffect

  • queueSoundEffect(type: SfxType, delay?: number, speed?: number): 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

release

  • release(): boolean
  • Returns boolean

removeProperty

  • removeProperty(property: Property): boolean

setInFov

  • setInFov(inFov: boolean): void
  • Parameters

    • inFov: boolean

    Returns void

setMoveType

setStatus

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

    Parameters

    Returns void

skipNextUpdate

  • skipNextUpdate(): void

tame

  • tame(player: Player, bonus?: number): boolean
  • Parameters

    • player: Player
    • Default value bonus: number = 0

    Returns boolean

toString

  • toString(): string

unhitch

  • unhitch(): void
  • Returns void

update

  • update(realPlayers: Player[]): boolean
  • Parameters

    Returns boolean

updateDoodadOverHiddenState

  • updateDoodadOverHiddenState(x: number, y: number, z: number, tile: ITile, hidden: boolean): void
  • Updates the DoodadOverHidden tile flag if the creature is large large creatures should render over the doodad over layer which means we should hide the doodad over layer for doodads on the creature

    Parameters

    • x: number
    • y: number
    • z: number
    • tile: ITile
    • hidden: boolean

    Returns void

Protected updateDoodadOverHiddenStateForCurrentTile

  • updateDoodadOverHiddenStateForCurrentTile(hidden?: boolean): void

Static is

  • is(value: any): value is Creature
  • Parameters

    • value: any

    Returns value is Creature

Object literals

direction

direction: object

x

x: number = 0

y

y: number = 0

Generated using TypeDoc