Optional
amountThe default amount of the item.
Automatically set to 0
if not provided.
The cost of items at a certain level.
Optional
descriptionThe description of the item. Can be a string or a function that returns a string.
// A dynamic description that returns a string
const description = (a, b) => `This is a ${a} that returns a ${b}`;
// ... create item here (see currencyStatic.addUpgrade)
const item = currencyStatic.getUpgrade("itemID");
// Getter property
console.log(item.description); // "This is a undefined that returns a undefined"
// Getter function
console.log(item.descriptionFn("dynamic", "string")); // "This is a dynamic that returns a string"
Optional
effectThe effect of the item. This runs when the item is bought, and instantly if runEffectInstantly
is true.
The tier of the item that was bought.
The amount of the item currently owned.
The item object that the effect is being run on.
The currency static class that the item is being run on.
Readonly
idThe ID of the item. Used to retrieve the item later.
Optional
nameThe name of the item. Defaults to the ID.
An interface for an item. An item is a type of upgrade that does not have a level. Ex. A potion that gives you 10 gold.