Hierarchy

Methods

  • Called when something is built on a tile

    Parameters

    • item: default

      The item used to build the object

    • tile: default

      The tile something was built on

    • doodad: default

      The doodad that was created on the tile

    Returns void

  • Returns any

  • Called before an npc attacks

    Returns

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

    Parameters

    • weapon: undefined | default

      The weapon used to attack

    • attackType: AttackType

      The attack type

    Returns undefined | boolean

  • Called when the walkTo of the player is about to change.

    Returns

    False to prevent the walk change or undefined to use the default logic

    Parameters

    Returns undefined | false

  • Called before consuming an item

    Returns

    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

    Parameters

    Returns undefined | boolean

  • Called when a human tries to interact with an NPC

    Returns

    True if the human can interact, false if the human cannot interact, or undefined to use the default logic

    Parameters

    • npc: default

      The NPC to interact with

    • interactType: undefined | number

      The interaction type

    Returns undefined | boolean

  • Called when movement is attempted on the server

    Returns

    False to prevent movement or undefined to use the default logic

    Parameters

    Returns undefined | false

  • Called when a player's title changes. IE, John -> John, the Merchant

    Parameters

    Returns any

  • Called when the human changes their layer (z position)

    Parameters

    • z: number
    • oldZ: number

    Returns any

  • Called when messages are cleared for this player

    Returns any

  • Called when notes are cleared. (Debug Tools)

    Returns any

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

    Returns void

  • Called when the human is damaged

    Returns

    The amount of damage the player should take (the player will take this damage)

    Parameters

    Returns number | void

  • Used for deregistering events

    Returns any

  • Called when the player is killed.

    Parameters

    • Optional showingGameEndScreen: boolean

      True if the game end screen will be shown

    Returns any

  • Parameters

    Returns any

  • Parameters

    Returns any

  • Called when a message is being displayed for a player

    Parameters

    • message: IMessage

      The message that will be displayed

    Returns any

  • Called when the human equips an item to a slot

    Parameters

    Returns any

  • Called when the human fails to equip an item to a slot

    Parameters

    Returns any

  • Called in Drop.canUse()

    Returns

    an Item[] if filtering, undefined to allow all of these items to be dropped

    Parameters

    • items: default[]

      The items that will be dropped

    • tile: default

      The tile the items will be dropped on

    Returns undefined | default[]

  • Parameters

    • attack: number

    Returns number

  • Parameters

    • baseStatBonuses: OptionalDescriptions<Stat, number>

    Returns OptionalDescriptions<Stat, number>

  • Parameters

    Returns default

  • Luck is a multiplier applied to some chance calculations. 1 is default, 0.5 would mean chances are halved, 2 would mean chances are doubled, etc.

    Parameters

    • multiplier: number

    Returns number

  • Called when getting the player's maximum health

    Parameters

    • maxHealth: number

      The current max health of the player (after any other previous mods)

    Returns number

  • Called when getting the player's maximum weight

    Parameters

    • maxWeight: number

      The current max weight of the player (after any other previous mods)

    Returns number

  • Called when getting the players movement intent

    Returns

    The movement intent of the player or undefined to use the default logic

    Returns undefined | IMovementIntent

  • Called when we get the skill gain multiplier

    Returns

    The multiplier for skill gain as a number or undefined to use the default logic

    Parameters

    • skillType: SkillType

      The skill to check for

    Returns undefined | number

  • Called when calculating the movement penalty of a tile.

    Parameters

    • penalty: number

      The current penalty of the tile

    • tile: default

      The tile to get the movement penalty of

    Returns number

  • Called when getting the players weight or stamina movement penalty

    Returns

    The weight/stamina movement penalty for the player or undefined to use the default logic

    Returns undefined | number

  • Called when getting the players weight status

    Returns

    The weight status of the player or undefined to use the default logic

    Returns undefined | WeightStatus

  • Parameters

    Returns undefined | boolean

  • Called when the players id has changed

    Parameters

    • currentId: number

      The players current id

    • newId: number

      The new id for the player

    • isAbsentPlayer: boolean

      True if the player is absent

    Returns any

  • Called when the players id is changing

    Parameters

    • currentId: number

      The players current id

    • newId: number

      The new id for the player

    • isAbsentPlayer: boolean

      True if the player is absent

    Returns any

  • Called when an item is added to the player's inventory

    Parameters

    • items: default[]
    • container: IContainer

      The container object the items were added to. This container might be inventory or a container within the inventory.

    • index: number

      The index the items were inserted at

    Returns any

  • Called when an item is removed from the players inventory

    Parameters

    • items: default[]
    • container: IContainer

      The container object the items were moved to.

    Returns any

  • Called when an item is moved from one container to another, while still in the players inventory.

    Parameters

    • items: default[]

      The items

    • container: IContainer

      The container object the items were moved to. This container might be inventory or a container within the inventory.

    • Optional previousContainer: IContainer

      The container object the items were moved from. This container might be inventory or a container within the inventory.

    Returns any

  • Called when checking if a human is swimming

    Returns

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

    Parameters

    • isSwimming: boolean

      True if the human is swimming

    Returns undefined | boolean

  • Called when the human is loaded onto an island

    Parameters

    Returns any

  • Called when the player completes a movement

    Returns any

  • Called when the human is moving to another island

    Parameters

    • oldIsland: default

      The humans old island

    • newIsland: default

      The humans new island

    Returns any

  • Returns any

  • Called when no input is received

    Returns any

  • Called when a book is opened by a player

    Parameters

    Returns void

  • Called when an doodad is picked up

    Parameters

    • doodad: default

      The doodad object

    Returns any

  • Called after moving.

    Parameters

    Returns void

  • 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 human is moving to another island

    Parameters

    • oldIsland: default

      The humans old island

    • newIslandId: `${number},${number}`

      The humans new island

    Returns any

  • Called when input is being processed on the server

    Returns

    False to prevent input processing or undefined to use the default logic

    Returns undefined | false

  • Called when a player responds to certain interrupts

    Parameters

    • interrupt: Prompt

      The interrupt

    • choice: boolean | default

      The selected choice

    Returns any

  • Called when the player has read a note.

    Parameters

    • id: number

      The id of the note that was read.

    Returns any

  • Called when the entity is removed from the game

    Returns void

  • Called when the entity is renamed

    Returns void

  • Used for registering events This may be called more than once on the same player

    Returns any

  • Called when the player is respawned.

    Returns false | void

  • Called when the player stops resting

    Parameters

    • restData: IRestData

      The data related to the rest event

    Returns any

  • Called when the player starts resting

    Parameters

    • restData: IRestData

      The data related to the rest event

    Returns any

  • Called when the player attempts to sail off the edge of the map

    Parameters

    Returns any

  • Called when a player sails to civilization.

    Returns any

  • Called when the human will be killed. If any handlers return false to stop the human from dying, no further handlers will be called.

    Returns

    false to stop the human from dying

    Returns false | void

  • Called when a message is about to be displayed

    Returns

    False to not display the message or undefined to use the default logic

    Parameters

    • message: IMessage

      The message that will be displayed

    • messageId: number

      The Message, or -1 if the message being displayed isn't a Message

    Returns undefined | boolean

  • Called to check whether the human should be rendered. If any handlers return false, then the human will not be rendered.

    Returns

    false to stop the human from being rendered

    Returns false | void

  • Called when the player will be respawned. If any handlers return false to stop the player from respawning, no further handlers will be called.

    Returns

    false to stop the player from respawning

    Returns false | void

  • 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

  • Returns

    True if the skill check should pass, false if it shouldn't, undefined if it should be random

    Parameters

    • skill: SkillType

      The skill that is being checked

    • check: number

      The desired value that needs to pass

    • Optional actionTier: number

      Optional action tier

    Returns undefined | boolean

  • Called when the human is spawned. (At the end of Player.setup / NPC.spawn)

    Returns any

  • 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 the player tick ends

    Returns any

  • Called when the player tick starts

    Returns any

  • Called when a turn is ending

    Returns any

  • Called when a turn is starting

    Returns any

  • Returns any

  • Called when the human unequips an item from a slot

    Parameters

    • item: default

      The item being unequipped

    • slot: EquipType

      The slot it was equipped in

    Returns any

  • Called when the human fails to unequip an item from a slot

    Parameters

    Returns any

  • Returns any

  • Called when the human faces a different direction

    Parameters

    • direction: Direction

      The direction the player is now facing

    Returns void

  • Parameters

    • action: ActionType
    • count: number
    • oldCount: number

    Returns any

  • Type Parameters

    Parameters

    • key: O

      The key of IOptions that was changed on this player

    • value: IOptions[O]

      The value this key was set to

    Returns any

  • Called when the players weight is being updated

    Returns

    A number to set the player weight to or undefined to use the default logic

    Parameters

    • newWeight: number

      The new weight of the player

    Returns undefined | number

  • Called when the players quickslots are updated

    Parameters

    • quickslot: number

      The quick slot

    • Optional itemType: ItemType

      The item type

    Returns any

  • Called when the walk path of the player changes.

    Parameters

    Returns any

  • Called when the player will write a note.

    Returns

    false if the note should be cancelled

    Parameters

    • note: INote

      The note that will be written.

    Returns false | void

  • Called when the player has written a note.

    Parameters

    • id: number

      The id of the note that was written.

    Returns any

Generated using TypeDoc