mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 08:13:50 +02:00
UI: Consistently calculate BitNode "level" (#2645)
This commit is contained in:
@@ -93,3 +93,12 @@ export function finishBitNode() {
|
||||
}
|
||||
wd.backdoorInstalled = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* BitNode level is not something that is stored, but rather calculated from the current BN and SF level. The concept
|
||||
* appeared because saying "Enter BN1.2" is shorter than saying "Enter BN1 with SF1.1". This is how we display it in the
|
||||
* BitVerse UI and other places. This function is used to consistently calculate this "level".
|
||||
*/
|
||||
export function getBitNodeLevel(bn = Player.bitNodeN, sfLevel = Player.activeSourceFileLvl(bn)): number {
|
||||
return Math.min(sfLevel + 1, bn === 12 ? Number.MAX_VALUE : 3);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user