diff --git a/dist/bundle.js b/dist/bundle.js index 39b708099..501bf7ad5 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -3247,6 +3247,7 @@ let CONSTANTS = { "kill('foo.script', getHostname(), 1, 'foodnstuff');

" + "killall(hostname/ip)
Kills all running scripts on the specified server. This function takes a single argument which " + "must be a string containing the hostname or IP of the target server. This function will always return true.

" + + "exit()
Terminates the script immediately

" + "scp(script, [source], destination)
Copies a script or literature (.lit) file to another server. The first argument is a string with " + "the filename of the script or literature file " + "to be copied, or an array of filenames to be copied. The next two arguments are strings containing the hostname/IPs of the source and target server. " + @@ -3370,7 +3371,7 @@ let CONSTANTS = { "have purchased. It takes an optional parameter specifying whether the hostname or IP addresses will be returned. If this " + "parameter is not specified, it is true by default and hostnames will be returned

" + "round(n)
Rounds the number n to the nearest integer. If the argument passed in is not a number, then the function will return 0.

" + - "write(port, data='', mode='a')
This function can be used to either write data to a port or to a text file (.txt).

" + + "write(port/fn, data='', mode='a')
This function can be used to either write data to a port or to a text file (.txt).

" + "If the first argument is a number between 1 and 10, then it specifies a port and this function will write data to a port. If the second " + "argument is not specified then it will write an empty string to the port. The third argument, mode, is not used when writing data to a port.

" + "If the first argument is a string, then it specifies the name of a text file (.txt) and this function will write data to a text file. " + @@ -3379,12 +3380,15 @@ let CONSTANTS = { "mode which means that it will overwrite the existing data on the file, or it will create a new file if it does not already exist. Otherwise, " + "the data will be written in 'append' mode which means that the data will be added at the end of the existing file, or it will create a new file if it " + "does not already exist. If mode isn't specified then it will be 'a' for 'append' mode by default.

" + - "read(port)
This function is used to read data from a port or from a text file (.txt).

" + + "read(port/fn)
This function is used to read data from a port or from a text file (.txt).

" + "This function takes a single argument. If this argument is a number between 1 and 10, then it specifies a port and it will read data from " + "a port. A port is a serialized queue. This function will remove the first element from the queue and return it. If the queue is empty, " + "then the string 'NULL PORT DATA' will be returned.

" + "If the first argument is a string, then it specifies the name of a text file and this function will return the data in the " + "specified text file. If the text file does not exist, an empty string will be returned

" + + "clear(port/fn)
This function is used to clear a Netscript Port or a text file.

" + + "It takes a single argument. If this argument is a number between 1 and 10, then it specifies a port and will clear it (deleting all data from it). " + + "If the argument is a string, then it specifies the name of a text file (.txt) and will clear the text file so that it is empty.

" + "scriptRunning(scriptname, hostname/ip)
Returns a boolean indicating whether any instance of the specified script is running " + "on a server, regardless of its arguments. This is different than the isRunning() function because it does not " + "try to identify a specific instance of a running script by its arguments.

" + @@ -6541,6 +6545,11 @@ function prestigeHomeComputer(homeComp) { homeComp.ramUsed = 0; homeComp.programs.push(__WEBPACK_IMPORTED_MODULE_2__CreateProgram_js__["a" /* Programs */].NukeProgram); + //Update RAM usage on all scripts + homeComp.scripts.forEach(function(script) { + script.updateRamUsage(); + }); + homeComp.messages.length = 0; homeComp.messages.push("hackers-starting-handbook.lit"); } @@ -26202,7 +26211,7 @@ function NetscriptFunctions(workerScript) { } else if (type.includes("stop") && type.includes("buy")) { orderType = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["a" /* OrderTypes */].StopBuy; } else if (type.includes("stop") && type.includes("sell")) { - orderType = OrderType.StopSell; + orderType = __WEBPACK_IMPORTED_MODULE_19__StockMarket_js__["a" /* OrderTypes */].StopSell; } else { throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Order Type passed into placeOrder()"); } @@ -26215,7 +26224,7 @@ function NetscriptFunctions(workerScript) { } else { throw Object(__WEBPACK_IMPORTED_MODULE_23__NetscriptEvaluator_js__["d" /* makeRuntimeRejectMsg */])(workerScript, "ERROR: Invalid Position Type passed into placeOrder()"); } - params = { + var params = { stock: stock, shares: shares, price: price, @@ -35344,7 +35353,7 @@ function iTutorialEnd() { Object(__WEBPACK_IMPORTED_MODULE_2__utils_DialogBox_js__["a" /* dialogBoxCreate */])("If you are new to the game, the following links may be useful for you!

" + "Getting Started Guide" + "Wiki

" + - "The Beginner's Guide to Hacking was added to your home computer! It contains stop tips/pointers for starting out with the game. " + + "The Beginner's Guide to Hacking was added to your home computer! It contains some tips/pointers for starting out with the game. " + "To read it, go to Terminal and enter

cat hackers-starting-handbook.lit"); __WEBPACK_IMPORTED_MODULE_1__Player_js__["a" /* Player */].getHomeComputer().messages.push("hackers-starting-handbook.lit"); } @@ -38366,15 +38375,17 @@ function logBoxUpdateText() { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Corporation; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__engine_js__ = __webpack_require__(5); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Location_js__ = __webpack_require__(12); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js__ = __webpack_require__(24); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__utils_decimal_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__ = __webpack_require__(2); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js__ = __webpack_require__(17); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__ = __webpack_require__(4); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__ = __webpack_require__(14); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Player_js__ = __webpack_require__(0); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js__ = __webpack_require__(24); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3__utils_decimal_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__ = __webpack_require__(1); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__ = __webpack_require__(2); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__ = __webpack_require__(7); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js__ = __webpack_require__(17); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js__); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__ = __webpack_require__(4); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__ = __webpack_require__(14); + @@ -38408,14 +38419,14 @@ CorporationState.prototype.getState = function() { } CorporationState.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("CorporationState", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("CorporationState", this); } CorporationState.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(CorporationState, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(CorporationState, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.CorporationState = CorporationState; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.CorporationState = CorporationState; /* Constants */ var TOTALSHARES = 1e9; //Total number of shares you have at your company @@ -38570,14 +38581,14 @@ Material.prototype.processMarket = function() { } Material.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Material", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Material", this); } Material.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Material, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Material, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.Material = Material; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.Material = Material; //Map of material (by name) to their sizes (how much space it takes in warehouse) let MaterialSizes = { @@ -38722,7 +38733,7 @@ Product.prototype.finishProduct = function(employeeProd, industry) { console.log("advMult: " + advMult); this.mku = 100 / (advMult * this.qlt * (busRatio + mgmtRatio)); this.dmd = industry.awareness === 0 ? 100 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness))); - this.cmp = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(0, 70); + this.cmp = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(0, 70); //Calculate the product's required materials //For now, just set it to be the same as the requirements to make materials @@ -38763,14 +38774,14 @@ Product.prototype.calculateRating = function(industry) { } Product.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Product", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Product", this); } Product.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Product, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Product, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.Product = Product; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.Product = Product; var Industries = { Energy: "Energy", @@ -38808,33 +38819,33 @@ var IndustryStartingCosts = { var IndustryDescriptions = { Energy: "Engage in the production and distribution of energy.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Energy).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Energy).format("$0.000a"), Utilities: "Distributes water and provides wastewater services.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Utilities).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Utilities).format("$0.000a"), Agriculture: "Cultive crops and breed livestock to produce food.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Agriculture).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Agriculture).format("$0.000a"), Fishing: "Produce food through the breeding and processing of fish and fish products

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Fishing).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Fishing).format("$0.000a"), Mining: "Extract and process metals from the earth.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Mining).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Mining).format("$0.000a"), Food: "Create your own restaurants all around the world.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Food).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Food).format("$0.000a"), Tobacco: "Create and distribute tobacco and tobacco-related products.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Tobacco).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Tobacco).format("$0.000a"), Chemical: "Product industrial chemicals

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Chemical).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Chemical).format("$0.000a"), Pharmaceutical: "Discover, develop, and create new pharmaceutical drugs.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Pharmaceutical).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Pharmaceutical).format("$0.000a"), Computer: "Develop and manufacture new computer hardware and networking infrastructures.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Computer).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Computer).format("$0.000a"), Robotics: "Develop and create robots.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Robotics).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Robotics).format("$0.000a"), Software: "Develop computer software and create AI Cores.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Software).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Software).format("$0.000a"), Healthcare: "Create and manage hospitals.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.Healthcare).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.Healthcare).format("$0.000a"), RealEstate: "Develop and manuage real estate properties.

" + - "Starting cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(IndustryStartingCosts.RealEstate).format("$0.000a"), + "Starting cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(IndustryStartingCosts.RealEstate).format("$0.000a"), } var ProductRatingWeights = { @@ -38954,10 +38965,10 @@ function Industry(params={}) { this.prodMult = 0; //Production multiplier //Financials - this.lastCycleRevenue = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); - this.lastCycleExpenses = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); - this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); - this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); + this.lastCycleRevenue = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); + this.lastCycleExpenses = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); + this.thisCycleRevenue = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); + this.thisCycleExpenses = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); this.state = 0; @@ -39291,7 +39302,7 @@ Industry.prototype.processProductMarket = function(marketCycles=1) { for (var name in this.products) { if (this.products.hasOwnProperty(name)) { var product = this.products[name]; - var change = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(1, 5) * 0.001; + var change = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(1, 5) * 0.001; if (this.type === Industries.Pharmaceutical || this.type === Industries.Software || this.type === Industries.Robotics) { change *= 2.5; @@ -39431,7 +39442,7 @@ Industry.prototype.processMaterials = function(marketCycles=1, company) { var mat = warehouse.materials[matName]; var sCost; - if (Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["f" /* isString */])(mat.sCost)) { + if (Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["f" /* isString */])(mat.sCost)) { sCost = mat.sCost.replace(/MP/g, mat.bCost); sCost = eval(sCost); } else { @@ -39708,14 +39719,14 @@ Industry.prototype.discontinueProduct = function(product, parentRefs) { } Industry.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Industry", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Industry", this); } Industry.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Industry, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Industry, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.Industry = Industry; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.Industry = Industry; var EmployeePositions = { Operations: "Operations", @@ -39732,17 +39743,17 @@ function Employee(params={}) { this.name = params.name ? params.name : "Bobby"; //Morale, happiness, and energy are 0-100 - this.mor = params.morale ? params.morale : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); - this.hap = params.happiness ? params.happiness : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); - this.ene = params.energy ? params.energy : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); + this.mor = params.morale ? params.morale : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); + this.hap = params.happiness ? params.happiness : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); + this.ene = params.energy ? params.energy : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100); - this.age = params.age ? params.age : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(20, 50); - this.int = params.intelligence ? params.intelligence : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.cha = params.charisma ? params.charisma : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.exp = params.experience ? params.experience : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.cre = params.creativity ? params.creativity : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.eff = params.efficiency ? params.efficiency : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); - this.sal = params.salary ? params.salary : Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(0.1, 5); + this.age = params.age ? params.age : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(20, 50); + this.int = params.intelligence ? params.intelligence : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.cha = params.charisma ? params.charisma : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.exp = params.experience ? params.experience : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.cre = params.creativity ? params.creativity : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.eff = params.efficiency ? params.efficiency : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(10, 50); + this.sal = params.salary ? params.salary : Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(0.1, 5); this.pro = 0; //Productivity, This is calculated this.loc = params.loc ? params.loc : ""; @@ -39821,25 +39832,25 @@ Employee.prototype.throwParty = function(money) { //'panel' is the DOM element on which to create the UI Employee.prototype.createUI = function(panel) { panel.style.color = "white"; - panel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + panel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { id:"cmpy-mgmt-employee-" + this.name + "-panel-text", - innerHTML:"Morale: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + - "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + - "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + - "Age: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + - "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.int, 3) + "
" + - "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cha, 3) + "
" + - "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + - "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cre, 3) + "
" + - "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.eff, 3) + "
" + - "Salary: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
", + innerHTML:"Morale: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + + "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + + "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + + "Age: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + + "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.int, 3) + "
" + + "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cha, 3) + "
" + + "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + + "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cre, 3) + "
" + + "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.eff, 3) + "
" + + "Salary: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
", })); //Selector for employee position - var selector = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var selector = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var key in EmployeePositions) { if (EmployeePositions.hasOwnProperty(key)) { - selector.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + selector.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { text: EmployeePositions[key], value: EmployeePositions[key], })); @@ -39869,27 +39880,27 @@ Employee.prototype.updateUI = function(panel) { if (text == null) { return this.createUI(panel); } - text.innerHTML = "Morale: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + - "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + - "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + - "Age: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + - "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.int, 3) + "
" + - "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cha, 3) + "
" + - "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + - "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cre, 3) + "
" + - "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.eff, 3) + "
" + - "Salary: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
"; + text.innerHTML = "Morale: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.mor, 3) + "
" + + "Happiness: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.hap, 3) + "
" + + "Energy: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.ene, 3) + "
" + + "Age: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.age, 3) + "
" + + "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.int, 3) + "
" + + "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cha, 3) + "
" + + "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.exp, 3) + "
" + + "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.cre, 3) + "
" + + "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.eff, 3) + "
" + + "Salary: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(this.sal).format("$0.000a") + "/ s
"; } Employee.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Employee", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Employee", this); } Employee.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Employee, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Employee, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.Employee = Employee; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.Employee = Employee; var OfficeSpaceTiers = { Basic: "Basic", @@ -39964,14 +39975,14 @@ OfficeSpace.prototype.findEmployees = function(company) { if (document.getElementById("cmpy-mgmt-hire-employee-popup") != null) {return;} //Generate three random employees (meh, decent, amazing) - var mult1 = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(25, 50)/100, - mult2 = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(51, 75)/100, - mult3 = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(76, 100)/100; - var int = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - cha = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - exp = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - cre = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), - eff = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + var mult1 = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(25, 50)/100, + mult2 = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(51, 75)/100, + mult3 = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(76, 100)/100; + var int = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + cha = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + exp = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + cre = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), + eff = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(50, 100), sal = 2.2 * (int + cha + exp + cre + eff); var emp1 = new Employee({ @@ -40001,34 +40012,34 @@ OfficeSpace.prototype.findEmployees = function(company) { salary: sal * mult3, }); - var text = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("h1", { + var text = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("h1", { innerHTML: "Select one of the following candidates for hire:", }); var createEmpDiv = function(employee, office) { - var div = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var div = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-find-employee-option", - innerHTML: "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.int, 1) + "
" + - "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cha, 1) + "
" + - "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.exp, 1) + "
" + - "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cre, 1) + "
" + - "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.eff, 1) + "
" + - "Salary: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(employee.sal).format('$0.000a') + " \ s
", + innerHTML: "Intelligence: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.int, 1) + "
" + + "Charisma: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cha, 1) + "
" + + "Experience: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.exp, 1) + "
" + + "Creativity: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.cre, 1) + "
" + + "Efficiency: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(employee.eff, 1) + "
" + + "Salary: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(employee.sal).format('$0.000a') + " \ s
", clickListener:()=>{ office.hireEmployee(employee, company); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); return false; } }); return div; }; - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", float:"right", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-hire-employee-popup"); return false; } }); @@ -40039,42 +40050,42 @@ OfficeSpace.prototype.findEmployees = function(company) { createEmpDiv(emp3, this), cancelBtn]; - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])("cmpy-mgmt-hire-employee-popup", elems); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])("cmpy-mgmt-hire-employee-popup", elems); } OfficeSpace.prototype.hireEmployee = function(employee, company) { - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["j" /* yesNoTxtInpBoxGetYesButton */])(), - noBtn = Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["i" /* yesNoTxtInpBoxGetNoButton */])(); + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["j" /* yesNoTxtInpBoxGetYesButton */])(), + noBtn = Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["i" /* yesNoTxtInpBoxGetNoButton */])(); yesBtn.innerHTML = "Hire"; noBtn.innerHTML = "Cancel"; yesBtn.addEventListener("click", ()=>{ - var name = Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["h" /* yesNoTxtInpBoxGetInput */])(); + var name = Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["h" /* yesNoTxtInpBoxGetInput */])(); for (var i = 0; i < this.employees.length; ++i) { if (this.employees[i].name === name) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You already have an employee with this nickname! Please give every employee a unique nickname."); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You already have an employee with this nickname! Please give every employee a unique nickname."); return false; } } employee.name = name; this.employees.push(employee); company.updateUIContent(); - return Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); }); noBtn.addEventListener("click", ()=>{ - return Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["f" /* yesNoTxtInpBoxClose */])(); }); - Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["g" /* yesNoTxtInpBoxCreate */])("Give your employee a nickname!"); + Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["g" /* yesNoTxtInpBoxCreate */])("Give your employee a nickname!"); } OfficeSpace.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("OfficeSpace", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("OfficeSpace", this); } OfficeSpace.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(OfficeSpace, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(OfficeSpace, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.OfficeSpace = OfficeSpace; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.OfficeSpace = OfficeSpace; function Warehouse(params={}) { this.loc = params.loc ? params.loc : ""; @@ -40117,11 +40128,11 @@ Warehouse.prototype.createUI = function(parentRefs) { return; } var company = parentRefs.company, industry = parentRefs.industry; - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(industryWarehousePanel); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(industryWarehousePanel); var storageText = "Storage: " + - (this.sizedUsed >= this.size ? Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3) : Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3)) + - "/" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.size, 3); - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + (this.sizedUsed >= this.size ? Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3) : Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sizeUsed, 3)) + + "/" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.size, 3); + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: storageText, display:"inline-block", color: this.sizeUsed >= this.size ? "red" : "white", @@ -40129,8 +40140,8 @@ Warehouse.prototype.createUI = function(parentRefs) { //Upgrade warehouse size button var upgradeCost = WarehouseUpgradeBaseCost * Math.pow(1.07, Math.round(this.size / 100) - 1); - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { - innerText:"Upgrade Warehouse Size - " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { + innerText:"Upgrade Warehouse Size - " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), display:"inline-block", class: company.funds.lt(upgradeCost) ? "a-link-button-inactive" : "a-link-button", clickListener:()=>{ @@ -40175,12 +40186,12 @@ Warehouse.prototype.createUI = function(parentRefs) { console.log("ERROR: Invalid state: " + industry.state); break; } - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:reqText, })); //Materials - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "
Materials:
", })); for (var matName in this.materials) { @@ -40195,7 +40206,7 @@ Warehouse.prototype.createUI = function(parentRefs) { //Products if (!(industry.makesProducts && Object.keys(industry.products).length > 0)) {return;} - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "
Products:
", })); for (var productName in industry.products) { @@ -40213,7 +40224,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { var company = parentRefs.company, industry = parentRefs.industry; var purchasePopupId = "cmpy-mgmt-material-purchase-popup", sellPopupid = "cmpy-mgmt-material-sell-popup"; - var div = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var div = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-warehouse-material-div", }); @@ -40227,66 +40238,66 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { //If Market Research upgrades are unlocked, add competition and demand info var cmpAndDmdText = ""; if (company.unlockUpgrades[2] === 1) { - cmpAndDmdText += "
Competition: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.cmp, 3); + cmpAndDmdText += "
Competition: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.cmp, 3); } if (company.unlockUpgrades[3] === 1) { - cmpAndDmdText += "
Demand: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.dmd, 3); + cmpAndDmdText += "
Demand: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.dmd, 3); } - var innerTxt = "

" + mat.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qty, 3) + - "(" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + - "Buy: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + - "/s
Prod: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.prd, 3) + "/s
Sell: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + - "/s
Export: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalExport, 3) + "/s
Import: " + - Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.imp, 3) + "/s" + cmpAndDmdText + "


" + - "

MP: $" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.bCost, 2) + + var innerTxt = "

" + mat.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qty, 3) + + "(" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + + "Buy: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + + "/s
Prod: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.prd, 3) + "/s
Sell: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + + "/s
Export: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalExport, 3) + "/s
Import: " + + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.imp, 3) + "/s" + cmpAndDmdText + "


" + + "

MP: $" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.bCost, 2) + "Market Price: The price you would pay if " + "you were to buy this material on the market


" + - "

Quality: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qlt, 2) + + "

Quality: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.qlt, 2) + "The quality of your material. Higher quality " + "will lead to more sales

"; - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: innerTxt, id: "cmpy-mgmt-warehouse-" + matName + "-text", display:"inline-block", })); - var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { display:"inline-block", }); div.appendChild(buttonPanel); //Button to set purchase amount - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { - innerText: "Buy (" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + ")", display:"inline-block", class:"a-link-button", + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { + innerText: "Buy (" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.buy, 3) + ")", display:"inline-block", class:"a-link-button", clickListener:()=>{ - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the amount of " + mat.name + " you would like " + "to purchase per second. This material's cost changes constantly" }); - var input = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var input = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", value:mat.buy ? mat.buy : null, placeholder: "Purchase amount" }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Confirm", class:"a-link-button", clickListener:()=>{ if (isNaN(input.value)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount"); } else { mat.buy = parseFloat(input.value); if (isNaN(mat.buy)) {mat.buy = 0;} - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(purchasePopupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(purchasePopupId); this.createUI(parentRefs); return false; } } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Cancel", class:"a-link-button", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(purchasePopupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(purchasePopupId); } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(purchasePopupId, [txt, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(purchasePopupId, [txt, input, confirmBtn, cancelBtn]); input.focus(); } })); @@ -40295,27 +40306,27 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { if (company.unlockUpgrades[0] === 1) { //Export unlock upgrade function createExportPopup() { var popupId = "cmpy-mgmt-export-popup"; - var exportTxt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var exportTxt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Select the industry and city to export this material to, as well as " + "how much of this material to export per second. You can set the export " + "amount to 'MAX' to export all of the materials in this warehouse." }); //Select industry and city to export to - var industrySelector = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("select", {}), - citySelector = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var industrySelector = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("select", {}), + citySelector = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var i = 0; i < company.divisions.length; ++i) { - industrySelector.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + industrySelector.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { text:company.divisions[i].name, value:company.divisions[i].name, changeListener:()=>{ var industryName = industrySelector.options[industrySelector.selectedIndex].value; for (var foo = 0; foo < company.divisions.length; ++foo) { if (company.divisions[foo].name == industryName) { - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["c" /* clearSelector */])(citySelector); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["c" /* clearSelector */])(citySelector); var selectedIndustry = company.divisions[foo]; for (var cityName in company.divisions[foo].warehouses) { if (company.divisions[foo].warehouses[cityName] instanceof Warehouse) { - citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { value:cityName, text:cityName, })); } @@ -40333,7 +40344,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { for (var cityName in company.divisions[i].warehouses) { if (company.divisions[i].warehouses.hasOwnProperty(cityName) && company.divisions[i].warehouses[cityName] instanceof Warehouse) { - citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { value:cityName, text:cityName, })); } @@ -40343,18 +40354,18 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } //Select amount to export - var exportAmount = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var exportAmount = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Export amount / s" }); - var exportBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var exportBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Export", clickListener:()=>{ var industryName = industrySelector.options[industrySelector.selectedIndex].text, cityName = citySelector.options[citySelector.selectedIndex].text, amt = parseFloat(exportAmount.value); if (isNaN(amt)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount entered for export"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid amount entered for export"); return; } var exportObj = {ind:industryName, city:cityName, amt:amt}; @@ -40366,7 +40377,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { var warehouse = company.divisions[i].warehouses[cityName]; if (warehouse instanceof Warehouse) { warehouse.materials[matName].imp += amt; - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } else { console.log("ERROR: Target city for export does not have warehouse in specified city"); @@ -40374,27 +40385,27 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } } console.log("ERROR: Could not find target industry/city for export"); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var currExportsText = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var currExportsText = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Below is a list of all current exports of this material from this warehouse. " + "Clicking on one of the exports below will REMOVE that export." }); var currExports = []; for (var i = 0; i < mat.exp.length; ++i) { (function(i, mat, currExports){ - currExports.push(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + currExports.push(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-existing-export", innerHTML: "Industry: " + mat.exp[i].ind + "
" + "City: " + mat.exp[i].city + "
" + @@ -40412,38 +40423,38 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } } mat.exp.splice(i, 1); //Remove export object - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); createExportPopup(); } })); })(i, mat, currExports); } - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [exportTxt, industrySelector, citySelector, exportAmount, + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [exportTxt, industrySelector, citySelector, exportAmount, exportBtn, cancelBtn, currExportsText].concat(currExports)); } - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Export", display:"inline-block", class:"a-link-button", clickListener:()=>{createExportPopup();} })); } - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break //Button to set sell amount - var innerTextString = (mat.sllman[1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/MAX)" : - "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sllman[1], 3) + ")") + var innerTextString = (mat.sllman[1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/MAX)" : + "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sll, 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sllman[1], 3) + ")") if (mat.sCost) { - if (Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["f" /* isString */])(mat.sCost)) { + if (Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["f" /* isString */])(mat.sCost)) { var sCost = mat.sCost.replace(/MP/g, mat.bCost); - innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(eval(sCost), 2); + innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(eval(sCost), 2); } else { - innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sCost, 2); + innerTextString += " @ $" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(mat.sCost, 2); } } - buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + buttonPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText: innerTextString, display:"inline-block", class:"a-link-button", clickListener:()=>{ - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the maximum amount of " + mat.name + " you would like " + "to sell per second, as well as the price at which you would " + "like to sell at.

" + @@ -40455,13 +40466,13 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { "changing price that depends on the market price. For example, if you set the sell price " + "to 'MP+10' then it will always be sold at $10 above the market price.", }); - var inputQty = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var inputQty = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", value: mat.sllman[1] ? mat.sllman[1] : null, placeholder: "Sell amount" }); - var inputPx = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var inputPx = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", value: mat.sCost ? mat.sCost : null, placeholder: "Sell price" }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Confirm", class:"a-link-button", margin:"6px", @@ -40473,7 +40484,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { var temp = cost.replace(/MP/g, mat.bCost); var temp = eval(temp); if (temp == null || isNaN(temp)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value or expression for sell price field"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value or expression for sell price field"); return false; } @@ -40488,7 +40499,7 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { mat.sllman[0] = true; mat.sllman[1] = -1; } else if (isNaN(inputQty.value)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric or 'MAX'"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric or 'MAX'"); return false; } else { var qty = parseFloat(inputQty.value); @@ -40502,19 +40513,19 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { } this.createUI(parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(sellPopupid); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(sellPopupid); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Cancel", class:"a-link-button", margin: "6px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(sellPopupid); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(sellPopupid); } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(sellPopupid, [txt, inputQty, inputPx, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(sellPopupid, [txt, inputQty, inputPx, confirmBtn, cancelBtn]); inputQty.focus(); } })); @@ -40525,15 +40536,15 @@ Warehouse.prototype.createMaterialUI = function(mat, matName, parentRefs) { Warehouse.prototype.createProductUI = function(product, parentRefs) { var company = parentRefs.company, industry = parentRefs.industry, city = currentCityUi; - var div = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var div = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-warehouse-product-div" }); //Products being designed TODO if (!product.fin) { - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Designing " + product.name + "...
" + - Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prog, 2) + "% complete", + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prog, 2) + "% complete", })); industryWarehousePanel.appendChild(div); return; @@ -40541,40 +40552,40 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { //Completed products var totalGain = product.data[city][1] - product.data[city][2]; //Production - sale - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { - innerHTML: "

" + product.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][0], 3) + //Quantity - "(" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + - "Prod: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][1], 3) + "/s
" + - "Sell: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/s


" + - "

Rating: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rat, 3) + - "Quality: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.qlt, 3) + "
" + - "Performance: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.per, 3) + "
" + - "Durability: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.dur, 3) + "
" + - "Reliability: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rel, 3) + "
" + - "Aesthetics: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.aes, 3) + "
" + - "Features: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.fea, 3) + "


" + - "

Est. Production Cost: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(product.pCost).format("$0.000a") + + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { + innerHTML: "

" + product.name + ": " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][0], 3) + //Quantity + "(" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(totalGain, 3) + "/s)" + + "Prod: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][1], 3) + "/s
" + + "Sell: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/s


" + + "

Rating: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rat, 3) + + "Quality: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.qlt, 3) + "
" + + "Performance: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.per, 3) + "
" + + "Durability: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.dur, 3) + "
" + + "Reliability: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.rel, 3) + "
" + + "Aesthetics: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.aes, 3) + "
" + + "Features: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.fea, 3) + "


" + + "

Est. Production Cost: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(product.pCost).format("$0.000a") + "An estimate of how much it costs to produce one unit of this product. " + "If your sell price exceeds this by too much, people won't buy your product. The better your " + "product is, the higher you can mark up its price.


" + - "Size: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.siz, 3), + "Size: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.siz, 3), })); - var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var buttonPanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { display:"inline-block", }); div.appendChild(buttonPanel); //Sell button - var sellInnerTextString = (product.sllman[city][1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/MAX)" : - "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.sllman[city][1], 3) + ")"); + var sellInnerTextString = (product.sllman[city][1] === -1 ? "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/MAX)" : + "Sell (" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.data[city][2], 3) + "/" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.sllman[city][1], 3) + ")"); if (product.sCost) { - sellInnerTextString += (" @ " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(product.sCost).format("$0.000a")); + sellInnerTextString += (" @ " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(product.sCost).format("$0.000a")); } - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:sellInnerTextString, class:"a-link-button", display:"inline-block",margin:"6px", clickListener:()=>{ var popupId = "cmpy-mgmt-sell-product-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:"Enter the maximum amount of " + product.name + " you would like " + "to sell per second, as well as the price at which you would like to " + "sell it at.

" + @@ -40583,19 +40594,19 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { "Setting the sell amount to 'MAX' will result in you always selling the " + "maximum possible amount of the material.

", }); - var inputQty = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var inputQty = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", value:product.sllman[city][1] ? product.sllman[city][1] : null, placeholder: "Sell amount" }); - var inputPx = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var inputPx = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", value: product.sCost ? product.sCost : null, placeholder: "Sell price" }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Confirm", clickListener:()=>{ //Parse price var cost = parseFloat(inputPx.value); if (isNaN(cost)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell price field"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell price field"); return false; } product.sCost = cost; @@ -40605,7 +40616,7 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { product.sllman[city][0] = true; product.sllman[city][1] = -1; } else if (isNaN(inputQty.value)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for sell quantity field! Must be numeric"); return false; } else { var qty = parseFloat(inputQty.value); @@ -40618,50 +40629,50 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { } } this.createUI(parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, inputQty, inputPx, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, inputQty, inputPx, confirmBtn, cancelBtn]); inputQty.focus(); } })); - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("br",{})); //force line break + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("br",{})); //force line break //Limit production button var limitProductionInnerText = "Limit Production"; if (product.prdman[city][0]) { - limitProductionInnerText += " (" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prdman[city][1], 3) + ")"; + limitProductionInnerText += " (" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(product.prdman[city][1], 3) + ")"; } - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:limitProductionInnerText,display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-limit-product-production-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Enter a limit to the amount of this product you would " + "like to product per second. Leave the box empty to set no limit." }); - var input = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var input = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Limit" }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Limit production", margin:'6px', clickListener:()=>{ if (input.value === "") { product.prdman[city][0] = false; - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } var qty = parseFloat(input.value); if (isNaN(qty)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); return false; } if (qty < 0) { @@ -40670,62 +40681,62 @@ Warehouse.prototype.createProductUI = function(product, parentRefs) { product.prdman[city][0] = true; product.prdman[city][1] = qty; } - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Cancel", margin:"6px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, input, confirmBtn, cancelBtn]); } })); //Discontinue button - div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + div.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:'a-link-button', display:"inline-block",innerText:"Discontinue", clickListener:()=>{ var popupId = "cmpy-mgmt-discontinue-product-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Are you sure you want to do this? Discontinuing a product " + "removes it completely and permanently. You will no longer " + "produce this product and all of its existing stock will be " + "removed and left unsold", }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button",innerText:"Discontinue", clickListener:()=>{ industry.discontinueProduct(product, parentRefs); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, confirmBtn, cancelBtn]); } })); industryWarehousePanel.appendChild(div); } Warehouse.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Warehouse", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Warehouse", this); } Warehouse.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Warehouse, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Warehouse, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.Warehouse = Warehouse; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.Warehouse = Warehouse; //Corporation Unlock Upgrades //Upgrades for entire corporation, unlocks features, either you have it or you dont @@ -40809,9 +40820,9 @@ function Corporation(params={}) { this.divisions = []; //Financial stats - this.funds = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(150e9); - this.revenue = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); - this.expenses = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); + this.funds = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(150e9); + this.revenue = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); + this.expenses = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); this.fundingRound = 0; this.public = false; //Publicly traded this.numShares = TOTALSHARES; @@ -40863,13 +40874,13 @@ Corporation.prototype.process = function(numCycles=1) { Corporation.prototype.determineValuation = function() { var val, profit = (this.revenue.minus(this.expenses)).toNumber(); if (this.public) { - val = 25e9 + this.funds.toNumber() + (profit * Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(7000, 8500)); + val = 25e9 + this.funds.toNumber() + (profit * Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(7000, 8500)); val *= (Math.pow(1.1, this.divisions.length)); val = Math.max(val, 0); } else { val = 10e9 + Math.max(this.funds.toNumber(), 0); //Base valuation if (profit > 0) { - val += (profit * Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["h" /* getRandomInt */])(12e3, 14e3)); + val += (profit * Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["h" /* getRandomInt */])(12e3, 14e3)); val *= (Math.pow(1.1, this.divisions.length)); } else { val = 10e9 * Math.pow(1.1, this.divisions.length); @@ -40899,53 +40910,53 @@ Corporation.prototype.getInvestment = function() { } var funding = val * percShares, investShares = Math.floor(TOTALSHARES * percShares), - yesBtn = Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), - noBtn = Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); + yesBtn = Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["d" /* yesNoBoxGetYesButton */])(), + noBtn = Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["c" /* yesNoBoxGetNoButton */])(); yesBtn.innerHTML = "Accept"; noBtn.innerHML = "Reject"; yesBtn.addEventListener("click", ()=>{ ++this.fundingRound; this.funds = this.funds.plus(funding); this.numShares -= investShares; - return Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); noBtn.addEventListener("click", ()=>{ - return Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); + return Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["a" /* yesNoBoxClose */])(); }); - Object(__WEBPACK_IMPORTED_MODULE_8__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("An investment firm has offered you " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(funding).format('$0.000a') + - " in funding in exchange for a " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(percShares*100).format("0.000a") + - "% stake in the company (" + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(investShares).format('0.000a') + " shares).

" + + Object(__WEBPACK_IMPORTED_MODULE_9__utils_YesNoBox_js__["b" /* yesNoBoxCreate */])("An investment firm has offered you " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(funding).format('$0.000a') + + " in funding in exchange for a " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(percShares*100).format("0.000a") + + "% stake in the company (" + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(investShares).format('0.000a') + " shares).

" + "Do you accept or reject this offer?"); } Corporation.prototype.goPublic = function() { var goPublicPopupId = "cmpy-mgmt-go-public-popup"; var initialSharePrice = this.determineValuation() / (TOTALSHARES); - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the number of shares you would like to issue " + "for your IPO. These shares will be publicly sold " + "and you will no longer own them. You will receive " + - __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(initialSharePrice).format('$0.000a') + " per share.

" + + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(initialSharePrice).format('$0.000a') + " per share.

" + "Furthermore, issuing more shares now will help drive up " + "your company's stock price in the future.

" + "You have a total of " + this.numShares + " of shares that you can issue.", }); - var input = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var input = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder: "Shares to issue", }); - var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var yesBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Go Public", clickListener:()=>{ var numShares = input.value; var initialSharePrice = this.determineValuation() / (TOTALSHARES); if (isNaN(numShares)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for number of issued shares"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for number of issued shares"); return false; } if (numShares > this.numShares) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Error: You don't have that many shares to issue!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Error: You don't have that many shares to issue!"); return false; } this.public = true; @@ -40953,19 +40964,19 @@ Corporation.prototype.goPublic = function() { this.issuedShares = numShares; this.numShares -= numShares; this.funds = this.funds.plus(numShares * initialSharePrice); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(goPublicPopupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(goPublicPopupId); return false; } }); - var noBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var noBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(goPublicPopupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(goPublicPopupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(goPublicPopupId, [txt, input, yesBtn, noBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(goPublicPopupId, [txt, input, yesBtn, noBtn]); } Corporation.prototype.updateSharePrice = function() { @@ -40985,7 +40996,7 @@ Corporation.prototype.unlock = function(upgrade) { this.unlockUpgrades.push(0); } if (this.funds.lt(price)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to unlock this!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to unlock this!"); return; } this.unlockUpgrades[upgN] = 1; @@ -41000,7 +41011,7 @@ Corporation.prototype.upgrade = function(upgrade) { while (this.upgradeMultipliers.length <= upgN) {this.upgradeMultipliers.push(1);} var totalCost = basePrice * Math.pow(this.upgrades[upgN], priceMult); if (this.funds.lt(totalCost)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to purchase this!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough funds to purchase this!"); return; } ++this.upgrades[upgN]; @@ -41021,19 +41032,19 @@ var companyManagementDiv, companyManagementHeaderTabs, companyManagementPanel, industryWarehousePanel, headerTabs, cityTabs; Corporation.prototype.createUI = function() { - companyManagementDiv = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + companyManagementDiv = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-container", position:"fixed", class:"generic-menupage-container" }); - companyManagementHeaderTabs = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-header-tabs"}); + companyManagementHeaderTabs = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-header-tabs"}); companyManagementDiv.appendChild(companyManagementHeaderTabs); //Create division/industry tabs at the top this.updateUIHeaderTabs(); //Create the 'panel' that will have the actual content in the UI - companyManagementPanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-panel"}); + companyManagementPanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", {id:"cmpy-mgmt-panel"}); companyManagementDiv.appendChild(companyManagementPanel); document.getElementById("entire-game-container").appendChild(companyManagementDiv); @@ -41042,14 +41053,14 @@ Corporation.prototype.createUI = function() { Corporation.prototype.updateUIHeaderTabs = function() { if (companyManagementHeaderTabs) { - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(companyManagementHeaderTabs); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["k" /* removeChildrenFromElement */])(companyManagementHeaderTabs); } else { console.log("ERROR: Header tabs div has not yet been created when Corporation.updateUIHeaderTabs() is called"); return; } //Corporation overview tabs - var cmpyOverviewHdrTab = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("button", { + var cmpyOverviewHdrTab = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:"cmpy-mgmt-company-tab", class:"cmpy-mgmt-header-tab", innerText:this.name, @@ -41068,26 +41079,26 @@ Corporation.prototype.updateUIHeaderTabs = function() { } //Create a tab to expand into a new industry - companyManagementHeaderTabs.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("button", { + companyManagementHeaderTabs.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:'cmpy-mgmt-expand-industry-tab', class:"cmpy-mgmt-header-tab", innerText:"Expand into new Industry", clickListener: ()=>{ if (document.getElementById("cmpy-mgmt-expand-industry-popup") != null) {return;} - var container = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var container = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"popup-box-container", id:"cmpy-mgmt-expand-industry-popup", }), - content = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"popup-box-content"}), - txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + content = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", {class:"popup-box-content"}), + txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Create a new division to expand into a new industry:", }), - selector = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("select", { + selector = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("select", { class:"cmpy-mgmt-industry-select" }), - industryDescription = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", {}), - nameInput = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + industryDescription = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", {}), + nameInput = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"text", id:"cmpy-mgmt-expand-industry-name-input", color:"white", @@ -41096,11 +41107,11 @@ Corporation.prototype.updateUIHeaderTabs = function() { maxLength: 30, pattern:"[a-zA-Z0-9-_]" }), - nameLabel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("label", { + nameLabel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("label", { for:"cmpy-mgmt-expand-industry-name-input", innerText:"Division name: " }), - yesBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("span", { + yesBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"popup-box-button", innerText:"Create Division", clickListener: ()=>{ @@ -41109,14 +41120,14 @@ Corporation.prototype.updateUIHeaderTabs = function() { for (var i = 0; i < this.divisions.length; ++i) { if (this.divisions[i].name === newDivisionName) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("This name is already in use!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("This name is already in use!"); return false; } } if (this.funds.lt(IndustryStartingCosts[ind])) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Not enough money to create a new division in this industry"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Not enough money to create a new division in this industry"); } else if (newDivisionName === "") { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("New division must have a name!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("New division must have a name!"); } else { this.funds = this.funds.minus(IndustryStartingCosts[ind]); var newInd = new Industry({ @@ -41126,17 +41137,17 @@ Corporation.prototype.updateUIHeaderTabs = function() { this.divisions.push(newInd); this.updateUIHeaderTabs(); this.selectHeaderTab(headerTabs[headerTabs.length-2]); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); this.displayDivisionContent(newInd, __WEBPACK_IMPORTED_MODULE_1__Location_js__["a" /* Locations */].Sector12); } return false; } }), - noBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("span", { + noBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"popup-box-button", innerText:"Cancel", clickListener: function() { - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])("cmpy-mgmt-expand-industry-popup"); return false; } }); @@ -41145,7 +41156,7 @@ Corporation.prototype.updateUIHeaderTabs = function() { for (var key in Industries) { if (Industries.hasOwnProperty(key)) { var ind = Industries[key]; - selector.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + selector.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { text: ind, value:key, })); @@ -41191,7 +41202,7 @@ Corporation.prototype.selectHeaderTab = function(currentTab) { Corporation.prototype.createDivisionUIHeaderTab = function(division) { var tabId = "cmpy-mgmt-" + division.name + "-tab"; - var tab = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("button", { + var tab = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:tabId, class:"cmpy-mgmt-header-tab", innerText:division.name, @@ -41232,7 +41243,7 @@ Corporation.prototype.updateUIContent = function() { Corporation.prototype.displayCorporationOverviewContent = function() { this.clearUIPanel(); - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { id:"cmpy-mgmt-overview-text", })); if (headerTabs && headerTabs.length >= 1) { @@ -41242,19 +41253,19 @@ Corporation.prototype.displayCorporationOverviewContent = function() { //Investors if (this.public) { //Sell share buttons - var sellShares = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var sellShares = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button tooltip", innerText:"Sell Shares", display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-sell-shares-popup"; var currentStockPrice = this.sharePrice; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the number of shares you would like to sell. The current price of your " + - "company's stock is " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a"), + "company's stock is " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a"), }); - var profitIndicator = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); - var input = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var profitIndicator = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); + var input = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Shares to sell", inputListener: ()=> { @@ -41265,43 +41276,43 @@ Corporation.prototype.displayCorporationOverviewContent = function() { profitIndicator.innerText = "You don't have this many shares to sell!"; } else { profitIndicator.innerText = "Sell " + numShares + " shares for a total of " + - __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); } } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Sell shares", display:"inline-block", clickListener:()=>{ var shares = Math.round(input.value); if (isNaN(shares)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); } else if (shares > this.numShares) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You don't have this many shares to sell"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: You don't have this many shares to sell"); } else { this.numShares -= shares; this.issuedShares += shares; - Player.gainMoney(shares * this.sharePrice); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + __WEBPACK_IMPORTED_MODULE_2__Player_js__["a" /* Player */].gainMoney(shares * this.sharePrice); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", display:"inline-block", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, profitIndicator, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, profitIndicator, input, confirmBtn, cancelBtn]); } }); - var sellSharesTooltip = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("span", { + var sellSharesTooltip = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"tooltiptext", innerText:"Sell your shares in the company. This is the only way to " + "profit from your business venture.", @@ -41309,19 +41320,19 @@ Corporation.prototype.displayCorporationOverviewContent = function() { sellShares.appendChild(sellSharesTooltip); //Buyback shares button - var buybackShares = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var buybackShares = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button tooltip", innerText:"Buyback shares", display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-buyback-shares-popup"; var currentStockPrice = this.sharePrice; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML: "Enter the number of shares you would like to buy back at market price. The current price of your " + - "company's stock is " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a"), + "company's stock is " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(currentStockPrice).format("$0.000a"), }); - var costIndicator = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); - var input = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var costIndicator = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); + var input = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Shares to sell", inputListener: ()=> { @@ -41334,43 +41345,43 @@ Corporation.prototype.displayCorporationOverviewContent = function() { "There are only " + this.issuedShares + " outstanding shares."; } else { costIndicator.innerText = "Purchase " + numShares + " shares for a total of " + - __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(numShares * currentStockPrice).format('$0.000a'); } } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Sell shares", display:"inline-block", clickListener:()=>{ var shares = Math.round(input.value); if (isNaN(shares)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: Invalid value for number of shares"); } else if (shares > this.issuedShares) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: There are not this many oustanding shares to buy back"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("ERROR: There are not this many oustanding shares to buy back"); } else { this.numShares += shares; this.issuedShares -= shares; //TODO REMOVE from Player money - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", display:"inline-block", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, costIndicator, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, costIndicator, input, confirmBtn, cancelBtn]); } }); - var buybackSharesTooltip = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("span", { + var buybackSharesTooltip = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"tooltiptext", innerText:"Buy back shares you that previously issued or sold at market " + "price." @@ -41380,7 +41391,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { companyManagementPanel.appendChild(sellShares); companyManagementPanel.appendChild(buybackShares); } else { - var findInvestors = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var findInvestors = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class: this.fundingRound >= 4 ? "a-link-button-inactive" : "a-link-button tooltip", innerText: "Find Investors", display:"inline-block", @@ -41388,14 +41399,14 @@ Corporation.prototype.displayCorporationOverviewContent = function() { this.getInvestment(); } }); - var findInvestorsTooltip = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("span", { + var findInvestorsTooltip = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"tooltiptext", innerText:"Search for private investors who will give you startup funding in exchange " + "for equity (stock shares) in your company" }); findInvestors.appendChild(findInvestorsTooltip); - var goPublic = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var goPublic = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button tooltip", innerText:"Go Public", display:"inline-block", @@ -41404,7 +41415,7 @@ Corporation.prototype.displayCorporationOverviewContent = function() { return false; } }); - var goPublicTooltip = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("span", { + var goPublicTooltip = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("span", { class:"tooltiptext", innerText: "Become a publicly traded and owned entity. Going public involves " + "issuing shares for an IPO. Once you are a public company, " + @@ -41422,10 +41433,10 @@ Corporation.prototype.displayCorporationOverviewContent = function() { //Don't show upgrades if player hasn't opened any divisions if (this.divisions.length <= 0) {return; } //Corporation Upgrades - var upgradeContainer = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var upgradeContainer = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-upgrade-container", }); - upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("h1", { + upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("h1", { innerText:"Upgrades", margin:"6px", padding:"6px", })); @@ -41447,12 +41458,12 @@ Corporation.prototype.displayCorporationOverviewContent = function() { return; } - upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + upgradeContainer.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-upgrade-div", - innerHTML:upgrade[2] + " - " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(upgrade[1]).format("$0.000a") + "

