Class: OreUpgrade

mmm. OreUpgrade

new OreUpgrade(colony, id, name, description, designation, price_common, price_rare, multiplier, type)

Represents an ore upgrade for purchase
Parameters:
Name Type Description
colony mmm.Colony The parent colony
id string ID of the upgrade
name string Name of the upgrade
description string Description of the upgrade
designation string Designation which when unlocked, unlocks the upgrade
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
multiplier number Multiplier effect on production
type string Type of units that are upgraded
Source:

Extends

Members

affordable :boolean

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

available :boolean

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

colony :mmm.Colony

Parent colony
Type:
Inherited From:
Source:

count :number

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

description :string

Description of the item
Type:
  • string
Inherited From:
Source:

designation :string

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

id :string

ID of the item
Type:
  • string
Inherited From:
Source:

is_upgrade :boolean

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

multiplier :number

Additional multiplier effect on production, 1 = 100%
Type:
  • number
Source:

name :string

Name of the item
Type:
  • string
Inherited From:
Source:

purchasable :boolean

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

purchased :boolean

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

rate_common_gain :number

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

rate_rare_gain :number

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

recyclable :boolean

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

show_details

Inherited From:
Source:

time_each :number

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

time_each_click :number

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

time_next :number

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

time_next_click :number

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

type :string

Type of units that the upgrade affects ("C" or "R" for common and rare)
Type:
  • string
Source:

unique :boolean

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

units :Array.<mmm.Unit>

Array of units that the upgrade affects
Type:
Source:

unlocked :boolean

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

Methods

purchase()

Purchases the item, paying the purchase price
Inherited From:
Source:

purchaseComplete()

Adds multiplier to units when purchase was successful
Source:

recycle()

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

(abstract) recycleComplete()

Actions to take when recycle was successful
Inherited From:
Source: