Changed confirm to prompt, updated version, more stock market balancing

This commit is contained in:
danielyxie 2017-11-02 22:11:14 -05:00
parent bc6f0da677
commit 03fdaeaba4
6 changed files with 80 additions and 40 deletions

22
dist/bundle.js vendored

@ -282,6 +282,7 @@ function PlayerObject() {
this.scriptProdSinceLastAug = 0;
this.stockProdSinceLastAug = 0;
this.crimeProdSinceLastAug = 0;
this.jobProdSinceLastAug = 0;
};
PlayerObject.prototype.init = function() {
@ -2581,7 +2582,7 @@ function powerOfTwo(n) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CONSTANTS; });
let CONSTANTS = {
Version: "0.32.0",
Version: "0.32.1",
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@ -3289,6 +3290,11 @@ let CONSTANTS = {
"Returns the amount of time in milliseconds that have passed since you last installed Augmentations (or destroyed a BitNode).<br><br>" +
"<i><u>sprintf()/vsprintf()</u></i><br>" +
"<a href='https://github.com/alexei/sprintf.js' target='_blank'>See this link for details</a><br><br>" +
"<i><u>prompt(message)</u></i><br>" +
"Prompts the player with a dialog box with two options: 'Yes' and 'No'. This function will returns true if " +
"the player clicks 'Yes' and false if the player click's 'No'. The script's execution is halted until the " +
"player selects 'Yes' or 'No'. The function takes a single string as an argument which specifies the text " +
"that appears on the dialog box.<br><br>" +
"<u><h1>Hacknet Nodes API</h1></u><br>" +
"Netscript provides the following API for accessing and upgrading your Hacknet Nodes through scripts. This API does NOT work offline.<br><br>" +
"<i><u>hacknetnodes</u></i><br>A special variable. This is an array that maps to the Player's Hacknet Nodes. The Hacknet Nodes are accessed through " +
@ -3693,10 +3699,10 @@ let CONSTANTS = {
"-Updated Netscript's 'interpreter/engine' to use the Bluebird promise library instead of native promises. " +
"It should now be faster and more memory-efficient. If this has broken any Netscript features please report it through Github or the subreddit (reddit.com/r/bitburner)<br>" +
"-Rebalanced stock market (adjusted parameters such as the volatility/trends/starting price of certain stocks)<br>" +
"-Added confirm() Netscript function<br>" +
"-Added prompt() Netscript function<br>" +
"-Added 'Buy Max' and 'Sell All' functions to Stock Market UI<br>" +
"-Added 'Portfolio' Mode to Stock Market UI so you can only view stocks you have a position/order in<br>" +
"-Added a button to kill a script from its log display box<br>" +
"-Added a button to kill a script from its log display box<br><br>" +
"v0.32.0<br>" +
"-Released BitNode-8: Ghost of Wall Street<br>" +
"-Re-designed Stock Market UI<br>" +
@ -22921,7 +22927,7 @@ function NetscriptFunctions(workerScript) {
getTimeSinceLastAug : function() {
return __WEBPACK_IMPORTED_MODULE_14__Player_js__["a" /* Player */].playtimeSinceLastAug;
},
confirm : function(txt) {
prompt : function(txt) {
if (__WEBPACK_IMPORTED_MODULE_30__utils_YesNoBox_js__["e" /* yesNoBoxOpen */]) {
workerScript.scriptRef.log("ERROR: confirm() failed because a pop-up dialog box is already open");
return false;
@ -36736,11 +36742,11 @@ function initStockMarket() {
}
var ecorp = __WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].AevumECorp;
var ecorpStk = new Stock(ecorp, StockSymbols[ecorp], 0.5, true, 16, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(20000, 25000));
var ecorpStk = new Stock(ecorp, StockSymbols[ecorp], 0.45, true, 19, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(20000, 25000));
StockMarket[ecorp] = ecorpStk;
var megacorp = __WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12MegaCorp;
var megacorpStk = new Stock(megacorp, StockSymbols[megacorp], 0.5, true, 16, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(25000, 33000));
var megacorpStk = new Stock(megacorp, StockSymbols[megacorp], 0.45, true, 19, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(25000, 33000));
StockMarket[megacorp] = megacorpStk;
var blade = __WEBPACK_IMPORTED_MODULE_2__Location_js__["a" /* Locations */].Sector12BladeIndustries;
@ -36852,11 +36858,11 @@ function initStockMarket() {
StockMarket[sigmacosm] = sigmacosmStk;
var joesguns = "Joes Guns";
var joesgunsStk = new Stock(joesguns, StockSymbols[joesguns], 3.7, true, 1, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(500, 1000));
var joesgunsStk = new Stock(joesguns, StockSymbols[joesguns], 3.8, true, 1, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(500, 1000));
StockMarket[joesguns] = joesgunsStk;
var catalyst = "Catalyst Ventures";
var catalystStk = new Stock(catalyst, StockSymbols[catalyst], 1.5, true, 13, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(500, 1000));
var catalystStk = new Stock(catalyst, StockSymbols[catalyst], 1.5, true, 14, Object(__WEBPACK_IMPORTED_MODULE_7__utils_HelperFunctions_js__["d" /* getRandomInt */])(500, 1000));
StockMarket[catalyst] = catalystStk;
var microdyne = "Microdyne Technologies";

@ -209,9 +209,28 @@ Industries:
*/
var TOTALSHARES = 1000000000; //Total number of shares you have at your company
function Material(params={}) {
this.name = params.name ? params.name : "";
this.qty = 0; //Quantity
this.qlt = 0; //Quality
this.dmd = 0; //Demand
this.cmp = 0; //Competition
this.mku = 0; //Markup
//How much space it takes in a Warehouse
this.siz = params.size ? params.size : 0;
this.purc = 0; //How much of this material is being purchased per second
this.cost = 0; //$ Cost per material
//Material requirements. An object that maps the name of a material to how much it requires
//to make 1 unit of the product.
this.req = params.req ? params.req : {};
}
var Materials = {
Water: 11,
Energy: 12,
Water: new Material({name: "Water", size: 0.1}),
Energy: new Material
Food: 13,
Plants: 14,
Metal: 15,
@ -224,23 +243,6 @@ var Materials = {
SciResearch: 22
}
function Material(params={}) {
this.name = params.name ? params.name : "";
this.qty = 0;
this.qlt = 0;
this.dmd = 0;
this.cmp = 0;
this.mku = 0;
//How much space it takes in a Warehouse
this.siz = params.size ? params.size : 0;
this.purc = 0; //How much of this material is being purchased per second
this.cost = 0; //$ Cost per material
this.req = params.req ? params.req : [];
}
function Product(params={}) {
"use strict"
this.name = params.name ? params.name : 0;
@ -258,6 +260,7 @@ function Product(params={}) {
this.siz = params.size ? params.size : 0; //How much space it takes in the warehouse
//Material requirements. An object that maps the name of a material to how much it requires
//to make 1 unit of the product.
this.req = params.req ? params.req : {};
}
@ -299,7 +302,7 @@ function Industry(params={}) {
};
this.type = params.type ? params.type : 0;
this.materials = {};
this.materials = {}; //Contains both materials that are created and required
this.products = {};
this.awareness = 0;
@ -330,6 +333,31 @@ Industry.prototype.init = function() {
break;
case Industries.Agriculture:
break;
case Industries.Fishing:
break;
case Industries.Mining:
break;
case Industries.Food:
break;
case Industries.Tobacco:
break;
case Industries.Chemical:
break;
case Industries.Pharmaceutical:
break;
case Industries.Computer:
break;
case Industries.Robotics:
break;
case Industries.Software:
break;
case Industries.Healthcare:
break;
case Industries.RealEstate:
break;
default:
console.log("ERR: Invalid Industry Type passed into Industry.init()");
return;
}
}

@ -1,5 +1,5 @@
let CONSTANTS = {
Version: "0.32.0",
Version: "0.32.1",
//Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
//and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@ -707,6 +707,11 @@ let CONSTANTS = {
"Returns the amount of time in milliseconds that have passed since you last installed Augmentations (or destroyed a BitNode).<br><br>" +
"<i><u>sprintf()/vsprintf()</u></i><br>" +
"<a href='https://github.com/alexei/sprintf.js' target='_blank'>See this link for details</a><br><br>" +
"<i><u>prompt(message)</u></i><br>" +
"Prompts the player with a dialog box with two options: 'Yes' and 'No'. This function will returns true if " +
"the player clicks 'Yes' and false if the player click's 'No'. The script's execution is halted until the " +
"player selects 'Yes' or 'No'. The function takes a single string as an argument which specifies the text " +
"that appears on the dialog box.<br><br>" +
"<u><h1>Hacknet Nodes API</h1></u><br>" +
"Netscript provides the following API for accessing and upgrading your Hacknet Nodes through scripts. This API does NOT work offline.<br><br>" +
"<i><u>hacknetnodes</u></i><br>A special variable. This is an array that maps to the Player's Hacknet Nodes. The Hacknet Nodes are accessed through " +
@ -1111,10 +1116,10 @@ let CONSTANTS = {
"-Updated Netscript's 'interpreter/engine' to use the Bluebird promise library instead of native promises. " +
"It should now be faster and more memory-efficient. If this has broken any Netscript features please report it through Github or the subreddit (reddit.com/r/bitburner)<br>" +
"-Rebalanced stock market (adjusted parameters such as the volatility/trends/starting price of certain stocks)<br>" +
"-Added confirm() Netscript function<br>" +
"-Added prompt() Netscript function<br>" +
"-Added 'Buy Max' and 'Sell All' functions to Stock Market UI<br>" +
"-Added 'Portfolio' Mode to Stock Market UI so you can only view stocks you have a position/order in<br>" +
"-Added a button to kill a script from its log display box<br>" +
"-Added a button to kill a script from its log display box<br><br>" +
"v0.32.0<br>" +
"-Released BitNode-8: Ghost of Wall Street<br>" +
"-Re-designed Stock Market UI<br>" +

@ -1350,7 +1350,7 @@ function NetscriptFunctions(workerScript) {
getTimeSinceLastAug : function() {
return Player.playtimeSinceLastAug;
},
confirm : function(txt) {
prompt : function(txt) {
if (yesNoBoxOpen) {
workerScript.scriptRef.log("ERROR: confirm() failed because a pop-up dialog box is already open");
return false;

@ -194,6 +194,7 @@ function PlayerObject() {
this.scriptProdSinceLastAug = 0;
this.stockProdSinceLastAug = 0;
this.crimeProdSinceLastAug = 0;
this.jobProdSinceLastAug = 0;
};
PlayerObject.prototype.init = function() {

@ -249,11 +249,11 @@ function initStockMarket() {
}
var ecorp = Locations.AevumECorp;
var ecorpStk = new Stock(ecorp, StockSymbols[ecorp], 0.5, true, 16, getRandomInt(20000, 25000));
var ecorpStk = new Stock(ecorp, StockSymbols[ecorp], 0.45, true, 19, getRandomInt(20000, 25000));
StockMarket[ecorp] = ecorpStk;
var megacorp = Locations.Sector12MegaCorp;
var megacorpStk = new Stock(megacorp, StockSymbols[megacorp], 0.5, true, 16, getRandomInt(25000, 33000));
var megacorpStk = new Stock(megacorp, StockSymbols[megacorp], 0.45, true, 19, getRandomInt(25000, 33000));
StockMarket[megacorp] = megacorpStk;
var blade = Locations.Sector12BladeIndustries;
@ -365,11 +365,11 @@ function initStockMarket() {
StockMarket[sigmacosm] = sigmacosmStk;
var joesguns = "Joes Guns";
var joesgunsStk = new Stock(joesguns, StockSymbols[joesguns], 3.7, true, 1, getRandomInt(500, 1000));
var joesgunsStk = new Stock(joesguns, StockSymbols[joesguns], 3.8, true, 1, getRandomInt(500, 1000));
StockMarket[joesguns] = joesgunsStk;
var catalyst = "Catalyst Ventures";
var catalystStk = new Stock(catalyst, StockSymbols[catalyst], 1.5, true, 13, getRandomInt(500, 1000));
var catalystStk = new Stock(catalyst, StockSymbols[catalyst], 1.5, true, 14, getRandomInt(500, 1000));
StockMarket[catalyst] = catalystStk;
var microdyne = "Microdyne Technologies";