Class: Item

Item(world)

Base class for all the purchasable "items".

Constructor

new Item(world)

Constructs a new item

Parameters:
Name Type Description
world

World this item belongs to

Author:
  • Harri Pellikka
Source:

Members

basePrice

The base price of the item (i.e. the price of the first level of this item)

Source:

description

Description text for this item

Source:

itemLevel

Current level of this item

Source:

maxItemLevel

Max. item level

Source:

modifiers

Modifiers applied to this item

Source:

name

Name of this item

Source:

priceMultiplier

Price multiplier per level. This is used in the price formula like this: price = (base price) * (price multiplier) ^ (item level)

Source:

world

World this item belongs to

Source:

Methods

getBasePrice()

Retrieves the base price of this item

Source:
Returns:

Base price of this item

getDescription()

This method logs the given message to the browser console.

Source:

getName() → {string}

Retrieves the name of this item

Source:
Returns:

Name of this item

Type
string

getPriceMultiplier()

Retrieves the price multiplier

Source:
Returns:

Price multiplier

setBasePrice(basePrice)

Sets the base price of this item

Parameters:
Name Type Description
basePrice

New base price for this item

Source:

setName(name)

Sets the name of this item

Parameters:
Name Type Description
name

New name for this item

Source:

setPriceMultiplier(multiplier)

Sets the price multiplier of this item

Parameters:
Name Type Description
multiplier

Price multiplier

Source: