Isotopeia:Electron neutrino

From matthyWiki
Revision as of 11:34, 10 December 2024 by Matthyno (talk | contribs) (description of elnn)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Electron neutrinos (symbolized as elnn, en, Ve, or [math]\displaystyle{ V_e }[/math]) are the 1st of the three currencies in Isotopeia.

In prestige

Each [math]\displaystyle{ 1.5\cdot10^{21} }[/math] electron neutrino contributes 1 positron to the prestige counter.

In the source code

The electron neutrino counter is a variable written as elnncn, and is stored in localStorage as JSON.parse(localStorage.getItem("ucc"))[1].

To increment the counter by your [math]\displaystyle{ V_e / c }[/math] (electron neutrinos per click), use electronn(elnpc), which increments the ELECTRON Neutrinos by the ELectron Neutrinos Per Click.

The (hopefully accurate) counter of [math]\displaystyle{ V_e / s }[/math] (electron neutrinos per second) can be found in the variable elnps and recalculated using updatePerSecond().

BuildingEN

The class-ified implementation of electron buildings can be found under the name BuildingEN in buildinglib.js. The constructor contains 5 positional arguments:

  • price: the price of the building,
  • name: the display name of the building (shown to the user),
  • ps: the per-second gain of the building with 0 positrons,
  • rspot: the index of the building, which is auto-defined in jtopia.js.

Methods

The following list contains all of the methods implemented in BuildingEN.

void .buy(int n = 1)

Purchases the amount n (by default, 1) of an electron neutrino building, if you have the required electorn neutrinos.

void .interval()

Starts an interval to gain this.ps electron neutrinos per second. This is added to the intervals variable so that it can be cleared later.

void .buildUI(bool isModded = false)

Constructs the UI/purchase menu for this building. Note that isModded is not needed and should always be unset or false, but this is by default false.

void .refreshCount()

Refreshes this building's internal count for how many there are of this building. This affects the price calculated via an recursive function defined as follows: [math]\displaystyle{ p_{n+1} = \left \lfloor 1.25p_n \right \rfloor }[/math] where [math]\displaystyle{ p_{n+1} }[/math] is defined as the new price for this building after [math]\displaystyle{ n }[/math] buildings, [math]\displaystyle{ n }[/math] as the current number of buildings owned, [math]\displaystyle{ p_n }[/math] as the previous building price. [math]\displaystyle{ p_0 }[/math] is also defined as the initial price of the building, as this.price in code.