v0.41.0 QOL changes and suggestions

This commit is contained in:
danielyxie 2018-11-01 13:18:32 -05:00
parent 013af4e26c
commit 5b06a0b800
17 changed files with 267 additions and 173 deletions

@ -0,0 +1,89 @@
@import "mixins";
@import "theme";
/**
* Styling for the Character Overview Panel (top-right)
*/
#character-overview-wrapper {
position: relative;
}
#character-overview-container {
display: none;
position: absolute; /* Stay in place */
right: 0;
top: 0;
height: auto; /* Full height */
padding: 10px 2px;
border: 2px solid var(--my-highlight-color);
width: auto;
max-width: 280px;
overflow: auto; /* Enable scroll if needed */
background-color: rgba(57, 54, 54, 0.9); /* Fallback color */
z-index: 1;
}
#character-overview-text {
color: $my-stat-physical;
table {
border-collapse: collapse;
margin: auto;
}
td {
padding: 2px;
vertical-align: middle;
}
}
.character-stat-text {
color: #fff;
background-color: #444;
}
.character-stat-cell {
text-align: right;
}
#character-hack-wrapper td,
#character-agi-wrapper td {
border-bottom: 1px #aaa solid;
padding-bottom: 10px;
}
#character-str-wrapper td,
#character-cha-wrapper td {
padding-top: 10px;
}
#character-hp-wrapper { color: $my-stat-hp-color; }
#character-money-wrapper { color: $my-stat-money-color; }
#character-hack-wrapper { color: $my-stat-hack-color; }
#character-cha-wrapper { color: $my-stat-cha-color; }
#character-int-wrapper { color: $my-stat-int-color; }
.character-overview-btn {
@include borderRadius(12px);
@include boxShadow(1px 1px 3px #000);
color: #cecece;
display: inline-block;
font-size: $defaultFontSize * 0.875;
font-weight: bold;
height: 25px;
background-color: #000;
padding: 5px 8px;
}
.character-quick-options {
margin-top: 10px;
text-align: center;
}
.character-overview-btn:hover,
.character-overview-btn:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}

