mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 14:27:03 +02:00
fix sleeve memory bug
This commit is contained in:
@@ -15,10 +15,7 @@ import { AugmentationAccordion } from "../../ui/React/AugmentationAccordion";
|
||||
export function InstalledAugmentations(): React.ReactElement {
|
||||
const sourceAugs = Player.augmentations.slice();
|
||||
|
||||
if (
|
||||
Settings.OwnedAugmentationsOrder ===
|
||||
OwnedAugmentationsOrderSetting.Alphabetically
|
||||
) {
|
||||
if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {
|
||||
sourceAugs.sort((aug1, aug2) => {
|
||||
return aug1.name <= aug2.name ? -1 : 1;
|
||||
});
|
||||
|
||||
@@ -23,10 +23,7 @@ type IState = {
|
||||
rerenderFlag: boolean;
|
||||
};
|
||||
|
||||
export class InstalledAugmentationsAndSourceFiles extends React.Component<
|
||||
IProps,
|
||||
IState
|
||||
> {
|
||||
export class InstalledAugmentationsAndSourceFiles extends React.Component<IProps, IState> {
|
||||
listRef: React.RefObject<HTMLUListElement>;
|
||||
|
||||
constructor(props: IProps) {
|
||||
@@ -89,14 +86,12 @@ export class InstalledAugmentationsAndSourceFiles extends React.Component<
|
||||
}
|
||||
|
||||
sortByAcquirementTime(): void {
|
||||
Settings.OwnedAugmentationsOrder =
|
||||
OwnedAugmentationsOrderSetting.AcquirementTime;
|
||||
Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;
|
||||
this.rerender();
|
||||
}
|
||||
|
||||
sortInOrder(): void {
|
||||
Settings.OwnedAugmentationsOrder =
|
||||
OwnedAugmentationsOrderSetting.Alphabetically;
|
||||
Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;
|
||||
this.rerender();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,7 @@ import { SourceFileAccordion } from "../../ui/React/SourceFileAccordion";
|
||||
export function OwnedSourceFiles(): React.ReactElement {
|
||||
const sourceSfs = Player.sourceFiles.slice();
|
||||
|
||||
if (
|
||||
Settings.OwnedAugmentationsOrder ===
|
||||
OwnedAugmentationsOrderSetting.Alphabetically
|
||||
) {
|
||||
if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {
|
||||
sourceSfs.sort((sf1, sf2) => {
|
||||
return sf1.n - sf2.n;
|
||||
});
|
||||
|
||||
@@ -25,10 +25,7 @@ export function PlayerMultipliers(): React.ReactElement {
|
||||
function improvements(r: number): JSX.Element[] {
|
||||
let elems: JSX.Element[] = [];
|
||||
if (r) {
|
||||
elems = [
|
||||
<td key="2"> {"=>"} </td>,
|
||||
<td key="3">{numeralWrapper.formatPercentage(r)}</td>,
|
||||
];
|
||||
elems = [<td key="2"> {"=>"} </td>, <td key="3">{numeralWrapper.formatPercentage(r)}</td>];
|
||||
}
|
||||
return elems;
|
||||
}
|
||||
@@ -60,20 +57,17 @@ export function PlayerMultipliers(): React.ReactElement {
|
||||
[
|
||||
"Bladeburner Success Chance",
|
||||
Player.bladeburner_success_chance_mult,
|
||||
Player.bladeburner_success_chance_mult *
|
||||
mults.bladeburner_success_chance_mult,
|
||||
Player.bladeburner_success_chance_mult * mults.bladeburner_success_chance_mult,
|
||||
],
|
||||
[
|
||||
"Bladeburner Max Stamina",
|
||||
Player.bladeburner_max_stamina_mult,
|
||||
Player.bladeburner_max_stamina_mult *
|
||||
mults.bladeburner_max_stamina_mult,
|
||||
Player.bladeburner_max_stamina_mult * mults.bladeburner_max_stamina_mult,
|
||||
],
|
||||
[
|
||||
"Bladeburner Stamina Gain",
|
||||
Player.bladeburner_stamina_gain_mult,
|
||||
Player.bladeburner_stamina_gain_mult *
|
||||
mults.bladeburner_stamina_gain_mult,
|
||||
Player.bladeburner_stamina_gain_mult * mults.bladeburner_stamina_gain_mult,
|
||||
],
|
||||
[
|
||||
"Bladeburner Field Analysis",
|
||||
@@ -95,110 +89,46 @@ export function PlayerMultipliers(): React.ReactElement {
|
||||
</p>
|
||||
<br />
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Hacking Chance ",
|
||||
Player.hacking_chance_mult,
|
||||
Player.hacking_chance_mult * mults.hacking_chance_mult,
|
||||
],
|
||||
[
|
||||
"Hacking Speed ",
|
||||
Player.hacking_speed_mult,
|
||||
Player.hacking_speed_mult * mults.hacking_speed_mult,
|
||||
],
|
||||
[
|
||||
"Hacking Money ",
|
||||
Player.hacking_money_mult,
|
||||
Player.hacking_money_mult * mults.hacking_money_mult,
|
||||
],
|
||||
[
|
||||
"Hacking Growth ",
|
||||
Player.hacking_grow_mult,
|
||||
Player.hacking_grow_mult * mults.hacking_grow_mult,
|
||||
],
|
||||
["Hacking Chance ", Player.hacking_chance_mult, Player.hacking_chance_mult * mults.hacking_chance_mult],
|
||||
["Hacking Speed ", Player.hacking_speed_mult, Player.hacking_speed_mult * mults.hacking_speed_mult],
|
||||
["Hacking Money ", Player.hacking_money_mult, Player.hacking_money_mult * mults.hacking_money_mult],
|
||||
["Hacking Growth ", Player.hacking_grow_mult, Player.hacking_grow_mult * mults.hacking_grow_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Hacking Level ",
|
||||
Player.hacking_mult,
|
||||
Player.hacking_mult * mults.hacking_mult,
|
||||
],
|
||||
[
|
||||
"Hacking Experience ",
|
||||
Player.hacking_exp_mult,
|
||||
Player.hacking_exp_mult * mults.hacking_exp_mult,
|
||||
],
|
||||
["Hacking Level ", Player.hacking_mult, Player.hacking_mult * mults.hacking_mult],
|
||||
["Hacking Experience ", Player.hacking_exp_mult, Player.hacking_exp_mult * mults.hacking_exp_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Strength Level ",
|
||||
Player.strength_mult,
|
||||
Player.strength_mult * mults.strength_mult,
|
||||
],
|
||||
[
|
||||
"Strength Experience ",
|
||||
Player.strength_exp_mult,
|
||||
Player.strength_exp_mult * mults.strength_exp_mult,
|
||||
],
|
||||
["Strength Level ", Player.strength_mult, Player.strength_mult * mults.strength_mult],
|
||||
["Strength Experience ", Player.strength_exp_mult, Player.strength_exp_mult * mults.strength_exp_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Defense Level ",
|
||||
Player.defense_mult,
|
||||
Player.defense_mult * mults.defense_mult,
|
||||
],
|
||||
[
|
||||
"Defense Experience ",
|
||||
Player.defense_exp_mult,
|
||||
Player.defense_exp_mult * mults.defense_exp_mult,
|
||||
],
|
||||
["Defense Level ", Player.defense_mult, Player.defense_mult * mults.defense_mult],
|
||||
["Defense Experience ", Player.defense_exp_mult, Player.defense_exp_mult * mults.defense_exp_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Dexterity Level ",
|
||||
Player.dexterity_mult,
|
||||
Player.dexterity_mult * mults.dexterity_mult,
|
||||
],
|
||||
[
|
||||
"Dexterity Experience ",
|
||||
Player.dexterity_exp_mult,
|
||||
Player.dexterity_exp_mult * mults.dexterity_exp_mult,
|
||||
],
|
||||
["Dexterity Level ", Player.dexterity_mult, Player.dexterity_mult * mults.dexterity_mult],
|
||||
["Dexterity Experience ", Player.dexterity_exp_mult, Player.dexterity_exp_mult * mults.dexterity_exp_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Agility Level ",
|
||||
Player.agility_mult,
|
||||
Player.agility_mult * mults.agility_mult,
|
||||
],
|
||||
[
|
||||
"Agility Experience ",
|
||||
Player.agility_exp_mult,
|
||||
Player.agility_exp_mult * mults.agility_exp_mult,
|
||||
],
|
||||
["Agility Level ", Player.agility_mult, Player.agility_mult * mults.agility_mult],
|
||||
["Agility Experience ", Player.agility_exp_mult, Player.agility_exp_mult * mults.agility_exp_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Charisma Level ",
|
||||
Player.charisma_mult,
|
||||
Player.charisma_mult * mults.charisma_mult,
|
||||
],
|
||||
[
|
||||
"Charisma Experience ",
|
||||
Player.charisma_exp_mult,
|
||||
Player.charisma_exp_mult * mults.charisma_exp_mult,
|
||||
],
|
||||
["Charisma Level ", Player.charisma_mult, Player.charisma_mult * mults.charisma_mult],
|
||||
["Charisma Experience ", Player.charisma_exp_mult, Player.charisma_exp_mult * mults.charisma_exp_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
@@ -211,8 +141,7 @@ export function PlayerMultipliers(): React.ReactElement {
|
||||
[
|
||||
"Hacknet Node purchase cost ",
|
||||
Player.hacknet_node_purchase_cost_mult,
|
||||
Player.hacknet_node_purchase_cost_mult *
|
||||
mults.hacknet_node_purchase_cost_mult,
|
||||
Player.hacknet_node_purchase_cost_mult * mults.hacknet_node_purchase_cost_mult,
|
||||
],
|
||||
[
|
||||
"Hacknet Node RAM upgrade cost ",
|
||||
@@ -222,48 +151,26 @@ export function PlayerMultipliers(): React.ReactElement {
|
||||
[
|
||||
"Hacknet Node Core purchase cost ",
|
||||
Player.hacknet_node_core_cost_mult,
|
||||
Player.hacknet_node_core_cost_mult *
|
||||
mults.hacknet_node_core_cost_mult,
|
||||
Player.hacknet_node_core_cost_mult * mults.hacknet_node_core_cost_mult,
|
||||
],
|
||||
[
|
||||
"Hacknet Node level upgrade cost ",
|
||||
Player.hacknet_node_level_cost_mult,
|
||||
Player.hacknet_node_level_cost_mult *
|
||||
mults.hacknet_node_level_cost_mult,
|
||||
Player.hacknet_node_level_cost_mult * mults.hacknet_node_level_cost_mult,
|
||||
],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Company reputation gain ",
|
||||
Player.company_rep_mult,
|
||||
Player.company_rep_mult * mults.company_rep_mult,
|
||||
],
|
||||
[
|
||||
"Faction reputation gain ",
|
||||
Player.faction_rep_mult,
|
||||
Player.faction_rep_mult * mults.faction_rep_mult,
|
||||
],
|
||||
[
|
||||
"Salary ",
|
||||
Player.work_money_mult,
|
||||
Player.work_money_mult * mults.work_money_mult,
|
||||
],
|
||||
["Company reputation gain ", Player.company_rep_mult, Player.company_rep_mult * mults.company_rep_mult],
|
||||
["Faction reputation gain ", Player.faction_rep_mult, Player.faction_rep_mult * mults.faction_rep_mult],
|
||||
["Salary ", Player.work_money_mult, Player.work_money_mult * mults.work_money_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
{MultiplierTable([
|
||||
[
|
||||
"Crime success ",
|
||||
Player.crime_success_mult,
|
||||
Player.crime_success_mult * mults.crime_success_mult,
|
||||
],
|
||||
[
|
||||
"Crime money ",
|
||||
Player.crime_money_mult,
|
||||
Player.crime_money_mult * mults.crime_money_mult,
|
||||
],
|
||||
["Crime success ", Player.crime_success_mult, Player.crime_success_mult * mults.crime_success_mult],
|
||||
["Crime money ", Player.crime_money_mult, Player.crime_money_mult * mults.crime_money_mult],
|
||||
])}
|
||||
<br />
|
||||
|
||||
|
||||
@@ -15,17 +15,14 @@ export function PurchasedAugmentations(): React.ReactElement {
|
||||
// Only render the last NeuroFlux (there are no findLastIndex btw)
|
||||
let nfgIndex = -1;
|
||||
for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {
|
||||
if (
|
||||
Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor
|
||||
) {
|
||||
if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {
|
||||
nfgIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < Player.queuedAugmentations.length; i++) {
|
||||
const ownedAug = Player.queuedAugmentations[i];
|
||||
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex)
|
||||
continue;
|
||||
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;
|
||||
const aug = Augmentations[ownedAug.name];
|
||||
let level = null;
|
||||
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {
|
||||
|
||||
@@ -47,13 +47,10 @@ export class AugmentationsRoot extends React.Component<IProps, IState> {
|
||||
<div id="augmentations-content">
|
||||
<h1>Purchased Augmentations</h1>
|
||||
<p>
|
||||
Below is a list of all Augmentations you have purchased but not yet
|
||||
installed. Click the button below to install them.
|
||||
</p>
|
||||
<p>
|
||||
WARNING: Installing your Augmentations resets most of your progress,
|
||||
including:
|
||||
Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to
|
||||
install them.
|
||||
</p>
|
||||
<p>WARNING: Installing your Augmentations resets most of your progress, including:</p>
|
||||
<br />
|
||||
<p>- Stats/Skill levels and Experience</p>
|
||||
<p>- Money</p>
|
||||
@@ -64,10 +61,9 @@ export class AugmentationsRoot extends React.Component<IProps, IState> {
|
||||
<p>- Stocks</p>
|
||||
<br />
|
||||
<p>
|
||||
Installing Augmentations lets you start over with the perks and
|
||||
benefits granted by all of the Augmentations you have ever installed.
|
||||
Also, you will keep any scripts and RAM/Core upgrades on your home
|
||||
computer (but you will lose all programs besides NUKE.exe)
|
||||
Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations
|
||||
you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you
|
||||
will lose all programs besides NUKE.exe)
|
||||
</p>
|
||||
<StdButton
|
||||
onClick={this.props.installAugmentationsFn}
|
||||
@@ -83,9 +79,7 @@ export class AugmentationsRoot extends React.Component<IProps, IState> {
|
||||
<PurchasedAugmentations />
|
||||
<h1>Installed Augmentations</h1>
|
||||
<p>
|
||||
{`List of all Augmentations ${
|
||||
Player.sourceFiles.length > 0 ? "and Source Files " : ""
|
||||
} ` +
|
||||
{`List of all Augmentations ${Player.sourceFiles.length > 0 ? "and Source Files " : ""} ` +
|
||||
`that have been installed. You have gained the effects of these.`}
|
||||
</p>
|
||||
<InstalledAugmentationsAndSourceFiles />
|
||||
|
||||
@@ -29,8 +29,8 @@ export function SourceFileMinus1(): React.ReactElement {
|
||||
panelContent={
|
||||
<>
|
||||
<p>
|
||||
This Source-File can only be acquired with obscure knowledge of
|
||||
the game, javascript, and the web ecosystem.
|
||||
This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web
|
||||
ecosystem.
|
||||
</p>
|
||||
<p>It increases all of the player's multipliers by 0.1%</p>
|
||||
<br />
|
||||
|
||||
Reference in New Issue
Block a user