Hierarchy

Methods

  • Called before a creature attacks

    Returns

    False if the creature cannot attack, or undefined to use the default logic

    Parameters

    Returns undefined | boolean

  • Called when a creature despawns

    Returns

    True if the creature can despawn, false if the creature can't despawn, or undefined to use the default logic

    Returns undefined | boolean

  • Called when a creature tries to face a new direction

    Returns

    True if the creature can face a new direction, false if the creature can't face a new direction, or undefined to use the default logic

    Parameters

    • x: number

      The x coordinate of the creature's facing direction

    • y: number

      The y coordinate of the creature's facing direction

    Returns undefined | boolean

  • Called when a creature tries to move

    Returns

    True if the creature can move, false if the creature cannot move, or undefined to use the default logic

    Parameters

    • tile: default

      The tile the creature is trying to move to

    • moveType: MoveType

      The creatures move type

    Returns undefined | boolean

  • Called when a creature may attempt to do a special ability

    Returns

    True if the creature can attempt to do a special ability, false if the creature can't perform special abilities, or undefined to use the default logic

    Returns undefined | boolean

  • Parameters

    • Optional intent: number
    • Optional directionToZoneCenter: number

    Returns any

  • Called when the entity is created in the game Also called for players that "rejoin" the game

    Returns void

  • Called when a creature is damaged

    Returns

    The amount of damage the creature should take (the creature will take this damage) or undefined to use the default logic

    Parameters

    Returns undefined | number

  • Called when a creature dies

    Returns void

  • Parameters

    Returns Defense

  • Parameters

    Returns undefined | boolean

  • Called before moving. Can be called twice for humans

    Parameters

    • fromTile: default
    • toTile: default
    • isMoving: boolean

      True the second time it's called, right as the entity is about to actually move

    Returns undefined | boolean | void

  • Called when the entity is removed from the game

    Returns void

  • Called when the entity is renamed

    Returns void

  • Called when a stat changes, for any reason

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • Optional oldValue: number

      The value that the stat changed from

    • Optional info: IStatChangeInfo<any>

      An IStatChangeInfo object describing why the change occurred. It will always be passed with a reason

    Returns void

  • Called when a stat changes, for any reason

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • oldValue: number

      The value that the stat changed from

    • info: IStatChangeInfo<any>

      An IStatChangeInfo object describing why the change occurred. It will always be passed with a reason

    Returns void

  • Called when a stat's max value changes, for any reason

    Parameters

    • stat: IStatMax

      An IStat object, the stat that was affected

    • Optional oldValue: number

      The value that the stat changed from

    • Optional info: IStatChangeInfo<any>

      An IStatChangeInfo object describing why the change occurred. It will always be passed with a reason

    Returns void

  • Called when a stat timer changes

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • Optional oldValue: number

      The value that the stat changed from

    Returns void

  • Called when a stat timer is removed

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    Returns any

  • Called when a stat timer will change

    Returns

    false to cancel the stat timer change, undefined otherwise.

    Parameters

    • stat: IStat

      An IStat object, the stat that will be affected

    • changeFactory: StatChangeTimerFactory

      An object for manipulating how the new stat change timer will be set

    Returns undefined | false

  • Called when this entity gets or loses a status effect

    Parameters

    • status: StatusType

      The type of status effect that was gained or lost

    • level: number

      Whether the entity now has the status effect

    • reason: StatusChangeReason

      The reason for the change

    • oldLevel: number

    Returns void

  • Called when a creature becomes tamed

    Parameters

    • owner: default<unknown, number, NPC | Player>

      The human which the creature is tamed for

    Returns void

Generated using TypeDoc