Isotopeia:Electron neutrino: Difference between revisions
description of elnn |
m fix capitals to indicate where abbreviation comes from |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Quality}} | |||
Electron neutrinos (symbolized as <code>elnn</code>, <code>en</code>, V<sub>e</sub>, or <math>V_e</math>) are the 1st of the three currencies in Isotopeia. | Electron neutrinos (symbolized as <code>elnn</code>, <code>en</code>, V<sub>e</sub>, or <math>V_e</math>) are the 1st of the three currencies in Isotopeia. | ||
== 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 == | ||
The electron neutrino counter is a variable written as <code>elnncn</code>, and is stored in <code>localStorage</code> as <code>JSON.parse(localStorage.getItem("ucc"))[1]</code>. | The electron neutrino counter is a variable written as <code>elnncn</code>, and is stored in <code>localStorage</code> as <code>JSON.parse(localStorage.getItem("ucc"))[1]</code>. | ||
To increment the counter by your <math>V_e / c</math> (electron neutrinos per click), use <code>electronn(elnpc)</code>, which increments the ELECTRON Neutrinos by the | To increment the counter by your <math>V_e / c</math> (electron neutrinos per click), use <code>electronn(elnpc)</code>, which increments the ELECTRON Neutrinos by the ELectroN Neutrinos Per Click. | ||
The (hopefully accurate) counter of <math>V_e / s</math> (electron neutrinos per second) can be found in the variable <code>elnps</code> and recalculated using <code>updatePerSecond()</code>. | The (hopefully accurate) counter of <math>V_e / s</math> (electron neutrinos per second) can be found in the variable <code>elnps</code> and recalculated using <code>updatePerSecond()</code>. | ||
Line 17: | Line 19: | ||
* <code>ps</code>: the per-second gain of the building with 0 positrons, | * <code>ps</code>: the per-second gain of the building with 0 positrons, | ||
* <code>rspot</code>: the index of the building, which is auto-defined in <code>jtopia.js</code>. | * <code>rspot</code>: the index of the building, which is auto-defined in <code>jtopia.js</code>. | ||
==== Variables ==== | |||
The following list contains all of the methods contained and implemented in <code>BuildingEN</code>. | |||
===== <code>int count</code> ===== | |||
The number of buildings owned globally by the player. | |||
===== <code>int initPrice</code> ===== | |||
The starting price of the building, unaffected by any number of the building. | |||
===== <code>str name</code> ===== | |||
The display name of the building that is shown to the player in places like the button name for purchasing the buildin g | |||
===== <code>str id</code> ===== | |||
The camelCase-named identifier for the building. This ID should avoid abbreviating unless the building's name is subjectively "too long." | |||
===== <code>double ps</code> ===== | |||
The amount this building provides per second, unbuffed by positrons. | |||
==== Methods ==== | ==== Methods ==== | ||
Line 32: | Line 52: | ||
===== <code>void .refreshCount()</code> ===== | ===== <code>void .refreshCount()</code> ===== | ||
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: | 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> | <math> | ||
p_{n+1} = \left \lfloor 1.25p_n \right \rfloor | p_{n+1} = \left \lfloor 1.25p_n \right \rfloor | ||
</math> | </math> | ||
where <math>p_{n+1}</math> is defined as the new price for this building after <math>n</math> buildings, <math>n</math> as the current number of buildings owned, <math>p_n</math> as the previous building price. <math>p_0</math> is also defined as the initial price of the building, as <code>this.price</code> in code. | |||
...where <math>p_{n+1}</math> is defined as the new price for this building after <math>n</math> buildings, <math>n</math> as the current number of buildings owned, <math>p_n</math> as the previous building price. <math>p_0</math> is also defined as the initial price of the building, as <code>this.price</code> in code. | |||
===== <code>void .refreshIntervals()</code> ===== | |||
<code>refreshIntervals</code> simply starts <code>this.count</code> intervals after refreshing the count using <code>.refreshCount()</code>. Note that this method does <b>not</b> restart current intervals, but instead starts new ones. |
Latest revision as of 12:09, 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[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.