@ -296,93 +296,6 @@ a:visited {
width: auto; width: auto;
} }
/* Character Overview */
#character-overview-wrapper {
position: relative;
}
#character-overview-container {
display: none;
position: absolute; /* Stay in place */
right: 0;
top: 0;
height: auto; /* Full height */
padding: 10px 2px;
border: 2px solid var(--my-highlight-color);
width: auto;
max-width: 280px;
overflow: auto; /* Enable scroll if needed */
background-color: rgba(57, 54, 54, 0.9); /* Fallback color */
z-index: 1;
}
#character-overview-text {
color: $my-stat-physical;
table {
border-collapse: collapse;
margin: auto;
}
td {
padding: 2px;
vertical-align: middle;
}
}
.character-stat-text {
color: #fff;
background-color: #444;
}
.character-stat-cell {
text-align: right;
}
#character-hack-wrapper td,
#character-agi-wrapper td {
border-bottom: 1px #aaa solid;
padding-bottom: 10px;
}
#character-str-wrapper td,
#character-cha-wrapper td {
padding-top: 10px;
}
#character-hp-wrapper { color: $my-stat-hp-color; }
#character-money-wrapper { color: $my-stat-money-color; }
#character-hack-wrapper { color: $my-stat-hack-color; }
#character-cha-wrapper { color: $my-stat-cha-color; }
#character-int-wrapper { color: $my-stat-int-color; }
#character-overview-save-button,
#character-overview-options-button {
@include borderRadius(12px);
@include boxShadow(1px 1px 3px #000);
color: #cecece;
display: inline-block;
font-size: $defaultFontSize * 0.875;
font-weight: bold;
height: 25px;
background-color: #000;
padding: 5px 8px;
}
.character-quick-options {
margin-top: 10px;
text-align: center;
}
#character-overview-save-button:hover,
#character-overview-save-button:focus,
#character-overview-options-button:hover,
#character-overview-options-button:focus {
color: #fff;
text-decoration: none;
cursor: pointer;
}
/* Scan analyze links from AutoLink */ /* Scan analyze links from AutoLink */
.scan-analyze-link { .scan-analyze-link {
cursor: pointer; cursor: pointer;

@ -62,7 +62,7 @@ let NetscriptFunctions =
"hack|sleep|grow|weaken|print|tprint|scan|nuke|brutessh|ftpcrack|" + //Netscript functions "hack|sleep|grow|weaken|print|tprint|scan|nuke|brutessh|ftpcrack|" + //Netscript functions
"clearLog|disableLog|enableLog|isLogEnabled|getScriptLogs|" + "clearLog|disableLog|enableLog|isLogEnabled|getScriptLogs|" +
"relaysmtp|httpworm|sqlinject|run|exec|spawn|kill|killall|exit|" + "relaysmtp|httpworm|sqlinject|run|exec|spawn|kill|killall|exit|" +
"scp|ls|hasRootAccess|" + "scp|ls|ps|hasRootAccess|" +
"getIp|getHackingMultipliers|getBitNodeMultipliers|getStats|isBusy|" + "getIp|getHackingMultipliers|getBitNodeMultipliers|getStats|isBusy|" +
"getHacknetMultipliers|" + "getHacknetMultipliers|" +
"getHostname|getHackingLevel|getServerMoneyAvailable|getServerMaxMoney|" + "getHostname|getHackingLevel|getServerMoneyAvailable|getServerMaxMoney|" +

@ -265,7 +265,7 @@ function initBitNodeMultipliers() {
BitNodeMultipliers.CorporationValuation = 0.5; BitNodeMultipliers.CorporationValuation = 0.5;
break; break;
case 6: //Bladeburner case 6: //Bladeburner
BitNodeMultipliers.HackingLevelMultiplier = 0.5; BitNodeMultipliers.HackingLevelMultiplier = 0.4;
BitNodeMultipliers.ServerMaxMoney = 0.5; BitNodeMultipliers.ServerMaxMoney = 0.5;
BitNodeMultipliers.ServerStartingMoney = 0.5; BitNodeMultipliers.ServerStartingMoney = 0.5;
BitNodeMultipliers.ServerStartingSecurity = 1.5; BitNodeMultipliers.ServerStartingSecurity = 1.5;
@ -282,7 +282,7 @@ function initBitNodeMultipliers() {
BitNodeMultipliers.BladeburnerRank = 0.6; BitNodeMultipliers.BladeburnerRank = 0.6;
BitNodeMultipliers.BladeburnerSkillCost = 2; BitNodeMultipliers.BladeburnerSkillCost = 2;
BitNodeMultipliers.AugmentationMoneyCost = 3; BitNodeMultipliers.AugmentationMoneyCost = 3;
BitNodeMultipliers.HackingLevelMultiplier = 0.5; BitNodeMultipliers.HackingLevelMultiplier = 0.4;
BitNodeMultipliers.ServerMaxMoney = 0.5; BitNodeMultipliers.ServerMaxMoney = 0.5;
BitNodeMultipliers.ServerStartingMoney = 0.5; BitNodeMultipliers.ServerStartingMoney = 0.5;
BitNodeMultipliers.ServerStartingSecurity = 1.5; BitNodeMultipliers.ServerStartingSecurity = 1.5;

@ -74,7 +74,6 @@ var ContractBaseMoneyGain = 50e3; //Base Money Gained per contract
var ActiveActionCssClass = "bladeburner-active-action"; var ActiveActionCssClass = "bladeburner-active-action";
//Console related stuff //Console related stuff
var consoleHistory = []; //Console command history
var consoleHistoryIndex = 0; var consoleHistoryIndex = 0;
var consoleHelpText = { var consoleHelpText = {
helpList:"Use 'help [command]' to get more information about a particular Bladeburner console command.<br><br>" + helpList:"Use 'help [command]' to get more information about a particular Bladeburner console command.<br><br>" +
@ -153,6 +152,7 @@ $(document).keydown(function(event) {
//} //}
if (!(Player.bladeburner instanceof Bladeburner)) {return;} if (!(Player.bladeburner instanceof Bladeburner)) {return;}
let consoleHistory = Player.bladeburner.consoleHistory;
//NOTE: Keycodes imported from Terminal.js //NOTE: Keycodes imported from Terminal.js
if (event.keyCode === KEY.ENTER) { if (event.keyCode === KEY.ENTER) {
@ -712,6 +712,9 @@ function Bladeburner(params={}) {
this.automateActionLow = 0; this.automateActionLow = 0;
this.automateThreshLow = 0; //Stamina Threshold this.automateThreshLow = 0; //Stamina Threshold
//Console command history
this.consoleHistory = [];
//Initialization //Initialization
initBladeburner(); initBladeburner();
this.initializeDomElementRefs(); this.initializeDomElementRefs();
@ -1740,6 +1743,9 @@ Bladeburner.prototype.createContent = function() {
this.postToConsole("Bladeburner Console BETA"); this.postToConsole("Bladeburner Console BETA");
this.postToConsole("Type 'help' to see console commands"); this.postToConsole("Type 'help' to see console commands");
for (let i = 0; i < this.consoleHistory.length; ++i) {
this.postToConsole(this.consoleHistory[i]);
}
DomElems.consoleInput.focus(); DomElems.consoleInput.focus();
} }
@ -2764,13 +2770,13 @@ Bladeburner.prototype.log = function(input) {
Bladeburner.prototype.executeConsoleCommands = function(commands) { Bladeburner.prototype.executeConsoleCommands = function(commands) {
try { try {
//Console History //Console History
if (consoleHistory[consoleHistory.length-1] != commands) { if (this.consoleHistory[this.consoleHistory.length-1] != commands) {
consoleHistory.push(commands); this.consoleHistory.push(commands);
if (consoleHistory.length > 50) { if (this.consoleHistory.length > 50) {
consoleHistory.splice(0, 1); this.consoleHistory.splice(0, 1);
} }
} }
consoleHistoryIndex = consoleHistory.length; consoleHistoryIndex = this.consoleHistory.length;
var arrayOfCommands = commands.split(";"); var arrayOfCommands = commands.split(";");
for (var i = 0; i < arrayOfCommands.length; ++i) { for (var i = 0; i < arrayOfCommands.length; ++i) {

@ -503,15 +503,24 @@ let CONSTANTS = {
LatestUpdate: LatestUpdate:
` `
v0.41.1 v0.41.1
* Stock Market changes: * IMPORTANT - Netscript Changes:
*** Stocks now have "maximum prices" ** purchaseTor() now returns true if you already have a TOR router (it used to return false)
*** If a stock reaches its "maximum price", it will most likely drop in value (although it might still rise) ** Added purchase4SMarketData() and purchase4SMarketDataTixApi() functions
*** Each stock has its own, unique maximum price
*** Maximum price for each stock are randomly generated and change during each 'reset'
*** Stock Market cycles are now accumulated/stored, much like it is for Gangs and Bladeburners
*** Accumulated/stored cycles cause stock prices to update up to 50% faster (from every 6 seconds to 4 seconds)
****** This means that after coming back from being offline, stock prices will update faster to make up for offline time
* Stock Market changes:
** Stocks now have "maximum prices"
** If a stock reaches its "maximum price", it will most likely drop in value (although it might still rise)
** Each stock has its own, unique maximum price
** Maximum price for each stock are randomly generated and change during each 'reset'
** Stock Market cycles are now accumulated/stored, much like it is for Gangs and Bladeburners
** Accumulated/stored cycles cause stock prices to update up to 50% faster (from every 6 seconds to 4 seconds)
*** This means that after coming back from being offline, stock prices will update faster to make up for offline time
* Decreased the Hacking Level multiplier for BitNodes 6 and 7 to 0.4 (from 0.5)
* Bladeburner console history is now saved and persists when switching screens or closing/reopening the game
* b1t_flum3.exe is no longer removed from your home computer upon reset
* Added main menu link for the Stock Market
* Job main menu link only appears if you actually have a job
` `
} }

@ -394,7 +394,6 @@ function displayFactionContent(factionName) {
var hacking = false; var hacking = false;
if (factionName === "NiteSec" || factionName === "The Black Hand") {hacking = true;} if (factionName === "NiteSec" || factionName === "The Black Hand") {hacking = true;}
Player.startGang(factionName, hacking); Player.startGang(factionName, hacking);
document.getElementById("gang-tab").style.display = "list-item";
document.getElementById("world-menu-header").click(); document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click(); document.getElementById("world-menu-header").click();
Engine.loadGangContent(); Engine.loadGangContent();

@ -1953,7 +1953,6 @@ function initLocationButtons() {
name:companyName, name:companyName,
}); });
displayLocationContent(); displayLocationContent();
document.getElementById("corporation-tab").style.display = "list-item";
document.getElementById("world-menu-header").click(); document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click(); document.getElementById("world-menu-header").click();
dialogBoxCreate("Congratulations! You just started your own corporation. You can visit " + dialogBoxCreate("Congratulations! You just started your own corporation. You can visit " +
@ -1983,7 +1982,6 @@ function initLocationButtons() {
Player.bladeburner = new Bladeburner({new:true}); Player.bladeburner = new Bladeburner({new:true});
dialogBoxCreate("You have been accepted into the Bladeburner division!"); dialogBoxCreate("You have been accepted into the Bladeburner division!");
displayLocationContent(); displayLocationContent();
document.getElementById("bladeburner-tab").style.display = "list-item";
document.getElementById("world-menu-header").click(); document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click(); document.getElementById("world-menu-header").click();
} else { } else {

@ -106,11 +106,14 @@ var possibleLogs = {
getServerGrowth: true, getServerGrowth: true,
getServerNumPortsRequired: true, getServerNumPortsRequired: true,
getServerRam: true, getServerRam: true,
// TIX API // TIX API
buyStock: true, buyStock: true,
sellStock: true, sellStock: true,
shortStock: true, shortStock: true,
sellShort: true, sellShort: true,
purchase4SMarketData: true,
purchase4SMarketDataTixApi: true,
// Singularity Functions // Singularity Functions
purchaseServer: true, purchaseServer: true,
@ -545,8 +548,14 @@ function NetscriptFunctions(workerScript) {
} }
return workerScript.disableLogs[fn] ? false : true; return workerScript.disableLogs[fn] ? false : true;
}, },
getScriptLogs : function() { getScriptLogs : function(fn, ip) {
if (workerScript.checkingRam) {return 0;} if (workerScript.checkingRam) {return 0;}
if (fn != null && typeof fn === 'string') {
// Get Logs of another script
if (ip == null) { ip = workerScript.serverIp; }
}
return workerScript.scriptRef.logs.slice(); return workerScript.scriptRef.logs.slice();
}, },
nuke : function(ip){ nuke : function(ip){
@ -1696,6 +1705,68 @@ function NetscriptFunctions(workerScript) {
stock.b ? forecast += stock.otlkMag : forecast -= stock.otlkMag; stock.b ? forecast += stock.otlkMag : forecast -= stock.otlkMag;
return forecast / 100; //Convert from percentage to decimal return forecast / 100; //Convert from percentage to decimal
}, },
purchase4SMarketData : function() {
if (workerScript.checkingRam) {
return updateStaticRam("purchase4SMarketData", CONSTANTS.ScriptBuySellStockRamCost);
}
updateDynamicRam("purchase4SMarketData", CONSTANTS.ScriptBuySellStockRamCost);
if (!Player.hasTixApiAccess) {
throw makeRuntimeRejectMsg(workerScript, "You don't have TIX API Access! Cannot use purchase4SMarketData()");
}
if (Player.Player.has4SData) {
if (workerScript.shouldLog("purchase4SMarketData")) {
workerScript.log("Already purchased 4S Market Data");
}
return true;
}
if (Player.money.lt(CONSTANTS.MarketData4SCost)) {
if (workerScript.shouldLog("purchase4SMarketData")) {
workerScript.log("Failed to purchase 4S Market Data - Not enough money");
}
return false;
}
Player.has4SData = true;
Player.loseMoney(CONSTANTS.MarketData4SCost);
if (workerScript.shouldLog("purchase4SMarketData")) {
workerScript.log("Purchased 4S Market Data");
}
return true;
},
purchase4SMarketDataTixApi : function() {
if (workerScript.checkingRam) {
return updateStaticRam("purchase4SMarketDataTixApi", CONSTANTS.ScriptBuySellStockRamCost);
}
updateDynamicRam("purchase4SMarketDataTixApi", CONSTANTS.ScriptBuySellStockRamCost);
if (!Player.hasTixApiAccess) {
throw makeRuntimeRejectMsg(workerScript, "You don't have TIX API Access! Cannot use purchase4SMarketDataTixApi()");
}
if (Player.has4SDataTixApi) {
if (workerScript.shouldLog("purchase4SMarketDataTixApi")) {
workerScript.log("Already purchased 4S Market Data TIX API");
}
return true;
}
if (Player.money.lt(CONSTANTS.MarketDataTixApi4SCost)) {
if (workerScript.shouldLog("purchase4SMarketDataTixApi")) {
workerScript.log("Failed to purchase 4S Market Data TIX API - Not enough money");
}
return false;
}
Player.has4SDataTixApi = true;
Player.loseMoney(CONSTANTS.MarketDataTixApi4SCost);
if (workerScript.shouldLog("purchase4SMarketDataTixApi")) {
workerScript.log("Purchased 4S Market Data TIX API");
}
return true;
},
getPurchasedServerLimit : function() { getPurchasedServerLimit : function() {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit); return updateStaticRam("getPurchasedServerLimit", CONSTANTS.ScriptGetPurchasedServerLimit);

@ -191,7 +191,6 @@ function PlayerObject() {
//Flags for determining whether certain "thresholds" have been achieved //Flags for determining whether certain "thresholds" have been achieved
this.firstFacInvRecvd = false; this.firstFacInvRecvd = false;
this.firstAugPurchased = false; this.firstAugPurchased = false;
this.firstJobRecvd = false;
this.firstTimeTraveled = false; this.firstTimeTraveled = false;
this.firstProgramAvailable = false; this.firstProgramAvailable = false;
@ -1687,12 +1686,8 @@ PlayerObject.prototype.applyForJob = function(entryPosType, sing=false) {
this.companyName = company.companyName; this.companyName = company.companyName;
this.companyPosition = pos; this.companyPosition = pos;
if (this.firstJobRecvd === false) { document.getElementById("world-menu-header").click();
this.firstJobRecvd = true; document.getElementById("world-menu-header").click();
document.getElementById("job-tab").style.display = "list-item";
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
}
if (leaveCompany) { if (leaveCompany) {
if (sing) {return true;} if (sing) {return true;}
@ -1797,14 +1792,10 @@ PlayerObject.prototype.applyForAgentJob = function(sing=false) {
PlayerObject.prototype.applyForEmployeeJob = function(sing=false) { PlayerObject.prototype.applyForEmployeeJob = function(sing=false) {
var company = Companies[this.location]; //Company being applied to var company = Companies[this.location]; //Company being applied to
if (this.isQualified(company, CompanyPositions.Employee)) { if (this.isQualified(company, CompanyPositions.Employee)) {
if (this.firstJobRecvd === false) {
this.firstJobRecvd = true;
document.getElementById("job-tab").style.display = "list-item";
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
}
this.companyName = company.companyName; this.companyName = company.companyName;
this.companyPosition = CompanyPositions.Employee; this.companyPosition = CompanyPositions.Employee;
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
if (sing) {return true;} if (sing) {return true;}
dialogBoxCreate("Congratulations, you are now employed at " + this.companyName); dialogBoxCreate("Congratulations, you are now employed at " + this.companyName);
Engine.loadLocationContent(); Engine.loadLocationContent();
@ -1817,14 +1808,10 @@ PlayerObject.prototype.applyForEmployeeJob = function(sing=false) {
PlayerObject.prototype.applyForPartTimeEmployeeJob = function(sing=false) { PlayerObject.prototype.applyForPartTimeEmployeeJob = function(sing=false) {
var company = Companies[this.location]; //Company being applied to var company = Companies[this.location]; //Company being applied to
if (this.isQualified(company, CompanyPositions.PartTimeEmployee)) { if (this.isQualified(company, CompanyPositions.PartTimeEmployee)) {
if (this.firstJobRecvd === false) {
this.firstJobRecvd = true;
document.getElementById("job-tab").style.display = "list-item";
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
}
this.companyName = company.companyName; this.companyName = company.companyName;
this.companyPosition = CompanyPositions.PartTimeEmployee; this.companyPosition = CompanyPositions.PartTimeEmployee;
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
if (sing) {return true;} if (sing) {return true;}
dialogBoxCreate("Congratulations, you are now employed part-time at " + this.companyName); dialogBoxCreate("Congratulations, you are now employed part-time at " + this.companyName);
Engine.loadLocationContent(); Engine.loadLocationContent();
@ -1837,14 +1824,10 @@ PlayerObject.prototype.applyForPartTimeEmployeeJob = function(sing=false) {
PlayerObject.prototype.applyForWaiterJob = function(sing=false) { PlayerObject.prototype.applyForWaiterJob = function(sing=false) {
var company = Companies[this.location]; //Company being applied to var company = Companies[this.location]; //Company being applied to
if (this.isQualified(company, CompanyPositions.Waiter)) { if (this.isQualified(company, CompanyPositions.Waiter)) {
if (this.firstJobRecvd === false) {
this.firstJobRecvd = true;
document.getElementById("job-tab").style.display = "list-item";
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
}
this.companyName = company.companyName; this.companyName = company.companyName;
this.companyPosition = CompanyPositions.Waiter; this.companyPosition = CompanyPositions.Waiter;
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
if (sing) {return true;} if (sing) {return true;}
dialogBoxCreate("Congratulations, you are now employed as a waiter at " + this.companyName); dialogBoxCreate("Congratulations, you are now employed as a waiter at " + this.companyName);
Engine.loadLocationContent(); Engine.loadLocationContent();
@ -1857,14 +1840,10 @@ PlayerObject.prototype.applyForWaiterJob = function(sing=false) {
PlayerObject.prototype.applyForPartTimeWaiterJob = function(sing=false) { PlayerObject.prototype.applyForPartTimeWaiterJob = function(sing=false) {
var company = Companies[this.location]; //Company being applied to var company = Companies[this.location]; //Company being applied to
if (this.isQualified(company, CompanyPositions.PartTimeWaiter)) { if (this.isQualified(company, CompanyPositions.PartTimeWaiter)) {
if (this.firstJobRecvd === false) {
this.firstJobRecvd = true;
document.getElementById("job-tab").style.display = "list-item";
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
}
this.companyName = company.companyName; this.companyName = company.companyName;
this.companyPosition = CompanyPositions.PartTimeWaiter; this.companyPosition = CompanyPositions.PartTimeWaiter;
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
if (sing) {return true;} if (sing) {return true;}
dialogBoxCreate("Congratulations, you are now employed as a part-time waiter at " + this.companyName); dialogBoxCreate("Congratulations, you are now employed as a part-time waiter at " + this.companyName);
Engine.loadLocationContent(); Engine.loadLocationContent();

@ -148,6 +148,10 @@ function prestigeAugmentation() {
Terminal.resetTerminalInput(); Terminal.resetTerminalInput();
Engine.loadTerminalContent(); Engine.loadTerminalContent();
// Refresh Main Menu (the 'World' menu, specifically)
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
//Red Pill //Red Pill
if (augmentationExists(AugmentationNames.TheRedPill) && if (augmentationExists(AugmentationNames.TheRedPill) &&
Augmentations[AugmentationNames.TheRedPill].owned) { Augmentations[AugmentationNames.TheRedPill].owned) {
@ -319,6 +323,10 @@ function prestigeSourceFile() {
Player.corporation = null; Player.corporation = null;
Player.bladeburner = null; Player.bladeburner = null;
// Refresh Main Menu (the 'World' menu, specifically)
document.getElementById("world-menu-header").click();
document.getElementById("world-menu-header").click();
//Gain int exp //Gain int exp
Player.gainIntelligenceExp(5); Player.gainIntelligenceExp(5);
} }

@ -198,16 +198,12 @@ function loadGame(saveString) {
//that everything should be available //that everything should be available
Player.firstFacInvRecvd = true; Player.firstFacInvRecvd = true;
Player.firstAugPurchased = true; Player.firstAugPurchased = true;
Player.firstJobRecvd = true;
Player.firstTimeTraveled = true; Player.firstTimeTraveled = true;
Player.firstProgramAvailable = true; Player.firstProgramAvailable = true;
} else { } else {
if (Player.factions.length > 0 || Player.factionInvitations.length > 0) { if (Player.factions.length > 0 || Player.factionInvitations.length > 0) {
Player.firstFacInvRecvd = true; Player.firstFacInvRecvd = true;
} }
if (Player.companyName !== "" || Player.companyPosition !== "") {
Player.firstJobRecvd = true;
}
if (Player.hacking_skill >= 25) { if (Player.hacking_skill >= 25) {
Player.firstScriptAvailable = true; Player.firstScriptAvailable = true;
} }
@ -417,16 +413,12 @@ function loadImportedGame(saveObj, saveString) {
//that everything should be available //that everything should be available
Player.firstFacInvRecvd = true; Player.firstFacInvRecvd = true;
Player.firstAugPurchased = true; Player.firstAugPurchased = true;
Player.firstJobRecvd = true;
Player.firstTimeTraveled = true; Player.firstTimeTraveled = true;
Player.firstProgramAvailable = true; Player.firstProgramAvailable = true;
} else { } else {
if (Player.factions.length > 0 || Player.factionInvitations.length > 0) { if (Player.factions.length > 0 || Player.factionInvitations.length > 0) {
Player.firstFacInvRecvd = true; Player.firstFacInvRecvd = true;
} }
if (Player.companyName !== "" || Player.companyPosition !== "") {
Player.firstJobRecvd = true;
}
if (Player.hacking_skill >= 25) { if (Player.hacking_skill >= 25) {
Player.firstScriptAvailable = true; Player.firstScriptAvailable = true;
} }

@ -344,12 +344,15 @@ function processSingleServerGrowth(server, numCycles) {
} }
function prestigeHomeComputer(homeComp) { function prestigeHomeComputer(homeComp) {
const hasBitflume = homeComp.programs.includes(Programs.BitFlume.name);
homeComp.programs.length = 0; //Remove programs homeComp.programs.length = 0; //Remove programs
homeComp.runningScripts = []; homeComp.runningScripts = [];
homeComp.serversOnNetwork = []; homeComp.serversOnNetwork = [];
homeComp.isConnectedTo = true; homeComp.isConnectedTo = true;
homeComp.ramUsed = 0; homeComp.ramUsed = 0;
homeComp.programs.push(Programs.NukeProgram.name); homeComp.programs.push(Programs.NukeProgram.name);
if (hasBitflume) { homeComp.programs.push(Programs.BitFlume.name); }
//Update RAM usage on all scripts //Update RAM usage on all scripts
homeComp.scripts.forEach(function(script) { homeComp.scripts.forEach(function(script) {

@ -743,6 +743,7 @@ function displayStockMarketContent() {
"Buy 4S Market Data Access - " + numeralWrapper.format(CONSTANTS.MarketData4SCost, '($0.000a)'), "Buy 4S Market Data Access - " + numeralWrapper.format(CONSTANTS.MarketData4SCost, '($0.000a)'),
"4S Market Data - Purchased"); "4S Market Data - Purchased");
marketDataButton.addEventListener("click", function() { marketDataButton.addEventListener("click", function() {
if (Player.money.lt(CONSTANTS.MarketData4SCost)) { return false; }
Player.has4SData = true; Player.has4SData = true;
Player.loseMoney(CONSTANTS.MarketData4SCost); Player.loseMoney(CONSTANTS.MarketData4SCost);
displayStockMarketContent(); displayStockMarketContent();
@ -782,6 +783,7 @@ function displayStockMarketContent() {
"4S Market Data TIX API - Purchased"); "4S Market Data TIX API - Purchased");
if (Player.hasTixApiAccess) { if (Player.hasTixApiAccess) {
marketDataTixButton.addEventListener("click", function() { marketDataTixButton.addEventListener("click", function() {
if (Player.money.lt(CONSTANTS.MarketDataTixApi4SCost)) { return false; }
Player.has4SDataTixApi = true; Player.has4SDataTixApi = true;
Player.loseMoney(CONSTANTS.MarketDataTixApi4SCost); Player.loseMoney(CONSTANTS.MarketDataTixApi4SCost);
displayStockMarketContent(); displayStockMarketContent();

@ -105,7 +105,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
" 2 + 2\n", " 2 + 2\n",
" 2 + 1 + 1\n", " 2 + 1 + 1\n",
" 1 + 1 + 1 + 1\n\n", " 1 + 1 + 1 + 1\n\n",
`How many different ways can ${n} be written as a sum of at least`, `How many different ways can the number ${n} be written as a sum of at least`,
"two positive integers?"].join(" "); "two positive integers?"].join(" ");
}, },
difficulty: 1.5, difficulty: 1.5,
@ -387,8 +387,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
{ {
desc: (data: number[]) => { desc: (data: number[]) => {
return ["You are given the following array of stock prices where the i-th element", return ["You are given the following array of stock prices (which are numbers)",
"represents the stock price on day i:\n\n", "where the i-th element represents the stock price on day i:\n\n",
`${data}\n\n`, `${data}\n\n`,
"Determine the maximum possible profit you can earn using at most", "Determine the maximum possible profit you can earn using at most",
"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made", "one transaction (i.e. you can only buy and sell the stock once). If no profit can be made",
@ -421,8 +421,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
{ {
desc: (data: number[]) => { desc: (data: number[]) => {
return ["You are given the following array of stock prices where the i-th element", return ["You are given the following array of stock prices (which are numbers)",
"represents the stock price on day i:\n\n", "where the i-th element represents the stock price on day i:\n\n",
`${data}\n\n`, `${data}\n\n`,
"Determine the maximum possible profit you can earn using as many", "Determine the maximum possible profit you can earn using as many",
"transactions as you'd like. A transaction is defined as buying", "transactions as you'd like. A transaction is defined as buying",
@ -455,8 +455,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
}, },
{ {
desc: (data: number[]) => { desc: (data: number[]) => {
return ["You are given the following array of stock prices where the i-th element", return ["You are given the following array of stock prices (which are numbers)",
"represents the stock price on day i:\n\n", "where the i-th element represents the stock price on day i:\n\n",
`${data}\n\n`, `${data}\n\n`,
"Determine the maximum possible profit you can earn using at most", "Determine the maximum possible profit you can earn using at most",
"two transactions. A transaction is defined as buying", "two transactions. A transaction is defined as buying",

@ -78,6 +78,7 @@ import 'normalize.css';
import "../css/styles.scss"; import "../css/styles.scss";
import "../css/buttons.scss"; import "../css/buttons.scss";
import "../css/mainmenu.scss"; import "../css/mainmenu.scss";
import "../css/characteroverview.scss";
import "../css/terminal.scss"; import "../css/terminal.scss";
import "../css/menupages.scss"; import "../css/menupages.scss";
import "../css/workinprogress.scss"; import "../css/workinprogress.scss";
@ -172,6 +173,7 @@ const Engine = {
worldMainMenuButton: null, worldMainMenuButton: null,
travelMainMenuButton: null, travelMainMenuButton: null,
jobMainMenuButton: null, jobMainMenuButton: null,
stockmarketMainMenuButton: null,
createProgramMainMenuButton: null, createProgramMainMenuButton: null,
factionsMainMenuButton: null, factionsMainMenuButton: null,
augmentationsMainMenuButton: null, augmentationsMainMenuButton: null,
@ -1186,6 +1188,7 @@ const Engine = {
var city = document.getElementById("city-tab"); var city = document.getElementById("city-tab");
var travel = document.getElementById("travel-tab"); var travel = document.getElementById("travel-tab");
var job = document.getElementById("job-tab"); var job = document.getElementById("job-tab");
var stockmarket = document.getElementById("stock-market-tab");
var bladeburner = document.getElementById("bladeburner-tab"); var bladeburner = document.getElementById("bladeburner-tab");
var corp = document.getElementById("corporation-tab"); var corp = document.getElementById("corporation-tab");
var gang = document.getElementById("gang-tab"); var gang = document.getElementById("gang-tab");
@ -1275,12 +1278,14 @@ const Engine = {
else {factions.style.display = "none";} else {factions.style.display = "none";}
if (Player.firstAugPurchased) {visibleMenuTabs.push(augmentations);} if (Player.firstAugPurchased) {visibleMenuTabs.push(augmentations);}
else {augmentations.style.display = "none";} else {augmentations.style.display = "none";}
if (Player.firstJobRecvd) {visibleMenuTabs.push(job);} if (Player.companyPosition !== "") {visibleMenuTabs.push(job);}
else {job.style.display = "none";} else {job.style.display = "none";}
if (Player.firstTimeTraveled) {visibleMenuTabs.push(travel);} if (Player.firstTimeTraveled) {visibleMenuTabs.push(travel);}
else {travel.style.display = "none";} else {travel.style.display = "none";}
if (Player.firstProgramAvailable) {visibleMenuTabs.push(createProgram);} if (Player.firstProgramAvailable) {visibleMenuTabs.push(createProgram);}
else {createProgram.style.display = "none";} else {createProgram.style.display = "none";}
if (Player.hasWseAccount) {visibleMenuTabs.push(stockmarket);}
else {stockmarket.style.display = "none";}
if(Player.bladeburner instanceof Bladeburner) {visibleMenuTabs.push(bladeburner);} if(Player.bladeburner instanceof Bladeburner) {visibleMenuTabs.push(bladeburner);}
else {bladeburner.style.display = "none";} else {bladeburner.style.display = "none";}
if(Player.corporation instanceof Corporation) {visibleMenuTabs.push(corp);} if(Player.corporation instanceof Corporation) {visibleMenuTabs.push(corp);}
@ -1324,6 +1329,7 @@ const Engine = {
factions.style.display = "none"; factions.style.display = "none";
augmentations.style.display = "none"; augmentations.style.display = "none";
job.style.display = "none"; job.style.display = "none";
stockmarket.style.display = "none";
travel.style.display = "none"; travel.style.display = "none";
createProgram.style.display = "none"; createProgram.style.display = "none";
bladeburner.style.display = "none"; bladeburner.style.display = "none";
@ -1540,28 +1546,38 @@ const Engine = {
} }
worldHdr.onclick = function() { worldHdr.onclick = function() {
var city = document.getElementById("city-tab"); var city = document.getElementById("city-tab");
var cityLink = document.getElementById("city-menu-link"); var cityLink = document.getElementById("city-menu-link");
var travel = document.getElementById("travel-tab"); var travel = document.getElementById("travel-tab");
var travelLink = document.getElementById("travel-menu-link"); var travelLink = document.getElementById("travel-menu-link");
var job = document.getElementById("job-tab"); var job = document.getElementById("job-tab");
var jobLink = document.getElementById("job-menu-link"); var jobLink = document.getElementById("job-menu-link");
var bladeburner = document.getElementById("bladeburner-tab"); var stockmarket = document.getElementById("stock-market-tab");
var bladeburnerLink = document.getElementById("bladeburner-menu-link"); var stockmarketLink = document.getElementById("stock-market-menu-link");
var corporation = document.getElementById("corporation-tab"); var bladeburner = document.getElementById("bladeburner-tab");
var corporationLink = document.getElementById("corporation-menu-link"); var bladeburnerLink = document.getElementById("bladeburner-menu-link");
var gang = document.getElementById("gang-tab"); var corporation = document.getElementById("corporation-tab");
var gangLink = document.getElementById("gang-menu-link"); var corporationLink = document.getElementById("corporation-menu-link");
var gang = document.getElementById("gang-tab");
var gangLink = document.getElementById("gang-menu-link");
// Determine whether certain links should show up
job.style.display = Player.companyPosition !== "" ? "list-item" : "none";
stockmarket.style.display = Player.hasWseAccount ? "list-item" : "none";
bladeburner.style.display = Player.bladeburner instanceof Bladeburner ? "list-item" : "none";
corporation.style.display = Player.corporation instanceof Corporation ? "list-item" : "none";
gang.style.display = Player.inGang() ? "list-item" : "none";
this.classList.toggle("opened"); this.classList.toggle("opened");
if (city.style.maxHeight) { if (city.style.maxHeight) {
Engine.toggleMainMenuHeader(false, Engine.toggleMainMenuHeader(false,
[city, travel, job, bladeburner, corporation, gang], [city, travel, job, stockmarket, bladeburner, corporation, gang],
[cityLink, travelLink, jobLink, bladeburnerLink, corporationLink, gangLink] [cityLink, travelLink, jobLink, stockmarketLink, bladeburnerLink, corporationLink, gangLink]
); );
} else { } else {
Engine.toggleMainMenuHeader(true, Engine.toggleMainMenuHeader(true,
[city, travel, job, bladeburner, corporation, gang], [city, travel, job, stockmarket, bladeburner, corporation, gang],
[cityLink, travelLink, jobLink, bladeburnerLink, corporationLink, gangLink] [cityLink, travelLink, jobLink, stockmarketLink, bladeburnerLink, corporationLink, gangLink]
); );
} }
} }
@ -1634,6 +1650,12 @@ const Engine = {
return false; return false;
}); });
Engine.Clickables.stockmarketMainMenuButton = clearEventListeners("stock-market-menu-link");
Engine.Clickables.stockmarketMainMenuButton.addEventListener("click", function() {
Engine.loadStockMarketContent();
return false;
});
Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link"); Engine.Clickables.createProgramMainMenuButton = clearEventListeners("create-program-menu-link");
Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() { Engine.Clickables.createProgramMainMenuButton.addEventListener("click", function() {

@ -81,6 +81,9 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %>
<li id="job-tab" class="mainmenu-accordion-panel"> <li id="job-tab" class="mainmenu-accordion-panel">
<button id="job-menu-link"> Job </button> <button id="job-menu-link"> Job </button>
</li> </li>
<li id="stock-market-tab" class="mainmenu-accordion-panel">
<button id="stock-market-menu-link"> Stock Market </button>
</li>
<li id="bladeburner-tab" class="mainmenu-accordion-panel"> <li id="bladeburner-tab" class="mainmenu-accordion-panel">
<button id="bladeburner-menu-link"> Bladeburner </button> <button id="bladeburner-menu-link"> Bladeburner </button>
</li> </li>
@ -789,8 +792,8 @@ if (htmlWebpackPlugin.options.googleAnalytics.trackingId) { %>
</table> </table>
</div> </div>
<div class="character-quick-options"> <div class="character-quick-options">
<button id="character-overview-save-button">Save Game</button> <button id="character-overview-save-button" class="character-overview-btn">Save Game</button>
<button id="character-overview-options-button">Options</button> <button id="character-overview-options-button" class="character-overview-btn">Options</button>
</div> </div>
</div> </div>
</div> </div>