" + upgrade[3], + innerHTML:upgrade[2] + " - " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(upgrade[1]).format("$0.000a") + "

" + upgrade[3], clickListener:()=>{ if (corp.funds.lt(upgrade[1])) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Insufficient funds"); } else { corp.unlock(upgrade); corp.displayCorporationOverviewContent(); @@ -41500,19 +41511,19 @@ Corporation.prototype.updateCorporationOverviewContent = function() { return; } var totalFunds = this.funds, - totalRevenue = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0), - totalExpenses = new __WEBPACK_IMPORTED_MODULE_2__utils_decimal_js___default.a(0); + totalRevenue = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0), + totalExpenses = new __WEBPACK_IMPORTED_MODULE_3__utils_decimal_js___default.a(0); var profit = this.revenue.minus(this.expenses).toNumber(), - profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); + profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); - var txt = "Total Funds: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(totalFunds.toNumber()).format('$0.000a') + "
" + - "Total Revenue: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(this.revenue.toNumber()).format("$0.000a") + " / s
" + - "Total Expenses: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(this.expenses.toNumber()).format("$0.000a") + "/ s
" + + var txt = "Total Funds: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(totalFunds.toNumber()).format('$0.000a') + "
" + + "Total Revenue: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(this.revenue.toNumber()).format("$0.000a") + " / s
" + + "Total Expenses: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(this.expenses.toNumber()).format("$0.000a") + "/ s
" + "Total Profits: " + profitStr + " / s
" + "Publicly Traded: " + (this.public ? "Yes" : "No") + "
" + - "Owned Stock Shares: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(this.numShares).format('0.000a') + "
" + - "Stock Price: " + (this.public ? "$" + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sharePrice, 2) : "N/A") + "
"; + "Owned Stock Shares: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(this.numShares).format('0.000a') + "
" + + "Stock Price: " + (this.public ? "$" + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(this.sharePrice, 2) : "N/A") + "
"; p.innerHTML = txt; } @@ -41533,19 +41544,19 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } //Expand into new City button - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("button", { + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("button", { class:"cmpy-mgmt-city-tab", innerText:"Expand into new City", display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-expand-city-popup"; - var text = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var text = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText: "Would you like to expand into a new city by opening an office? " + - "This would cost " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(OfficeInitialCost).format('$0.000a'), + "This would cost " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(OfficeInitialCost).format('$0.000a'), }); - var citySelector = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var citySelector = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var cityName in division.offices) { if (division.offices.hasOwnProperty(cityName)) { if (!(division.offices[cityName] instanceof OfficeSpace)) { - citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + citySelector.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { text: cityName, value: cityName })); @@ -41553,69 +41564,69 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } } - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Confirm", class:"a-link-button", display:"inline-block", margin:"3px", clickListener:()=>{ var city = citySelector.options[citySelector.selectedIndex].value; if (this.funds.lt(OfficeInitialCost)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to open a new office!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to open a new office!"); } else { this.funds = this.funds.minus(OfficeInitialCost); - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Opened a new office in " + city + "!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Opened a new office in " + city + "!"); division.offices[city] = new OfficeSpace({ loc:city, size:OfficeInitialSize, }); this.displayDivisionContent(division, city); } - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Cancel", class:"a-link-button", display:"inline-block", margin:"3px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }) - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, citySelector, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, citySelector, confirmBtn, cancelBtn]); return false; } })); - companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break + companyManagementPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("br", {})); // Force line break //Left and right panels - var leftPanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var leftPanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-industry-left-panel" }); - var rightPanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + var rightPanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { class:"cmpy-mgmt-industry-right-panel" }); companyManagementPanel.appendChild(leftPanel); companyManagementPanel.appendChild(rightPanel); //Different sections (Overview, Employee/Office, and Warehouse) - industryOverviewPanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryOverviewPanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-industry-overview-panel", class:"cmpy-mgmt-industry-overview-panel" }); leftPanel.appendChild(industryOverviewPanel); - industryEmployeePanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryEmployeePanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-employee-panel", class:"cmpy-mgmt-employee-panel" }); leftPanel.appendChild(industryEmployeePanel); - industryWarehousePanel = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("div", { + industryWarehousePanel = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("div", { id:"cmpy-mgmt-warehouse-panel", class:"cmpy-mgmt-warehouse-panel" }); rightPanel.appendChild(industryWarehousePanel); //Industry overview text element - industryOverviewText = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); + industryOverviewText = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", {}); industryOverviewPanel.appendChild(industryOverviewText); //Industry Overview 'Create Product' button if applicable @@ -41668,17 +41679,17 @@ Corporation.prototype.displayDivisionContent = function(division, city) { "Investing money in marketing the product will help the product's sales."; //Create the button - industryOverviewPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryOverviewPanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:createProductButtonText, margin:"6px", display:"inline-block", clickListener:()=>{ var popupId = "cmpy-mgmt-create-product-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:createProductPopupText, }); - var designCity = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); + var designCity = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("select", {}); for (var cityName in division.offices) { if (division.offices[cityName] instanceof OfficeSpace) { - designCity.add(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("option", { + designCity.add(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("option", { value:cityName, text:cityName })); @@ -41692,19 +41703,19 @@ Corporation.prototype.displayDivisionContent = function(division, city) { } else if (division.type === Industries.RealEstate) { foo = "Property Name"; } - var productNameInput = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var productNameInput = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { placeholder:foo, }); - var lineBreak1 = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("br",{}); - var designInvestInput = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var lineBreak1 = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("br",{}); + var designInvestInput = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Design investment" }); - var marketingInvestInput = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var marketingInvestInput = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", placeholder:"Marketing investment" }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Develop Product", clickListener:()=>{ @@ -41713,13 +41724,13 @@ Corporation.prototype.displayDivisionContent = function(division, city) { var designInvest = parseFloat(designInvestInput.value), marketingInvest = parseFloat(marketingInvestInput.value); if (productNameInput.value == null || productNameInput.value === "") { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You must specify a name for your product!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You must specify a name for your product!"); } else if (isNaN(designInvest)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for design investment"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for design investment"); } else if (isNaN(marketingInvest)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for marketing investment"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value for marketing investment"); } else if (this.funds.lt(designInvest + marketingInvest)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to make this large of an investment"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to make this large of an investment"); } else { var product = new Product({ name:productNameInput.value.replace(/[<>]/g, ''), //Sanitize for HTMl elements @@ -41729,21 +41740,21 @@ Corporation.prototype.displayDivisionContent = function(division, city) { }); this.funds = this.funds.minus(designInvest + marketingInvest); division.products[product.name] = product; - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); } this.updateUIContent(); return false; } }) - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }) - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, designCity, productNameInput, lineBreak1, + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, designCity, productNameInput, lineBreak1, designInvestInput, marketingInvestInput, confirmBtn, cancelBtn]); } })); @@ -41755,7 +41766,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { console.log("ERROR: Current city for UI does not have an office space"); return; } - industryEmployeeText = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + industryEmployeeText = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { id: "cmpy-mgmt-employee-p", display:"block", innerHTML: "

