Isotopeia:Electron neutrino: Difference between revisions
m quality |
mNo edit summary |
||
Line 4: | Line 4: | ||
== In prestige == | == In prestige == | ||
Each <math>1.5\cdot10^{21}</math> electron | Each <math>1.5\cdot10^{21}</math> electron neutrinos contributes 1 positron to the prestige counter. | ||
== In the source code == | == In the source code == |
Revision as of 09:55, 3 January 2025
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
Each [math]\displaystyle{ 1.5\cdot10^{21} }[/math] electron neutrinos 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 injtopia.js
.
Variables
The following list contains all of the methods contained and implemented in BuildingEN
.
int count
The number of buildings owned globally by the player.
int initPrice
The starting price of the building, unaffected by any number of the building.
str name
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
The camelCase-named identifier for the building. This ID should avoid abbreviating unless the building's name is subjectively "too long."
double ps
The amount this building provides per second, unbuffed by positrons.
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.
void .refreshIntervals()
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.