Isotopeia:Electron neutrino
Page quality | ||||||
---|---|---|---|---|---|---|
★★★★★ |
Electron neutrinos (symbolized as elnn
, en
, Ve, or [math]\displaystyle{ V_e }[/math]) are the 1st of the three currencies in Isotopeia.
In prestige[edit]
Each [math]\displaystyle{ 1.5\cdot10^{21} }[/math] electron neutrinos contributes 1 positron to the prestige counter.
In the source code[edit]
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
[edit]
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 injtopia.js
.
Variables[edit]
The following list contains all of the methods contained and implemented in BuildingEN
.
int count
[edit]
The number of buildings owned globally by the player.
int initPrice
[edit]
The starting price of the building, unaffected by any number of the building.
str name
[edit]
The display name of the building that is shown to the player in places like the button name for purchasing the buildin g
str id
[edit]
The camelCase-named identifier for the building. This ID should avoid abbreviating unless the building's name is subjectively "too long."
double ps
[edit]
The amount this building provides per second, unbuffed by positrons.
Methods[edit]
The following list contains all of the methods implemented in BuildingEN
.
void .buy(int n = 1)
[edit]
Purchases the amount n
(by default, 1
) of an electron neutrino building, if you have the required electorn neutrinos.
void .interval()
[edit]
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)
[edit]
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()
[edit]
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.
void .refreshIntervals()
[edit]
refreshIntervals
simply starts this.count
intervals after refreshing the count using .refreshCount()
. Note that this method does not restart current intervals, but instead starts new ones.