mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 22:37:06 +02:00
fix sleeve memory bug
This commit is contained in:
@@ -8,11 +8,7 @@ import { Factions } from "../Faction/Factions";
|
||||
import { numeralWrapper } from "../ui/numeralFormat";
|
||||
import { Money } from "../ui/React/Money";
|
||||
|
||||
import {
|
||||
Generic_fromJSON,
|
||||
Generic_toJSON,
|
||||
Reviver,
|
||||
} from "../../utils/JSONReviver";
|
||||
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviver";
|
||||
|
||||
interface IConstructorParams {
|
||||
info: string | JSX.Element;
|
||||
@@ -58,11 +54,7 @@ interface IConstructorParams {
|
||||
programs?: string[];
|
||||
}
|
||||
|
||||
function generateStatsDescription(
|
||||
mults: IMap<number>,
|
||||
programs?: string[],
|
||||
startingMoney?: number,
|
||||
): JSX.Element {
|
||||
function generateStatsDescription(mults: IMap<number>, programs?: string[], startingMoney?: number): JSX.Element {
|
||||
const f = (x: number, decimals = 0): string => {
|
||||
// look, I don't know how to make a "smart decimals"
|
||||
// todo, make it smarter
|
||||
@@ -224,8 +216,7 @@ function generateStatsDescription(
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />+{f(mults.hacking_speed_mult - 1)} faster hack(), grow(), and
|
||||
weaken()
|
||||
<br />+{f(mults.hacking_speed_mult - 1)} faster hack(), grow(), and weaken()
|
||||
</>
|
||||
);
|
||||
if (mults.hacking_chance_mult)
|
||||
@@ -250,15 +241,11 @@ function generateStatsDescription(
|
||||
</>
|
||||
);
|
||||
|
||||
if (
|
||||
mults.faction_rep_mult &&
|
||||
mults.faction_rep_mult === mults.company_rep_mult
|
||||
) {
|
||||
if (mults.faction_rep_mult && mults.faction_rep_mult === mults.company_rep_mult) {
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />+{f(mults.faction_rep_mult - 1)} reputation from factions and
|
||||
companies
|
||||
<br />+{f(mults.faction_rep_mult - 1)} reputation from factions and companies
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
@@ -311,16 +298,14 @@ function generateStatsDescription(
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />-{f(-(mults.hacknet_node_purchase_cost_mult - 1))} hacknet nodes
|
||||
cost
|
||||
<br />-{f(-(mults.hacknet_node_purchase_cost_mult - 1))} hacknet nodes cost
|
||||
</>
|
||||
);
|
||||
if (mults.hacknet_node_level_cost_mult)
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />-{f(-(mults.hacknet_node_level_cost_mult - 1))} hacknet nodes
|
||||
upgrade cost
|
||||
<br />-{f(-(mults.hacknet_node_level_cost_mult - 1))} hacknet nodes upgrade cost
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -328,32 +313,28 @@ function generateStatsDescription(
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />+{f(mults.bladeburner_max_stamina_mult - 1)} Bladeburner Max
|
||||
Stamina
|
||||
<br />+{f(mults.bladeburner_max_stamina_mult - 1)} Bladeburner Max Stamina
|
||||
</>
|
||||
);
|
||||
if (mults.bladeburner_stamina_gain_mult)
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />+{f(mults.bladeburner_stamina_gain_mult - 1)} Bladeburner Stamina
|
||||
gain
|
||||
<br />+{f(mults.bladeburner_stamina_gain_mult - 1)} Bladeburner Stamina gain
|
||||
</>
|
||||
);
|
||||
if (mults.bladeburner_analysis_mult)
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />+{f(mults.bladeburner_analysis_mult - 1)} Bladeburner Field
|
||||
Analysis effectiveness
|
||||
<br />+{f(mults.bladeburner_analysis_mult - 1)} Bladeburner Field Analysis effectiveness
|
||||
</>
|
||||
);
|
||||
if (mults.bladeburner_success_chance_mult)
|
||||
desc = (
|
||||
<>
|
||||
{desc}
|
||||
<br />+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner
|
||||
Contracts and Operations success chance
|
||||
<br />+{f(mults.bladeburner_success_chance_mult - 1)} Bladeburner Contracts and Operations success chance
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -362,8 +343,7 @@ function generateStatsDescription(
|
||||
<>
|
||||
{desc}
|
||||
<br />
|
||||
Start with <Money money={startingMoney} /> after installing
|
||||
Augmentations.
|
||||
Start with <Money money={startingMoney} /> after installing Augmentations.
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -425,8 +405,7 @@ export class Augmentation {
|
||||
this.info = params.info;
|
||||
this.prereqs = params.prereqs ? params.prereqs : [];
|
||||
|
||||
this.baseRepRequirement =
|
||||
params.repCost * BitNodeMultipliers.AugmentationRepCost;
|
||||
this.baseRepRequirement = params.repCost * BitNodeMultipliers.AugmentationRepCost;
|
||||
this.baseCost = params.moneyCost * BitNodeMultipliers.AugmentationMoneyCost;
|
||||
this.startingCost = this.baseCost;
|
||||
|
||||
@@ -504,43 +483,32 @@ export class Augmentation {
|
||||
this.mults.hacknet_node_money_mult = params.hacknet_node_money_mult;
|
||||
}
|
||||
if (params.hacknet_node_purchase_cost_mult) {
|
||||
this.mults.hacknet_node_purchase_cost_mult =
|
||||
params.hacknet_node_purchase_cost_mult;
|
||||
this.mults.hacknet_node_purchase_cost_mult = params.hacknet_node_purchase_cost_mult;
|
||||
}
|
||||
if (params.hacknet_node_ram_cost_mult) {
|
||||
this.mults.hacknet_node_ram_cost_mult = params.hacknet_node_ram_cost_mult;
|
||||
}
|
||||
if (params.hacknet_node_core_cost_mult) {
|
||||
this.mults.hacknet_node_core_cost_mult =
|
||||
params.hacknet_node_core_cost_mult;
|
||||
this.mults.hacknet_node_core_cost_mult = params.hacknet_node_core_cost_mult;
|
||||
}
|
||||
if (params.hacknet_node_level_cost_mult) {
|
||||
this.mults.hacknet_node_level_cost_mult =
|
||||
params.hacknet_node_level_cost_mult;
|
||||
this.mults.hacknet_node_level_cost_mult = params.hacknet_node_level_cost_mult;
|
||||
}
|
||||
if (params.bladeburner_max_stamina_mult) {
|
||||
this.mults.bladeburner_max_stamina_mult =
|
||||
params.bladeburner_max_stamina_mult;
|
||||
this.mults.bladeburner_max_stamina_mult = params.bladeburner_max_stamina_mult;
|
||||
}
|
||||
if (params.bladeburner_stamina_gain_mult) {
|
||||
this.mults.bladeburner_stamina_gain_mult =
|
||||
params.bladeburner_stamina_gain_mult;
|
||||
this.mults.bladeburner_stamina_gain_mult = params.bladeburner_stamina_gain_mult;
|
||||
}
|
||||
if (params.bladeburner_analysis_mult) {
|
||||
this.mults.bladeburner_analysis_mult = params.bladeburner_analysis_mult;
|
||||
}
|
||||
if (params.bladeburner_success_chance_mult) {
|
||||
this.mults.bladeburner_success_chance_mult =
|
||||
params.bladeburner_success_chance_mult;
|
||||
this.mults.bladeburner_success_chance_mult = params.bladeburner_success_chance_mult;
|
||||
}
|
||||
|
||||
if (params.stats) this.stats = params.stats;
|
||||
else
|
||||
this.stats = generateStatsDescription(
|
||||
this.mults,
|
||||
params.programs,
|
||||
params.startingMoney,
|
||||
);
|
||||
else this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);
|
||||
}
|
||||
|
||||
// Adds this Augmentation to the specified Factions
|
||||
@@ -548,9 +516,7 @@ export class Augmentation {
|
||||
for (let i = 0; i < factionList.length; ++i) {
|
||||
const faction: Faction | null = Factions[factionList[i]];
|
||||
if (faction == null) {
|
||||
console.warn(
|
||||
`In Augmentation.addToFactions(), could not find faction with this name: ${factionList[i]}`,
|
||||
);
|
||||
console.warn(`In Augmentation.addToFactions(), could not find faction with this name: ${factionList[i]}`);
|
||||
continue;
|
||||
}
|
||||
faction.augmentations.push(this.name);
|
||||
@@ -563,9 +529,7 @@ export class Augmentation {
|
||||
if (Factions.hasOwnProperty(fac)) {
|
||||
const facObj: Faction | null = Factions[fac];
|
||||
if (facObj == null) {
|
||||
console.warn(
|
||||
`Invalid Faction object in addToAllFactions(). Key value: ${fac}`,
|
||||
);
|
||||
console.warn(`Invalid Faction object in addToAllFactions(). Key value: ${fac}`);
|
||||
continue;
|
||||
}
|
||||
facObj.augmentations.push(this.name);
|
||||
|
||||
@@ -141,9 +141,7 @@ function initAugmentations() {
|
||||
Object.keys(randomBonuses.bonuses).forEach(
|
||||
(key) => (UnstableCircadianModulatorParams[key] = randomBonuses.bonuses[key]),
|
||||
);
|
||||
const UnstableCircadianModulator = new Augmentation(
|
||||
UnstableCircadianModulatorParams,
|
||||
);
|
||||
const UnstableCircadianModulator = new Augmentation(UnstableCircadianModulatorParams);
|
||||
|
||||
UnstableCircadianModulator.addToFactions(["Speakers for the Dead"]);
|
||||
if (augmentationExists(AugmentationNames.UnstableCircadianModulator)) {
|
||||
@@ -156,9 +154,7 @@ function initAugmentations() {
|
||||
name: AugmentationNames.HemoRecirculator,
|
||||
moneyCost: 4.5e7,
|
||||
repCost: 1e4,
|
||||
info:
|
||||
"A heart implant that greatly increases the body's ability to effectively use and pump " +
|
||||
"blood.",
|
||||
info: "A heart implant that greatly increases the body's ability to effectively use and pump " + "blood.",
|
||||
strength_mult: 1.08,
|
||||
defense_mult: 1.08,
|
||||
agility_mult: 1.08,
|
||||
@@ -221,9 +217,7 @@ function initAugmentations() {
|
||||
name: AugmentationNames.Targeting3,
|
||||
moneyCost: 1.15e8,
|
||||
repCost: 2.75e4,
|
||||
info:
|
||||
"The latest version of the 'Augmented Targeting' implant adds the ability to " +
|
||||
"lock-on and track threats.",
|
||||
info: "The latest version of the 'Augmented Targeting' implant adds the ability to " + "lock-on and track threats.",
|
||||
prereqs: [AugmentationNames.Targeting2],
|
||||
dexterity_mult: 1.3,
|
||||
});
|
||||
@@ -442,15 +436,11 @@ function initAugmentations() {
|
||||
repCost: 1.125e6,
|
||||
moneyCost: 4.25e9,
|
||||
info:
|
||||
"Graphene is grafted and fused into the skeletal structure, " +
|
||||
"enhancing bone density and tensile strength.",
|
||||
"Graphene is grafted and fused into the skeletal structure, " + "enhancing bone density and tensile strength.",
|
||||
strength_mult: 1.7,
|
||||
defense_mult: 1.7,
|
||||
});
|
||||
GrapheneBoneLacings.addToFactions([
|
||||
"Fulcrum Secret Technologies",
|
||||
"The Covenant",
|
||||
]);
|
||||
GrapheneBoneLacings.addToFactions(["Fulcrum Secret Technologies", "The Covenant"]);
|
||||
if (augmentationExists(AugmentationNames.GrapheneBoneLacings)) {
|
||||
delete Augmentations[AugmentationNames.GrapheneBoneLacings];
|
||||
}
|
||||
@@ -530,11 +520,7 @@ function initAugmentations() {
|
||||
prereqs: [AugmentationNames.BionicLegs],
|
||||
agility_mult: 2.5,
|
||||
});
|
||||
GrapheneBionicLegs.addToFactions([
|
||||
"MegaCorp",
|
||||
"ECorp",
|
||||
"Fulcrum Secret Technologies",
|
||||
]);
|
||||
GrapheneBionicLegs.addToFactions(["MegaCorp", "ECorp", "Fulcrum Secret Technologies"]);
|
||||
if (augmentationExists(AugmentationNames.GrapheneBionicLegs)) {
|
||||
delete Augmentations[AugmentationNames.GrapheneBionicLegs];
|
||||
}
|
||||
@@ -638,10 +624,7 @@ function initAugmentations() {
|
||||
hacking_money_mult: 1.15,
|
||||
hacking_mult: 1.12,
|
||||
});
|
||||
ArtificialBioNeuralNetwork.addToFactions([
|
||||
"BitRunners",
|
||||
"Fulcrum Secret Technologies",
|
||||
]);
|
||||
ArtificialBioNeuralNetwork.addToFactions(["BitRunners", "Fulcrum Secret Technologies"]);
|
||||
if (augmentationExists(AugmentationNames.ArtificialBioNeuralNetwork)) {
|
||||
delete Augmentations[AugmentationNames.ArtificialBioNeuralNetwork];
|
||||
}
|
||||
@@ -677,11 +660,7 @@ function initAugmentations() {
|
||||
hacking_exp_mult: 1.1,
|
||||
hacking_mult: 1.08,
|
||||
});
|
||||
EnhancedMyelinSheathing.addToFactions([
|
||||
"Fulcrum Secret Technologies",
|
||||
"BitRunners",
|
||||
"The Black Hand",
|
||||
]);
|
||||
EnhancedMyelinSheathing.addToFactions(["Fulcrum Secret Technologies", "BitRunners", "The Black Hand"]);
|
||||
if (augmentationExists(AugmentationNames.EnhancedMyelinSheathing)) {
|
||||
delete Augmentations[AugmentationNames.EnhancedMyelinSheathing];
|
||||
}
|
||||
@@ -727,13 +706,7 @@ function initAugmentations() {
|
||||
"and delete it.",
|
||||
hacking_money_mult: 1.25,
|
||||
});
|
||||
DataJack.addToFactions([
|
||||
"BitRunners",
|
||||
"The Black Hand",
|
||||
"NiteSec",
|
||||
"Chongqing",
|
||||
"New Tokyo",
|
||||
]);
|
||||
DataJack.addToFactions(["BitRunners", "The Black Hand", "NiteSec", "Chongqing", "New Tokyo"]);
|
||||
if (augmentationExists(AugmentationNames.DataJack)) {
|
||||
delete Augmentations[AugmentationNames.DataJack];
|
||||
}
|
||||
@@ -1001,11 +974,7 @@ function initAugmentations() {
|
||||
hacking_money_mult: 1.15,
|
||||
hacking_mult: 1.09,
|
||||
});
|
||||
CranialSignalProcessorsG3.addToFactions([
|
||||
"NiteSec",
|
||||
"The Black Hand",
|
||||
"BitRunners",
|
||||
]);
|
||||
CranialSignalProcessorsG3.addToFactions(["NiteSec", "The Black Hand", "BitRunners"]);
|
||||
if (augmentationExists(AugmentationNames.CranialSignalProcessorsG3)) {
|
||||
delete Augmentations[AugmentationNames.CranialSignalProcessorsG3];
|
||||
}
|
||||
@@ -1122,9 +1091,7 @@ function initAugmentations() {
|
||||
name: AugmentationNames.FocusWire,
|
||||
repCost: 7.5e4,
|
||||
moneyCost: 9e8,
|
||||
info:
|
||||
"A cranial implant that stops procrastination by blocking specific neural pathways " +
|
||||
"in the brain.",
|
||||
info: "A cranial implant that stops procrastination by blocking specific neural pathways " + "in the brain.",
|
||||
hacking_exp_mult: 1.05,
|
||||
strength_exp_mult: 1.05,
|
||||
defense_exp_mult: 1.05,
|
||||
@@ -1134,12 +1101,7 @@ function initAugmentations() {
|
||||
company_rep_mult: 1.1,
|
||||
work_money_mult: 1.2,
|
||||
});
|
||||
FocusWire.addToFactions([
|
||||
"Bachman & Associates",
|
||||
"Clarke Incorporated",
|
||||
"Four Sigma",
|
||||
"KuaiGong International",
|
||||
]);
|
||||
FocusWire.addToFactions(["Bachman & Associates", "Clarke Incorporated", "Four Sigma", "KuaiGong International"]);
|
||||
if (augmentationExists(AugmentationNames.FocusWire)) {
|
||||
delete Augmentations[AugmentationNames.FocusWire];
|
||||
}
|
||||
@@ -1156,12 +1118,7 @@ function initAugmentations() {
|
||||
company_rep_mult: 1.3,
|
||||
hacking_mult: 1.08,
|
||||
});
|
||||
PCDNI.addToFactions([
|
||||
"Four Sigma",
|
||||
"OmniTek Incorporated",
|
||||
"ECorp",
|
||||
"Blade Industries",
|
||||
]);
|
||||
PCDNI.addToFactions(["Four Sigma", "OmniTek Incorporated", "ECorp", "Blade Industries"]);
|
||||
if (augmentationExists(AugmentationNames.PCDNI)) {
|
||||
delete Augmentations[AugmentationNames.PCDNI];
|
||||
}
|
||||
@@ -1179,11 +1136,7 @@ function initAugmentations() {
|
||||
company_rep_mult: 1.75,
|
||||
hacking_mult: 1.1,
|
||||
});
|
||||
PCDNIOptimizer.addToFactions([
|
||||
"Fulcrum Secret Technologies",
|
||||
"ECorp",
|
||||
"Blade Industries",
|
||||
]);
|
||||
PCDNIOptimizer.addToFactions(["Fulcrum Secret Technologies", "ECorp", "Blade Industries"]);
|
||||
if (augmentationExists(AugmentationNames.PCDNIOptimizer)) {
|
||||
delete Augmentations[AugmentationNames.PCDNIOptimizer];
|
||||
}
|
||||
@@ -1220,13 +1173,7 @@ function initAugmentations() {
|
||||
company_rep_mult: 1.1,
|
||||
faction_rep_mult: 1.1,
|
||||
});
|
||||
ADRPheromone1.addToFactions([
|
||||
"Tian Di Hui",
|
||||
"The Syndicate",
|
||||
"NWO",
|
||||
"MegaCorp",
|
||||
"Four Sigma",
|
||||
]);
|
||||
ADRPheromone1.addToFactions(["Tian Di Hui", "The Syndicate", "NWO", "MegaCorp", "Four Sigma"]);
|
||||
if (augmentationExists(AugmentationNames.ADRPheromone1)) {
|
||||
delete Augmentations[AugmentationNames.ADRPheromone1];
|
||||
}
|
||||
@@ -1243,12 +1190,7 @@ function initAugmentations() {
|
||||
company_rep_mult: 1.2,
|
||||
faction_rep_mult: 1.2,
|
||||
});
|
||||
ADRPheromone2.addToFactions([
|
||||
"Silhouette",
|
||||
"Four Sigma",
|
||||
"Bachman & Associates",
|
||||
"Clarke Incorporated",
|
||||
]);
|
||||
ADRPheromone2.addToFactions(["Silhouette", "Four Sigma", "Bachman & Associates", "Clarke Incorporated"]);
|
||||
if (augmentationExists(AugmentationNames.ADRPheromone2)) {
|
||||
delete Augmentations[AugmentationNames.ADRPheromone2];
|
||||
}
|
||||
@@ -1267,11 +1209,7 @@ function initAugmentations() {
|
||||
company_rep_mult: 1.15,
|
||||
faction_rep_mult: 1.15,
|
||||
});
|
||||
ShadowsSimulacrum.addToFactions([
|
||||
"The Syndicate",
|
||||
"The Dark Army",
|
||||
"Speakers for the Dead",
|
||||
]);
|
||||
ShadowsSimulacrum.addToFactions(["The Syndicate", "The Dark Army", "Speakers for the Dead"]);
|
||||
if (augmentationExists(AugmentationNames.ShadowsSimulacrum)) {
|
||||
delete Augmentations[AugmentationNames.ShadowsSimulacrum];
|
||||
}
|
||||
@@ -1373,9 +1311,8 @@ function initAugmentations() {
|
||||
"body's nervous system.",
|
||||
stats: (
|
||||
<>
|
||||
This special augmentation can be leveled up infinitely. Each level of
|
||||
this augmentation increases ALL multipliers by 1%, stacking
|
||||
multiplicatively.
|
||||
This special augmentation can be leveled up infinitely. Each level of this augmentation increases ALL
|
||||
multipliers by 1%, stacking multiplicatively.
|
||||
</>
|
||||
),
|
||||
hacking_chance_mult: 1.01,
|
||||
@@ -1419,17 +1356,13 @@ function initAugmentations() {
|
||||
// levels that are purchased but not yet installed
|
||||
let nextLevel = currLevel;
|
||||
for (let i = 0; i < Player.queuedAugmentations.length; ++i) {
|
||||
if (
|
||||
Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor
|
||||
) {
|
||||
if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {
|
||||
++nextLevel;
|
||||
}
|
||||
}
|
||||
let mult = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);
|
||||
NeuroFluxGovernor.baseRepRequirement =
|
||||
500 * mult * BitNodeMultipliers.AugmentationRepCost;
|
||||
NeuroFluxGovernor.baseCost =
|
||||
750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;
|
||||
NeuroFluxGovernor.baseRepRequirement = 500 * mult * BitNodeMultipliers.AugmentationRepCost;
|
||||
NeuroFluxGovernor.baseCost = 750e3 * mult * BitNodeMultipliers.AugmentationMoneyCost;
|
||||
if (augmentationExists(AugmentationNames.NeuroFluxGovernor)) {
|
||||
delete Augmentations[AugmentationNames.NeuroFluxGovernor];
|
||||
}
|
||||
@@ -1559,9 +1492,7 @@ function initAugmentations() {
|
||||
name: AugmentationNames.SmartSonar,
|
||||
repCost: 2.25e4,
|
||||
moneyCost: 7.5e7,
|
||||
info:
|
||||
"A cochlear implant that helps the player detect and locate enemies " +
|
||||
"using sound propagation.",
|
||||
info: "A cochlear implant that helps the player detect and locate enemies " + "using sound propagation.",
|
||||
dexterity_mult: 1.1,
|
||||
dexterity_exp_mult: 1.15,
|
||||
crime_money_mult: 1.25,
|
||||
@@ -1593,12 +1524,7 @@ function initAugmentations() {
|
||||
agility_exp_mult: 1.1,
|
||||
charisma_exp_mult: 1.1,
|
||||
});
|
||||
PowerRecirculator.addToFactions([
|
||||
"Tetrads",
|
||||
"The Dark Army",
|
||||
"The Syndicate",
|
||||
"NWO",
|
||||
]);
|
||||
PowerRecirculator.addToFactions(["Tetrads", "The Dark Army", "The Syndicate", "NWO"]);
|
||||
if (augmentationExists(AugmentationNames.PowerRecirculator)) {
|
||||
delete Augmentations[AugmentationNames.PowerRecirculator];
|
||||
}
|
||||
@@ -1941,9 +1867,8 @@ function initAugmentations() {
|
||||
moneyCost: 1.25e8,
|
||||
info: (
|
||||
<>
|
||||
A collection of digital assets saved on a small chip. The chip is
|
||||
implanted into your wrist. A small jack in the chip allows you to
|
||||
connect it to a computer and upload the assets.
|
||||
A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the
|
||||
chip allows you to connect it to a computer and upload the assets.
|
||||
</>
|
||||
),
|
||||
startingMoney: 1e6,
|
||||
@@ -2006,8 +1931,7 @@ function initAugmentations() {
|
||||
repCost: 7.5e3,
|
||||
moneyCost: 3e7,
|
||||
info:
|
||||
"A tiny chip that sits behind the retinae. This implant lets the" +
|
||||
"user visually detect infrared radiation.",
|
||||
"A tiny chip that sits behind the retinae. This implant lets the" + "user visually detect infrared radiation.",
|
||||
crime_success_mult: 1.25,
|
||||
crime_money_mult: 1.1,
|
||||
dexterity_mult: 1.1,
|
||||
@@ -2098,8 +2022,7 @@ function initAugmentations() {
|
||||
repCost: 6.25e4,
|
||||
moneyCost: 2.75e8,
|
||||
info:
|
||||
"Cybernetic arms created from plasteel and carbon fibers that completely replace " +
|
||||
"the user's organic arms.",
|
||||
"Cybernetic arms created from plasteel and carbon fibers that completely replace " + "the user's organic arms.",
|
||||
strength_mult: 1.3,
|
||||
dexterity_mult: 1.3,
|
||||
});
|
||||
@@ -2417,8 +2340,8 @@ function initAugmentations() {
|
||||
"weaponized by Bladeburner units to be used against Synthoids.",
|
||||
stats: (
|
||||
<>
|
||||
This augmentation allows you to perform Bladeburner actions and other
|
||||
actions (such as working, commiting crimes, etc.) at the same time.
|
||||
This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting
|
||||
crimes, etc.) at the same time.
|
||||
</>
|
||||
),
|
||||
isSpecial: true,
|
||||
@@ -2429,8 +2352,7 @@ function initAugmentations() {
|
||||
|
||||
// Update costs based on how many have been purchased
|
||||
mult = Math.pow(
|
||||
CONSTANTS.MultipleAugMultiplier *
|
||||
[1, 0.96, 0.94, 0.93][SourceFileFlags[11]],
|
||||
CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]],
|
||||
Player.queuedAugmentations.length,
|
||||
);
|
||||
for (var name in Augmentations) {
|
||||
@@ -2445,9 +2367,7 @@ function initAugmentations() {
|
||||
//Resets an Augmentation during (re-initizliation)
|
||||
function resetAugmentation(newAugObject) {
|
||||
if (!(newAugObject instanceof Augmentation)) {
|
||||
throw new Error(
|
||||
"Invalid argument 'newAugObject' passed into resetAugmentation",
|
||||
);
|
||||
throw new Error("Invalid argument 'newAugObject' passed into resetAugmentation");
|
||||
}
|
||||
var name = newAugObject.name;
|
||||
if (augmentationExists(name)) {
|
||||
@@ -2464,9 +2384,7 @@ function applyAugmentation(aug, reapply = false) {
|
||||
// Apply multipliers
|
||||
for (const mult in augObj.mults) {
|
||||
if (Player[mult] == null) {
|
||||
console.warn(
|
||||
`Augmentation has unrecognized multiplier property: ${mult}`,
|
||||
);
|
||||
console.warn(`Augmentation has unrecognized multiplier property: ${mult}`);
|
||||
} else {
|
||||
Player[mult] *= augObj.mults[mult];
|
||||
}
|
||||
@@ -2477,9 +2395,7 @@ function applyAugmentation(aug, reapply = false) {
|
||||
if (!reapply) {
|
||||
Augmentations[aug.name].level = aug.level;
|
||||
for (let i = 0; i < Player.augmentations.length; ++i) {
|
||||
if (
|
||||
Player.augmentations[i].name == AugmentationNames.NeuroFluxGovernor
|
||||
) {
|
||||
if (Player.augmentations[i].name == AugmentationNames.NeuroFluxGovernor) {
|
||||
Player.augmentations[i].level = aug.level;
|
||||
return;
|
||||
// break;
|
||||
@@ -2503,9 +2419,7 @@ function installAugmentations() {
|
||||
let augmentationList = "";
|
||||
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;
|
||||
}
|
||||
@@ -2519,8 +2433,7 @@ function installAugmentations() {
|
||||
}
|
||||
|
||||
applyAugmentation(Player.queuedAugmentations[i]);
|
||||
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex)
|
||||
continue;
|
||||
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;
|
||||
|
||||
let level = "";
|
||||
if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {
|
||||
@@ -2555,13 +2468,7 @@ export function displayAugmentationsContent(contentEl) {
|
||||
onExport(Player);
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<AugmentationsRoot
|
||||
exportGameFn={backup}
|
||||
installAugmentationsFn={installAugmentations}
|
||||
/>,
|
||||
contentEl,
|
||||
);
|
||||
ReactDOM.render(<AugmentationsRoot exportGameFn={backup} installAugmentationsFn={installAugmentations} />, contentEl);
|
||||
}
|
||||
|
||||
export function isRepeatableAug(aug) {
|
||||
@@ -2574,9 +2481,4 @@ export function isRepeatableAug(aug) {
|
||||
return false;
|
||||
}
|
||||
|
||||
export {
|
||||
installAugmentations,
|
||||
initAugmentations,
|
||||
applyAugmentation,
|
||||
augmentationExists,
|
||||
};
|
||||
export { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };
|
||||
|
||||
@@ -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