From a1da58f2a9284239d330707d1c0953b2c7f97356 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 5 Jun 2018 01:27:18 -0400 Subject: [PATCH 1/3] fix faction reputation --- src/Faction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Faction.js b/src/Faction.js index b349aaa32..261b7b254 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -599,7 +599,7 @@ function createFactionAugmentationDisplayElements(augmentationsList, augs, facti var pElem = createElement("p", { display:"inline", }) - var req = aug.baseRepRequirement * faction.augmentationRepRequirementMult; + var req = aug.baseRepRequirement * factionInfo.augmentationRepRequirementMult; var hasPrereqs = hasAugmentationPrereqs(aug); if (!hasPrereqs) { aElem.setAttribute("class", "a-link-button-inactive"); From 3e429e30bee5a0cc57d574b2d505cfb51aad25e6 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 5 Jun 2018 01:58:34 -0400 Subject: [PATCH 2/3] bn12 plus faction fix from my last pr --- src/Augmentations.js | 3 ++- src/BitNode.js | 50 +++++++++++++++++++++++++++++++++++++++++--- src/Faction.js | 9 ++++---- src/RedPill.js | 2 +- src/SourceFile.js | 38 ++++++++++++++++++++++++++++++++- 5 files changed, 92 insertions(+), 10 deletions(-) diff --git a/src/Augmentations.js b/src/Augmentations.js index df36c6e81..3ea75815c 100644 --- a/src/Augmentations.js +++ b/src/Augmentations.js @@ -2594,8 +2594,9 @@ function displaySourceFiles(listElement, sourceFiles) { console.log("ERROR: Invalid source file number: " + sourceFiles[i].n); continue; } + const maxLevel = sourceFiles[i].n == 12 ? "∞" : "3"; var accordion = createAccordionElement({ - hdrText:sourceFileObject.name + "
" + "Level " + (sourceFiles[i].lvl) + " / 3", + hdrText:sourceFileObject.name + "
" + "Level " + (sourceFiles[i].lvl) + " / "+maxLevel, panelText:sourceFileObject.info }); diff --git a/src/BitNode.js b/src/BitNode.js index 619caa90c..52a65f917 100644 --- a/src/BitNode.js +++ b/src/BitNode.js @@ -156,10 +156,9 @@ function initBitNodes() { "Level 1: 24%
" + "Level 2: 36%
" + "Level 3: 42%"); - + BitNodes["BitNode12"] = new BitNode(12, "The testing ground", "Ender improvement center", "Something about this bitnode being the testing ground for the enders security. This bitnode is infinitely repeatable but gets harder each time. This awards Source-File 12 which awards 1% to all stats each time this bitnode is destroyed."); //Books: Frontera, Shiner - BitNodes["BitNode12"] = new BitNode(12, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes - BitNodes["BitNode13"] = new BitNode(13, "", "COMING SOON"); + BitNodes["BitNode13"] = new BitNode(13, "fOS", "COMING SOON"); //Unlocks the new game mode and the rest of the BitNodes BitNodes["BitNode14"] = new BitNode(14, "", "COMING SOON"); BitNodes["BitNode15"] = new BitNode(15, "", "COMING SOON"); BitNodes["BitNode16"] = new BitNode(16, "", "COMING SOON"); @@ -304,6 +303,51 @@ function initBitNodeMultipliers() { BitNodeMultipliers.InfiltrationRep = 2.5; BitNodeMultipliers.CorporationValuation = 0.01; break; + case 12: //The Testing Ground + let sf12Lvl = 0; + for(let i = 0; i < Player.sourceFiles.length; i++) { + if(Player.sourceFiles[i].n == 12) { + sf12Lvl = Player.sourceFiles[i].lvl; + } + } + const inc = Math.pow(1.01, sf12Lvl); + const dec = Math.pow(0.99, sf12Lvl); + BitNodeMultipliers.HackingLevelMultiplier = dec; + + BitNodeMultipliers.ServerMaxMoney = dec; + BitNodeMultipliers.ServerStartingMoney = dec; + BitNodeMultipliers.ServerGrowthRate = dec; + BitNodeMultipliers.ServerWeakenRate = dec; + + //this one is special because it can cause the min + //security to go over 100 and make it impossible to + //get money through hacking. This stat should not be + + //BitNodeMultipliers.ServerStartingSecurity = inc; + + BitNodeMultipliers.ManualHackMoney = dec; + BitNodeMultipliers.ScriptHackMoney = dec; + BitNodeMultipliers.CompanyWorkMoney = dec; + BitNodeMultipliers.CrimeMoney = dec; + BitNodeMultipliers.HacknetNodeMoney = dec; + + BitNodeMultipliers.CompanyWorkExpGain = dec; + BitNodeMultipliers.ClassGymExpGain = dec; + BitNodeMultipliers.FactionWorkExpGain = dec; + BitNodeMultipliers.HackExpGain = dec; + BitNodeMultipliers.CrimeExpGain = dec; + + BitNodeMultipliers.FactionWorkRepGain = dec; + BitNodeMultipliers.FactionPassiveRepGain = dec; + BitNodeMultipliers.RepToDonateToFaction = inc; + + BitNodeMultipliers.AugmentationRepCost = inc; + BitNodeMultipliers.AugmentationMoneyCost = inc; + + BitNodeMultipliers.InfiltrationMoney = dec; + BitNodeMultipliers.InfiltrationRep = dec; + + BitNodeMultipliers.CorporationValuation = dec; default: console.log("WARNING: Player.bitNodeN invalid"); break; diff --git a/src/Faction.js b/src/Faction.js index 261b7b254..034b27678 100644 --- a/src/Faction.js +++ b/src/Faction.js @@ -626,7 +626,7 @@ function createFactionAugmentationDisplayElements(augmentationsList, augs, facti } function purchaseAugmentationBoxCreate(aug, fac) { - const factionInfo = fac.info(); + const factionInfo = fac.getInfo(); var yesBtn = yesNoBoxGetYesButton(), noBtn = yesNoBoxGetNoButton(); yesBtn.innerHTML = "Purchase"; noBtn.innerHTML = "Cancel"; @@ -671,12 +671,13 @@ function hasAugmentationPrereqs(aug) { } function purchaseAugmentation(aug, fac, sing=false) { + const factionInfo = fac.getInfo(); var hasPrereqs = hasAugmentationPrereqs(aug); if (!hasPrereqs) { var txt = "You must first purchase or install " + aug.prereqs.join(",") + " before you can " + "purchase this one."; if (sing) {return txt;} else {dialogBoxCreate(txt);} - } else if (Player.money.lt(aug.baseCost * fac.augmentationPriceMult)) { + } else if (Player.money.lt(aug.baseCost * factionInfo.augmentationPriceMult)) { let txt = "You don't have enough money to purchase " + aug.name; if (sing) {return txt;} dialogBoxCreate(txt); @@ -684,7 +685,7 @@ function purchaseAugmentation(aug, fac, sing=false) { let txt = "You don't have enough faction reputation to purchase " + aug.name; if (sing) {return txt;} dialogBoxCreate(txt); - } else if (Player.money.gte(aug.baseCost * fac.augmentationPriceMult)) { + } else if (Player.money.gte(aug.baseCost * factionInfo.augmentationPriceMult)) { if (Player.firstAugPurchased === false) { Player.firstAugPurchased = true; document.getElementById("augmentations-tab").style.display = "list-item"; @@ -698,7 +699,7 @@ function purchaseAugmentation(aug, fac, sing=false) { } Player.queuedAugmentations.push(queuedAugmentation); - Player.loseMoney((aug.baseCost * fac.augmentationPriceMult)); + Player.loseMoney((aug.baseCost * factionInfo.augmentationPriceMult)); //If you just purchased Neuroflux Governor, recalculate the cost if (aug.name == AugmentationNames.NeuroFluxGovernor) { diff --git a/src/RedPill.js b/src/RedPill.js index 9a35bf04f..ffa550eb2 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -208,7 +208,7 @@ function loadBitVerse(destroyedBitNodeNum, flume=false) { var elemId = "bitnode-" + i.toString(); var elem = clearEventListeners(elemId); if (elem == null) {return;} - if (i === 1 || i === 2 || i === 3 || i === 4 || i === 5 || i === 6 || i === 8 || i === 11) { + if (i === 1 || i === 2 || i === 3 || i === 4 || i === 5 || i === 6 || i === 8 || i === 11 || i === 12) { elem.addEventListener("click", function() { var bitNodeKey = "BitNode" + i; var bitNode = BitNodes[bitNodeKey]; diff --git a/src/SourceFile.js b/src/SourceFile.js index 80a5132fb..ab9796116 100644 --- a/src/SourceFile.js +++ b/src/SourceFile.js @@ -66,7 +66,7 @@ function initSourceFiles() { "Level 1: 24%
" + "Level 2: 36%
" + "Level 3: 42%
"); - SourceFiles["SourceFile12"] = new SourceFile(12); + SourceFiles["SourceFile12"] = new SourceFile(12, "This Source-File increases all your multipliers by 1% per level"); } function PlayerOwnedSourceFile(number, level) { @@ -181,6 +181,42 @@ function applySourceFile(srcFile) { Player.work_money_mult *= incMult; Player.company_rep_mult *= incMult; break; + case 12: //The testing ground + const inc = Math.pow(1.01, srcFile.lvl); + const dec = Math.pow(0.99, srcFile.lvl); + + Player.hacking_chance_mult *= inc; + Player.hacking_speed_mult *= inc; + Player.hacking_money_mult *= inc; + Player.hacking_grow_mult *= inc; + Player.hacking_mult *= inc; + + Player.strength_mult *= inc; + Player.defense_mult *= inc; + Player.dexterity_mult *= inc; + Player.agility_mult *= inc; + Player.charisma_mult *= inc; + + Player.hacking_exp_mult *= inc; + Player.strength_exp_mult *= inc; + Player.defense_exp_mult *= inc; + Player.dexterity_exp_mult *= inc; + Player.agility_exp_mult *= inc; + Player.charisma_exp_mult *= inc; + + Player.company_rep_mult *= inc; + Player.faction_rep_mult *= inc; + + Player.crime_money_mult *= inc; + Player.crime_success_mult *= inc; + + Player.hacknet_node_money_mult *= inc; + Player.hacknet_node_purchase_cost_mult *= dec; + Player.hacknet_node_ram_cost_mult *= dec; + Player.hacknet_node_core_cost_mult *= dec; + Player.hacknet_node_level_cost_mult *= dec; + + Player.work_money_mult *= inc; default: console.log("ERROR: Invalid source file number: " + srcFile.n); break; From bcabc72c353ba49b5cf8fec7b76cbf79f7eed7c7 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Tue, 5 Jun 2018 02:52:59 -0400 Subject: [PATCH 3/3] Update RedPill.js --- src/RedPill.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RedPill.js b/src/RedPill.js index ffa550eb2..60ad4104e 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -113,7 +113,7 @@ function giveSourceFile(bitNodeNumber) { } if (alreadyOwned && ownedSourceFile) { - if (ownedSourceFile.lvl >= 3) { + if (ownedSourceFile.lvl >= 3 && ownedSourceFile.n !== 12) { dialogBoxCreate("The Source-File for the BitNode you just destroyed, " + sourceFile.name + ", " + "is already at max level!"); } else {