From 2c2548f8567329456540c0fdfafcf87903c22ea4 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Sun, 6 Jun 2021 12:00:59 -0400 Subject: [PATCH] dev menu is now save-file sensitive, Fixed some bugs related to BN5-1 int --- src/DevMenu.jsx | 19 ++++++++++++++++--- src/Prestige.js | 5 +++-- src/RedPill.js | 28 +++++++--------------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/DevMenu.jsx b/src/DevMenu.jsx index 20e61f83e..24ea78b56 100644 --- a/src/DevMenu.jsx +++ b/src/DevMenu.jsx @@ -14,6 +14,7 @@ import { AllServers } from "./Server/AllServers"; import { GetServerByHostname } from "./Server/ServerHelpers"; import { hackWorldDaemon } from "./RedPill"; import { StockMarket } from "./StockMarket/StockMarket"; +import { Bladeburner } from "./Bladeburner"; import { Stock } from "./StockMarket/Stock"; import { Engine } from "./engine"; import { saveObject } from "./SaveObject"; @@ -145,6 +146,10 @@ class DevMenuComponent extends Component { hackWorldDaemon(Player.bitNodeN, true); } + quickHackW0r1dD43m0n() { + hackWorldDaemon(Player.bitNodeN, false, true); + } + hackW0r1dD43m0n() { hackWorldDaemon(Player.bitNodeN); } @@ -708,7 +713,6 @@ class DevMenuComponent extends Component { contractTypes.push(); } - return (
@@ -728,6 +732,7 @@ class DevMenuComponent extends Component {
+
@@ -1066,6 +1071,7 @@ class DevMenuComponent extends Component {
+ {Player.bladeburner instanceof Bladeburner &&
@@ -1101,7 +1107,9 @@ class DevMenuComponent extends Component {
+ } + {Player.inGang() &&
@@ -1125,7 +1133,9 @@ class DevMenuComponent extends Component {
+ } + {Player.hasCorporation() &&
@@ -1152,6 +1162,7 @@ class DevMenuComponent extends Component {
+ }
@@ -1181,7 +1192,7 @@ class DevMenuComponent extends Component {
- + {Player.hasWseAccount &&
@@ -1208,8 +1219,9 @@ class DevMenuComponent extends Component {
+ } - + {Player.sleeves.length > 0 &&
@@ -1231,6 +1243,7 @@ class DevMenuComponent extends Component {
+ }
diff --git a/src/Prestige.js b/src/Prestige.js index 777690b98..48fc82167 100755 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -176,7 +176,7 @@ function prestigeAugmentation() { // Prestige by destroying Bit Node and gaining a Source File -function prestigeSourceFile() { +function prestigeSourceFile(flume) { initBitNodeMultipliers(Player); updateSourceFileFlags(Player); @@ -350,7 +350,8 @@ function prestigeSourceFile() { document.getElementById("world-menu-header").click(); // Gain int exp - Player.gainIntelligenceExp(300); + if(SourceFileFlags[5] !== 0 && !flume) + Player.gainIntelligenceExp(300); resetPidCounter(); } diff --git a/src/RedPill.js b/src/RedPill.js index c47997fd9..0858dbc5a 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -134,7 +134,7 @@ function giveSourceFile(bitNodeNumber) { } else { var playerSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1); Player.sourceFiles.push(playerSrcFile); - if (bitNodeNumber === 5) { // Artificial Intelligence + if (bitNodeNumber === 5 && Player.intelligence === 0) { // Artificial Intelligence Player.intelligence = 1; } dialogBoxCreate("You received a Source-File for destroying a Bit Node!

" + @@ -305,31 +305,17 @@ function createBitNodeYesNoEventListener(newBitNode, destroyedBitNode, flume=fal yesBtn.addEventListener("click", function() { if (!flume) { giveSourceFile(destroyedBitNode); - if (newBitNode === 5) { - if(Player.intelligence === 0) { - Player.intelligence = 1; - Player.updateSkillLevels(); - } - } - } else { - // If player used flume, subtract 300 int exp. The prestigeSourceFile() - // function below grants 300 int exp, so this allows sets net gain to 0 - Player.gainIntelligenceExp(-300); - if(SourceFileFlags[5] === 0 || newBitNode !== 5) { + if(SourceFileFlags[5] === 0 && newBitNode !== 5) { Player.intelligence = 0; Player.intelligence_exp = 0; - Player.updateSkillLevels(); - } - if (newBitNode === 5) { - if(Player.intelligence === 0) { - Player.intelligence = 1; - Player.updateSkillLevels(); - } } } + if (newBitNode === 5 && Player.intelligence === 0) { + Player.intelligence = 1; + } redPillFlag = false; - var container = document.getElementById("red-pill-content"); + const container = document.getElementById("red-pill-content"); removeChildrenFromElement(container); // Set new Bit Node @@ -341,7 +327,7 @@ function createBitNodeYesNoEventListener(newBitNode, destroyedBitNode, flume=fal document.getElementById("terminal-input-td").innerHTML = '$ '; $('input[class=terminal-input]').prop('disabled', false); - prestigeSourceFile(); + prestigeSourceFile(flume); yesNoBoxClose(); }); const noBtn = yesNoBoxGetNoButton();