Item

new Item()

Properties:
Name Type Description
area Area

Area the item belongs to (warning: this is not the area is currently in but the area it belongs to on a fresh load)

properties object

Essentially a blob of whatever attrs the item designer wanted to add

behaviors array | string

Single or list of behaviors this object uses

description string

Long description seen when looking at it

id number

vnum

isEquipped boolean

Whether or not item is currently equipped

inventory Map

Current items this item contains

name string

Name shown in inventory and when equipped

room Room

Room the item is currently in

roomDesc string

Description shown when item is seen in a room

script string

A custom script for this item

type ItemType | string
uuid string

UUID differentiating all instances of this item

Members

display

Friendly display colorized by quality

Methods

addItem(item)

Add an item to this item's inventory

Parameters:
Name Type Description
item Item

findOwner() → {Player|null}

For finding the player who has the item in their possession.

Returns:
Player | null -

owner

getBehavior(name) → {*}

Parameters:
Name Type Description
name string
Returns:
*

hasBehavior(name) → {boolean}

Parameters:
Name Type Description
name string
Returns:
boolean

isInventoryFull() → {boolean}

Returns:
boolean

qualityColorize(string)

Colorize the given string according to this item's quality

Parameters:
Name Type Description
string string
Returns:
-

string

removeItem(item)

Remove an item from this item's inventory

Parameters:
Name Type Description
item Item

Events

updateTick