Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IHumanEvents

Hierarchy

Index

Methods

calculateEquipmentStats

  • calculateEquipmentStats(): any
  • Returns any

canAttack

  • canAttack(weapon: Item | undefined, attackType: AttackType): boolean | undefined
  • Called before an npc attacks

    Parameters

    • weapon: Item | undefined

      The weapon used to attack

    • attackType: AttackType

      The attack type

    Returns boolean | undefined

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

canConsumeItem

  • Called before consuming an item

    Parameters

    Returns boolean | undefined

    True if the human can consume the item (default logic isn't called, should use your own code for consumption), false if the human cannot consume the item, or undefined to use the default logic

canDropItem

  • canDropItem(item: Item, tile: ITile, dropAll: boolean, dropAllQuality: Quality | undefined): boolean | undefined
  • Called when an item is being dropped

    Parameters

    • item: Item

      The item to be dropped

    • tile: ITile

      The tile the item will be dropped on

    • dropAll: boolean

      True if all items of this type will be dropped

    • dropAllQuality: Quality | undefined

      If not undefined, all items of this quality will be dropped

    Returns boolean | undefined

    True if the item can be dropped, false if the item can not be dropped, or undefined to use the default logic

created

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

    Returns void

isSwimming

  • isSwimming(isSwimming: boolean): boolean | undefined
  • Called when checking if a human is swimming

    Parameters

    • isSwimming: boolean

      True if the human is swimming

    Returns boolean | undefined

    True if the human should be swimming, false if they should not be swimming, or undefined to use the default logic

postMove

  • postMove(fromX: number, fromY: number, fromZ: number, fromTile: ITile, toX: number, toY: number, toZ: number, toTile: ITile): void
  • Parameters

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

    Returns void

preMove

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

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

    Returns boolean | undefined | void

removed

  • removed(): void
  • Called when the entity is removed from the game

    Returns void

skillChange

  • skillChange(skill: SkillType, value: number, oldValue: number): any
  • Parameters

    • skill: SkillType

      The skill that is changing

    • value: number

      The new skill value (core + bonus)

    • oldValue: number

      The previous skill value (previous core + bonus)

    Returns any

statBonusChanged

  • Called when a stat changes, for any reason

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • Optional oldValue: undefined | number

      The value that the stat changed from

    • Optional info: IStatChangeInfo

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

    Returns void

statChanged

  • 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

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

    Returns void

statMaxChanged

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

    Parameters

    • stat: IStatMax

      An IStat object, the stat that was affected

    • Optional oldValue: undefined | number

      The value that the stat changed from

    • Optional info: IStatChangeInfo

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

    Returns void

statTimerChanged

  • statTimerChanged(stat: IStat, oldValue?: undefined | number): void
  • Called when a stat timer changes

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    • Optional oldValue: undefined | number

      The value that the stat changed from

    Returns void

statTimerRemoved

  • statTimerRemoved(stat: IStat): any
  • Called when a stat timer is removed

    Parameters

    • stat: IStat

      An IStat object, the stat that was affected

    Returns any

statTimerWillChange

  • Called when a stat timer will change

    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 false | undefined

    false to cancel the stat timer change, undefined otherwise.

statusChange

  • Called when this entity gets or loses a status effect

    Parameters

    • status: StatusType

      The type of status effect that was gained or lost

    • hasStatus: boolean

      Whether the entity now has the status effect

    • reason: StatusEffectChangeReason

      The reason for the change

    Returns void

Generated using TypeDoc