Constructor
new Item(world)
Constructs a new item
Parameters:
| Name | Type | Description |
|---|---|---|
world |
World this item belongs to |
Members
basePrice
The base price of the item (i.e. the price of the first level of this item)
description
Description text for this item
itemLevel
Current level of this item
maxItemLevel
Max. item level
modifiers
Modifiers applied to this item
name
Name of this item
priceMultiplier
Price multiplier per level. This is used in the price formula like this: price = (base price) * (price multiplier) ^ (item level)
world
World this item belongs to
Methods
getBasePrice()
Retrieves the base price of this item
Returns:
Base price of this item
getDescription()
This method logs the given message to the browser console.
getName() → {string}
Retrieves the name of this item
Returns:
Name of this item
- Type
- string
getPriceMultiplier()
Retrieves the price multiplier
Returns:
Price multiplier
setBasePrice(basePrice)
Sets the base price of this item
Parameters:
| Name | Type | Description |
|---|---|---|
basePrice |
New base price for this item |
setName(name)
Sets the name of this item
Parameters:
| Name | Type | Description |
|---|---|---|
name |
New name for this item |
setPriceMultiplier(multiplier)
Sets the price multiplier of this item
Parameters:
| Name | Type | Description |
|---|---|---|
multiplier |
Price multiplier |