Office Space


" + @@ -41766,7 +41777,7 @@ Corporation.prototype.displayDivisionContent = function(division, city) { }); industryEmployeePanel.appendChild(industryEmployeeText); - industryEmployeeHireButton = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeeHireButton = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Hire Employee", display:"inline-block", @@ -41778,123 +41789,123 @@ Corporation.prototype.displayDivisionContent = function(division, city) { industryEmployeePanel.appendChild(industryEmployeeHireButton); //Upgrade Office Size button - industryOfficeUpgradeSizeButton = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryOfficeUpgradeSizeButton = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Upgrade Office size", display:"inline-block", margin:"6px", clickListener:()=>{ var popupId = "cmpy-mgmt-upgrade-office-size-popup"; var upgradeCost = OfficeInitialCost * Math.pow(1.13, Math.round(office.size / OfficeInitialSize)); - var text = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var text = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerHTML:"Increase the size of your office space to fit " + OfficeInitialSize + - " more employees. This will cost " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), + " more employees. This will cost " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(upgradeCost).format('$0.000a'), }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", margin:"8px", innerText:"Upgrade Office Size", clickListener:()=>{ if (this.funds.lt(upgradeCost)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to purchase this upgrade!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to purchase this upgrade!"); } else { office.size += OfficeInitialSize; this.funds = this.funds.minus(upgradeCost); - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Office space increased! It can now hold " + office.size + " employees"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Office space increased! It can now hold " + office.size + " employees"); this.updateUIContent(); } - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", innerText:"Cancel", display:"inline-block", margin:"8px", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }) - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [text, confirmBtn, cancelBtn]); return false; } }); industryEmployeePanel.appendChild(industryOfficeUpgradeSizeButton); //Throw Office Party - industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("br",{})); - industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("br",{})); + industryEmployeePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Throw Office Party", tooltip:"Throw an office party to increase your employee's morale and happiness", clickListener:()=>{ var popupId = "cmpy-mgmt-throw-office-party-popup"; - var txt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var txt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Enter the amount of money you would like to spend PER EMPLOYEE " + "on this office party" }); - var totalCostTxt = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("p", { + var totalCostTxt = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("p", { innerText:"Throwing this party will cost a total of $0" }); - var input = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("input", { + var input = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("input", { type:"number", inputListener:()=>{ if (isNaN(input.value) || input.value < 0) { totalCostTxt.innerText = "Invalid value entered!" } else { var totalCost = input.value * office.employees.length; - totalCostTxt.innerText = "Throwing this party will cost a total of " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(totalCost).format('$0.000a'); + totalCostTxt.innerText = "Throwing this party will cost a total of " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(totalCost).format('$0.000a'); } } }); - var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var confirmBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Throw Party", clickListener:()=>{ if (isNaN(input.value) || input.value < 0) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("Invalid value entered"); } else { var totalCost = input.value * office.employees.length; if (this.funds.lt(totalCost)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to throw this party!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You don't have enough company funds to throw this party!"); } else { this.funds = this.funds.minus(totalCost); var mult; for (var fooit = 0; fooit < office.employees.length; ++fooit) { mult = office.employees[fooit].throwParty(input.value); } - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You threw a party for the office! The morale and happiness " + - "of each employee increased by " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])((mult-1) * 100, 2) + "%."); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You threw a party for the office! The morale and happiness " + + "of each employee increased by " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])((mult-1) * 100, 2) + "%."); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); } } return false; } }); - var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + var cancelBtn = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { class:"a-link-button", display:"inline-block", innerText:"Cancel", clickListener:()=>{ - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(popupId); return false; } }); - Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, totalCostTxt, input, confirmBtn, cancelBtn]); + Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["g" /* createPopup */])(popupId, [txt, totalCostTxt, input, confirmBtn, cancelBtn]); } })); //Employee list - var industryEmployeeList = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("ul", { + var industryEmployeeList = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("ul", { id:"cmpy-mgmt-employee-ul" }); industryEmployeePanel.appendChild(industryEmployeeList); for (var i = 0; i < office.employees.length; ++i) { (function() { var emp = office.employees[i]; - var li = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["e" /* createAccordionElement */])({ + var li = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["e" /* createAccordionElement */])({ id:"cmpy-mgmt-employee-" + emp.name, hdrText:emp.name, }); @@ -41913,12 +41924,12 @@ Corporation.prototype.displayDivisionContent = function(division, city) { if (warehouse instanceof Warehouse) { warehouse.createUI({industry:division, company: this}); } else { - industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("a", { + industryWarehousePanel.appendChild(Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("a", { innerText:"Purchase Warehouse ($5b)", class: "a-link-button", clickListener:()=>{ if (this.funds.lt(WarehouseInitialCost)) { - Object(__WEBPACK_IMPORTED_MODULE_3__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You do not have enough funds to do this!"); + Object(__WEBPACK_IMPORTED_MODULE_4__utils_DialogBox_js__["a" /* dialogBoxCreate */])("You do not have enough funds to do this!"); } else { division.warehouses[currentCityUi] = new Warehouse({ loc:currentCityUi, @@ -41941,18 +41952,18 @@ Corporation.prototype.updateDivisionContent = function(division) { } //Industry Overview Text var profit = division.lastCycleRevenue.minus(division.lastCycleExpenses).toNumber(), - profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); + profitStr = profit >= 0 ? __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(profit).format("$0.000a") : "-" + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(-1 * profit).format("$0.000a"); industryOverviewText.innerHTML = "Industry: " + division.type + "

" + "Awareness: " + division.awareness + "
" + "Popularity: " + division.popularity + "

" + - "Revenue: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(division.lastCycleRevenue.toNumber()).format("$0.000a") + " / s
" + - "Expenses: " + __WEBPACK_IMPORTED_MODULE_6__utils_numeral_min_js___default()(division.lastCycleExpenses.toNumber()).format("$0.000a") + " /s
" + + "Revenue: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(division.lastCycleRevenue.toNumber()).format("$0.000a") + " / s
" + + "Expenses: " + __WEBPACK_IMPORTED_MODULE_7__utils_numeral_min_js___default()(division.lastCycleExpenses.toNumber()).format("$0.000a") + " /s
" + "Profit: " + profitStr + " / s

" + - "

Production Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.prodMult, 2) + + "

Production Multiplier: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.prodMult, 2) + "Production gain from owning production-boosting materials " + "such as hardware, Robots, AI Cores, and Real Estate


" + - "Scientific Research: " + Object(__WEBPACK_IMPORTED_MODULE_7__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.sciResearch.qty, 3); + "Scientific Research: " + Object(__WEBPACK_IMPORTED_MODULE_8__utils_StringHelperFunctions_js__["c" /* formatNumber */])(division.sciResearch.qty, 3); //Office and Employee List var office = division.offices[currentCityUi]; @@ -41974,7 +41985,7 @@ Corporation.prototype.updateDivisionContent = function(division) { var emp = office.employees[i]; var panel = document.getElementById("cmpy-mgmt-employee-" + emp.name + "-panel"); if (panel == null) { - var li = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["e" /* createAccordionElement */])({ + var li = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["e" /* createAccordionElement */])({ id:"cmpy-mgmt-employee-" + emp.name, hdrText:emp.name, }); @@ -41996,7 +42007,7 @@ Corporation.prototype.updateDivisionContent = function(division) { } Corporation.prototype.createCityUITab = function(city, division) { - var tab = Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["f" /* createElement */])("button", { + var tab = Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["f" /* createElement */])("button", { id:"cmpy-mgmt-city-" + city + "-tab", class:"cmpy-mgmt-city-tab", innerText:city, @@ -42022,7 +42033,7 @@ Corporation.prototype.selectCityTab = function(activeTab, city) { Corporation.prototype.clearUI = function() { //Delete everything - if (companyManagementDiv != null) {Object(__WEBPACK_IMPORTED_MODULE_4__utils_HelperFunctions_js__["l" /* removeElementById */])(companyManagementDiv.id);} + if (companyManagementDiv != null) {Object(__WEBPACK_IMPORTED_MODULE_5__utils_HelperFunctions_js__["l" /* removeElementById */])(companyManagementDiv.id);} //Reset global DOM variables companyManagementDiv = null; @@ -42052,14 +42063,14 @@ Corporation.prototype.clearUI = function() { } Corporation.prototype.toJSON = function() { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Corporation", this); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["b" /* Generic_toJSON */])("Corporation", this); } Corporation.fromJSON = function(value) { - return Object(__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Corporation, value.data); + return Object(__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["a" /* Generic_fromJSON */])(Corporation, value.data); } -__WEBPACK_IMPORTED_MODULE_5__utils_JSONReviver_js__["c" /* Reviver */].constructors.Corporation = Corporation; +__WEBPACK_IMPORTED_MODULE_6__utils_JSONReviver_js__["c" /* Reviver */].constructors.Corporation = Corporation; diff --git a/src/CompanyManagement.js b/src/CompanyManagement.js index 463466906..8388d8f3d 100644 --- a/src/CompanyManagement.js +++ b/src/CompanyManagement.js @@ -1,5 +1,6 @@ import {Engine} from "./engine.js"; import {Locations} from "./Location.js"; +import {Player} from "./Player.js"; import Decimal from '../utils/decimal.js'; import {dialogBoxCreate} from "../utils/DialogBox.js"; diff --git a/src/Constants.js b/src/Constants.js index a2f9ad64a..96372cd80 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -525,6 +525,7 @@ let CONSTANTS = { "kill('foo.script', getHostname(), 1, 'foodnstuff');

" + "killall(hostname/ip)
Kills all running scripts on the specified server. This function takes a single argument which " + "must be a string containing the hostname or IP of the target server. This function will always return true.

" + + "exit()
Terminates the script immediately

" + "scp(script, [source], destination)
Copies a script or literature (.lit) file to another server. The first argument is a string with " + "the filename of the script or literature file " + "to be copied, or an array of filenames to be copied. The next two arguments are strings containing the hostname/IPs of the source and target server. " + @@ -648,7 +649,7 @@ let CONSTANTS = { "have purchased. It takes an optional parameter specifying whether the hostname or IP addresses will be returned. If this " + "parameter is not specified, it is true by default and hostnames will be returned

" + "round(n)
Rounds the number n to the nearest integer. If the argument passed in is not a number, then the function will return 0.

" + - "write(port, data='', mode='a')
This function can be used to either write data to a port or to a text file (.txt).

" + + "write(port/fn, data='', mode='a')
This function can be used to either write data to a port or to a text file (.txt).

" + "If the first argument is a number between 1 and 10, then it specifies a port and this function will write data to a port. If the second " + "argument is not specified then it will write an empty string to the port. The third argument, mode, is not used when writing data to a port.

" + "If the first argument is a string, then it specifies the name of a text file (.txt) and this function will write data to a text file. " + @@ -657,12 +658,15 @@ let CONSTANTS = { "mode which means that it will overwrite the existing data on the file, or it will create a new file if it does not already exist. Otherwise, " + "the data will be written in 'append' mode which means that the data will be added at the end of the existing file, or it will create a new file if it " + "does not already exist. If mode isn't specified then it will be 'a' for 'append' mode by default.

" + - "read(port)
This function is used to read data from a port or from a text file (.txt).

" + + "read(port/fn)
This function is used to read data from a port or from a text file (.txt).

" + "This function takes a single argument. If this argument is a number between 1 and 10, then it specifies a port and it will read data from " + "a port. A port is a serialized queue. This function will remove the first element from the queue and return it. If the queue is empty, " + "then the string 'NULL PORT DATA' will be returned.

" + "If the first argument is a string, then it specifies the name of a text file and this function will return the data in the " + "specified text file. If the text file does not exist, an empty string will be returned

" + + "clear(port/fn)
This function is used to clear a Netscript Port or a text file.

" + + "It takes a single argument. If this argument is a number between 1 and 10, then it specifies a port and will clear it (deleting all data from it). " + + "If the argument is a string, then it specifies the name of a text file (.txt) and will clear the text file so that it is empty.

" + "scriptRunning(scriptname, hostname/ip)
Returns a boolean indicating whether any instance of the specified script is running " + "on a server, regardless of its arguments. This is different than the isRunning() function because it does not " + "try to identify a specific instance of a running script by its arguments.

" + diff --git a/src/InteractiveTutorial.js b/src/InteractiveTutorial.js index fd95c28a6..e0596db28 100644 --- a/src/InteractiveTutorial.js +++ b/src/InteractiveTutorial.js @@ -648,7 +648,7 @@ function iTutorialEnd() { dialogBoxCreate("If you are new to the game, the following links may be useful for you!

" + "Getting Started Guide" + "Wiki

" + - "The Beginner's Guide to Hacking was added to your home computer! It contains stop tips/pointers for starting out with the game. " + + "The Beginner's Guide to Hacking was added to your home computer! It contains some tips/pointers for starting out with the game. " + "To read it, go to Terminal and enter

cat hackers-starting-handbook.lit"); Player.getHomeComputer().messages.push("hackers-starting-handbook.lit"); } diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 80cb7777c..d6c7de37f 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -1033,7 +1033,7 @@ function NetscriptFunctions(workerScript) { } else if (type.includes("stop") && type.includes("buy")) { orderType = OrderTypes.StopBuy; } else if (type.includes("stop") && type.includes("sell")) { - orderType = OrderType.StopSell; + orderType = OrderTypes.StopSell; } else { throw makeRuntimeRejectMsg(workerScript, "ERROR: Invalid Order Type passed into placeOrder()"); } @@ -1046,7 +1046,7 @@ function NetscriptFunctions(workerScript) { } else { throw makeRuntimeRejectMsg(workerScript, "ERROR: Invalid Position Type passed into placeOrder()"); } - params = { + var params = { stock: stock, shares: shares, price: price, diff --git a/src/Server.js b/src/Server.js index 840d84466..f431d7fe8 100644 --- a/src/Server.js +++ b/src/Server.js @@ -696,6 +696,11 @@ function prestigeHomeComputer(homeComp) { homeComp.ramUsed = 0; homeComp.programs.push(Programs.NukeProgram); + //Update RAM usage on all scripts + homeComp.scripts.forEach(function(script) { + script.updateRamUsage(); + }); + homeComp.messages.length = 0; homeComp.messages.push("hackers-starting-handbook.lit"); }