Class: Item

mmm. Item

new Item(colony, id, name, description, designation, price_common, price_rare, rate_common, rate_rare, unique)

Base class representing an item for purchase
Parameters:
Name Type Description
colony mmm.Colony The parent colony
id string ID of the item
name string Name of the item
description string Description of the item
designation string Designation which when unlocked, unlocks the item
price_common number | function Number or function returning the price in common ore
price_rare number | function Number or function returning the price in rare ore
rate_common number | function Number or function returning the production rate in common ore
rate_rare number | function Number or function returning the production rate in rare ore
unique boolean Whether or not there can only be at most one of the item
Source:

Members

affordable :boolean

Whether or not an item can be purchased because enough ore is in storage to afford the price
Type:
  • boolean
Source:

available :boolean

Whether or not an item can be purchased because it is unique and already purchased
Type:
  • boolean
Source:

colony :mmm.Colony

Parent colony
Type:
Source:

count :number

Current number of this unit already purchased
Type:
  • number
Source:

description :string

Description of the item
Type:
  • string
Source:

designation :string

Designation which when unlocked, unlocks the item
Type:
  • string
Source:

id :string

ID of the item
Type:
  • string
Source:

is_upgrade :boolean

Whether or not the item is an upgrade
Type:
  • boolean
Source:

name :string

Name of the item
Type:
  • string
Source:

purchasable :boolean

Whether or not an item can be purchased because it unlocked, affordable and available
Type:
  • boolean
Source:

purchased :boolean

Whether or not an item has already been purchased
Type:
  • boolean
Source:

rate_common_gain :number

Rate of item common ore production over total colony common ore production
Type:
  • number
Source:

rate_rare_gain :number

Rate of item rare ore production over total colony rare ore production
Type:
  • number
Source:

recyclable :boolean

Whether or not the item can be recycled (sold)
Type:
  • boolean
Source:

show_details

Source:

time_each :number

Seconds each item costs when the user is clicking
Type:
  • number
Source:

time_each_click :number

Seconds each item costs when the user is clicking
Type:
  • number
Source:

time_next :number

Seconds until item is affordable when the user is not clicking
Type:
  • number
Source:

time_next_click :number

Seconds until item is affordable when the user is clicking
Type:
  • number
Source:

unique :boolean

Whether or not there can only be one of this item
Type:
  • boolean
Source:

unlocked :boolean

Whether or not an item can be purchased because it's designation has been unlocked
Type:
  • boolean
Source:

Methods

purchase()

Purchases the item, paying the purchase price
Source:

(abstract) purchaseComplete()

Actions to take when purchase was successful
Source:

recycle()

Recycles the item, refunding some of the purchase price
Source:

(abstract) recycleComplete()

Actions to take when recycle was successful
Source: