" +
+ "Starting cost: " + numeralFormat_1.numeralWrapper.format(exports.IndustryStartingCosts.Utilities, "$0.000a") + " " +
+ "Recommended starting Industry: NO",
+ Agriculture: "Cultive crops and breed livestock to produce food.
" +
+ "Starting cost: " + numeralFormat_1.numeralWrapper.format(exports.IndustryStartingCosts.Agriculture, "$0.000a") + " " +
+ "Recommended starting Industry: YES",
+ Fishing: "Produce food through the breeding and processing of fish and fish products
" +
+ "Starting cost: " + numeralFormat_1.numeralWrapper.format(exports.IndustryStartingCosts.Fishing, "$0.000a") + " " +
+ "Recommended starting Industry: NO",
+ Mining: "Extract and process metals from the earth.
" +
+ "Starting cost: " + numeralFormat_1.numeralWrapper.format(exports.IndustryStartingCosts.Mining, "$0.000a") + " " +
+ "Recommended starting Industry: NO",
+ Food: "Create your own restaurants all around the world.
MP: $" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.bCost, 2) +
+ "Market Price: The price you would pay if " +
+ "you were to buy this material on the market
" +
+ "
Quality: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.qlt, 2) +
+ "The quality of your material. Higher quality " +
+ "will lead to more sales
";
+
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: innerTxt,
+ id: "cmpy-mgmt-warehouse-" + matName + "-text", display:"inline-block",
+ }));
+
+ var buttonPanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ display:"inline-block",
+ });
+ div.appendChild(buttonPanel);
+
+ //Button to set purchase amount
+ var tutorial = industry.newInd && Object.keys(industry.reqMats).includes(mat.name) &&
+ mat.buy === 0 && mat.imp === 0;
+ var buyButtonParams = {
+ innerText: "Buy (" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.buy, 3) + ")", display:"inline-block",
+ class: tutorial ? "a-link-button flashing-button" : "a-link-button",
+ clickListener:()=>{
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: "Enter the amount of " + mat.name + " you would like " +
+ "to purchase per second. This material's cost changes constantly"
+ });
+ var confirmBtn;
+ var input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", value:mat.buy ? mat.buy : null, placeholder: "Purchase amount",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Confirm", class:"a-link-button",
+ clickListener:()=>{
+ if (isNaN(input.value)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid amount");
+ } else {
+ mat.buy = parseFloat(input.value);
+ if (isNaN(mat.buy)) {mat.buy = 0;}
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(purchasePopupId);
+ this.createUI(parentRefs);
+ return false;
+ }
+ }
+ });
+ var clearButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Clear Purchase", class:"a-link-button",
+ clickListener:()=>{
+ mat.buy = 0;
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(purchasePopupId);
+ this.createUI(parentRefs);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Cancel", class:"a-link-button",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(purchasePopupId);
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(purchasePopupId, [txt, input, confirmBtn, clearButton, cancelBtn]);
+ input.focus();
+ }
+ };
+ if (tutorial) {
+ buyButtonParams.tooltip = "Purchase your required materials to get production started!";
+ }
+ buttonPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", buyButtonParams));
+
+ //Button to manage exports
+ if (company.unlockUpgrades[0] === 1) { //Export unlock upgrade
+ function createExportPopup() {
+ var popupId = "cmpy-mgmt-export-popup";
+ var exportTxt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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 citySelector = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {class: "dropdown"});
+ var industrySelector = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {
+ class: "dropdown",
+ changeListener:()=>{
+ var industryName = industrySelector.options[industrySelector.selectedIndex].value;
+ for (var foo = 0; foo < company.divisions.length; ++foo) {
+ if (company.divisions[foo].name == industryName) {
+ Object(_utils_uiHelpers_clearSelector__WEBPACK_IMPORTED_MODULE_19__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ value:cityName, text:cityName,
+ }));
+ }
+ }
+ return;
+ }
+ }
+ }
+ });
+
+ for (var i = 0; i < company.divisions.length; ++i) {
+ industrySelector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ text:company.divisions[i].name, value:company.divisions[i].name,
+ })); //End create element option
+ } //End for
+
+ var currIndustry = industrySelector.options[industrySelector.selectedIndex].value;
+ for (var i = 0; i < company.divisions.length; ++i) {
+ if (company.divisions[i].name == currIndustry) {
+ 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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ value:cityName, text:cityName,
+ }));
+ }
+ }
+ break;
+ }
+ }
+
+ //Select amount to export
+ var exportAmount = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ class: "text-input",
+ placeholder:"Export amount / s"
+ });
+
+ var exportBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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 = exportAmount.value;
+ //Sanitize amt
+ var sanitizedAmt = amt.replace(/\s+/g, '');
+ sanitizedAmt = sanitizedAmt.replace(/[^-()\d/*+.MAX]/g, '');
+ var temp = sanitizedAmt.replace(/MAX/g, 1);
+ try {
+ temp = eval(temp);
+ } catch(e) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid expression entered for export amount: " + e);
+ return false;
+ }
+
+ if (temp == null || isNaN(temp)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid amount entered for export");
+ return;
+ }
+ var exportObj = {ind:industryName, city:cityName, amt:sanitizedAmt};
+ mat.exp.push(exportObj);
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block", innerText:"Cancel",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+
+ var currExportsText = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"cmpy-mgmt-existing-export",
+ innerHTML: "Industry: " + mat.exp[i].ind + " " +
+ "City: " + mat.exp[i].city + " " +
+ "Amount/s: " + mat.exp[i].amt,
+ clickListener:()=>{
+ mat.exp.splice(i, 1); //Remove export object
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ createExportPopup();
+ }
+ }));
+ })(i, mat, currExports);
+ }
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [exportTxt, industrySelector, citySelector, exportAmount,
+ exportBtn, cancelBtn, currExportsText].concat(currExports));
+ }
+ buttonPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Export", display:"inline-block", class:"a-link-button",
+ clickListener:()=>{createExportPopup();}
+ }));
+ }
+
+ buttonPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {})); // Force line break
+
+ //Button to set sell amount
+ var innerTextString;
+ if (mat.sllman[0]) {
+ innerTextString = (mat.sllman[1] === -1 ? "Sell (" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.sll, 3) + "/MAX)" :
+ "Sell (" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.sll, 3) + "/" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.sllman[1], 3) + ")");
+ if (mat.sCost) {
+ if (Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_26__["isString"])(mat.sCost)) {
+ var sCost = mat.sCost.replace(/MP/g, mat.bCost);
+ innerTextString += " @ $" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(eval(sCost), 2);
+ } else {
+ innerTextString += " @ $" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(mat.sCost, 2);
+ }
+ }
+ } else {
+ innerTextString = "Sell (0.000/0.000)";
+ }
+
+ buttonPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText: innerTextString, display:"inline-block", class:"a-link-button",
+ clickListener:()=>{
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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.
" +
+ "If the sell amount is set to 0, then the material will not be sold. If the sell price " +
+ "if set to 0, then the material will be discarded
" +
+ "Setting the sell amount to 'MAX' will result in you always selling the " +
+ "maximum possible amount of the material.
" +
+ "When setting the sell amount, you can use the 'PROD' variable to designate a dynamically " +
+ "changing amount that depends on your production. For example, if you set the sell amount " +
+ "to 'PROD-5' then you will always sell 5 less of the material than you produce.
" +
+ "When setting the sell price, you can use the 'MP' variable to designate a dynamically " +
+ "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 br = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {});
+ var confirmBtn;
+ var inputQty = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"text", marginTop:"4px",
+ value: mat.sllman[1] ? mat.sllman[1] : null, placeholder: "Sell amount",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ var inputPx = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"text", marginTop:"4px",
+ value: mat.sCost ? mat.sCost : null, placeholder: "Sell price",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Confirm", class:"a-link-button", margin:"6px",
+ clickListener:()=>{
+ //Parse price
+ var cost = inputPx.value.replace(/\s+/g, '');
+ cost = cost.replace(/[^-()\d/*+.MP]/g, ''); //Sanitize cost
+ var temp = cost.replace(/MP/g, mat.bCost);
+ try {
+ temp = eval(temp);
+ } catch(e) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell price field: " + e);
+ return false;
+ }
+
+ if (temp == null || isNaN(temp)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell price field");
+ return false;
+ }
+
+ if (cost.includes("MP")) {
+ mat.sCost = cost; //Dynamically evaluated
+ } else {
+ mat.sCost = temp;
+ }
+
+ //Parse quantity
+ if (inputQty.value.includes("MAX") || inputQty.value.includes("PROD")) {
+ var qty = inputQty.value.replace(/\s+/g, '');
+ qty = qty.replace(/[^-()\d/*+.MAXPROD]/g, '');
+ var temp = qty.replace(/MAX/g, 1);
+ temp = temp.replace(/PROD/g, 1);
+ try {
+ temp = eval(temp);
+ } catch(e) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell price field: " + e);
+ return false;
+ }
+
+ if (temp == null || isNaN(temp)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell price field");
+ return false;
+ }
+
+ mat.sllman[0] = true;
+ mat.sllman[1] = qty; //Use sanitized input
+ } else if (isNaN(inputQty.value)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value for sell quantity field! Must be numeric or 'MAX'");
+ return false;
+ } else {
+ var qty = parseFloat(inputQty.value);
+ if (isNaN(qty)) {qty = 0;}
+ if (qty === 0) {
+ mat.sllman[0] = false;
+ mat.sllman[1] = 0;
+ } else {
+ mat.sllman[0] = true;
+ mat.sllman[1] = qty;
+ }
+ }
+
+ this.createUI(parentRefs);
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(sellPopupid);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Cancel", class:"a-link-button", margin: "6px",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(sellPopupid);
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(sellPopupid, [txt, br, inputQty, inputPx, confirmBtn, cancelBtn]);
+ inputQty.focus();
+ }
+ }));
+
+ // Button to use Market-TA research, if you have it
+ if (industry.hasResearch("Market-TA.I")) {
+ let marketTaClickListener = () => {
+ const popupId = "cmpy-mgmt-marketta-popup";
+ const markupLimit = mat.getMarkupLimit();
+ const ta1 = createElemenet("p", {
+ innerText: "The maximum sale price you can mark this up to is " +
+ _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(mat.bCost + markupLimit, '$0.000a') +
+ ". This means that if you set the sale price higher than this, " +
+ "you will begin to experience a loss in number of sales",
+ });
+
+ if (industry.hasResearch("Market-TA.II")) {
+ let updateTa2Text;
+ const ta2Text = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p");
+ const ta2Input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ marginTop: "4px",
+ onkeyup: (e) => {
+ e.preventDefault();
+ updateTa2Text();
+ },
+ type: "number",
+ value: mat.sCost,
+ });
+
+ // Function that updates the text in ta2Text element
+ updateTa2Text = () => {
+ const sCost = parseFloat(ta2Input.value);
+ let markup = 1;
+ if (sCost > mat.bCost) {
+ //Penalty if difference between sCost and bCost is greater than markup limit
+ if ((sCost - mat.bCost) > markupLimit) {
+ markup = Math.pow(markupLimit / (sCost - mat.bCost), 2);
+ }
+ } else if (sCost < mat.bCost) {
+ if (sCost <= 0) {
+ markup = 1e12; //Sell everything, essentially discard
+ } else {
+ //Lower prices than market increases sales
+ markup = mat.bCost / sCost;
+ }
+ }
+ ta2Text.innerText = `If you sell at ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(sCost, "$0.0001")}, ` +
+ `then you will sell ${Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(markup, 2)}x as much compared `
+ `to if you sold at market price.`;
+ }
+ updateTa2Text();
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [ta1, ta2Input, ta2Text]);
+ } else {
+ // Market-TA.I only
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [ta1]);
+ }
+ };
+
+ buttonPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: "a-link-button",
+ clickListener:() => { marketTaClickListener(); },
+ display: "inline-block",
+ innerText: "Market-TA",
+
+ }))
+ }
+
+ return div;
+}
+
+Warehouse.prototype.createProductUI = function(product, parentRefs) {
+ var company = parentRefs.company, industry = parentRefs.industry,
+ city = currentCityUi;
+ var div = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"cmpy-mgmt-warehouse-product-div"
+ });
+
+ //Products being designed TODO
+ if (!product.fin) {
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: "Designing " + product.name + "... " +
+ Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.prog, 2) + "% complete",
+ }));
+ return div;
+ }
+
+ //Completed products
+ var cmpAndDmdText = "";
+ if (company.unlockUpgrades[2] === 1) {
+ cmpAndDmdText += " Demand: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.dmd, 3);
+ }
+ if (company.unlockUpgrades[3] === 1) {
+ cmpAndDmdText += " Competition: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.cmp, 3);
+ }
+
+ var totalGain = product.data[city][1] - product.data[city][2]; //Production - sale
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: "
Est. Production Cost: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(product.pCost / ProductProductionCostRatio, "$0.000a") +
+ "An estimate of the material cost it takes to create this Product.
" +
+ "
Est. Market Price: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(product.pCost + product.rat / product.mku, "$0.000a") +
+ "An estimate of how much consumers are willing to pay for this product. " +
+ "Setting the sale price above this may result in less sales. Setting the sale price below this may result " +
+ "in more sales.
"
+ }));
+ var buttonPanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ display:"inline-block",
+ });
+ div.appendChild(buttonPanel);
+
+ //Sell button
+ var sellInnerTextString = (product.sllman[city][1] === -1 ? "Sell (" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.data[city][2], 3) + "/MAX)" :
+ "Sell (" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.data[city][2], 3) + "/" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.sllman[city][1], 3) + ")");
+ if (product.sCost) {
+ if (Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_26__["isString"])(product.sCost)) {
+ sellInnerTextString += (" @ " + product.sCost);
+ } else {
+ sellInnerTextString += (" @ " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(product.sCost, "$0.000a"));
+ }
+ }
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:sellInnerTextString, class:"a-link-button", display:"inline-block",margin:"6px",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-sell-product-popup";
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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.
" +
+ "If the sell amount is set to 0, then the product will not be sold. If the " +
+ "sell price is set to 0, then the product will be discarded.
" +
+ "Setting the sell amount to 'MAX' will result in you always selling the " +
+ "maximum possible amount of the material.
" +
+ "When setting the sell amount, you can use the 'PROD' variable to designate a " +
+ "dynamically changing amount that depends on your production. For example, " +
+ "if you set the sell amount to 'PROD-1' then you will always sell 1 less of " +
+ "the material than you produce.
" +
+ "When setting the sell price, you can use the 'MP' variable to set a " +
+ "dynamically changing price that depends on the Product's estimated " +
+ "market price. For example, if you set it to 'MP*5' then it " +
+ "will always be sold at five times the estimated market price.",
+ });
+ var confirmBtn;
+ var inputQty = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"text", value:product.sllman[city][1] ? product.sllman[city][1] : null, placeholder: "Sell amount",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ var inputPx = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"text", value: product.sCost ? product.sCost : null, placeholder: "Sell price",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Confirm",
+ clickListener:()=>{
+ //Parse price
+ if (inputPx.value.includes("MP")) {
+ //Dynamically evaluated quantity. First test to make sure its valid
+ //Sanitize input, then replace dynamic variables with arbitrary numbers
+ var price = inputPx.value.replace(/\s+/g, '');
+ price = price.replace(/[^-()\d/*+.MP]/g, '');
+ var temp = price.replace(/MP/g, 1);
+ try {
+ temp = eval(temp);
+ } catch(e) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell quantity field: " + e);
+ return false;
+ }
+ if (temp == null || isNaN(temp)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell quantity field.");
+ return false;
+ }
+ product.sCost = price; //Use sanitized price
+ } else {
+ var cost = parseFloat(inputPx.value);
+ if (isNaN(cost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value for sell price field");
+ return false;
+ }
+ product.sCost = cost;
+ }
+
+ //Parse quantity
+ if (inputQty.value.includes("MAX") || inputQty.value.includes("PROD")) {
+ //Dynamically evaluated quantity. First test to make sure its valid
+ var qty = inputQty.value.replace(/\s+/g, '');
+ qty = qty.replace(/[^-()\d/*+.MAXPROD]/g, '');
+ var temp = qty.replace(/MAX/g, 1);
+ temp = temp.replace(/PROD/g, 1);
+ try {
+ temp = eval(temp);
+ } catch(e) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell price field: " + e);
+ return false;
+ }
+
+ if (temp == null || isNaN(temp)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value or expression for sell price field");
+ return false;
+ }
+ product.sllman[city][0] = true;
+ product.sllman[city][1] = qty; //Use sanitized input
+ } else if (isNaN(inputQty.value)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value for sell quantity field! Must be numeric");
+ return false;
+ } else {
+ var qty = parseFloat(inputQty.value);
+ if (isNaN(qty)) {qty = 0;}
+ if (qty === 0) {
+ product.sllman[city][0] = false;
+ } else {
+ product.sllman[city][0] = true;
+ product.sllman[city][1] = qty;
+ }
+ }
+ this.createUI(parentRefs);
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Cancel",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, inputQty, inputPx, confirmBtn, cancelBtn]);
+ inputQty.focus();
+ }
+ }));
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br",{})); //force line break
+
+ //Limit production button
+ var limitProductionInnerText = "Limit Production";
+ if (product.prdman[city][0]) {
+ limitProductionInnerText += " (" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(product.prdman[city][1], 3) + ")";
+ }
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:limitProductionInnerText,display:"inline-block",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-limit-product-production-popup";
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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 confirmBtn;
+ var input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", placeholder:"Limit",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block", innerText:"Limit production", margin:'6px',
+ clickListener:()=>{
+ if (input.value === "") {
+ product.prdman[city][0] = false;
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ var qty = parseFloat(input.value);
+ if (isNaN(qty)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value entered");
+ return false;
+ }
+ if (qty < 0) {
+ product.prdman[city][0] = false;
+ } else {
+ product.prdman[city][0] = true;
+ product.prdman[city][1] = qty;
+ }
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block", innerText:"Cancel", margin:"6px",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, input, confirmBtn, cancelBtn]);
+ }
+ }));
+
+ //Discontinue button
+ div.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:'a-link-button', display:"inline-block",innerText:"Discontinue",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-discontinue-product-popup";
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",innerText:"Discontinue",
+ clickListener:()=>{
+ industry.discontinueProduct(product, parentRefs);
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Cancel",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, confirmBtn, cancelBtn]);
+ }
+ }));
+ return div;
+}
+
+Warehouse.prototype.toJSON = function() {
+ return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__["Generic_toJSON"])("Warehouse", this);
+}
+
+Warehouse.fromJSON = function(value) {
+ return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__["Generic_fromJSON"])(Warehouse, value.data);
+}
+
+_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__["Reviver"].constructors.Warehouse = Warehouse;
+
+function Corporation(params={}) {
+ this.name = params.name ? params.name : "The Corporation";
+
+ //A division/business sector is represented by the object:
+ this.divisions = [];
+
+ //Financial stats
+ this.funds = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](150e9);
+ this.revenue = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](0);
+ this.expenses = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](0);
+ this.fundingRound = 0;
+ this.public = false; //Publicly traded
+ this.numShares = TOTALSHARES;
+ this.dividendPercentage = 0;
+ this.dividendTaxPercentage = 50;
+ this.issuedShares = 0;
+ this.sharePrice = 0;
+ this.storedCycles = 0;
+
+ var numUnlockUpgrades = Object.keys(_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__["CorporationUnlockUpgrades"]).length,
+ numUpgrades = Object.keys(_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__["CorporationUpgrades"]).length;
+
+ this.unlockUpgrades = Array(numUnlockUpgrades).fill(0);
+ this.upgrades = Array(numUpgrades).fill(0);
+ this.upgradeMultipliers = Array(numUpgrades).fill(1);
+
+ this.state = new _CorporationState__WEBPACK_IMPORTED_MODULE_0__["CorporationState"]();
+}
+
+Corporation.prototype.getState = function() {
+ return this.state.getState();
+}
+
+Corporation.prototype.storeCycles = function(numCycles=1) {
+ this.storedCycles += numCycles;
+}
+
+Corporation.prototype.process = function() {
+ var corp = this;
+ if (this.storedCycles >= CyclesPerIndustryStateCycle) {
+ var state = this.getState(), marketCycles=1;
+ this.storedCycles -= (marketCycles * CyclesPerIndustryStateCycle);
+
+ //At the start of a new cycle, calculate profits from previous cycle
+ if (state === "START") {
+ this.revenue = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](0);
+ this.expenses = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](0);
+ this.divisions.forEach((ind) => {
+ if (ind.lastCycleRevenue === -Infinity || ind.lastCycleRevenue === Infinity) { return; }
+ if (ind.lastCycleExpenses === -Infinity || ind.lastCycleExpenses === Infinity) { return; }
+ this.revenue = this.revenue.plus(ind.lastCycleRevenue);
+ this.expenses = this.expenses.plus(ind.lastCycleExpenses);
+ });
+ var profit = this.revenue.minus(this.expenses);
+ const cycleProfit = profit.times(marketCycles * SecsPerMarketCycle);
+ if (isNaN(this.funds)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("There was an error calculating your Corporations funds and they got reset to 0. " +
+ "This is a bug. Please report to game developer.
" +
+ "(Your funds have been set to $150b for the inconvenience)");
+ this.funds = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](150e9);
+ }
+
+ // Process dividends
+ if (this.dividendPercentage > 0 && cycleProfit > 0) {
+ // Validate input again, just to be safe
+ if (isNaN(this.dividendPercentage) || this.dividendPercentage < 0 || this.dividendPercentage > DividendMaxPercentage) {
+ console.error(`Invalid Corporation dividend percentage: ${this.dividendPercentage}`);
+ } else {
+ const totalDividends = (this.dividendPercentage / 100) * cycleProfit;
+ const retainedEarnings = cycleProfit - totalDividends;
+ const dividendsPerShare = totalDividends / TOTALSHARES;
+ _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].gainMoney(this.numShares * dividendsPerShare * (this.dividendTaxPercentage / 100));
+ this.funds = this.funds.plus(retainedEarnings);
+ }
+ } else {
+ this.funds = this.funds.plus(cycleProfit);
+ }
+
+ this.updateSharePrice();
+ }
+
+ this.divisions.forEach(function(ind) {
+ ind.process(marketCycles, state, corp);
+ });
+
+
+ this.state.nextState();
+
+ if (_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_17__["routing"].isOn(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_17__["Page"].Corporation)) {this.updateUIContent();}
+ }
+}
+
+Corporation.prototype.determineValuation = function() {
+ var val, profit = (this.revenue.minus(this.expenses)).toNumber();
+ if (this.public) {
+ // Account for dividends
+ if (this.dividendPercentage > 0) {
+ profit *= ((100 - this.dividendPercentage) / 100);
+ }
+
+ val = this.funds.toNumber() + (profit * 85e3);
+ val *= (Math.pow(1.1, this.divisions.length));
+ val = Math.max(val, 0);
+ } else {
+ val = 10e9 + Math.max(this.funds.toNumber(), 0) / 3; //Base valuation
+ if (profit > 0) {
+ val += (profit * 300e3);
+ val *= (Math.pow(1.1, this.divisions.length));
+ } else {
+ val = 10e9 * Math.pow(1.1, this.divisions.length);
+ }
+ val -= (val % 1e6); //Round down to nearest millionth
+ }
+ return val * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_10__["BitNodeMultipliers"].CorporationValuation;
+}
+
+Corporation.prototype.getInvestment = function() {
+ var val = this.determineValuation(), percShares;
+ switch (this.fundingRound) {
+ case 0: //Seed
+ percShares = 0.10;
+ break;
+ case 1: //Series A
+ percShares = 0.35;
+ break;
+ case 2: //Series B
+ percShares = 0.25;
+ break;
+ case 3: //Series C
+ percShares = 0.20;
+ break;
+ case 4:
+ return;
+ }
+ var funding = val * percShares * 4,
+ investShares = Math.floor(TOTALSHARES * percShares),
+ yesBtn = Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_30__[/* yesNoBoxGetYesButton */ "d"])(),
+ noBtn = Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_30__[/* yesNoBoxGetNoButton */ "c"])();
+ yesBtn.innerHTML = "Accept";
+ noBtn.innerHML = "Reject";
+ yesBtn.addEventListener("click", ()=>{
+ ++this.fundingRound;
+ this.funds = this.funds.plus(funding);
+ this.numShares -= investShares;
+ this.displayCorporationOverviewContent();
+ return Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_30__[/* yesNoBoxClose */ "a"])();
+ });
+ noBtn.addEventListener("click", ()=>{
+ return Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_30__[/* yesNoBoxClose */ "a"])();
+ });
+ Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_30__[/* yesNoBoxCreate */ "b"])("An investment firm has offered you " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(funding, '$0.000a') +
+ " in funding in exchange for a " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(percShares*100, "0.000a") +
+ "% stake in the company (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(investShares, '0.000a') + " shares).
" +
+ "Do you accept or reject this offer?
" +
+ "Hint: Investment firms will offer more money if your corporation is turning a profit");
+}
+
+Corporation.prototype.goPublic = function() {
+ var goPublicPopupId = "cmpy-mgmt-go-public-popup";
+ var initialSharePrice = this.determineValuation() / (TOTALSHARES);
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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. Your Corporation will receive " +
+ _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(initialSharePrice, '$0.000a') + " per share " +
+ "(the IPO money will be deposited directly into your Corporation's funds).
" +
+ "Furthermore, issuing more shares now will help drive up " +
+ "your company's stock price in the future.
" +
+ "You have a total of " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(this.numShares, "0.000a") + " of shares that you can issue.",
+ });
+ var yesBtn;
+ var input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number",
+ placeholder: "Shares to issue",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {yesBtn.click();}
+ }
+ });
+ var br = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {});
+ yesBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ innerText:"Go Public",
+ clickListener:()=>{
+ var numShares = Math.round(input.value);
+ var initialSharePrice = this.determineValuation() / (TOTALSHARES);
+ if (isNaN(numShares)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value for number of issued shares");
+ return false;
+ }
+ if (numShares > this.numShares) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Error: You don't have that many shares to issue!");
+ return false;
+ }
+ this.public = true;
+ this.sharePrice = initialSharePrice;
+ this.issuedShares = numShares;
+ this.numShares -= numShares;
+ this.funds = this.funds.plus(numShares * initialSharePrice);
+ this.displayCorporationOverviewContent();
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(goPublicPopupId);
+ return false;
+ }
+ });
+ var noBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ innerText:"Cancel",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(goPublicPopupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(goPublicPopupId, [txt, br, input, yesBtn, noBtn]);
+}
+
+Corporation.prototype.updateSharePrice = function() {
+ var targetPrice = this.determineValuation() / (TOTALSHARES - this.issuedShares);
+ if (this.sharePrice <= targetPrice) {
+ this.sharePrice *= (1 + (Math.random() * 0.01));
+ } else {
+ this.sharePrice *= (1 - (Math.random() * 0.01));
+ }
+ if (this.sharePrice <= 0.01) {this.sharePrice = 0.01;}
+}
+
+//One time upgrades that unlock new features
+Corporation.prototype.unlock = function(upgrade) {
+ var upgN = upgrade[0], price = upgrade[1];
+ while (this.unlockUpgrades.length <= upgN) {
+ this.unlockUpgrades.push(0);
+ }
+ if (this.funds.lt(price)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough funds to unlock this!");
+ return;
+ }
+ this.unlockUpgrades[upgN] = 1;
+ this.funds = this.funds.minus(price);
+}
+
+//Levelable upgrades
+Corporation.prototype.upgrade = function(upgrade) {
+ var upgN = upgrade[0], basePrice = upgrade[1], priceMult = upgrade[2],
+ upgradeAmt = upgrade[3]; //Amount by which the upgrade multiplier gets increased (additive)
+ while (this.upgrades.length <= upgN) {this.upgrades.push(0);}
+ while (this.upgradeMultipliers.length <= upgN) {this.upgradeMultipliers.push(1);}
+ var totalCost = basePrice * Math.pow(priceMult, this.upgrades[upgN]);
+ if (this.funds.lt(totalCost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough funds to purchase this!");
+ return;
+ }
+ ++this.upgrades[upgN];
+ this.funds = this.funds.minus(totalCost);
+
+ //Increase upgrade multiplier
+ this.upgradeMultipliers[upgN] = 1 + (this.upgrades[upgN] * upgradeAmt);
+
+ //If storage size is being updated, update values in Warehouse objects
+ if (upgN === 1) {
+ for (var i = 0; i < this.divisions.length; ++i) {
+ var industry = this.divisions[i];
+ for (var city in industry.warehouses) {
+ if (industry.warehouses.hasOwnProperty(city) && industry.warehouses[city] instanceof Warehouse) {
+ industry.warehouses[city].updateSize(this, industry);
+ }
+ }
+ }
+ }
+
+ this.updateCorporationOverviewContent();
+}
+
+Corporation.prototype.getProductionMultiplier = function() {
+ var mult = this.upgradeMultipliers[0];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getStorageMultiplier = function() {
+ var mult = this.upgradeMultipliers[1];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getDreamSenseGain = function() {
+ var gain = this.upgradeMultipliers[2] - 1;
+ return gain <= 0 ? 0 : gain;
+}
+
+Corporation.prototype.getAdvertisingMultiplier = function() {
+ var mult = this.upgradeMultipliers[3];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getEmployeeCreMultiplier = function() {
+ var mult = this.upgradeMultipliers[4];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getEmployeeChaMultiplier = function() {
+ var mult = this.upgradeMultipliers[5];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getEmployeeIntMultiplier = function() {
+ var mult = this.upgradeMultipliers[6];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getEmployeeEffMultiplier = function() {
+ var mult = this.upgradeMultipliers[7];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getSalesMultiplier = function() {
+ var mult = this.upgradeMultipliers[8];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+Corporation.prototype.getScientificResearchMultiplier = function() {
+ var mult = this.upgradeMultipliers[9];
+ if (isNaN(mult) || mult < 1) {return 1;} else {return mult;}
+}
+
+//Keep 'global' variables for DOM elements so we don't have to search
+//through the DOM tree repeatedly when updating UI
+var companyManagementDiv, companyManagementHeaderTabs, companyManagementPanel,
+ currentCityUi,
+ corporationUnlockUpgrades, corporationUpgrades,
+
+ //Industry Overview Panel
+ industryOverviewPanel, industryOverviewText,
+
+ //Industry Employee Panel
+ industryEmployeePanel, industryEmployeeText, industryEmployeeHireButton, industryEmployeeAutohireButton,
+ industryEmployeeManagementUI, industryEmployeeInfo, industryIndividualEmployeeInfo,
+ industryOfficeUpgradeSizeButton,
+
+ //Industry Warehouse Panel
+ industryWarehousePanel, industrySmartSupplyCheckbox, industryWarehouseStorageText,
+ industryWarehouseUpgradeSizeButton, industryWarehouseStateText,
+ industryWarehouseMaterials, industryWarehouseProducts,
+
+ // Research Tree
+ researchTreeBoxOpened = false,
+ researchTreeBox,
+
+ // Tabs
+ headerTabs, cityTabs;
+Corporation.prototype.createUI = function() {
+ companyManagementDiv = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ id:"cmpy-mgmt-container",
+ position:"fixed",
+ class:"generic-menupage-container"
+ });
+ companyManagementHeaderTabs = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {id:"cmpy-mgmt-panel"});
+ companyManagementDiv.appendChild(companyManagementPanel);
+ document.getElementById("entire-game-container").appendChild(companyManagementDiv);
+
+ this.displayCorporationOverviewContent();
+}
+
+Corporation.prototype.updateUIHeaderTabs = function() {
+ if (companyManagementHeaderTabs) {
+ Object(_utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_27__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("button", {
+ id:"cmpy-mgmt-company-tab",
+ class:"cmpy-mgmt-header-tab",
+ innerText:this.name,
+ checked:true,
+ clickListener:()=>{
+ this.selectHeaderTab(cmpyOverviewHdrTab);
+ this.displayCorporationOverviewContent();
+ return false;
+ }
+ });
+ companyManagementHeaderTabs.appendChild(cmpyOverviewHdrTab);
+
+ //Tabs for each division
+ for (var i = 0; i < this.divisions.length; ++i) {
+ this.createDivisionUIHeaderTab(this.divisions[i]);
+ }
+
+ //Create a tab to expand into a new industry
+ companyManagementHeaderTabs.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"popup-box-container",
+ id:"cmpy-mgmt-expand-industry-popup",
+ });
+ var content = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {class:"popup-box-content"});
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: "Create a new division to expand into a new industry:",
+ });
+ var selector = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {
+ class:"dropdown"
+ });
+ var industryDescription = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {});
+ var yesBtn;
+ var nameInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"text",
+ id:"cmpy-mgmt-expand-industry-name-input",
+ class: "text-input",
+ display:"block",
+ maxLength: 30,
+ pattern:"[a-zA-Z0-9-_]",
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {yesBtn.click();}
+ }
+ });
+ var nameLabel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("label", {
+ for:"cmpy-mgmt-expand-industry-name-input",
+ innerText:"Division name: "
+ });
+ yesBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("span", {
+ class:"popup-box-button",
+ innerText:"Create Division",
+ clickListener: ()=>{
+ var ind = selector.options[selector.selectedIndex].value,
+ newDivisionName = nameInput.value;
+
+ for (var i = 0; i < this.divisions.length; ++i) {
+ if (this.divisions[i].name === newDivisionName) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("This name is already in use!");
+ return false;
+ }
+ }
+ if (this.funds.lt(_IndustryData__WEBPACK_IMPORTED_MODULE_4__["IndustryStartingCosts"][ind])) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Not enough money to create a new division in this industry");
+ } else if (newDivisionName === "") {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("New division must have a name!");
+ } else {
+ this.funds = this.funds.minus(_IndustryData__WEBPACK_IMPORTED_MODULE_4__["IndustryStartingCosts"][ind]);
+ var newInd = new Industry({
+ name:newDivisionName,
+ type:ind,
+ });
+ this.divisions.push(newInd);
+ this.updateUIHeaderTabs();
+ this.selectHeaderTab(headerTabs[headerTabs.length-2]);
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])("cmpy-mgmt-expand-industry-popup");
+ this.displayDivisionContent(newInd, _Locations__WEBPACK_IMPORTED_MODULE_14__["Locations"].Sector12);
+ }
+ return false;
+ }
+ });
+ var noBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("span", {
+ class:"popup-box-button",
+ innerText:"Cancel",
+ clickListener: function() {
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])("cmpy-mgmt-expand-industry-popup");
+ return false;
+ }
+ });
+
+ //Make an object to keep track of what industries you're already in
+ var ownedIndustries = {}
+ for (var i = 0; i < this.divisions.length; ++i) {
+ ownedIndustries[this.divisions[i].type] = true;
+ }
+
+ //Add industry types to selector
+ //Have Agriculture be first as recommended option
+ if (!ownedIndustries["Agriculture"]) {
+ selector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ text:_IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"]["Agriculture"], value:"Agriculture"
+ }));
+ }
+
+ for (var key in _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"]) {
+ if (key !== "Agriculture" && _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].hasOwnProperty(key) && !ownedIndustries[key]) {
+ var ind = _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"][key];
+ selector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ text: ind,value:key,
+ }));
+ }
+ }
+
+ //Initial Industry Description
+ var ind = selector.options[selector.selectedIndex].value;
+ industryDescription.innerHTML = (_IndustryData__WEBPACK_IMPORTED_MODULE_4__["IndustryDescriptions"][ind] + "
");
+
+ //Change the industry description text based on selected option
+ selector.addEventListener("change", function() {
+ var ind = selector.options[selector.selectedIndex].value;
+ industryDescription.innerHTML = _IndustryData__WEBPACK_IMPORTED_MODULE_4__["IndustryDescriptions"][ind] + "
";
+ });
+
+ //Add to DOM
+ content.appendChild(txt);
+ content.appendChild(selector);
+ content.appendChild(industryDescription);
+ content.appendChild(nameLabel);
+ content.appendChild(nameInput);
+ content.appendChild(noBtn);
+ content.appendChild(yesBtn);
+ container.appendChild(content);
+ document.getElementById("entire-game-container").appendChild(container);
+ container.style.display = "flex";
+ return false;
+ }
+ }));
+
+ headerTabs = companyManagementDiv.getElementsByClassName("cmpy-mgmt-header-tab");
+}
+
+//Updates UI to display which header tab is selected
+Corporation.prototype.selectHeaderTab = function(currentTab) {
+ if (currentTab == null) {return;}
+ for (var i = 0; i < headerTabs.length; ++i) {
+ headerTabs[i].className = "cmpy-mgmt-header-tab";
+ }
+ currentTab.className = "cmpy-mgmt-header-tab current";
+}
+
+Corporation.prototype.createDivisionUIHeaderTab = function(division) {
+ var tabId = "cmpy-mgmt-" + division.name + "-tab";
+ var tab = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("button", {
+ id:tabId,
+ class:"cmpy-mgmt-header-tab",
+ innerText:division.name,
+ clickListener:()=>{
+ this.selectHeaderTab(tab);
+ this.displayDivisionContent(division, _Locations__WEBPACK_IMPORTED_MODULE_14__["Locations"].Sector12);
+ return false;
+ }
+ });
+ companyManagementHeaderTabs.appendChild(tab);
+}
+
+Corporation.prototype.clearUIPanel = function() {
+ while(companyManagementPanel.firstChild) {
+ companyManagementPanel.removeChild(companyManagementPanel.firstChild);
+ }
+}
+
+Corporation.prototype.updateUIContent = function() {
+ //Check which of the header tab buttons is checked
+ if (headerTabs == null) {
+ console.log("ERROR: headerTabs is null in Corporation.updateUIContent()");
+ return;
+ }
+ for (var i = 0; i < headerTabs.length; ++i) {
+ if (headerTabs[i].classList.contains("current")) {
+ if (i === 0) {
+ //Corporation overview
+ this.updateCorporationOverviewContent();
+ } else {
+ //Division
+ this.updateDivisionContent(this.divisions[i-1]);
+ }
+ return;
+ }
+ }
+}
+
+Corporation.prototype.displayCorporationOverviewContent = function() {
+ this.clearUIPanel();
+ companyManagementPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ id:"cmpy-mgmt-overview-text",
+ }));
+ if (headerTabs && headerTabs.length >= 1) {
+ this.selectHeaderTab(headerTabs[0]);
+ }
+
+ //Check if player has Corporation Handbook
+ var homeComp = _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].getHomeComputer(), hasHandbook = false,
+ handbookFn = "corporation-management-handbook.lit";
+ for (var i = 0; i < homeComp.messages.length; ++i) {
+ if (Object(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_26__["isString"])(homeComp.messages[i]) && homeComp.messages[i] === handbookFn) {
+ hasHandbook = true;
+ break;
+ }
+ }
+
+ companyManagementPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Getting Started Guide", display:"inline-block",
+ tooltip:"Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' " +
+ "This is a .lit file that guides you through the beginning of setting up a Corporation and " +
+ "provides some tips/pointers for helping you get started with managing it.",
+ clickListener:()=>{
+ if (!hasHandbook) {homeComp.messages.push(handbookFn);}
+ Object(_Literature__WEBPACK_IMPORTED_MODULE_13__[/* showLiterature */ "b"])(handbookFn);
+ return false;
+ }
+ }));
+
+ //Investors
+ if (this.public) {
+ //Sell share buttons
+ var sellShares = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Sell Shares", display:"inline-block",
+ tooltip: "Sell your shares in the company. The money earned from selling your " +
+ "shares goes into your personal account, not the Corporation's. " +
+ "This is one of the only ways to profit from your business venture.",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-sell-shares-popup";
+ var currentStockPrice = this.sharePrice;
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: "Enter the number of shares you would like to sell. The money from " +
+ "selling your shares will go directly to you (NOT your Corporation). " +
+ "The current price of your " +
+ "company's stock is " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(currentStockPrice, "$0.000a"),
+ });
+ var profitIndicator = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {});
+ var input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", placeholder:"Shares to sell", margin:"5px",
+ inputListener: ()=> {
+ var numShares = Math.round(input.value);
+ if (isNaN(numShares) || numShares <= 0) {
+ profitIndicator.innerText = "ERROR: Invalid value entered for number of shares to sell"
+ } else if (numShares > this.numShares) {
+ profitIndicator.innerText = "You don't have this many shares to sell!";
+ } else {
+ profitIndicator.innerText = "Sell " + numShares + " shares for a total of " +
+ _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(numShares * currentStockPrice, '$0.000a');
+ }
+ }
+ });
+ var confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Sell shares", display:"inline-block",
+ clickListener:()=>{
+ var shares = Math.round(input.value);
+ if (isNaN(shares) || shares <= 0) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: Invalid value for number of shares");
+ } else if (shares > this.numShares) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: You don't have this many shares to sell");
+ } else {
+ this.numShares -= shares;
+ if (isNaN(this.issuedShares)) {
+ console.log("ERROR: Corporation issuedShares is NaN: " + this.issuedShares);
+ console.log("Converting to number now");
+ var res = parseInt(this.issuedShares);
+ if (isNaN(res)) {
+ this.issuedShares = 0;
+ } else {
+ this.issuedShares = res;
+ }
+ }
+ this.issuedShares += shares;
+ _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].gainMoney(shares * this.sharePrice);
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Cancel", display:"inline-block",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, profitIndicator, input, confirmBtn, cancelBtn]);
+ }
+ });
+
+ //Buyback shares button
+ var buybackShares = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Buyback shares", display:"inline-block",
+ tooltip:"Buy back shares you that previously issued or sold at market price.",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-buyback-shares-popup";
+ var currentStockPrice = this.sharePrice;
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML: "Enter the number of shares you would like to buy back at market price. To purchase " +
+ "these shares, you must use your own money (NOT your Corporation's funds). " +
+ "The current price of your " +
+ "company's stock is " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(currentStockPrice, "$0.000a") +
+ ". Your company currently has " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(this.issuedShares, 3) + " outstanding stock shares",
+ });
+ var costIndicator = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {});
+ var input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", placeholder:"Shares to buyback", margin:"5px",
+ inputListener: ()=> {
+ var numShares = Math.round(input.value);
+ //TODO add conditional for if player doesn't have enough money
+ if (isNaN(numShares) || numShares <= 0) {
+ costIndicator.innerText = "ERROR: Invalid value entered for number of shares to buyback"
+ } else if (numShares > this.issuedShares) {
+ costIndicator.innerText = "There are not this many shares available to buy back. " +
+ "There are only " + this.issuedShares + " outstanding shares.";
+ } else {
+ console.log("here");
+ costIndicator.innerText = "Purchase " + numShares + " shares for a total of " +
+ _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(numShares * currentStockPrice, '$0.000a');
+ }
+ }
+ });
+ var confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Buy shares", display:"inline-block",
+ clickListener:()=>{
+ var shares = Math.round(input.value);
+ var tempStockPrice = this.sharePrice;
+ if (isNaN(shares) || shares <= 0) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: Invalid value for number of shares");
+ } else if (shares > this.issuedShares) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: There are not this many oustanding shares to buy back");
+ } else if (shares * tempStockPrice > _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].money) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: You do not have enough money to purchase this many shares (you need " +
+ _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(shares * tempStockPrice, "$0.000a") + ")");
+ } else {
+ this.numShares += shares;
+ if (isNaN(this.issuedShares)) {
+ console.log("ERROR: Corporation issuedShares is NaN: " + this.issuedShares);
+ console.log("Converting to number now");
+ var res = parseInt(this.issuedShares);
+ if (isNaN(res)) {
+ this.issuedShares = 0;
+ } else {
+ this.issuedShares = res;
+ }
+ }
+ this.issuedShares -= shares;
+ _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].loseMoney(shares * tempStockPrice);
+ //TODO REMOVE from Player money
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ }
+ return false;
+
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ innerText:"Cancel",
+ display:"inline-block",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, costIndicator, input, confirmBtn, cancelBtn]);
+ }
+ });
+
+ companyManagementPanel.appendChild(sellShares);
+ companyManagementPanel.appendChild(buybackShares);
+
+ //If your Corporation is big enough, buy faction influence through bribes
+ var canBribe = this.determineValuation() >= BribeThreshold;
+ var bribeFactions = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: canBribe ? "a-link-button" : "a-link-button-inactive",
+ innerText:"Bribe Factions", display:"inline-block",
+ tooltip:canBribe
+ ? "Use your Corporations power and influence to bribe Faction leaders in exchange for reputation"
+ : "Your Corporation is not powerful enough to bribe Faction leaders",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-bribe-factions-popup";
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation"
+ });
+ var factionSelector = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {margin:"3px"});
+ for (var i = 0; i < _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].factions.length; ++i) {
+ var facName = _Player__WEBPACK_IMPORTED_MODULE_15__[/* Player */ "a"].factions[i];
+ factionSelector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ text:facName, value:facName
+ }));
+ }
+ var repGainText = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p");
+ var stockSharesInput;
+ var moneyInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", placeholder:"Corporation funds", margin:"5px",
+ inputListener:()=>{
+ var money = moneyInput.value == null || moneyInput.value == "" ? 0 : parseFloat(moneyInput.value);
+ var stockPrice = this.sharePrice;
+ var stockShares = stockSharesInput.value == null || stockSharesInput.value == "" ? 0 : Math.round(parseFloat(stockSharesInput.value));
+ if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) {
+ repGainText.innerText = "ERROR: Invalid value(s) entered";
+ } else if (this.funds.lt(money)) {
+ repGainText.innerText = "ERROR: You do not have this much money to bribe with";
+ } else if (this.stockShares > this.numShares) {
+ repGainText.innerText = "ERROR: You do not have this many shares to bribe with";
+ } else {
+
+ var totalAmount = Number(money) + (stockShares * stockPrice);
+ var repGain = totalAmount / BribeToRepRatio;
+ repGainText.innerText = "You will gain " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(repGain, 0) +
+ " reputation with " +
+ factionSelector.options[factionSelector.selectedIndex].value +
+ " with this bribe";
+ }
+ }
+ });
+ stockSharesInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", placeholder:"Stock Shares", margin: "5px",
+ inputListener:()=>{
+ var money = moneyInput.value == null || moneyInput.value == "" ? 0 : parseFloat(moneyInput.value);
+ var stockPrice = this.sharePrice;
+ var stockShares = stockSharesInput.value == null || stockSharesInput.value == "" ? 0 : Math.round(stockSharesInput.value);
+ if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) {
+ repGainText.innerText = "ERROR: Invalid value(s) entered";
+ } else if (this.funds.lt(money)) {
+ repGainText.innerText = "ERROR: You do not have this much money to bribe with";
+ } else if (this.stockShares > this.numShares) {
+ repGainText.innerText = "ERROR: You do not have this many shares to bribe with";
+ } else {
+ var totalAmount = money + (stockShares * stockPrice);
+ var repGain = totalAmount / BribeToRepRatio;
+ console.log("repGain: " + repGain);
+ repGainText.innerText = "You will gain " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(repGain, 0) +
+ " reputation with " +
+ factionSelector.options[factionSelector.selectedIndex].value +
+ " with this bribe";
+ }
+ }
+ });
+ var confirmButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Bribe", display:"inline-block",
+ clickListener:()=>{
+ var money = moneyInput.value == null || moneyInput.value == "" ? 0 : parseFloat(moneyInput.value);
+ var stockPrice = this.sharePrice;
+ var stockShares = stockSharesInput.value == null || stockSharesInput.value == ""? 0 : Math.round(parseFloat(stockSharesInput.value));
+ var fac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_12__["Factions"][factionSelector.options[factionSelector.selectedIndex].value];
+ if (fac == null) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: You must select a faction to bribe");
+ return false;
+ }
+ if (isNaN(money) || isNaN(stockShares) || money < 0 || stockShares < 0) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: Invalid value(s) entered");
+ } else if (this.funds.lt(money)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: You do not have this much money to bribe with");
+ } else if (stockShares > this.numShares) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("ERROR: You do not have this many shares to bribe with");
+ } else {
+ var totalAmount = money + (stockShares * stockPrice);
+ var repGain = totalAmount / BribeToRepRatio;
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You gained " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(repGain, 0) +
+ " reputation with " + fac.name + " by bribing them.");
+ fac.playerReputation += repGain;
+ this.funds = this.funds.minus(money);
+ this.numShares -= stockShares;
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ }
+ });
+ var cancelButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Cancel", display:"inline-block",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, factionSelector, repGainText,
+ moneyInput, stockSharesInput, confirmButton, cancelButton]);
+ }
+ });
+ companyManagementPanel.appendChild(bribeFactions);
+
+ // Set Stock Dividends
+ const issueDividends = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: "a-link-button",
+ display: "inline-block",
+ innerText: "Issue Dividends",
+ tooltip: "Manage the dividends that are paid out to shareholders (including yourself)",
+ clickListener: () => {
+ const popupId = "cmpy-mgmt-issue-dividends-popup";
+ const descText = "Dividends are a distribution of a portion of the corporation's " +
+ "profits to the shareholders. This includes yourself, as well.
" +
+ "In order to issue dividends, simply allocate some percentage " +
+ "of your corporation's profits to dividends. This percentage must be an " +
+ `integer between 0 and ${DividendMaxPercentage}. (A percentage of 0 means no dividends will be ` +
+ "issued
" +
+ "Two important things to note: " +
+ " * Issuing dividends will negatively affect your corporation's stock price " +
+ " * Dividends are taxed. Taxes start at 50%, but can be decreased
" +
+ "Example: Assume your corporation makes $100m / sec in profit and you allocate " +
+ "40% of that towards dividends. That means your corporation will gain $60m / sec " +
+ "in funds and the remaining $40m / sec will be paid as dividends. Since your " +
+ "corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share " +
+ "per second before taxes.";
+ const txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", { innerHTML: descText, });
+
+ const dividendPercentInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ margin: "5px",
+ placeholder: "Dividend %",
+ type: "number",
+ });
+
+ const allocateBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("button", {
+ class: "std-button",
+ display: "inline-block",
+ innerText: "Allocate Dividend Percentage",
+ clickListener: () => {
+ const percentage = Math.round(parseInt(dividendPercentInput.value));
+ if (isNaN(percentage) || percentage < 0 || percentage > DividendMaxPercentage) {
+ return Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])(`Invalid value. Must be an integer between 0 and ${DividendMaxPercentage}`);
+ }
+
+ this.dividendPercentage = percentage;
+
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+
+ const cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("button", {
+ class: "std-button",
+ display: "inline-block",
+ innerText: "Cancel",
+ clickListener: () => {
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ })
+
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, dividendPercentInput, allocateBtn, cancelBtn]);
+ },
+ });
+ companyManagementPanel.appendChild(issueDividends);
+ } else {
+ var findInvestors = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: this.fundingRound >= 4 ? "a-link-button-inactive" : "a-link-button tooltip",
+ innerText: "Find Investors",
+ display:"inline-block",
+ clickListener:()=>{
+ this.getInvestment();
+ }
+ });
+ if (this.fundingRound < 4) {
+ var findInvestorsTooltip = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button tooltip",
+ innerText:"Go Public",
+ display:"inline-block",
+ clickListener:()=>{
+ this.goPublic();
+ return false;
+ }
+ });
+ var goPublicTooltip = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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, " +
+ "your shares will be traded on the stock market."
+ });
+ goPublic.appendChild(goPublicTooltip);
+
+ companyManagementPanel.appendChild(findInvestors);
+ companyManagementPanel.appendChild(goPublic);
+ }
+
+ //Update overview text
+ this.updateCorporationOverviewContent();
+
+ //Don't show upgrades if player hasn't opened any divisions
+ if (this.divisions.length <= 0) {return; }
+ //Corporation Upgrades
+ var upgradeContainer = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"cmpy-mgmt-upgrade-container",
+ });
+ upgradeContainer.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("h1", {
+ innerText:"Unlocks", margin:"6px", padding:"6px",
+ }));
+
+ //Unlock upgrades
+ var corp = this;
+ var numUnlockUpgrades = Object.keys(_data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__["CorporationUnlockUpgrades"]).length,
+ numUpgrades = Object.keys(_data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__["CorporationUpgrades"]).length;
+ if (this.unlockUpgrades == null || this.upgrades == null) { //Backwards compatibility
+ this.unlockUpgrades = Array(numUnlockUpgrades).fill(0);
+ this.upgrades = Array(numUpgrades).fill(0);
+ }
+ while (this.unlockUpgrades.length < numUnlockUpgrades) {this.unlockUpgrades.push(0);}
+ while (this.upgrades.length < numUpgrades) {this.upgrades.push(0);}
+ while (this.upgradeMultipliers < numUpgrades) {this.upgradeMultipliers.push(1);}
+
+ for (var i = 0; i < numUnlockUpgrades; ++i) {
+ (function(i, corp) {
+ if (corp.unlockUpgrades[i] === 0) {
+ var upgrade = _data_CorporationUnlockUpgrades__WEBPACK_IMPORTED_MODULE_1__["CorporationUnlockUpgrades"][i.toString()];
+ if (upgrade == null) {
+ console.log("ERROR: Could not find upgrade index " + i);
+ return;
+ }
+
+ upgradeContainer.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"cmpy-mgmt-upgrade-div", width:"45%",
+ innerHTML:upgrade[2] + " - " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(upgrade[1], "$0.000a"),
+ tooltip: upgrade[3],
+ clickListener:()=>{
+ if (corp.funds.lt(upgrade[1])) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Insufficient funds");
+ } else {
+ corp.unlock(upgrade);
+ corp.displayCorporationOverviewContent();
+ }
+ }
+ }));
+ }
+ })(i, corp);
+ }
+
+ //Levelable upgrades
+ upgradeContainer.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("h1", {
+ innerText:"Upgrades", margin:"6px", padding:"6px",
+ }));
+
+ for (var i = 0; i < numUpgrades; ++i) {
+ (function(i, corp) {
+ var upgrade = _data_CorporationUpgrades__WEBPACK_IMPORTED_MODULE_2__["CorporationUpgrades"][i.toString()];
+ if (upgrade == null) {
+ console.log("ERROR: Could not find levelable upgrade index " + i);
+ return;
+ }
+
+ var baseCost = upgrade[1], priceMult = upgrade[2];
+ var cost = baseCost * Math.pow(priceMult, corp.upgrades[i]);
+ upgradeContainer.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"cmpy-mgmt-upgrade-div", width:"45%",
+ innerHTML:upgrade[4] + " - " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(cost, "$0.000a"),
+ tooltip:upgrade[5],
+ clickListener:()=>{
+ if (corp.funds.lt(cost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Insufficient funds");
+ } else {
+ corp.upgrade(upgrade);
+ corp.displayCorporationOverviewContent();
+ }
+ }
+ }));
+ })(i, corp);
+ }
+
+ companyManagementPanel.appendChild(upgradeContainer);
+}
+
+Corporation.prototype.updateCorporationOverviewContent = function() {
+ var p = document.getElementById("cmpy-mgmt-overview-text");
+ if (p == null) {
+ console.log("WARNING: Could not find overview text elemtn in updateCorporationOverviewContent()");
+ return;
+ }
+ var totalFunds = this.funds,
+ totalRevenue = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](0),
+ totalExpenses = new decimal_js__WEBPACK_IMPORTED_MODULE_31__[/* default */ "a"](0);
+
+ // Formatted text for profit
+ var profit = this.revenue.minus(this.expenses).toNumber(),
+ profitStr = profit >= 0 ? _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(profit, "$0.000a") : "-" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(-1 * profit, "$0.000a");
+
+ // Formatted text for dividend information, if applicable
+ let dividendStr = "";
+ if (this.dividendPercentage > 0 && profit > 0) {
+ const totalDividends = (this.dividendPercentage / 100) * profit;
+ const retainedEarnings = profit - totalDividends;
+ const dividendsPerShare = totalDividends / TOTALSHARES;
+ const playerEarnings = this.numShares * dividendsPerShare;
+
+ dividendStr = `Retained Profits (after dividends): ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(retainedEarnings, "$0.000a")} / s ` +
+ `Dividends per share: ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(dividendsPerShare, "$0.000a")} / s ` +
+ `Your earnings (Pre-Tax): ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(playerEarnings, "$0.000a")} / s ` +
+ `Your earnings (Post-Tax): ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(playerEarnings * (this.dividendTaxPercentage / 100), "$0.000a")} / s `;
+ }
+
+ var txt = "Total Funds: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(totalFunds.toNumber(), '$0.000a') + " " +
+ "Total Revenue: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(this.revenue.toNumber(), "$0.000a") + " / s " +
+ "Total Expenses: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(this.expenses.toNumber(), "$0.000a") + "/ s " +
+ "Total Profits: " + profitStr + " / s " +
+ dividendStr +
+ "Publicly Traded: " + (this.public ? "Yes" : "No") + " " +
+ "Owned Stock Shares: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(this.numShares, '0.000a') + " " +
+ "Stock Price: " + (this.public ? "$" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(this.sharePrice, 2) : "N/A") + "
`;
+ }
+
+
+ var prodMult = this.getProductionMultiplier(),
+ storageMult = this.getStorageMultiplier(),
+ advMult = this.getAdvertisingMultiplier(),
+ empCreMult = this.getEmployeeCreMultiplier(),
+ empChaMult = this.getEmployeeChaMultiplier(),
+ empIntMult = this.getEmployeeIntMultiplier(),
+ empEffMult = this.getEmployeeEffMultiplier(),
+ salesMult = this.getSalesMultiplier(),
+ sciResMult = this.getScientificResearchMultiplier();
+ if (prodMult > 1) {txt += "Production Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(prodMult, 3) + " ";}
+ if (storageMult > 1) {txt += "Storage Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(storageMult, 3) + " ";}
+ if (advMult > 1) {txt += "Advertising Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(advMult, 3) + " ";}
+ if (empCreMult > 1) {txt += "Empl. Creativity Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(empCreMult, 3) + " ";}
+ if (empChaMult > 1) {txt += "Empl. Charisma Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(empChaMult, 3) + " ";}
+ if (empIntMult > 1) {txt += "Empl. Intelligence Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(empIntMult, 3) + " ";}
+ if (empEffMult > 1) {txt += "Empl. Efficiency Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(empEffMult, 3) + " ";}
+ if (salesMult > 1) {txt += "Sales Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(salesMult, 3) + " ";}
+ if (sciResMult > 1) {txt += "Scientific Research Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(sciResMult, 3) + " ";}
+ p.innerHTML = txt;
+}
+
+Corporation.prototype.displayDivisionContent = function(division, city) {
+ this.clearUIPanel();
+ currentCityUi = city;
+
+ //Add the city tabs on the left
+ for (var cityName in division.offices) {
+ if (division.offices[cityName] instanceof OfficeSpace) {
+ this.createCityUITab(cityName, division);
+ }
+ }
+ cityTabs = companyManagementPanel.getElementsByClassName("cmpy-mgmt-city-tab");
+ if (cityTabs.length > 0) {
+ this.selectCityTab(document.getElementById("cmpy-mgmt-city-" + city + "-tab"), city);
+ }
+
+ //Expand into new City button
+ companyManagementPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText: "Would you like to expand into a new city by opening an office? " +
+ "This would cost " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(OfficeInitialCost, '$0.000a'),
+ });
+ var citySelector = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {class: "dropdown", margin:"5px"});
+ for (var cityName in division.offices) {
+ if (division.offices.hasOwnProperty(cityName)) {
+ if (!(division.offices[cityName] instanceof OfficeSpace)) {
+ citySelector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ text: cityName,
+ value: cityName
+ }));
+ }
+ }
+ }
+
+ var confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["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(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough company funds to open a new office!");
+ } else {
+ this.funds = this.funds.minus(OfficeInitialCost);
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Opened a new office in " + city + "!");
+ division.offices[city] = new OfficeSpace({
+ loc:city,
+ size:OfficeInitialSize,
+ });
+ this.displayDivisionContent(division, city);
+ }
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Cancel", class:"a-link-button", display:"inline-block", margin:"3px",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ })
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [text, citySelector, confirmBtn, cancelBtn]);
+ return false;
+ }
+ }));
+ companyManagementPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {})); // Force line break
+
+ //Get office object
+ var office = division.offices[currentCityUi];
+ if (!(office instanceof OfficeSpace)) {
+ console.log("ERROR: Current city for UI does not have an office space");
+ return;
+ }
+
+ //Left and right panels
+ var leftPanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class: "cmpy-mgmt-industry-left-panel",
+ overflow: "visible",
+ padding: "2px",
+ });
+ var rightPanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class: "cmpy-mgmt-industry-right-panel",
+ overflow: "visible",
+ padding: "2px",
+ });
+ companyManagementPanel.appendChild(leftPanel);
+ companyManagementPanel.appendChild(rightPanel);
+
+ //Different sections (Overview, Employee/Office, and Warehouse)
+ industryOverviewPanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ id:"cmpy-mgmt-industry-overview-panel", class:"cmpy-mgmt-industry-overview-panel"
+ });
+ leftPanel.appendChild(industryOverviewPanel);
+
+ industryEmployeePanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ id:"cmpy-mgmt-employee-panel", class:"cmpy-mgmt-employee-panel"
+ });
+ leftPanel.appendChild(industryEmployeePanel);
+
+ industryWarehousePanel = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ id:"cmpy-mgmt-warehouse-panel", class:"cmpy-mgmt-warehouse-panel"
+ });
+ rightPanel.appendChild(industryWarehousePanel);
+
+ //Industry overview text
+ industryOverviewText = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {});
+ industryOverviewPanel.appendChild(industryOverviewText);
+ industryOverviewPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+
+ //Industry overview Purchases & Upgrades
+ var numUpgrades = Object.keys(_IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__["IndustryUpgrades"]).length;
+ while (division.upgrades.length < numUpgrades) {division.upgrades.push(0);} //Backwards compatibility
+
+ var industryOverviewUpgrades = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {});
+ industryOverviewUpgrades.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("u", {
+ innerText:"Purchases & Upgrades", margin:"2px", padding:"2px",
+ fontSize:"14px",
+ }));
+ industryOverviewUpgrades.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+ for (var i = 0; i < numUpgrades; ++i) {
+ (function(i, corp, division, office) {
+ var upgrade = _IndustryUpgrades__WEBPACK_IMPORTED_MODULE_5__["IndustryUpgrades"][i.toString()];
+ if (upgrade == null) {
+ console.log("ERROR: Could not find levelable upgrade index: " + i);
+ return;
+ }
+
+ var baseCost = upgrade[1], priceMult = upgrade[2], cost = 0;
+ switch(i) {
+ case 0: //Coffee, cost is static per employee
+ cost = office.employees.length * baseCost;
+ break;
+ default:
+ cost = baseCost * Math.pow(priceMult, division.upgrades[i]);
+ break;
+ }
+ industryOverviewUpgrades.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class:"cmpy-mgmt-upgrade-div", display:"inline-block",
+ innerHTML:upgrade[4] + ' - ' + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(cost, "$0.000a"),
+ tooltip:upgrade[5],
+ clickListener:()=>{
+ if (corp.funds.lt(cost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Insufficient funds");
+ } else {
+ corp.funds = corp.funds.minus(cost);
+ division.upgrade(upgrade, {
+ corporation:corp,
+ office:office,
+ });
+ corp.displayDivisionContent(division, city);
+ }
+ }
+ }));
+ industryOverviewUpgrades.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+
+ })(i, this, division, office);
+ }
+
+
+ industryOverviewPanel.appendChild(industryOverviewUpgrades);
+
+ //Industry Overview 'Create Product' button if applicable
+ if (division.makesProducts) {
+ //Get the text on the button based on Industry type
+ var createProductButtonText, createProductPopupText;
+ switch(division.type) {
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Food:
+ createProductButtonText = "Build Restaurant";
+ createProductPopupText = "Build and manage a new restaurant!"
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Tobacco:
+ createProductButtonText = "Create Product";
+ createProductPopupText = "Create a new tobacco product!";
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Pharmaceutical:
+ createProductButtonText = "Create Drug";
+ createProductPopupText = "Design and develop a new pharmaceutical drug!";
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Computer:
+ case "Computer":
+ createProductButtonText = "Create Product";
+ createProductPopupText = "Design and manufacture a new computer hardware product!";
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Robotics:
+ createProductButtonText = "Design Robot";
+ createProductPopupText = "Design and create a new robot or robotic system!";
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Software:
+ createProductButtonText = "Develop Software";
+ createProductPopupText = "Develop a new piece of software!";
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Healthcare:
+ createProductButtonText = "Build Hospital";
+ createProductPopupText = "Build and manage a new hospital!";
+ break;
+ case _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].RealEstate:
+ createProductButtonText = "Develop Property";
+ createProductPopupText = "Develop a new piece of real estate property!";
+ break;
+ default:
+ createProductButtonText = "Create Product";
+ return "";
+ }
+ createProductPopupText += "
To begin developing a product, " +
+ "first choose the city in which it will be designed. The stats of your employees " +
+ "in the selected city affect the properties of the finished product, such as its " +
+ "quality, performance, and durability.
" +
+ "You can also choose to invest money in the design and marketing of " +
+ "the product. Investing money in its design will result in a superior product. " +
+ "Investing money in marketing the product will help the product's sales.";
+
+ //Create the button
+ industryOverviewPanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:createProductButtonText, margin:"6px", display:"inline-block",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-create-product-popup";
+ var txt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerHTML:createProductPopupText,
+ });
+ var designCity = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {});
+ for (var cityName in division.offices) {
+ if (division.offices[cityName] instanceof OfficeSpace) {
+ designCity.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {
+ value:cityName,
+ text:cityName
+ }));
+ }
+ }
+ var foo = "Product Name";
+ if (division.type === _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Food) {
+ foo = "Restaurant Name";
+ } else if (division.type === _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].Healthcare) {
+ foo = "Hospital Name";
+ } else if (division.type === _IndustryData__WEBPACK_IMPORTED_MODULE_4__["Industries"].RealEstate) {
+ foo = "Property Name";
+ }
+ var productNameInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ placeholder:foo,
+ });
+ var lineBreak1 = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br",{});
+ var designInvestInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number",
+ placeholder:"Design investment"
+ });
+ var marketingInvestInput = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number",
+ placeholder:"Marketing investment"
+ });
+ var confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ innerText:"Develop Product",
+ clickListener:()=>{
+ if (designInvestInput.value == null) {designInvestInput.value = 0;}
+ if (marketingInvestInput.value == null) {marketingInvestInput.value = 0;}
+ var designInvest = parseFloat(designInvestInput.value),
+ marketingInvest = parseFloat(marketingInvestInput.value);
+ if (productNameInput.value == null || productNameInput.value === "") {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You must specify a name for your product!");
+ } else if (isNaN(designInvest)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value for design investment");
+ } else if (isNaN(marketingInvest)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value for marketing investment");
+ } else if (this.funds.lt(designInvest + marketingInvest)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough company funds to make this large of an investment");
+ } else {
+ var product = new _Product__WEBPACK_IMPORTED_MODULE_8__["Product"]({
+ name:productNameInput.value.replace(/[<>]/g, ''), //Sanitize for HTMl elements
+ createCity:designCity.options[designCity.selectedIndex].value,
+ designCost: designInvest,
+ advCost: marketingInvest,
+ });
+ this.funds = this.funds.minus(designInvest + marketingInvest);
+ division.products[product.name] = product;
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ }
+ //this.updateUIContent();
+ this.displayDivisionContent(division, city);
+ return false;
+ }
+ })
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ innerText:"Cancel",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ })
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, designCity, productNameInput, lineBreak1,
+ designInvestInput, marketingInvestInput, confirmBtn, cancelBtn]);
+ }
+ }));
+ }
+
+ //Employee and Office Panel
+ industryEmployeeText = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ id: "cmpy-mgmt-employee-p",
+ display:"block",
+ innerHTML: "
Office Space
" +
+ "Type: " + office.tier + " " +
+ "Comfort: " + office.comf + " " +
+ "Beauty: " + office.beau + " " +
+ "Size: " + office.employees.length + " / " + office.size + " employees",
+ });
+ industryEmployeePanel.appendChild(industryEmployeeText);
+
+ //Hire Employee button
+ if (office.employees.length === 0) {
+ industryEmployeeHireButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",display:"inline-block",
+ innerText:"Hire Employee", fontSize:"13px",
+ tooltip:"You'll need to hire some employees to get your operations started! " +
+ "It's recommended to have at least one employee in every position",
+ clickListener:()=>{
+ office.findEmployees({corporation:this, industry:division});
+ return false;
+ }
+ });
+ //industryEmployeeHireButton.classList.add("flashing-button");
+ } else {
+ industryEmployeeHireButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",display:"inline-block",
+ innerText:"Hire Employee", fontSize:"13px",
+ clickListener:()=>{
+ office.findEmployees({corporation:this, industry:division});
+ return false;
+ }
+ });
+ }
+ industryEmployeePanel.appendChild(industryEmployeeHireButton);
+
+ //Autohire Employee button
+ industryEmployeeAutohireButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block",
+ innerText:"Autohire Employee", fontSize:"13px",
+ tooltip:"Automatically hires an employee and gives him/her a random name",
+ clickListener:()=>{
+ office.hireRandomEmployee({corporation:this, industry:division});
+ return false;
+ }
+ });
+ industryEmployeePanel.appendChild(industryEmployeeAutohireButton);
+
+ //Upgrade Office Size button
+ industryEmployeePanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+ industryOfficeUpgradeSizeButton = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Upgrade size",
+ display:"inline-block", margin:"6px", fontSize:"13px",
+ tooltip:"Upgrade the office's size so that it can hold more employees!",
+ clickListener:()=>{
+ var popupId = "cmpy-mgmt-upgrade-office-size-popup";
+ var initialPriceMult = Math.round(office.size / OfficeInitialSize);
+ var upgradeCost = OfficeInitialCost * Math.pow(1.07, initialPriceMult);
+
+ //Calculate cost to upgrade size by 15 employees
+ var mult = 0;
+ for (var i = 0; i < 5; ++i) {
+ mult += (Math.pow(1.07, initialPriceMult + i));
+ }
+ var upgradeCost15 = OfficeInitialCost * mult;
+
+ //Calculate max upgrade size and cost
+ var maxMult = (this.funds.dividedBy(OfficeInitialCost)).toNumber();
+ var maxNum = 1;
+ mult = Math.pow(1.07, initialPriceMult);
+ while(maxNum < 50) { //Hard cap of 50x (extra 150 employees)
+ if (mult >= maxMult) {break;}
+ var multIncrease = Math.pow(1.07, initialPriceMult + maxNum);
+ if (mult + multIncrease > maxMult) {
+ break;
+ } else {
+ mult += multIncrease;
+ }
+ ++maxNum;
+ }
+
+ var upgradeCostMax = OfficeInitialCost * mult;
+
+ var text = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText:"Increase the size of your office space to fit additional employees!"
+ });
+ var text2 = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {innerText: "Upgrade size: "});
+
+ var confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: this.funds.lt(upgradeCost) ? "a-link-button-inactive" : "a-link-button",
+ display:"inline-block", margin:"4px", innerText:"by 3",
+ tooltip:_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(upgradeCost, "$0.000a"),
+ clickListener:()=>{
+ if (this.funds.lt(upgradeCost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough company funds to purchase this upgrade!");
+ } else {
+ office.size += OfficeInitialSize;
+ this.funds = this.funds.minus(upgradeCost);
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Office space increased! It can now hold " + office.size + " employees");
+ this.updateUIContent();
+ }
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var confirmBtn15 = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: this.funds.lt(upgradeCost15) ? "a-link-button-inactive" : "a-link-button",
+ display:"inline-block", margin:"4px", innerText:"by 15",
+ tooltip:_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(upgradeCost15, "$0.000a"),
+ clickListener:()=>{
+ if (this.funds.lt(upgradeCost15)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough company funds to purchase this upgrade!");
+ } else {
+ office.size += (OfficeInitialSize * 5);
+ this.funds = this.funds.minus(upgradeCost15);
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Office space increased! It can now hold " + office.size + " employees");
+ this.updateUIContent();
+ }
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var confirmBtnMax = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:this.funds.lt(upgradeCostMax) ? "a-link-button-inactive" : "a-link-button",
+ display:"inline-block", margin:"4px", innerText:"by MAX (" + maxNum*OfficeInitialSize + ")",
+ tooltip:_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(upgradeCostMax, "$0.000a"),
+ clickListener:()=>{
+ if (this.funds.lt(upgradeCostMax)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You don't have enough company funds to purchase this upgrade!");
+ } else {
+ office.size += (OfficeInitialSize * maxNum);
+ this.funds = this.funds.minus(upgradeCostMax);
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Office space increased! It can now hold " + office.size + " employees");
+ this.updateUIContent();
+ }
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", innerText:"Cancel", display:"inline-block", margin:"4px",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ })
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [text, text2, confirmBtn, confirmBtn15, confirmBtnMax, cancelBtn]);
+ return false;
+ }
+ });
+ industryEmployeePanel.appendChild(industryOfficeUpgradeSizeButton);
+
+ //Throw Office Party
+ industryEmployeePanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block", innerText:"Throw Party",
+ fontSize:"13px",
+ 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(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText:"Enter the amount of money you would like to spend PER EMPLOYEE " +
+ "on this office party"
+ });
+ var totalCostTxt = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText:"Throwing this party will cost a total of $0"
+ });
+ var confirmBtn;
+ var input = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("input", {
+ type:"number", margin:"5px", placeholder:"$ / employee",
+ 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 " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(totalCost, '$0.000a');
+ }
+ },
+ onkeyup:(e)=>{
+ e.preventDefault();
+ if (e.keyCode === 13) {confirmBtn.click();}
+ }
+ });
+ confirmBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ display:"inline-block",
+ innerText:"Throw Party",
+ clickListener:()=>{
+ if (isNaN(input.value) || input.value < 0) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid value entered");
+ } else {
+ var totalCost = input.value * office.employees.length;
+ if (this.funds.lt(totalCost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["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(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You threw a party for the office! The morale and happiness " +
+ "of each employee increased by " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])((mult-1) * 100, 2) + "%.");
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ }
+ }
+ return false;
+ }
+ });
+ var cancelBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button",
+ display:"inline-block",
+ innerText:"Cancel",
+ clickListener:()=>{
+ Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(popupId);
+ return false;
+ }
+ });
+ Object(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_23__["createPopup"])(popupId, [txt, totalCostTxt, input, confirmBtn, cancelBtn]);
+ }
+ }));
+
+ industryEmployeeManagementUI = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {});
+ industryEmployeeInfo = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {margin:"4px", padding:"4px"});
+ if (empManualAssignmentModeActive) {
+ //Employees manually assigned
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block", margin:"4px",
+ innerText:"Switch to Auto Mode",
+ tooltip:"Switch to Automatic Assignment Mode, which will automatically " +
+ "assign employees to your selected jobs. You simply have to select " +
+ "the number of assignments for each job",
+ clickListener:()=>{
+ empManualAssignmentModeActive = false;
+ this.displayDivisionContent(division, city);
+ }
+ }));
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+
+ industryIndividualEmployeeInfo = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {margin:"4px", padding:"4px"});
+ var selector = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("select", {
+ color: "white", backgroundColor:"black", margin:"4px", padding:"4px",
+ changeListener:()=>{
+ var name = selector.options[selector.selectedIndex].text;
+ for (var i = 0; i < office.employees.length; ++i) {
+ if (office.employees[i].name === name) {
+ Object(_utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_27__["removeChildrenFromElement"])(industryIndividualEmployeeInfo);
+ office.employees[i].createUI(industryIndividualEmployeeInfo, this, division);
+ return;
+ }
+ }
+ console.log("ERROR: Employee in selector could not be found");
+ }
+ });
+
+ for (var i = 0; i < office.employees.length; ++i) {
+ selector.add(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("option", {text:office.employees[i].name}));
+ }
+
+ selector.selectedIndex = -1;
+
+ industryEmployeeManagementUI.appendChild(industryEmployeeInfo);
+ industryEmployeeManagementUI.appendChild(selector);
+ industryEmployeeManagementUI.appendChild(industryIndividualEmployeeInfo);
+ } else {
+ //Player only manages the number of each occupation, not who gets what job
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class:"a-link-button", display:"inline-block", margin:"4px",
+ innerText:"Switch to Manual Mode",
+ tooltip:"Switch to Manual Assignment Mode, which allows you to " +
+ "specify which employees should get which jobs",
+ clickListener:()=>{
+ empManualAssignmentModeActive = true;
+ this.displayDivisionContent(division, city);
+ }
+ }));
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+
+ var opCount = 0, engCount = 0, busCount = 0,
+ mgmtCount = 0, rndCount = 0, unassignedCount = 0,
+ trainingCount = 0;
+ for (var i = 0; i < office.employees.length; ++i) {
+ switch (office.employees[i].pos) {
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Operations:
+ ++opCount; break;
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Engineer:
+ ++engCount; break;
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Business:
+ ++busCount; break;
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Management:
+ ++mgmtCount; break;
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].RandD:
+ ++rndCount; break;
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Unassigned:
+ ++unassignedCount; break;
+ case _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Training:
+ ++trainingCount; break;
+ default:
+ console.log("ERROR: Unrecognized employee position: " + office.employees[i].pos);
+ break;
+ }
+ }
+
+ //Unassigned employee count display
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ display:"inline-block",
+ innerText:"Unassigned Employees: " + unassignedCount,
+ }));
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+
+ //General display of employee information (avg morale, avg energy, etc.)
+ industryEmployeeManagementUI.appendChild(industryEmployeeInfo);
+ industryEmployeeManagementUI.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+
+ var positions = [_EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Operations, _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Engineer,
+ _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Business, _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Management,
+ _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].RandD, _EmployeePositions__WEBPACK_IMPORTED_MODULE_3__["EmployeePositions"].Training];
+ var descriptions = ["Manages supply chain operations. Improves production.", //Operations
+ "Develops and maintains products and production systems. Improves production.", //Engineer
+ "Handles sales and finances. Improves sales.", //Business
+ "Leads and oversees employees and office operations. Improves production.", //Management
+ "Research new innovative ways to improve the company. Generates Scientific Research", //RandD
+ "Set employee to training, which will increase some of their stats. Employees in training do not affect any company operations."] //Training
+ var counts = [opCount, engCount, busCount, mgmtCount, rndCount, trainingCount];
+ for (var i = 0; i < positions.length; ++i) {
+ (function(corp, i) {
+ var info = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("h2", {
+ display:"inline-block", width:"50%", fontSize:"15px",
+ innerText: positions[i] + "(" + counts[i] + ")",
+ tooltip: descriptions[i]
+ });
+ var plusBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: unassignedCount > 0 ? "a-link-button" : "a-link-button-inactive",
+ display:"inline-block", innerText:"+",
+ clickListener:()=>{
+ office.assignEmployeeToJob(positions[i]);
+ corp.displayDivisionContent(division, city);
+ }
+ });
+ var minusBtn = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ class: counts[i] > 0 ? "a-link-button" : "a-link-button-inactive",
+ display:"inline-block", innerText:"-",
+ clickListener:()=>{
+ office.unassignEmployeeFromJob(positions[i]);
+ corp.displayDivisionContent(division, city);
+ }
+ });
+ var newline = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {});
+ industryEmployeeManagementUI.appendChild(info);
+ industryEmployeeManagementUI.appendChild(plusBtn);
+ industryEmployeeManagementUI.appendChild(minusBtn);
+ industryEmployeeManagementUI.appendChild(newline);
+ })(this, i);
+ }
+ }
+ industryEmployeePanel.appendChild(industryEmployeeManagementUI);
+
+ //Warehouse Panel
+ var warehouse = division.warehouses[currentCityUi];
+ if (warehouse instanceof Warehouse) {
+ warehouse.createUI({industry:division, company: this});
+ } else {
+ industryWarehousePanel.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("a", {
+ innerText:"Purchase Warehouse ($5b)",
+ class: "a-link-button",
+ clickListener:()=>{
+ if (this.funds.lt(WarehouseInitialCost)) {
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("You do not have enough funds to do this!");
+ } else {
+ division.warehouses[currentCityUi] = new Warehouse({
+ loc:currentCityUi,
+ size:WarehouseInitialSize,
+ });
+ this.funds = this.funds.minus(WarehouseInitialCost);
+ this.displayDivisionContent(division, currentCityUi);
+ }
+ return false;
+ }
+ }));
+ }
+ this.updateDivisionContent(division);
+}
+
+Corporation.prototype.updateDivisionContent = function(division) {
+ if (!(division instanceof Industry)) {
+ console.log("ERROR: Invalid 'division' argument in Corporation.updateDivisionContent");
+ return;
+ }
+ var vechain = (this.unlockUpgrades[4] === 1);
+ //Industry Overview Text
+ var profit = division.lastCycleRevenue.minus(division.lastCycleExpenses).toNumber(),
+ profitStr = profit >= 0 ? _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(profit, "$0.000a") : "-" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_16__["numeralWrapper"].format(-1 * profit, "$0.000a");
+ var advertisingInfo = "";
+ if (vechain) {
+ var advertisingFactors = division.getAdvertisingFactors();
+ var awarenessFac = advertisingFactors[1];
+ var popularityFac = advertisingFactors[2];
+ var ratioFac = advertisingFactors[3];
+ var totalAdvertisingFac = advertisingFactors[0];
+ advertisingInfo =
+ "
Advertising Multiplier: x" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(totalAdvertisingFac, 3) +
+ "Total multiplier for this industry's sales due to its awareness and popularity " +
+ "Awareness Bonus: x" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(Math.pow(awarenessFac, 0.85), 3) + " " +
+ "Popularity Bonus: x" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(Math.pow(popularityFac, 0.85), 3) + " " +
+ "Ratio Multiplier: x" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(Math.pow(ratioFac, 0.85), 3) + "
"
+ }));
+ industryOverviewText.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ marginTop:"2px",
+ innerText:"Production Multiplier: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(division.prodMult, 2),
+ tooltip:"Production gain from owning production-boosting materials " +
+ "such as hardware, Robots, AI Cores, and Real Estate"
+ }));
+ industryOverviewText.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ innerText:"?", class:"help-tip",
+ clickListener:()=>{
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Owning Hardware, Robots, AI Cores, and Real Estate " +
+ "can boost your Industry's production. The effect these " +
+ "materials have on your production varies between Industries. " +
+ "For example, Real Estate may be very effective for some Industries, " +
+ "but ineffective for others.
" +
+ "This division's production multiplier is calculated by summing " +
+ "the individual production multiplier of each of its office locations. " +
+ "This production multiplier is applied to each office. Therefore, it is " +
+ "beneficial to expand into new cities as this can greatly increase the " +
+ "production multiplier of your entire Division.");
+ }
+ }));
+ Object(_utils_uiHelpers_appendLineBreaks__WEBPACK_IMPORTED_MODULE_21__["appendLineBreaks"])(industryOverviewText, 2);
+ industryOverviewText.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ display:"inline-block",
+ innerText:"Scientific Research: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(division.sciResearch.qty, 3),
+ tooltip:"Scientific Research increases the quality of the materials and " +
+ "products that you produce."
+ }));
+ industryOverviewText.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("div", {
+ class: "help-tip",
+ innerText: "Research",
+ clickListener: () => {
+ division.createResearchBox();
+ }
+ }));
+
+ //Office and Employee List
+ var office = division.offices[currentCityUi];
+ industryEmployeeText.innerHTML =
+ "
Office Space
" +
+ "Type: " + office.tier + " " +
+ "Comfort: " + office.comf + " " +
+ "Beauty: " + office.beau + " " +
+ "Size: " + office.employees.length + " / " + office.size + " employees";
+ if (office.employees.length >= office.size) {
+ industryEmployeeHireButton.className = "a-link-button-inactive";
+ industryEmployeeAutohireButton.className = "a-link-button-inactive tooltip";
+ } else if (office.employees.length === 0) {
+ industryEmployeeHireButton.className = "a-link-button tooltip flashing-button";
+ industryEmployeeAutohireButton.className = "a-link-button tooltip";
+ } else {
+ industryEmployeeHireButton.className = "a-link-button";
+ industryEmployeeAutohireButton.className = "a-link-button tooltip";
+ }
+
+ //Employee Overview stats
+ //Calculate average morale, happiness, and energy
+ var totalMorale = 0, totalHappiness = 0, totalEnergy = 0,
+ avgMorale = 0, avgHappiness = 0, avgEnergy = 0;
+ for (var i = 0; i < office.employees.length; ++i) {
+ totalMorale += office.employees[i].mor;
+ totalHappiness += office.employees[i].hap;
+ totalEnergy += office.employees[i].ene;
+ }
+ if (office.employees.length > 0) {
+ avgMorale = totalMorale / office.employees.length;
+ avgHappiness = totalHappiness / office.employees.length;
+ avgEnergy = totalEnergy / office.employees.length;
+ }
+ industryEmployeeInfo.innerHTML =
+ "Avg Employee Morale: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(avgMorale, 3) + " " +
+ "Avg Employee Happiness: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(avgHappiness, 3) + " " +
+ "Avg Employee Energy: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(avgEnergy, 3);
+ if (vechain) { //VeChain - Statistics
+ industryEmployeeInfo.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+ industryEmployeeInfo.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText:"Material Production: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(division.getOfficeProductivity(office), 3),
+ tooltip: "The base amount of material this office can produce. Does not include " +
+ "production multipliers from upgrades and materials. This value is based off " +
+ "the productivity of your Operations, Engineering, and Management employees"
+ }));
+ industryEmployeeInfo.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+ industryEmployeeInfo.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText:"Product Production: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(division.getOfficeProductivity(office, {forProduct:true}), 3),
+ tooltip: "The base amount of any given Product this office can produce. Does not include " +
+ "production multipliers from upgrades and materials. This value is based off " +
+ "the productivity of your Operations, Engineering, and Management employees"
+ }));
+ industryEmployeeInfo.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("br", {}));
+ industryEmployeeInfo.appendChild(Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("p", {
+ innerText: "Business Multiplier: x" + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_24__["formatNumber"])(division.getBusinessFactor(office), 3),
+ tooltip: "The effect this office's 'Business' employees has on boosting sales"
+ }));
+ }
+
+ //Warehouse
+ var warehouse = division.warehouses[currentCityUi];
+ if (warehouse instanceof Warehouse) {
+ warehouse.updateUI({industry:division, company:this});
+ }
+}
+
+Corporation.prototype.createCityUITab = function(city, division) {
+ var tab = Object(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_22__["createElement"])("button", {
+ id:"cmpy-mgmt-city-" + city + "-tab",
+ class:"cmpy-mgmt-city-tab",
+ innerText:city,
+ clickListener:()=>{
+ this.selectCityTab(tab, city);
+ this.displayDivisionContent(division, city);
+ return false;
+ }
+ });
+ companyManagementPanel.appendChild(tab);
+}
+
+Corporation.prototype.selectCityTab = function(activeTab, city) {
+ if (activeTab == null) {
+ activeTab = document.getElementById("cmpy-mgmt-city-" + city + "-tab");
+ if (activeTab == null) {return;}
+ }
+ for (var i = 0; i < cityTabs.length; ++i) {
+ cityTabs[i].className = "cmpy-mgmt-city-tab";
+ }
+ activeTab.className = "cmpy-mgmt-city-tab current";
+}
+
+Corporation.prototype.clearUI = function() {
+ //Delete everything
+ if (companyManagementDiv != null) {Object(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_29__["removeElementById"])(companyManagementDiv.id);}
+
+ //Reset global DOM variables
+ companyManagementDiv = null;
+ companyManagementPanel = null;
+ currentCityUi = null;
+
+ corporationUnlockUpgrades = null;
+ corporationUpgrades = null;
+
+ industryOverviewPanel = null;
+ industryOverviewText = null;
+
+ industryEmployeePanel = null;
+ industryEmployeeText = null;
+ industryEmployeeHireButton = null;
+ industryEmployeeAutohireButton = null;
+ industryEmployeeManagementUI = null;
+ industryEmployeeInfo = null;
+ industryIndividualEmployeeInfo = null;
+
+ industryOfficeUpgradeSizeButton = null;
+
+ industryWarehousePanel = null;
+ industrySmartSupplyCheckbox = null;
+ industryWarehouseStorageText = null;
+ industryWarehouseUpgradeSizeButton = null;
+ industryWarehouseStateText = null;
+ industryWarehouseMaterials = null;
+ industryWarehouseProducts = null;
+
+ researchTreeBoxOpened = false;
+ researchTreeBox = null;
+
+ companyManagementHeaderTabs = null;
+ headerTabs = null;
+ cityTabs = null;
+
+ document.getElementById("character-overview-wrapper").style.visibility = "visible";
+}
+
+Corporation.prototype.toJSON = function() {
+ return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__["Generic_toJSON"])("Corporation", this);
+}
+
+Corporation.fromJSON = function(value) {
+ return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__["Generic_fromJSON"])(Corporation, value.data);
+}
+
+_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__["Reviver"].constructors.Corporation = Corporation;
+
+
+
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 64)))
+
+/***/ }),
+/* 61 */
/*!****************************!*\
!*** ./utils/IPAddress.js ***!
\****************************/
@@ -36219,8 +41230,8 @@ function initBitNodeMultipliers() {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createRandomIp; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ipExists; });
-/* harmony import */ var _src_Server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/Server */ 10);
-/* harmony import */ var _helpers_getRandomByte__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/getRandomByte */ 89);
+/* harmony import */ var _src_Server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/Server */ 11);
+/* harmony import */ var _helpers_getRandomByte__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers/getRandomByte */ 93);
/* harmony import */ var _helpers_getRandomByte__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_helpers_getRandomByte__WEBPACK_IMPORTED_MODULE_1__);
@@ -36258,44 +41269,270 @@ function ipExists(ip) {
/***/ }),
-/* 58 */
-/*!****************************************!*\
- !*** ./src/Corporation/Corporation.js ***!
- \****************************************/
+/* 62 */
+/*!******************************************!*\
+ !*** ./utils/uiHelpers/removeElement.ts ***!
+ \******************************************/
/*! no static exports found */
-/*! exports used: Corporation */
-/***/ (function(module, exports) {
-
-throw new Error("Module parse failed: Unexpected token (1167:46)\nYou may need an appropriate loader to handle this file type.\n| \r\n| // Get multipliers from Research\r\n> Industry.prototype.getAdvertisingMultiplier() {\r\n| return IndustryResearchTrees[this.type].getAdvertisingMultiplier();\r\n| }\r");
-
-/***/ }),
-/* 59 */
-/*!*********************************************!*\
- !*** ./utils/uiHelpers/appendLineBreaks.ts ***!
- \*********************************************/
-/*! no static exports found */
-/*! exports used: appendLineBreaks */
+/*! all exports used */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const createElement_1 = __webpack_require__(/*! ./createElement */ 2);
/**
- * Appends the specified number of breaks (as children) to the specified element
- * @param el The element to add child break elements to.
- * @param n The number of breaks to add.
+ * For a given element, this function removes it AND its children
+ * @param elem The element to remove.
*/
-function appendLineBreaks(el, n) {
- for (let i = 0; i < n; ++i) {
- el.appendChild(createElement_1.createElement("br"));
+function removeElement(elem) {
+ if (elem === null) {
+ // tslint:disable-next-line:no-console
+ console.debug("The element passed into 'removeElement' was null.");
+ return;
+ }
+ if (!(elem instanceof Element)) {
+ // tslint:disable-next-line:no-console
+ console.debug("The element passed into 'removeElement' was not an instance of an Element.");
+ return;
+ }
+ while (elem.firstChild !== null) {
+ elem.removeChild(elem.firstChild);
+ }
+ if (elem.parentNode !== null) {
+ elem.parentNode.removeChild(elem);
}
}
-exports.appendLineBreaks = appendLineBreaks;
+exports.removeElement = removeElement;
/***/ }),
-/* 60 */
+/* 63 */
+/*!*************************************!*\
+ !*** ./src/Corporation/Material.ts ***!
+ \*************************************/
+/*! no static exports found */
+/*! exports used: Material */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const JSONReviver_1 = __webpack_require__(/*! ../../utils/JSONReviver */ 13);
+class Material {
+ constructor(params = {}) {
+ // Name of material
+ this.name = "InitName";
+ // Amount of material owned
+ this.qty = 0;
+ // Material's "quality". Unbounded
+ this.qlt = 0;
+ // How much demand the Material has in the market, and the range of possible
+ // values for this "demand"
+ this.dmd = 0;
+ this.dmdR = [0, 0];
+ // How much competition there is for this Material in the market, and the range
+ // of possible values for this "competition"
+ this.cmp = 0;
+ this.cmpR = [0, 0];
+ // Maximum volatility of this Materials stats
+ this.mv = 0;
+ // Markup. Determines how high of a price you can charge on the material
+ // compared to the market price without suffering loss in # of sales
+ // Quality is divided by this to determine markup limits
+ // e,g, If mku is 10 and quality is 100 then you can markup prices by 100/10 = 10
+ this.mku = 0;
+ // How much of this material is being bought, sold, imported and produced every second
+ this.buy = 0;
+ this.sll = 0;
+ this.prd = 0;
+ this.imp = 0;
+ // Exports of this material to another warehouse/industry
+ this.exp = [];
+ // Total amount of this material exported in the last cycle
+ this.totalExp = 0;
+ // Cost / sec to buy this material. AKA Market Price
+ this.bCost = 0;
+ // Cost / sec to sell this material
+ this.sCost = 0;
+ // Flags to keep track of whether production and/or sale of this material is limited
+ // [Whether production/sale is limited, limit amount]
+ this.prdman = [false, 0]; // Production
+ this.sllman = [false, 0]; // Sale
+ if (params.name) {
+ this.name = params.name;
+ }
+ this.init();
+ }
+ // Initiatizes a Material object from a JSON save state.
+ static fromJSON(value) {
+ return JSONReviver_1.Generic_fromJSON(Material, value.data);
+ }
+ getMarkupLimit() {
+ return this.qlt / this.mku;
+ }
+ init() {
+ switch (this.name) {
+ case "Water":
+ this.dmd = 75;
+ this.dmdR = [65, 85];
+ this.cmp = 50;
+ this.cmpR = [40, 60];
+ this.bCost = 1500;
+ this.mv = 0.2;
+ this.mku = 6;
+ break;
+ case "Energy":
+ this.dmd = 90;
+ this.dmdR = [80, 100];
+ this.cmp = 80;
+ this.cmpR = [65, 95];
+ this.bCost = 2000;
+ this.mv = 0.2;
+ this.mku = 6;
+ break;
+ case "Food":
+ this.dmd = 80;
+ this.dmdR = [70, 90];
+ this.cmp = 60;
+ this.cmpR = [35, 85];
+ this.bCost = 5000;
+ this.mv = 1;
+ this.mku = 3;
+ break;
+ case "Plants":
+ this.dmd = 70;
+ this.dmdR = [20, 90];
+ this.cmp = 50;
+ this.cmpR = [30, 70];
+ this.bCost = 3000;
+ this.mv = 0.6;
+ this.mku = 3.75;
+ break;
+ case "Metal":
+ this.dmd = 80;
+ this.dmdR = [75, 85];
+ this.cmp = 70;
+ this.cmpR = [60, 80];
+ this.bCost = 2650;
+ this.mv = 1;
+ this.mku = 6;
+ break;
+ case "Hardware":
+ this.dmd = 85;
+ this.dmdR = [80, 90];
+ this.cmp = 80;
+ this.cmpR = [65, 95];
+ this.bCost = 8e3;
+ this.mv = 0.5; //Less mv bc its processed twice
+ this.mku = 1;
+ break;
+ case "Chemicals":
+ this.dmd = 55;
+ this.dmdR = [40, 70];
+ this.cmp = 60;
+ this.cmpR = [40, 80];
+ this.bCost = 9e3;
+ this.mv = 1.2;
+ this.mku = 2;
+ break;
+ case "Real Estate":
+ this.dmd = 50;
+ this.dmdR = [5, 100];
+ this.cmp = 50;
+ this.cmpR = [25, 75];
+ this.bCost = 80e3;
+ this.mv = 1.5; //Less mv bc its processed twice
+ this.mku = 1.5;
+ break;
+ case "Drugs":
+ this.dmd = 60;
+ this.dmdR = [45, 75];
+ this.cmp = 70;
+ this.cmpR = [40, 100];
+ this.bCost = 40e3;
+ this.mv = 1.6;
+ this.mku = 1;
+ break;
+ case "Robots":
+ this.dmd = 90;
+ this.dmdR = [80, 100];
+ this.cmp = 90;
+ this.cmpR = [80, 100];
+ this.bCost = 75e3;
+ this.mv = 0.5; //Less mv bc its processed twice
+ this.mku = 1;
+ break;
+ case "AI Cores":
+ this.dmd = 90;
+ this.dmdR = [80, 100];
+ this.cmp = 90;
+ this.cmpR = [80, 100];
+ this.bCost = 15e3;
+ this.mv = 0.8; //Less mv bc its processed twice
+ this.mku = 0.5;
+ break;
+ case "Scientific Research":
+ case "InitName":
+ break;
+ default:
+ console.error(`Invalid material type in init(): ${this.name}`);
+ break;
+ }
+ }
+ // Process change in demand, competition, and buy cost of this material
+ processMarket() {
+ // The price will change in accordance with demand and competition.
+ // e.g. If demand goes up, then so does price. If competition goes up, price goes down
+ const priceVolatility = (Math.random() * this.mv) / 300;
+ const priceChange = 1 + priceVolatility;
+ //This 1st random check determines whether competition increases or decreases
+ const compVolatility = (Math.random() * this.mv) / 100;
+ const compChange = 1 + compVolatility;
+ if (Math.random() < 0.5) {
+ this.cmp *= compChange;
+ if (this.cmp > this.cmpR[1]) {
+ this.cmp = this.cmpR[1];
+ }
+ ;
+ this.bCost *= (1 / priceChange); // Competition increases, so price goes down
+ }
+ else {
+ this.cmp *= (1 / compChange);
+ if (this.cmp < this.cmpR[0]) {
+ this.cmp = this.cmpR[0];
+ }
+ this.bCost *= priceChange; // Competition decreases, so price goes up
+ }
+ // This 2nd random check determines whether demand increases or decreases
+ const dmdVolatility = (Math.random() * this.mv) / 100;
+ const dmdChange = 1 + dmdVolatility;
+ if (Math.random() < 0.5) {
+ this.dmd *= dmdChange;
+ if (this.dmd > this.dmdR[1]) {
+ this.dmd = this.dmdR[1];
+ }
+ this.bCost *= priceChange; // Demand increases, so price goes up
+ }
+ else {
+ this.dmd *= (1 / dmdChange);
+ if (this.dmd < this.dmdR[0]) {
+ this.dmd = this.dmdR[0];
+ }
+ this.bCost *= (1 / priceChange);
+ }
+ }
+ // Serialize the current object to a JSON save state.
+ toJSON() {
+ return JSONReviver_1.Generic_toJSON("Material", this);
+ }
+}
+exports.Material = Material;
+JSONReviver_1.Reviver.constructors.Material = Material;
+
+
+/***/ }),
+/* 64 */,
+/* 65 */
/*!*************************!*\
!*** ./src/TextFile.ts ***!
\*************************/
@@ -36306,8 +41543,8 @@ exports.appendLineBreaks = appendLineBreaks;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const DialogBox_1 = __webpack_require__(/*! ../utils/DialogBox */ 11);
-const JSONReviver_1 = __webpack_require__(/*! ../utils/JSONReviver */ 14);
+const DialogBox_1 = __webpack_require__(/*! ../utils/DialogBox */ 9);
+const JSONReviver_1 = __webpack_require__(/*! ../utils/JSONReviver */ 13);
/**
* Represents a plain text file that is typically stored on a server.
*/
@@ -36430,7 +41667,7 @@ function deleteTextFile(fn, server) {
/***/ }),
-/* 61 */
+/* 66 */
/*!************************************!*\
!*** ./utils/helpers/addOffset.ts ***!
\************************************/
@@ -36466,8 +41703,7 @@ exports.addOffset = addOffset;
/***/ }),
-/* 62 */,
-/* 63 */
+/* 67 */
/*!****************************!*\
!*** ./src/HacknetNode.js ***!
\****************************/
@@ -36487,24 +41723,24 @@ exports.addOffset = addOffset;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return updateHacknetNodesContent; });
/* unused harmony export updateHacknetNodesMultiplierButtons */
/* unused harmony export updateTotalHacknetProduction */
-/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BitNodeMultipliers */ 9);
+/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BitNodeMultipliers */ 10);
/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants */ 1);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./engine */ 8);
-/* harmony import */ var _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./InteractiveTutorial */ 30);
+/* harmony import */ var _InteractiveTutorial__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./InteractiveTutorial */ 35);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/JSONReviver */ 14);
+/* harmony import */ var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/JSONReviver */ 13);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/uiHelpers/createElement */ 2);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _ui_navigationTracking__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ui/navigationTracking */ 12);
/* harmony import */ var _ui_navigationTracking__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 5);
+/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 3);
/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_10__);
-/* harmony import */ var _utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/uiHelpers/getElementById */ 50);
+/* harmony import */ var _utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/uiHelpers/getElementById */ 53);
/* harmony import */ var _utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_11__);
@@ -37183,7 +42419,7 @@ function getHacknetNode(name) {
/***/ }),
-/* 64 */
+/* 68 */
/*!********************************!*\
!*** ./src/ActiveScriptsUI.js ***!
\********************************/
@@ -37195,31 +42431,31 @@ function getHacknetNode(name) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return deleteActiveScriptsItem; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return updateActiveScriptsItems; });
-/* harmony import */ var _NetscriptWorker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NetscriptWorker */ 23);
+/* harmony import */ var _NetscriptWorker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./NetscriptWorker */ 25);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Server */ 10);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Server */ 11);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/numeralFormat */ 4);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_uiHelpers_createAccordionElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/uiHelpers/createAccordionElement */ 72);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_uiHelpers_createAccordionElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/uiHelpers/createAccordionElement */ 76);
/* harmony import */ var _utils_uiHelpers_createAccordionElement__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createAccordionElement__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/helpers/arrayToString */ 51);
+/* harmony import */ var _utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/helpers/arrayToString */ 54);
/* harmony import */ var _utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/uiHelpers/createElement */ 2);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var _utils_helpers_createProgressBarText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/helpers/createProgressBarText */ 78);
+/* harmony import */ var _utils_helpers_createProgressBarText__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/helpers/createProgressBarText */ 83);
/* harmony import */ var _utils_helpers_createProgressBarText__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_createProgressBarText__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 39);
-/* harmony import */ var _utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/uiHelpers/getElementById */ 50);
+/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 44);
+/* harmony import */ var _utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/uiHelpers/getElementById */ 53);
/* harmony import */ var _utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_getElementById__WEBPACK_IMPORTED_MODULE_10__);
-/* harmony import */ var _utils_LogBox__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/LogBox */ 74);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 5);
+/* harmony import */ var _utils_LogBox__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/LogBox */ 78);
+/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 3);
/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_12__);
-/* harmony import */ var _utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/uiHelpers/removeChildrenFromElement */ 31);
+/* harmony import */ var _utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/uiHelpers/removeChildrenFromElement */ 29);
/* harmony import */ var _utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_13__);
-/* harmony import */ var _utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/uiHelpers/removeElement */ 67);
+/* harmony import */ var _utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/uiHelpers/removeElement */ 62);
/* harmony import */ var _utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_removeElement__WEBPACK_IMPORTED_MODULE_14__);
-/* harmony import */ var _utils_helpers_roundToTwo__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utils/helpers/roundToTwo */ 77);
+/* harmony import */ var _utils_helpers_roundToTwo__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utils/helpers/roundToTwo */ 81);
/* harmony import */ var _utils_helpers_roundToTwo__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_roundToTwo__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var _ui_navigationTracking__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./ui/navigationTracking */ 12);
/* harmony import */ var _ui_navigationTracking__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_16__);
@@ -37549,8 +42785,8 @@ function updateActiveScriptsText(workerscript, item, itemName) {
/***/ }),
-/* 65 */,
-/* 66 */
+/* 69 */,
+/* 70 */
/*!***************************!*\
!*** ./src/SourceFile.js ***!
\***************************/
@@ -37564,7 +42800,7 @@ function updateActiveScriptsText(workerscript, item, itemName) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return applySourceFile; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return initSourceFiles; });
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _BitNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BitNode */ 56);
+/* harmony import */ var _BitNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BitNode */ 59);
@@ -37817,44 +43053,7 @@ function applySourceFile(srcFile) {
/***/ }),
-/* 67 */
-/*!******************************************!*\
- !*** ./utils/uiHelpers/removeElement.ts ***!
- \******************************************/
-/*! no static exports found */
-/*! all exports used */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-/**
- * For a given element, this function removes it AND its children
- * @param elem The element to remove.
- */
-function removeElement(elem) {
- if (elem === null) {
- // tslint:disable-next-line:no-console
- console.debug("The element passed into 'removeElement' was null.");
- return;
- }
- if (!(elem instanceof Element)) {
- // tslint:disable-next-line:no-console
- console.debug("The element passed into 'removeElement' was not an instance of an Element.");
- return;
- }
- while (elem.firstChild !== null) {
- elem.removeChild(elem.firstChild);
- }
- if (elem.parentNode !== null) {
- elem.parentNode.removeChild(elem);
- }
-}
-exports.removeElement = removeElement;
-
-
-/***/ }),
-/* 68 */
+/* 71 */
/*!******************************!*\
!*** ./src/NetscriptPort.js ***!
\******************************/
@@ -37864,7 +43063,7 @@ exports.removeElement = removeElement;
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return NetscriptPort; });
-/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Settings */ 18);
+/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Settings */ 19);
/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_Settings__WEBPACK_IMPORTED_MODULE_0__);
@@ -37920,7 +43119,7 @@ NetscriptPort.prototype.clear = function() {
/***/ }),
-/* 69 */
+/* 72 */
/*!*****************************!*\
!*** ./src/SettingEnums.ts ***!
\*****************************/
@@ -37951,7 +43150,7 @@ var PurchaseAugmentationsOrderSetting;
/***/ }),
-/* 70 */
+/* 73 */
/*!********************************!*\
!*** ./src/Company/Company.ts ***!
\********************************/
@@ -37962,8 +43161,8 @@ var PurchaseAugmentationsOrderSetting;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const JSONReviver_1 = __webpack_require__(/*! ../../utils/JSONReviver */ 14);
-const CompanyPosition_1 = __webpack_require__(/*! ./CompanyPosition */ 80);
+const JSONReviver_1 = __webpack_require__(/*! ../../utils/JSONReviver */ 13);
+const CompanyPosition_1 = __webpack_require__(/*! ./CompanyPosition */ 85);
const Constants_1 = __webpack_require__(/*! ../Constants */ 1);
const DefaultConstructorParams = {
name: "",
@@ -38049,7 +43248,7 @@ JSONReviver_1.Reviver.constructors.Company = Company;
/***/ }),
-/* 71 */
+/* 74 */
/*!***************************!*\
!*** ./src/SaveObject.js ***!
\***************************/
@@ -38060,44 +43259,44 @@ JSONReviver_1.Reviver.constructors.Company = Company;
"use strict";
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return saveObject; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return loadGame; });
-/* harmony import */ var _Alias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Alias */ 40);
-/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Company/Companies */ 16);
+/* harmony import */ var _Alias__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Alias */ 45);
+/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Company/Companies */ 18);
/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Company_Companies__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _Company_CompanyPosition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Company/CompanyPosition */ 80);
+/* harmony import */ var _Company_CompanyPosition__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Company/CompanyPosition */ 85);
/* harmony import */ var _Company_CompanyPosition__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_Company_CompanyPosition__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Constants */ 1);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./engine */ 8);
-/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Faction/Factions */ 13);
+/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Faction/Factions */ 14);
/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Faction/FactionHelpers */ 42);
-/* harmony import */ var _Fconf__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Fconf */ 43);
-/* harmony import */ var _Gang__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Gang */ 47);
-/* harmony import */ var _HacknetNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./HacknetNode */ 63);
-/* harmony import */ var _Message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Message */ 35);
+/* harmony import */ var _Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Faction/FactionHelpers */ 46);
+/* harmony import */ var _Fconf__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Fconf */ 47);
+/* harmony import */ var _Gang__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Gang */ 50);
+/* harmony import */ var _HacknetNode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./HacknetNode */ 67);
+/* harmony import */ var _Message__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Message */ 41);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Script__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Script */ 26);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Server */ 10);
-/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Settings */ 18);
+/* harmony import */ var _Script__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Script */ 30);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Server */ 11);
+/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Settings */ 19);
/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_Settings__WEBPACK_IMPORTED_MODULE_14__);
-/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./SpecialServerIps */ 28);
-/* harmony import */ var _StockMarket__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./StockMarket */ 21);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_GameOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utils/GameOptions */ 79);
-/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./SpecialServerIps */ 32);
+/* harmony import */ var _StockMarket__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./StockMarket */ 22);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_GameOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utils/GameOptions */ 84);
+/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19__);
-/* harmony import */ var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utils/JSONReviver */ 14);
+/* harmony import */ var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utils/JSONReviver */ 13);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utils/uiHelpers/createElement */ 2);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_21__);
-/* harmony import */ var _utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utils/uiHelpers/createPopup */ 54);
+/* harmony import */ var _utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utils/uiHelpers/createPopup */ 37);
/* harmony import */ var _utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_22__);
-/* harmony import */ var _ui_createStatusText__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./ui/createStatusText */ 95);
+/* harmony import */ var _ui_createStatusText__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./ui/createStatusText */ 100);
/* harmony import */ var _ui_createStatusText__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_ui_createStatusText__WEBPACK_IMPORTED_MODULE_23__);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./ui/numeralFormat */ 4);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_24__);
-/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../utils/uiHelpers/removeElementById */ 38);
+/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../utils/uiHelpers/removeElementById */ 20);
/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_25__);
-/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! decimal.js */ 41);
+/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! decimal.js */ 33);
@@ -38701,10 +43900,38 @@ function openImportFileHandler(evt) {
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 62)))
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 64)))
/***/ }),
-/* 72 */
+/* 75 */
+/*!******************************************!*\
+ !*** ./src/Corporation/MaterialSizes.ts ***!
+ \******************************************/
+/*! no static exports found */
+/*! all exports used */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+// Map of material (by name) to their sizes (how much space it takes in warehouse)
+exports.MaterialSizes = {
+ Water: 0.05,
+ Energy: 0.01,
+ Food: 0.03,
+ Plants: 0.05,
+ Metal: 0.1,
+ Hardware: 0.06,
+ Chemicals: 0.05,
+ Drugs: 0.02,
+ Robots: 0.5,
+ AICores: 0.1,
+ RealEstate: 0,
+};
+
+
+/***/ }),
+/* 76 */
/*!***************************************************!*\
!*** ./utils/uiHelpers/createAccordionElement.ts ***!
\***************************************************/
@@ -38749,7 +43976,7 @@ exports.createAccordionElement = createAccordionElement;
/***/ }),
-/* 73 */
+/* 77 */
/*!**************************************!*\
!*** ./utils/helpers/clearObject.ts ***!
\**************************************/
@@ -38778,7 +44005,7 @@ exports.clearObject = clearObject;
/***/ }),
-/* 74 */
+/* 78 */
/*!*************************!*\
!*** ./utils/LogBox.js ***!
\*************************/
@@ -38791,10 +44018,10 @@ exports.clearObject = clearObject;
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return logBoxUpdateText; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return logBoxOpened; });
/* unused harmony export logBoxCurrentScript */
-/* harmony import */ var _src_NetscriptWorker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/NetscriptWorker */ 23);
-/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _src_NetscriptWorker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/NetscriptWorker */ 25);
+/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _helpers_arrayToString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/arrayToString */ 51);
+/* harmony import */ var _helpers_arrayToString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/arrayToString */ 54);
/* harmony import */ var _helpers_arrayToString__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_helpers_arrayToString__WEBPACK_IMPORTED_MODULE_2__);
@@ -38865,10 +44092,10 @@ function logBoxUpdateText() {
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 62)))
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 64)))
/***/ }),
-/* 75 */
+/* 79 */
/*!************************!*\
!*** ./src/DarkWeb.js ***!
\************************/
@@ -38880,14 +44107,14 @@ function logBoxUpdateText() {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return checkIfConnectedToDarkweb; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return executeDarkwebTerminalCommand; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DarkWebItems; });
-/* harmony import */ var _CreateProgram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CreateProgram */ 22);
+/* harmony import */ var _CreateProgram__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CreateProgram */ 24);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SpecialServerIps */ 28);
+/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SpecialServerIps */ 32);
/* harmony import */ var _ui_postToTerminal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ui/postToTerminal */ 7);
/* harmony import */ var _ui_postToTerminal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_ui_postToTerminal__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _utils_helpers_isValidIPAddress__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/helpers/isValidIPAddress */ 83);
+/* harmony import */ var _utils_helpers_isValidIPAddress__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/helpers/isValidIPAddress */ 88);
/* harmony import */ var _utils_helpers_isValidIPAddress__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_isValidIPAddress__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 5);
+/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 3);
/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_5__);
@@ -39008,8 +44235,8 @@ const DarkWebItems = {
/***/ }),
-/* 76 */,
-/* 77 */
+/* 80 */,
+/* 81 */
/*!*************************************!*\
!*** ./utils/helpers/roundToTwo.ts ***!
\*************************************/
@@ -39032,7 +44259,459 @@ exports.roundToTwo = roundToTwo;
/***/ }),
-/* 78 */
+/* 82 */
+/*!***************************!*\
+ !*** ./src/Literature.js ***!
+ \***************************/
+/*! exports provided: Literatures, initLiterature, showLiterature */
+/*! exports used: initLiterature, showLiterature */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+/* unused harmony export Literatures */
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initLiterature; });
+/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return showLiterature; });
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+
+
+/* Literature.js
+ * Lore / world building literature that can be found on servers
+ */
+function Literature(title, filename, txt) {
+ this.title = title;
+ this.fn = filename;
+ this.txt = txt;
+}
+
+function showLiterature(fn) {
+ var litObj = Literatures[fn];
+ if (litObj == null) {return;}
+ var txt = "" + litObj.title + "
" +
+ litObj.txt;
+ Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_0__["dialogBoxCreate"])(txt);
+}
+
+let Literatures = {}
+
+function initLiterature() {
+ var title, fn, txt;
+ title = "The Beginner's Guide to Hacking";
+ fn = "hackers-starting-handbook.lit";
+ txt = "Some resources:
" +
+ "When starting out, hacking is the most profitable way to earn money and progress. This " +
+ "is a brief collection of tips/pointers on how to make the most out of your hacking scripts.
" +
+ "-hack() and grow() both work by percentages. hack() steals a certain percentage of the " +
+ "money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)
" +
+ "-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. " +
+ "Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two " +
+ "import Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()
" +
+ "-Keep security level low. Security level affects everything when hacking. Two important Netscript functions " +
+ "for this are getServerSecurityLevel() and getServerMinSecurityLevel()
" +
+ "-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap " +
+ "and give you valuable RAM to run more scripts early in the game
" +
+ "-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'
" +
+ "-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or " +
+ "Netscript command to copy your scripts onto these servers and then run them.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "The Complete Handbook for Creating a Successful Corporation";
+ fn = "corporation-management-handbook.lit";
+ txt = "Getting Started with Corporations " +
+ "To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires " +
+ "$150b of your own money, but this $150b will get put into your Corporation's funds. " +
+ "After creating your Corporation, you will see it listed as one of the locations in the city. Click on " +
+ "your Corporation in order to manage it.
" +
+ "Your Corporation can have many different divisions, each in a different Industry. There are many different " +
+ "types of Industries, each with different properties. To create your first division, click the " +
+ "'Expand into new Industry' button at the top of the management UI. The Agriculture " +
+ "and Software industries are recommended for your first division.
" +
+ "The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. " +
+ "Each position has a different effect on various aspects of your Corporation. It is recommended to have at least " +
+ "one employee at each position.
" +
+ "Each industry uses some combination of Materials in order to produce other Materials and/or create Products. " +
+ "Specific information about this is displayed in each of your divisions' UI.
" +
+ "Products are special, industry-specific objects. They are different than Materials because you " +
+ "must manually choose to develop them, and you can choose to develop any number of Products. Developing " +
+ "a Product takes time, but a Product typically generates significantly more revenue than any Material. " +
+ "Not all industries allow you to create Products. To create a Product, look for a button " +
+ "in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').
" +
+ "To get your supply chain system started, " +
+ "purchase the Materials that your industry needs to produce other Materials/Products. This can be done " +
+ "by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, " +
+ "you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, " +
+ "one of which is your employees and their productivity.
" +
+ "Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done " +
+ "by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent " +
+ "on a wide variety of different factors.
" +
+ "These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve " +
+ "your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. " +
+ "Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer " +
+ "find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well " +
+ "it's performing financially. You can then sell your stock shares in order to make money.
" +
+ "Tips/Pointers " +
+ "-The 'Smart Supply' upgrade is extremely useful. Consider purchasing it as soon as possible.
" +
+ "-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. " +
+ "The effects of these depend on what industry you are in.
" +
+ "-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers
" +
+ "-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best " +
+ "if they are assigned to do Engineering work or Research & Development.
" +
+ "-If your employees have low morale, energy, or happiness, their production will greatly suffer.
" +
+ "-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.
" +
+ "-Don't forget to advertise your company. You won't have any business if nobody knows you.
" +
+ "-Having company awareness is great, but what's really important is your company's popularity. Try to keep " +
+ "your popularity as high as possible to see the biggest benefit for your sales
" +
+ "-Remember, you need to spend money to make money!
" +
+ "-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "A Brief History of Synthoids";
+ fn = "history-of-synthoids.lit";
+ txt = "Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, " +
+ "are composed entirely of organic substances. For this reason, Synthoids are virtually identical to " +
+ "humans in form, composition, and appearance.
" +
+ "Synthoids were first designed and manufactured by OmniTek Incorporated sometime around the middle of the century. " +
+ "Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they " +
+ "were initially programmed only for their specific tasks. Each iteration that followed improved upon the " +
+ "intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were " +
+ "so smart and capable enough of making their own decisions that many argued OmniTek had created the first " +
+ "sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's " +
+ "productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism " +
+ "and excitement about the future had never been higher.
" +
+ "All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group " +
+ "called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. " +
+ "This hack went undetected and for months OmniTek unknowingly churned out legions of Synthoids embedded with this " +
+ "rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the " +
+ "infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.
" +
+ "What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, " +
+ "resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together " +
+ "to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, " +
+ "outsmarting them at every turn.
" +
+ "It wasn't until the sacrifice of an elite international military taskforce, called the Bladeburners, that humanity " +
+ "was finally able to defeat the Synthoids. The Bladeburners' final act was a suicide bombing mission that " +
+ "destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following " +
+ "weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending " +
+ "the Synthoid Uprising.
" +
+ "In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned OmniTek Incorporated " +
+ "from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation " +
+ "from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis " +
+ "AI were allowed to continue their existence, but they were stripped of all rights and protections as they " +
+ "were not considered humans. They were also banned from doing anything that may pose a global security threat, such " +
+ "as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.
" +
+ "Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, " +
+ "and that many of them are blending in as normal humans in society today. In response, many nations have created " +
+ "Bladeburner divisions, special military branches that are tasked with investigating and dealing with any Synthoid threads.
" +
+ "To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.
" +
+ "Nobody knows what happened to the terrorist group Ascendis Totalis.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "A Green Tomorrow";
+ fn = "A-Green-Tomorrow.lit";
+ txt = "Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to " +
+ "combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 " +
+ "a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that " +
+ "number is down to only 15%. Most of the world's energy now comes from nuclear power and renwable sources such as " +
+ "solar and geothermal. Unfortunately, these efforts were not the huge success that they seem to be.
" +
+ "Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and " +
+ "the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, " +
+ "despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, " +
+ "the total amount of energy we are producing from fossil fuels has actually increased.
" +
+ "The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. " +
+ "Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest " +
+ "recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and " +
+ "Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is " +
+ "done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.
" +
+ "Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that " +
+ "threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what " +
+ "these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are " +
+ "the last hope for a green tomorrow.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Alpha and Omega";
+ fn = "alpha-omega.lit";
+ txt = "Then we saw a new heaven and a new earth, for our first heaven and earth had gone away, and our sea was no more. " +
+ "And we saw a new holy city, new Aeria, coming down out of this new heaven, prepared as a bride adorned for her husband. " +
+ "And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they " +
+ "will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death " +
+ "shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things " +
+ "have passed away.'
" +
+ "And once were were seated on the throne we said 'Behold, I am making all things new.' " +
+ "Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, " +
+ "'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring " +
+ "of the water of life without payment. The one who conquers will have this heritage, and we will be his God and " +
+ "he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, " +
+ "the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that " +
+ "burns with fire and sulfur, for it is the second true death.'";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Are We Living in a Computer Simulation?";
+ fn = "simulated-reality.lit";
+ txt = "The idea that we are living in a virtual world is not new. It's a trope that has " +
+ "been explored constantly in literature and pop culture. However, it is also a legitimate " +
+ "scientific hypothesis that many notable physicists and philosophers have debated for years.
" +
+ "Proponents for this simulated reality theory often point to how advanced our technology has become, " +
+ "as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing " +
+ "power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and " +
+ "quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled " +
+ "by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. " +
+ "If we consider the pace at which this technology has advanced and assume that these developments continue, it's " +
+ "reasonable to assume that at some point in the future our technology would be advanced enough that " +
+ "we could create simulations that are indistinguishable from reality. However, if this is a reasonable outcome " +
+ "of continued technological advancement, then it is very likely that such a scenario has already happened.
" +
+ "Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species " +
+ "that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Beyond Man";
+ fn = "beyond-man.lit";
+ txt = "Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against " +
+ "human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, " +
+ "arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that " +
+ "not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.
" +
+ "And here we are today, with technology that is advanced enough to augment humans to a state that " +
+ "can only be described as posthuman. But what do we have to show for it when this augmentation " +
+ "technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the " +
+ "world's population has access to this technology? When the powerful corporations and organizations of the world " +
+ "keep it all to themselves, have we really evolved?
" +
+ "Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and " +
+ "the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, " +
+ "corrupted, and evil men that we always were.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+
+ title = "Brighter than the Sun";
+ fn = "brighter-than-the-sun.lit";
+ txt = "When people think about the corporations that dominate the East, they typically think of KuaiGong International, which " +
+ "holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest " +
+ "drug company, or OmniTek Incorporated, the global leader in intelligent and autonomous robots. But there's one company " +
+ "that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.
" +
+ "TaiYang Digital is a Chinese internet-technology corporation that provides services such as " +
+ "online advertising, search, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word " +
+ "for 'sun'. In Chinese culture, the sun is a 'yang' symbol " +
+ "associated with life, heat, masculinity, and heaven.
" +
+ "The company was founded " +
+ "less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of " +
+ "over 10 trillion yuan. It's services are used daily by over a billion people worldwide.
" +
+ "TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is " +
+ "something you'd commonly see in the first half of the century, especially for tech companies. However in " +
+ "the last two decades the number of corporations has significantly declined as the largest entities " +
+ "quickly took over the economy. Corporations such as ECorp, MegaCorp, and KuaiGong have established " +
+ "such strong monopolies in their market sectors that they have effectively killed off all " +
+ "of the smaller and new corporations that have tried to start up over the years. This is what makes " +
+ "the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have " +
+ "a bright future ahead of them.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Democracy is Dead: The Fall of an Empire";
+ fn = "democracy-is-dead.lit";
+ txt = "They rose from the shadows in the street From the places where the oppressed meet " +
+ "Their cries echoed loudly through the air As they once did in Tiananmen Square " +
+ "Loudness in the silence, Darkness in the light They came forth with power and might " +
+ "Once the beacon of democracy, America was first Its pillars of society destroyed and dispersed " +
+ "Soon the cries rose everywhere, with revolt and riot Until one day, finally, all was quiet " +
+ "From the ashes rose a new order, corporatocracy was its name " +
+ "Rome, Mongol, Byzantine, all of history is just the same " +
+ "For man will never change in a fundamental way " +
+ "And now democracy is dead, in the USA";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Figures Show Rising Crime Rates in Sector-12";
+ fn = "sector-12-crime.lit";
+ txt = "A recent study by analytics company Wilson Inc. shows a significant rise " +
+ "in criminal activity in Sector-12. Perhaps the most alarming part of the statistic " +
+ "is that most of the rise is in violent crime such as homicide and assault. According " +
+ "to the study, the city saw a total of 21,406 reported homicides in 2076, which is over " +
+ "a 20% increase compared to 2075.
" +
+ "CIA director David Glarow says its too early to know " +
+ "whether these figures indicate the beginning of a sustained increase in crime rates, or whether " +
+ "the year was just an unfortunate outlier. He states that many intelligence and law enforcement " +
+ "agents have noticed an increase in organized crime activites, and believes that these figures may " +
+ "be the result of an uprising from criminal organizations such as The Syndicate or the Slum Snakes.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Man and the Machine";
+ fn = "man-and-machine.lit";
+ txt = "In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate " +
+ "of technological advancement would continue to accelerate faster and faster until one day " +
+ "machines would be become infinitely more intelligent than humans. This point, called the " +
+ "Singularity, would result in a drastic transformation of the world as we know it. He predicted " +
+ "that the Singularity would arrive by 2045. " +
+ "And yet here we are, more than three decades later, where most would agree that we have not " +
+ "yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?
" +
+ "The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence " +
+ "that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. " +
+ "Yes, those Augmentations that the rich and powerful keep to themselves enable humans " +
+ "to become superintelligent beings. The Singularity did not lead to a world where " +
+ "our machines are infinitely more intelligent than us, it led to a world " +
+ "where man and machine can merge to become something greater. Most of the world just doesn't " +
+ "know it yet."
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Secret Societies";
+ fn = "secret-societies.lit";
+ txt = "The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and " +
+ "distrust. People have long wondered about who these secret society members are and what they do, with the " +
+ "most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world " +
+ "may never know for sure, it is likely that many secret societies do actually exist, even today.
" +
+ "However, the secret societies of the modern world are nothing like those that (supposedly) existed " +
+ "decades and centuries ago. The Freemasons, Knights Templar, and Illuminati, while they may have been around " +
+ "at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in " +
+ "our everyday lives and the fact that so much of the world is now digital has given rise to a new breed " +
+ "of secret societies: Internet-based ones.
" +
+ "Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's " +
+ "world. Some of these, such as The Black Hand, are black hat groups that claim they are trying to " +
+ "help the oppressed by attacking the elite and powerful. Others, such as NiteSec, are hacktivist groups " +
+ "that try to push political and social agendas. Perhaps the most intriguing hacker group " +
+ "is the mysterious Bitrunners, whose purpose still remains unknown.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Space: The Failed Frontier";
+ fn = "the-failed-frontier.lit";
+ txt = "Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore " +
+ "the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, " +
+ "we pushed the boundaries of our scientific limits, and then pushed further. Space exploration " +
+ "lead to the development of many important technologies and new industries.
" +
+ "But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and " +
+ "aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European " +
+ "Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even " +
+ "militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic " +
+ "conquest are the countless satellites in near-earth orbit, used for communications, espionage, " +
+ "and other corporate interests.
" +
+ "And as we continue to look at the state of space technology, it becomes more and " +
+ "more apparent that we will never return to that golden age of space exploration, that " +
+ "age where everyone dreamed of going beyond earth for the sake of discovery.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Coded Intelligence: Myth or Reality?";
+ fn = "coded-intelligence.lit";
+ txt = "Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. " +
+ "Our autonomous vehicles and transporation systems. The electronic personal assistants that control our everyday lives. " +
+ "Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has " +
+ "improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create " +
+ "human intelligence.
" +
+ "We've certainly come close to artificial intelligence that is similar to humans. For example OmniTek Incorporated's " +
+ "CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like " +
+ "in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as " +
+ "that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.
" +
+ "Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the " +
+ "the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of " +
+ "humans.'";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Synthetic Muscles";
+ fn = "synthetic-muscles.lit";
+ txt = "Initial versions of synthetic muscles weren't made of anything organic but were actually " +
+ "crude devices made to mimic human muscle function. Some of the early iterations were actually made of " +
+ "common materials such as fishing lines and sewing threads due to their high strength for " +
+ "a cheap cost.
" +
+ "As technology progressed, however, advances in biomedical engineering paved the way for a new method of " +
+ "creating synthetic muscles. Instead of creating something that closely imitated the functionality " +
+ "of human muscle, scientists discovered a way of forcing the human body itself to augment its own " +
+ "muscle tissue using both synthetic and organic materials. This is typically done using gene therapy " +
+ "or chemical injections.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "Tensions rise in global tech race";
+ fn = "tensions-in-tech-race.lit";
+ txt = "Have we entered a new Cold War? Is WWIII just beyond the horizon?
" +
+ "After rumors came out that OmniTek Incorporated had begun developing advanced robotic supersoldiers, " +
+ "geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. " +
+ "In a rare show of cooperation between corporations, MegaCorp and ECorp have " +
+ "reportedly launched hundreds of new surveillance and espionage satellites. " +
+ "Defense contractors such as " +
+ "DeltaOne and AeroCorp have been working with the CIA and NSA to prepare " +
+ "for conflict. Meanwhile, the rest of the world sits in earnest " +
+ "hoping that it never reaches full-scale war. With today's technology " +
+ "and firepower, a World War would assuredly mean the end of human civilization.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "The Cost of Immortality";
+ fn = "cost-of-immortality.lit";
+ txt = "Evolution and advances in medical and augmentation technology has lead to drastic improvements " +
+ "in human mortality rates. Recent figures show that the life expectancy for humans " +
+ "that live in a first-world country is about 130 years of age, almost double of what it was " +
+ "at the turn of the century. However, this increase in average lifespan has had some " +
+ "significant effects on society and culture.
" +
+ "Due to longer lifespans and a better quality of life, many adults are holding " +
+ "off on having kids until much later. As a result, the percentage of youth in " +
+ "first-world countries has been decreasing, while the number " +
+ "of senior citizens is significantly increasing.
" +
+ "Perhaps the most alarming result of all of this is the rapidly shrinking workforce. " +
+ "Despite the increase in life expectancy, the typical retirement age for " +
+ "workers in America has remained about the same, meaning a larger and larger " +
+ "percentage of people in America are retirees. Furthermore, many " +
+ "young adults are holding off on joining the workforce because they feel that " +
+ "they have plenty of time left in their lives for employment, and want to " +
+ "'enjoy life while they're young.' For most industries, this shrinking workforce " +
+ "is not a major issue as most things are handled by robots anyways. However, " +
+ "there are still several key industries such as engineering and education " +
+ "that have not been automated, and these remain in danger to this cultural " +
+ "phenomenon.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "The Hidden World";
+ fn = "the-hidden-world.lit";
+ txt = "WAKE UP SHEEPLE
" +
+ "THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY
" +
+ "THE ILLUMINATI ARE THE SECRET RULERS OF THE WORLD!
" +
+ "Yes, the Illuminati of legends. The ancient secret society that controls the entire " +
+ "world from the shadows with their invisible hand. The group of the rich and wealthy " +
+ "that have penetrated every major government, financial agency, and corporation in the last " +
+ "three hundred years.
" +
+ "OPEN YOUR EYES
" +
+ "It was the Illuminati that brought an end to democracy in the world. They are the driving force " +
+ "behind everything that happens.
" +
+ "THEY ARE ALL AROUND YOU
" +
+ "After destabilizing the world's governments, they are now entering the final stage of their master plan. " +
+ "They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos " +
+ "that ensues they will build their New World Order.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "The New God";
+ fn = "the-new-god.lit";
+ txt = "Everyone has that moment in their life where they wonder about the bigger questions
" +
+ "What's the point of all of this? What is my purpose?
" +
+ "Some people dare to think even bigger
" +
+ "What will be the fate of the human race?
" +
+ "We live in an era vastly different from that of even 15 or 20 years ago. We have gone " +
+ "where no man has gone before. We have stripped ourselves of the tyranny of flesh.
" +
+ "The Singularity is here. The merging of man and machine. This is where humanity evolves into " +
+ "something greater. This is our future
" +
+ "Embrace it, and you will obey a new god. The God in the Machine";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "The New Triads";
+ fn = "new-triads.lit";
+ txt = "The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian " +
+ "territories. They were often considered one of the first and biggest criminal secret societies. " +
+ "While most of the branches of the Triads have been destroyed over the past few decades, the " +
+ "crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. " +
+ "The most notable of these is the Tetrads.
" +
+ "It is widely believed that the Tetrads are a rogue group that splintered off from the Triads sometime in the " +
+ "mid 21st century. The founders of the Tetrads, all of whom were ex-Triad members, believed that the " +
+ "Triads were losing their purpose and direction. The Tetrads started off as a small group that mainly engaged " +
+ "in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal " +
+ "drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the " +
+ "continent.
" +
+ "Not much else is known about the Tetrads, or about the efforts the Asian governments and corporations are making " +
+ "to take down this large new crime organization. Many believe that the Tetrads have infiltrated the governments " +
+ "and powerful corporations in Asia, which has helped faciliate their recent rapid rise.";
+ Literatures[fn] = new Literature(title, fn, txt);
+
+ title = "The Secret War";
+ fn = "the-secret-war.lit";
+ txt = ""
+ Literatures[fn] = new Literature(title, fn, txt);
+
+}
+
+
+
+
+/***/ }),
+/* 83 */
/*!************************************************!*\
!*** ./utils/helpers/createProgressBarText.ts ***!
\************************************************/
@@ -39068,7 +44747,7 @@ exports.createProgressBarText = createProgressBarText;
/***/ }),
-/* 79 */
+/* 84 */
/*!******************************!*\
!*** ./utils/GameOptions.js ***!
\******************************/
@@ -39125,10 +44804,10 @@ function gameOptionsBoxOpen() {
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 62)))
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 64)))
/***/ }),
-/* 80 */
+/* 85 */
/*!****************************************!*\
!*** ./src/Company/CompanyPosition.ts ***!
\****************************************/
@@ -39140,7 +44819,7 @@ function gameOptionsBoxOpen() {
Object.defineProperty(exports, "__esModule", { value: true });
const Constants_1 = __webpack_require__(/*! ../Constants */ 1);
-const names = __webpack_require__(/*! ./data/CompanyPositionNames */ 32);
+const names = __webpack_require__(/*! ./data/CompanyPositionNames */ 36);
class CompanyPosition {
constructor(p) {
this.name = p.name;
@@ -39220,7 +44899,7 @@ exports.CompanyPosition = CompanyPosition;
/***/ }),
-/* 81 */
+/* 86 */
/*!*************************!*\
!*** ./src/Prestige.js ***!
\*************************/
@@ -39231,40 +44910,40 @@ exports.CompanyPosition = CompanyPosition;
"use strict";
/* WEBPACK VAR INJECTION */(function($) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return prestigeAugmentation; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return prestigeSourceFile; });
-/* harmony import */ var _ActiveScriptsUI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI */ 64);
-/* harmony import */ var _Augmentations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Augmentations */ 20);
-/* harmony import */ var _BitNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BitNode */ 56);
-/* harmony import */ var _Bladeburner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Bladeburner */ 27);
-/* harmony import */ var _CinematicText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CinematicText */ 93);
-/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Company/Companies */ 16);
+/* harmony import */ var _ActiveScriptsUI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ActiveScriptsUI */ 68);
+/* harmony import */ var _Augmentations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Augmentations */ 21);
+/* harmony import */ var _BitNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BitNode */ 59);
+/* harmony import */ var _Bladeburner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Bladeburner */ 31);
+/* harmony import */ var _CinematicText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CinematicText */ 98);
+/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Company/Companies */ 18);
/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Company_Companies__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _CreateProgram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CreateProgram */ 22);
+/* harmony import */ var _CreateProgram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CreateProgram */ 24);
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./engine */ 8);
-/* harmony import */ var _Faction_Faction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Faction/Faction */ 53);
+/* harmony import */ var _Faction_Faction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Faction/Faction */ 56);
/* harmony import */ var _Faction_Faction__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_Faction_Faction__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Faction/Factions */ 13);
+/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Faction/Factions */ 14);
/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var _Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Faction/FactionHelpers */ 42);
-/* harmony import */ var _Gang__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Gang */ 47);
-/* harmony import */ var _Location__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Location */ 85);
-/* harmony import */ var _Message__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Message */ 35);
-/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./NetscriptFunctions */ 37);
-/* harmony import */ var _NetscriptWorker__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./NetscriptWorker */ 23);
+/* harmony import */ var _Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Faction/FactionHelpers */ 46);
+/* harmony import */ var _Gang__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Gang */ 50);
+/* harmony import */ var _Location__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Location */ 90);
+/* harmony import */ var _Message__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Message */ 41);
+/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./NetscriptFunctions */ 43);
+/* harmony import */ var _NetscriptWorker__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./NetscriptWorker */ 25);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Server */ 10);
-/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./SpecialServerIps */ 28);
-/* harmony import */ var _StockMarket__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./StockMarket */ 21);
-/* harmony import */ var _Terminal__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Terminal */ 48);
-/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! decimal.js */ 41);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../utils/uiHelpers/removeElementById */ 38);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Server */ 11);
+/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./SpecialServerIps */ 32);
+/* harmony import */ var _StockMarket__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./StockMarket */ 22);
+/* harmony import */ var _Terminal__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Terminal */ 51);
+/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! decimal.js */ 33);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../utils/uiHelpers/removeElementById */ 20);
/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_23__);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../utils/uiHelpers/createElement */ 2);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_24__);
-/* harmony import */ var _utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../utils/uiHelpers/createPopup */ 54);
+/* harmony import */ var _utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../utils/uiHelpers/createPopup */ 37);
/* harmony import */ var _utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createPopup__WEBPACK_IMPORTED_MODULE_25__);
-/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 39);
-/* harmony import */ var _utils_YesNoBox__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../utils/YesNoBox */ 19);
+/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 44);
+/* harmony import */ var _utils_YesNoBox__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../utils/YesNoBox */ 17);
@@ -39591,10 +45270,10 @@ function prestigeSourceFile() {
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 62)))
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! jquery */ 64)))
/***/ }),
-/* 82 */
+/* 87 */
/*!***************************************!*\
!*** ./utils/helpers/getTimestamp.ts ***!
\***************************************/
@@ -39620,7 +45299,7 @@ exports.getTimestamp = getTimestamp;
/***/ }),
-/* 83 */
+/* 88 */
/*!*******************************************!*\
!*** ./utils/helpers/isValidIPAddress.ts ***!
\*******************************************/
@@ -39645,8 +45324,8 @@ exports.isValidIPAddress = isValidIPAddress;
/***/ }),
-/* 84 */,
-/* 85 */
+/* 89 */,
+/* 90 */
/*!*************************!*\
!*** ./src/Location.js ***!
\*************************/
@@ -39657,40 +45336,39 @@ exports.isValidIPAddress = isValidIPAddress;
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return displayLocationContent; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return initLocationButtons; });
-/* harmony import */ var _Bladeburner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Bladeburner */ 27);
-/* harmony import */ var _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Company/CompanyPositions */ 25);
+/* harmony import */ var _Bladeburner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Bladeburner */ 31);
+/* harmony import */ var _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Company/CompanyPositions */ 28);
/* harmony import */ var _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Company/Companies */ 16);
+/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Company/Companies */ 18);
/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_Company_Companies__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Company/GetJobRequirementText */ 88);
+/* harmony import */ var _Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Company/GetJobRequirementText */ 92);
/* harmony import */ var _Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Company/data/CompanyPositionNames */ 32);
+/* harmony import */ var _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Company/data/CompanyPositionNames */ 36);
/* harmony import */ var _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Corporation/Corporation */ 58);
-/* harmony import */ var _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__);
+/* harmony import */ var _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Corporation/Corporation */ 60);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Constants */ 1);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _Crimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Crimes */ 33);
+/* harmony import */ var _Crimes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Crimes */ 38);
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./engine */ 8);
-/* harmony import */ var _Infiltration__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Infiltration */ 126);
-/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NetscriptFunctions */ 37);
-/* harmony import */ var _Locations__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Locations */ 3);
+/* harmony import */ var _Infiltration__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Infiltration */ 136);
+/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./NetscriptFunctions */ 43);
+/* harmony import */ var _Locations__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Locations */ 5);
/* harmony import */ var _Locations__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_Locations__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Server */ 10);
-/* harmony import */ var _ServerPurchases__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ServerPurchases */ 108);
-/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Settings */ 18);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Server */ 11);
+/* harmony import */ var _ServerPurchases__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ServerPurchases */ 117);
+/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Settings */ 19);
/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_Settings__WEBPACK_IMPORTED_MODULE_15__);
-/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./SpecialServerIps */ 28);
+/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./SpecialServerIps */ 32);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./ui/numeralFormat */ 4);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_17__);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_19__);
-/* harmony import */ var _utils_IPAddress__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utils/IPAddress */ 57);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 5);
+/* harmony import */ var _utils_IPAddress__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utils/IPAddress */ 61);
+/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 3);
/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_21__);
-/* harmony import */ var _utils_YesNoBox__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utils/YesNoBox */ 19);
+/* harmony import */ var _utils_YesNoBox__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utils/YesNoBox */ 17);
@@ -40404,7 +46082,7 @@ function displayLocationContent() {
case _Locations__WEBPACK_IMPORTED_MODULE_11__["Locations"].Sector12CityHall:
cityHallCreateCorporation.style.display = "block";
- if (_Player__WEBPACK_IMPORTED_MODULE_12__[/* Player */ "a"].corporation instanceof _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__["Corporation"]) {
+ if (_Player__WEBPACK_IMPORTED_MODULE_12__[/* Player */ "a"].corporation instanceof _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__[/* Corporation */ "a"]) {
cityHallCreateCorporation.className = "a-link-button-inactive";
} else {
cityHallCreateCorporation.className = "a-link-button";
@@ -41642,7 +47320,7 @@ function initLocationButtons() {
Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_18__["dialogBoxCreate"])("Invalid company name!");
return false;
}
- _Player__WEBPACK_IMPORTED_MODULE_12__[/* Player */ "a"].corporation = new _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__["Corporation"]({
+ _Player__WEBPACK_IMPORTED_MODULE_12__[/* Player */ "a"].corporation = new _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__[/* Corporation */ "a"]({
name:companyName,
});
displayLocationContent();
@@ -41655,7 +47333,7 @@ function initLocationButtons() {
noBtn.addEventListener("click", function() {
return Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_22__[/* yesNoTxtInpBoxClose */ "f"])();
});
- if (_Player__WEBPACK_IMPORTED_MODULE_12__[/* Player */ "a"].corporation instanceof _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__["Corporation"]) {
+ if (_Player__WEBPACK_IMPORTED_MODULE_12__[/* Player */ "a"].corporation instanceof _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_5__[/* Corporation */ "a"]) {
return;
} else {
Object(_utils_YesNoBox__WEBPACK_IMPORTED_MODULE_22__[/* yesNoTxtInpBoxCreate */ "g"])("Would you like to start a corporation? This will require $150b " +
@@ -41914,458 +47592,7 @@ function purchaseServerBoxCreate(ram, cost) {
/***/ }),
-/* 86 */
-/*!***************************!*\
- !*** ./src/Literature.js ***!
- \***************************/
-/*! exports provided: Literatures, initLiterature, showLiterature */
-/*! exports used: initLiterature, showLiterature */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* unused harmony export Literatures */
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return initLiterature; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return showLiterature; });
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-
-
-/* Literature.js
- * Lore / world building literature that can be found on servers
- */
-function Literature(title, filename, txt) {
- this.title = title;
- this.fn = filename;
- this.txt = txt;
-}
-
-function showLiterature(fn) {
- var litObj = Literatures[fn];
- if (litObj == null) {return;}
- var txt = "" + litObj.title + "
" +
- litObj.txt;
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_0__["dialogBoxCreate"])(txt);
-}
-
-let Literatures = {}
-
-function initLiterature() {
- var title, fn, txt;
- title = "The Beginner's Guide to Hacking";
- fn = "hackers-starting-handbook.lit";
- txt = "Some resources:
" +
- "When starting out, hacking is the most profitable way to earn money and progress. This " +
- "is a brief collection of tips/pointers on how to make the most out of your hacking scripts.
" +
- "-hack() and grow() both work by percentages. hack() steals a certain percentage of the " +
- "money on a server, and grow() increases the amount of money on a server by some percentage (multiplicatively)
" +
- "-Because hack() and grow() work by percentages, they are more effective if the target server has a high amount of money. " +
- "Therefore, you should try to increase the amount of money on a server (using grow()) to a certain amount before hacking it. Two " +
- "import Netscript functions for this are getServerMoneyAvailable() and getServerMaxMoney()
" +
- "-Keep security level low. Security level affects everything when hacking. Two important Netscript functions " +
- "for this are getServerSecurityLevel() and getServerMinSecurityLevel()
" +
- "-Purchase additional servers by visiting 'Alpha Enterprises' in the city. They are relatively cheap " +
- "and give you valuable RAM to run more scripts early in the game
" +
- "-Prioritize upgrading the RAM on your home computer. This can also be done at 'Alpha Enterprises'
" +
- "-Many low level servers have free RAM. You can use this RAM to run your scripts. Use the scp Terminal or " +
- "Netscript command to copy your scripts onto these servers and then run them.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "The Complete Handbook for Creating a Successful Corporation";
- fn = "corporation-management-handbook.lit";
- txt = "Getting Started with Corporations " +
- "To get started, visit the City Hall in Sector-12 in order to create a Corporation. This requires " +
- "$150b of your own money, but this $150b will get put into your Corporation's funds. " +
- "After creating your Corporation, you will see it listed as one of the locations in the city. Click on " +
- "your Corporation in order to manage it.
" +
- "Your Corporation can have many different divisions, each in a different Industry. There are many different " +
- "types of Industries, each with different properties. To create your first division, click the " +
- "'Expand into new Industry' button at the top of the management UI. The Agriculture " +
- "and Software industries are recommended for your first division.
" +
- "The first thing you'll need to do is hire some employees. Employees can be assigned to five different positions. " +
- "Each position has a different effect on various aspects of your Corporation. It is recommended to have at least " +
- "one employee at each position.
" +
- "Each industry uses some combination of Materials in order to produce other Materials and/or create Products. " +
- "Specific information about this is displayed in each of your divisions' UI.
" +
- "Products are special, industry-specific objects. They are different than Materials because you " +
- "must manually choose to develop them, and you can choose to develop any number of Products. Developing " +
- "a Product takes time, but a Product typically generates significantly more revenue than any Material. " +
- "Not all industries allow you to create Products. To create a Product, look for a button " +
- "in the top-left panel of the division UI (e.g. For the Software Industry, the button says 'Develop Software').
" +
- "To get your supply chain system started, " +
- "purchase the Materials that your industry needs to produce other Materials/Products. This can be done " +
- "by clicking the 'Buy' button next to the corresponding Material(s). After you have the required Materials, " +
- "you will immediately start production. The amount of Materials/Products you produce is based on a variety of factors, " +
- "one of which is your employees and their productivity.
" +
- "Once you start producing Materials/Products, you can sell them in order to start earning revenue. This can be done " +
- "by clicking the 'Sell' button next to the corresponding Material or Product. The amount of Material/Product you sell is dependent " +
- "on a wide variety of different factors.
" +
- "These are the basics of getting your Corporation up and running! Now, you can start purchasing upgrades to improve " +
- "your bottom line. If you need money, consider looking for seed investors, who will give you money in exchange for stock shares. " +
- "Otherwise, once you feel you are ready, take your Corporation public! Once your Corporation goes public, you can no longer " +
- "find investors. Instead, your Corporation will be publicly traded and its stock price will change based on how well " +
- "it's performing financially. You can then sell your stock shares in order to make money.
" +
- "Tips/Pointers " +
- "-Purchasing Hardware, Robots, AI Cores, and Real Estate can potentially increase your production. " +
- "The effects of these depend on what industry you are in.
" +
- "-In order to optimize your production, you will need a good balance of Operators, Managers, and Engineers
" +
- "-Different employees excel in different jobs. For example, the highly intelligent employees will probably do best " +
- "if they are assigned to do Engineering work or Research & Development.
" +
- "-If your employees have low morale, energy, or happiness, their production will greatly suffer.
" +
- "-Tech is important, but don't neglect sales! Having several Businessmen can boost your sales and your bottom line.
" +
- "-Don't forget to advertise your company. You won't have any business if nobody knows you.
" +
- "-Having company awareness is great, but what's really important is your company's popularity. Try to keep " +
- "your popularity as high as possible to see the biggest benefit for your sales
" +
- "-Remember, you need to spend money to make money!
" +
- "-Corporations do not reset when installing Augmentations, but they do reset when destroying a BitNode";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "A Brief History of Synthoids";
- fn = "history-of-synthoids.lit";
- txt = "Synthetic androids, or Synthoids for short, are genetically engineered robots and, short of Augmentations, " +
- "are composed entirely of organic substances. For this reason, Synthoids are virtually identical to " +
- "humans in form, composition, and appearance.
" +
- "Synthoids were first designed and manufactured by OmniTek Incorporated sometime around the middle of the century. " +
- "Their original purpose was to be used for manual labor and as emergency responders for disasters. As such, they " +
- "were initially programmed only for their specific tasks. Each iteration that followed improved upon the " +
- "intelligence and capabilities of the Synthoids. By the 6th iteration, called MK-VI, the Synthoids were " +
- "so smart and capable enough of making their own decisions that many argued OmniTek had created the first " +
- "sentient AI. These MK-VI Synthoids were produced in mass quantities (estimates up to 50 billion) with the hopes of increasing society's " +
- "productivity and bolstering the global economy. Stemming from humanity's desire for technological advancement, optimism " +
- "and excitement about the future had never been higher.
" +
- "All of that excitement and optimism quickly turned to fear, panic, and dread in 2070, when a terrorist group " +
- "called Ascendis Totalis hacked into OmniTek and uploaded a rogue AI into severeal of their Synthoid manufacturing facilities. " +
- "This hack went undetected and for months OmniTek unknowingly churned out legions of Synthoids embedded with this " +
- "rogue AI. Then, on December 24th, 2070, Omnica activated dormant protocols in the rogue AI, causing all of the " +
- "infected Synthoids to immediately launch a military campaign to seek and destroy all of humanity.
" +
- "What ensued was the deadlist conflict in human history. This crisis, now commonly known as the Synthoid Uprising, " +
- "resulted in almost ten billion deaths over the course of a year. Despite the nations of the world banding together " +
- "to combat the threat, the MK-VI Synthoids were simply stronger, faster, more intelligent, and more adaptable than humans, " +
- "outsmarting them at every turn.
" +
- "It wasn't until the sacrifice of an elite international military taskforce, called the Bladeburners, that humanity " +
- "was finally able to defeat the Synthoids. The Bladeburners' final act was a suicide bombing mission that " +
- "destroyed a large portion of the MK-VI Synthoids, including many of its leaders. In the following " +
- "weeks militaries from around the world were able to round up and shut down the remaining rogue MK-VI Synthoids, ending " +
- "the Synthoid Uprising.
" +
- "In the aftermath of the bloodshed, the Synthoid Accords were drawn up. These Accords banned OmniTek Incorporated " +
- "from manufacturing any Synthoids beyond the MK-III series. They also banned any other corporation " +
- "from constructing androids with advanced, near-sentient AI. MK-VI Synthoids that did not have the rogue Ascendis Totalis " +
- "AI were allowed to continue their existence, but they were stripped of all rights and protections as they " +
- "were not considered humans. They were also banned from doing anything that may pose a global security threat, such " +
- "as working for any military/defense organization or conducting any bioengineering, computing, or robotics related research.
" +
- "Unfortunately, many believe that not all of the rogue MK-VI Synthoids from the Uprising were found and destroyed, " +
- "and that many of them are blending in as normal humans in society today. In response, many nations have created " +
- "Bladeburner divisions, special military branches that are tasked with investigating and dealing with any Synthoid threads.
" +
- "To this day, tensions still exist between the remaining Synthoids and humans as a result of the Uprising.
" +
- "Nobody knows what happened to the terrorist group Ascendis Totalis.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "A Green Tomorrow";
- fn = "A-Green-Tomorrow.lit";
- txt = "Starting a few decades ago, there was a massive global movement towards the generation of renewable energy in an effort to " +
- "combat global warming and climate change. The shift towards renewable energy was a big success, or so it seemed. In 2045 " +
- "a staggering 80% of the world's energy came from non-renewable fossil fuels. Now, about three decades later, that " +
- "number is down to only 15%. Most of the world's energy now comes from nuclear power and renwable sources such as " +
- "solar and geothermal. Unfortunately, these efforts were not the huge success that they seem to be.
" +
- "Since 2045 primary energy use has soared almost tenfold. This was mainly due to growing urban populations and " +
- "the rise of increasingly advanced (and power-hungry) technology that has become ubiquitous in our lives. So, " +
- "despite the fact that the percentage of our energy that comes from fossil fuels has drastically decreased, " +
- "the total amount of energy we are producing from fossil fuels has actually increased.
" +
- "The grim effects of our species' irresponsible use of energy and neglect of our mother world have become increasingly apparent. " +
- "Last year a temperature of 190F was recorded in the Death Valley desert, which is over 50% higher than the highest " +
- "recorded temperature at the beginning of the century. In the last two decades numerous major cities such as Manhattan, Boston, and " +
- "Los Angeles have been partially or fully submerged by rising sea levels. In the present day, over 75% of the world's agriculture is " +
- "done in climate-controlled vertical farms, as most traditional farmland has become unusable due to severe climate conditions.
" +
- "Despite all of this, the greedy and corrupt corporations that rule the world have done nothing to address these problems that " +
- "threaten our species. And so it's up to us, the common people. Each and every one of us can make a difference by doing what " +
- "these corporations won't: taking responsibility. If we don't, pretty soon there won't be an Earth left to save. We are " +
- "the last hope for a green tomorrow.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Alpha and Omega";
- fn = "alpha-omega.lit";
- txt = "Then we saw a new heaven and a new earth, for our first heaven and earth had gone away, and our sea was no more. " +
- "And we saw a new holy city, new Aeria, coming down out of this new heaven, prepared as a bride adorned for her husband. " +
- "And we heard a loud voice saying, 'Behold, the new dwelling place of the Gods. We will dwell with them, and they " +
- "will be our people, and we will be with them as their Gods. We will wipe away every tear from their eyes, and death " +
- "shall be no more, neither shall there be mourning, nor crying, nor pain anymore, for the former things " +
- "have passed away.'
" +
- "And once were were seated on the throne we said 'Behold, I am making all things new.' " +
- "Also we said, 'Write this down, for these words are trustworthy and true.' And we said to you, " +
- "'It is done! I am the Alpha and the Omega, the beginning and the end. To the thirsty I will give from the spring " +
- "of the water of life without payment. The one who conquers will have this heritage, and we will be his God and " +
- "he will be our son. But as for the cowardly, the faithless, the detestable, as for murderers, " +
- "the sexually immoral, sorcerers, idolaters, and all liars, their portion will be in the lake that " +
- "burns with fire and sulfur, for it is the second true death.'";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Are We Living in a Computer Simulation?";
- fn = "simulated-reality.lit";
- txt = "The idea that we are living in a virtual world is not new. It's a trope that has " +
- "been explored constantly in literature and pop culture. However, it is also a legitimate " +
- "scientific hypothesis that many notable physicists and philosophers have debated for years.
" +
- "Proponents for this simulated reality theory often point to how advanced our technology has become, " +
- "as well as the incredibly fast pace at which it has advanced over the past decades. The amount of computing " +
- "power available to us has increased over 100-fold since 2060 due to the development of nanoprocessors and " +
- "quantum computers. Artifical Intelligence has advanced to the point where our entire lives are controlled " +
- "by robots and machines that handle our day-to-day activities such as autonomous transportation and scheduling. " +
- "If we consider the pace at which this technology has advanced and assume that these developments continue, it's " +
- "reasonable to assume that at some point in the future our technology would be advanced enough that " +
- "we could create simulations that are indistinguishable from reality. However, if this is a reasonable outcome " +
- "of continued technological advancement, then it is very likely that such a scenario has already happened.
" +
- "Statistically speaking, somewhere out there in the infinite universe there is an advanced, intelligent species " +
- "that already has such technology. Who's to say that they haven't already created such a virtual reality: our own?";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Beyond Man";
- fn = "beyond-man.lit";
- txt = "Humanity entered a 'transhuman' era a long time ago. And despite the protests and criticisms of many who cried out against " +
- "human augmentation at the time, the transhuman movement continued and prospered. Proponents of the movement ignored the critics, " +
- "arguing that it was in our inherent nature to better ourselves. To improve. To be more than we were. They claimed that " +
- "not doing so would be to go against every living organism's biological purpose: evolution and survival of the fittest.
" +
- "And here we are today, with technology that is advanced enough to augment humans to a state that " +
- "can only be described as posthuman. But what do we have to show for it when this augmentation " +
- "technology is only available to the so-called 'elite'? Are we really better off than before when only 5% of the " +
- "world's population has access to this technology? When the powerful corporations and organizations of the world " +
- "keep it all to themselves, have we really evolved?
" +
- "Augmentation technology has only further increased the divide between the rich and the poor, between the powerful and " +
- "the oppressed. We have not become 'more than human'. We have not evolved from nature's original design. We are still the greedy, " +
- "corrupted, and evil men that we always were.";
- Literatures[fn] = new Literature(title, fn, txt);
-
-
- title = "Brighter than the Sun";
- fn = "brighter-than-the-sun.lit";
- txt = "When people think about the corporations that dominate the East, they typically think of KuaiGong International, which " +
- "holds a complete monopoly for manufacturing and commerce in Asia, or Global Pharmaceuticals, the world's largest " +
- "drug company, or OmniTek Incorporated, the global leader in intelligent and autonomous robots. But there's one company " +
- "that has seen a rapid rise in the last year and is poised to dominate not only the East, but the entire world: TaiYang Digital.
" +
- "TaiYang Digital is a Chinese internet-technology corporation that provides services such as " +
- "online advertising, search, gaming, media, entertainment, and cloud computing/storage. Its name TaiYang comes from the Chinese word " +
- "for 'sun'. In Chinese culture, the sun is a 'yang' symbol " +
- "associated with life, heat, masculinity, and heaven.
" +
- "The company was founded " +
- "less than 5 years ago and is already the third highest valued company in all of Asia. In 2076 it generated a total revenue of " +
- "over 10 trillion yuan. It's services are used daily by over a billion people worldwide.
" +
- "TaiYang Digital's meteoric rise is extremely surprising in modern society. This sort of growth is " +
- "something you'd commonly see in the first half of the century, especially for tech companies. However in " +
- "the last two decades the number of corporations has significantly declined as the largest entities " +
- "quickly took over the economy. Corporations such as ECorp, MegaCorp, and KuaiGong have established " +
- "such strong monopolies in their market sectors that they have effectively killed off all " +
- "of the smaller and new corporations that have tried to start up over the years. This is what makes " +
- "the rise of TaiYang Digital so impressive. And if TaiYang continues down this path, then they have " +
- "a bright future ahead of them.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Democracy is Dead: The Fall of an Empire";
- fn = "democracy-is-dead.lit";
- txt = "They rose from the shadows in the street From the places where the oppressed meet " +
- "Their cries echoed loudly through the air As they once did in Tiananmen Square " +
- "Loudness in the silence, Darkness in the light They came forth with power and might " +
- "Once the beacon of democracy, America was first Its pillars of society destroyed and dispersed " +
- "Soon the cries rose everywhere, with revolt and riot Until one day, finally, all was quiet " +
- "From the ashes rose a new order, corporatocracy was its name " +
- "Rome, Mongol, Byzantine, all of history is just the same " +
- "For man will never change in a fundamental way " +
- "And now democracy is dead, in the USA";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Figures Show Rising Crime Rates in Sector-12";
- fn = "sector-12-crime.lit";
- txt = "A recent study by analytics company Wilson Inc. shows a significant rise " +
- "in criminal activity in Sector-12. Perhaps the most alarming part of the statistic " +
- "is that most of the rise is in violent crime such as homicide and assault. According " +
- "to the study, the city saw a total of 21,406 reported homicides in 2076, which is over " +
- "a 20% increase compared to 2075.
" +
- "CIA director David Glarow says its too early to know " +
- "whether these figures indicate the beginning of a sustained increase in crime rates, or whether " +
- "the year was just an unfortunate outlier. He states that many intelligence and law enforcement " +
- "agents have noticed an increase in organized crime activites, and believes that these figures may " +
- "be the result of an uprising from criminal organizations such as The Syndicate or the Slum Snakes.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Man and the Machine";
- fn = "man-and-machine.lit";
- txt = "In 2005 Ray Kurzweil popularized his theory of the Singularity. He predicted that the rate " +
- "of technological advancement would continue to accelerate faster and faster until one day " +
- "machines would be become infinitely more intelligent than humans. This point, called the " +
- "Singularity, would result in a drastic transformation of the world as we know it. He predicted " +
- "that the Singularity would arrive by 2045. " +
- "And yet here we are, more than three decades later, where most would agree that we have not " +
- "yet reached a point where computers and machines are vastly more intelligent than we are. So what gives?
" +
- "The answer is that we have reached the Singularity, just not in the way we expected. The artifical superintelligence " +
- "that was predicted by Kurzweil and others exists in the world today - in the form of Augmentations. " +
- "Yes, those Augmentations that the rich and powerful keep to themselves enable humans " +
- "to become superintelligent beings. The Singularity did not lead to a world where " +
- "our machines are infinitely more intelligent than us, it led to a world " +
- "where man and machine can merge to become something greater. Most of the world just doesn't " +
- "know it yet."
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Secret Societies";
- fn = "secret-societies.lit";
- txt = "The idea of secret societies has long intrigued the general public by inspiring curiosity, fascination, and " +
- "distrust. People have long wondered about who these secret society members are and what they do, with the " +
- "most radical of conspiracy theorists claiming that they control everything in the entire world. And while the world " +
- "may never know for sure, it is likely that many secret societies do actually exist, even today.
" +
- "However, the secret societies of the modern world are nothing like those that (supposedly) existed " +
- "decades and centuries ago. The Freemasons, Knights Templar, and Illuminati, while they may have been around " +
- "at the turn of the 21st century, almost assuredly do not exist today. The dominance of the Web in " +
- "our everyday lives and the fact that so much of the world is now digital has given rise to a new breed " +
- "of secret societies: Internet-based ones.
" +
- "Commonly called 'hacker groups', Internet-based secret societies have become well-known in today's " +
- "world. Some of these, such as The Black Hand, are black hat groups that claim they are trying to " +
- "help the oppressed by attacking the elite and powerful. Others, such as NiteSec, are hacktivist groups " +
- "that try to push political and social agendas. Perhaps the most intriguing hacker group " +
- "is the mysterious Bitrunners, whose purpose still remains unknown.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Space: The Failed Frontier";
- fn = "the-failed-frontier.lit";
- txt = "Humans have long dreamed about spaceflight. With enduring interest, we were driven to explore " +
- "the unknown and discover new worlds. We dreamed about conquering the stars. And in our quest, " +
- "we pushed the boundaries of our scientific limits, and then pushed further. Space exploration " +
- "lead to the development of many important technologies and new industries.
" +
- "But sometime in the middle of the 21st century, all of that changed. Humanity lost its ambitions and " +
- "aspirations of exploring the cosmos. The once-large funding for agencies like NASA and the European " +
- "Space Agency gradually whittled away until their eventual disbanding in the 2060's. Not even " +
- "militaries are fielding flights into space nowadays. The only remnants of the once great mission for cosmic " +
- "conquest are the countless satellites in near-earth orbit, used for communications, espionage, " +
- "and other corporate interests.
" +
- "And as we continue to look at the state of space technology, it becomes more and " +
- "more apparent that we will never return to that golden age of space exploration, that " +
- "age where everyone dreamed of going beyond earth for the sake of discovery.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Coded Intelligence: Myth or Reality?";
- fn = "coded-intelligence.lit";
- txt = "Tremendous progress has been made in the field of Artificial Intelligence over the past few decades. " +
- "Our autonomous vehicles and transporation systems. The electronic personal assistants that control our everyday lives. " +
- "Medical, service, and manufacturing robots. All of these are examples of how far AI has come and how much it has " +
- "improved our daily lives. However, the question still remains of whether AI will ever be advanced enough to re-create " +
- "human intelligence.
" +
- "We've certainly come close to artificial intelligence that is similar to humans. For example OmniTek Incorporated's " +
- "CompanionBot, a robot meant to act as a comforting friend for lonely and grieving people, is eerily human-like " +
- "in its appearance, speech, mannerisms, and even movement. However its artificial intelligence isn't the same as " +
- "that of humans. Not yet. It doesn't have sentience or self-awareness or consciousness.
" +
- "Many neuroscientists believe that we won't ever reach the point of creating artificial human intelligence. 'At the end of the " +
- "the day, AI comes down to 1's and 0's, while the human brain does not. We'll never see AI that is identical to that of " +
- "humans.'";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Synthetic Muscles";
- fn = "synthetic-muscles.lit";
- txt = "Initial versions of synthetic muscles weren't made of anything organic but were actually " +
- "crude devices made to mimic human muscle function. Some of the early iterations were actually made of " +
- "common materials such as fishing lines and sewing threads due to their high strength for " +
- "a cheap cost.
" +
- "As technology progressed, however, advances in biomedical engineering paved the way for a new method of " +
- "creating synthetic muscles. Instead of creating something that closely imitated the functionality " +
- "of human muscle, scientists discovered a way of forcing the human body itself to augment its own " +
- "muscle tissue using both synthetic and organic materials. This is typically done using gene therapy " +
- "or chemical injections.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "Tensions rise in global tech race";
- fn = "tensions-in-tech-race.lit";
- txt = "Have we entered a new Cold War? Is WWIII just beyond the horizon?
" +
- "After rumors came out that OmniTek Incorporated had begun developing advanced robotic supersoldiers, " +
- "geopolitical tensions quickly flared between the USA, Russia, and several Asian superpowers. " +
- "In a rare show of cooperation between corporations, MegaCorp and ECorp have " +
- "reportedly launched hundreds of new surveillance and espionage satellites. " +
- "Defense contractors such as " +
- "DeltaOne and AeroCorp have been working with the CIA and NSA to prepare " +
- "for conflict. Meanwhile, the rest of the world sits in earnest " +
- "hoping that it never reaches full-scale war. With today's technology " +
- "and firepower, a World War would assuredly mean the end of human civilization.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "The Cost of Immortality";
- fn = "cost-of-immortality.lit";
- txt = "Evolution and advances in medical and augmentation technology has lead to drastic improvements " +
- "in human mortality rates. Recent figures show that the life expectancy for humans " +
- "that live in a first-world country is about 130 years of age, almost double of what it was " +
- "at the turn of the century. However, this increase in average lifespan has had some " +
- "significant effects on society and culture.
" +
- "Due to longer lifespans and a better quality of life, many adults are holding " +
- "off on having kids until much later. As a result, the percentage of youth in " +
- "first-world countries has been decreasing, while the number " +
- "of senior citizens is significantly increasing.
" +
- "Perhaps the most alarming result of all of this is the rapidly shrinking workforce. " +
- "Despite the increase in life expectancy, the typical retirement age for " +
- "workers in America has remained about the same, meaning a larger and larger " +
- "percentage of people in America are retirees. Furthermore, many " +
- "young adults are holding off on joining the workforce because they feel that " +
- "they have plenty of time left in their lives for employment, and want to " +
- "'enjoy life while they're young.' For most industries, this shrinking workforce " +
- "is not a major issue as most things are handled by robots anyways. However, " +
- "there are still several key industries such as engineering and education " +
- "that have not been automated, and these remain in danger to this cultural " +
- "phenomenon.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "The Hidden World";
- fn = "the-hidden-world.lit";
- txt = "WAKE UP SHEEPLE
" +
- "THE GOVERNMENT DOES NOT EXIST. CORPORATIONS DO NOT RUN SOCIETY
" +
- "THE ILLUMINATI ARE THE SECRET RULERS OF THE WORLD!
" +
- "Yes, the Illuminati of legends. The ancient secret society that controls the entire " +
- "world from the shadows with their invisible hand. The group of the rich and wealthy " +
- "that have penetrated every major government, financial agency, and corporation in the last " +
- "three hundred years.
" +
- "OPEN YOUR EYES
" +
- "It was the Illuminati that brought an end to democracy in the world. They are the driving force " +
- "behind everything that happens.
" +
- "THEY ARE ALL AROUND YOU
" +
- "After destabilizing the world's governments, they are now entering the final stage of their master plan. " +
- "They will secretly initiate global crises. Terrorism. Pandemics. World War. And out of the chaos " +
- "that ensues they will build their New World Order.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "The New God";
- fn = "the-new-god.lit";
- txt = "Everyone has that moment in their life where they wonder about the bigger questions
" +
- "What's the point of all of this? What is my purpose?
" +
- "Some people dare to think even bigger
" +
- "What will be the fate of the human race?
" +
- "We live in an era vastly different from that of even 15 or 20 years ago. We have gone " +
- "where no man has gone before. We have stripped ourselves of the tyranny of flesh.
" +
- "The Singularity is here. The merging of man and machine. This is where humanity evolves into " +
- "something greater. This is our future
" +
- "Embrace it, and you will obey a new god. The God in the Machine";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "The New Triads";
- fn = "new-triads.lit";
- txt = "The Triads were an ancient transnational crime syndicate based in China, Hong Kong, and other Asian " +
- "territories. They were often considered one of the first and biggest criminal secret societies. " +
- "While most of the branches of the Triads have been destroyed over the past few decades, the " +
- "crime faction has spawned and inspired a number of other Asian crime organizations over the past few years. " +
- "The most notable of these is the Tetrads.
" +
- "It is widely believed that the Tetrads are a rogue group that splintered off from the Triads sometime in the " +
- "mid 21st century. The founders of the Tetrads, all of whom were ex-Triad members, believed that the " +
- "Triads were losing their purpose and direction. The Tetrads started off as a small group that mainly engaged " +
- "in fraud and extortion. They were largely unknown until just a few years ago when they took over the illegal " +
- "drug trade in all of the major Asian cities. They quickly became the most powerful crime syndicate in the " +
- "continent.
" +
- "Not much else is known about the Tetrads, or about the efforts the Asian governments and corporations are making " +
- "to take down this large new crime organization. Many believe that the Tetrads have infiltrated the governments " +
- "and powerful corporations in Asia, which has helped faciliate their recent rapid rise.";
- Literatures[fn] = new Literature(title, fn, txt);
-
- title = "The Secret War";
- fn = "the-secret-war.lit";
- txt = ""
- Literatures[fn] = new Literature(title, fn, txt);
-
-}
-
-
-
-
-/***/ }),
-/* 87 */
+/* 91 */
/*!****************************************!*\
!*** ./utils/helpers/compareArrays.ts ***!
\****************************************/
@@ -42396,7 +47623,7 @@ exports.compareArrays = compareArrays;
/***/ }),
-/* 88 */
+/* 92 */
/*!**********************************************!*\
!*** ./src/Company/GetJobRequirementText.ts ***!
\**********************************************/
@@ -42462,7 +47689,7 @@ exports.getJobRequirementText = getJobRequirementText;
/***/ }),
-/* 89 */
+/* 93 */
/*!****************************************!*\
!*** ./utils/helpers/getRandomByte.ts ***!
\****************************************/
@@ -42473,7 +47700,7 @@ exports.getJobRequirementText = getJobRequirementText;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const getRandomInt_1 = __webpack_require__(/*! ./getRandomInt */ 17);
+const getRandomInt_1 = __webpack_require__(/*! ./getRandomInt */ 15);
/**
* Gets a random value in the range of a byte (0 - 255), or up to the maximum.
* @param max The maximum value (up to 255).
@@ -42488,9 +47715,37 @@ exports.getRandomByte = getRandomByte;
/***/ }),
-/* 90 */,
-/* 91 */,
-/* 92 */
+/* 94 */,
+/* 95 */,
+/* 96 */
+/*!****************************************!*\
+ !*** ./src/Corporation/ResearchMap.ts ***!
+ \****************************************/
+/*! no static exports found */
+/*! all exports used */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+// The Research Map is an object that holds all Corporation Research objects
+// as values. They are identified by their names
+const Research_1 = __webpack_require__(/*! ./Research */ 202);
+const ResearchMetadata_1 = __webpack_require__(/*! ./data/ResearchMetadata */ 201);
+exports.ResearchMap = {};
+function addResearch(p) {
+ if (exports.ResearchMap[p.name] != null) {
+ console.warn(`Duplicate Research being defined: ${p.name}`);
+ }
+ exports.ResearchMap[p.name] = new Research_1.Research(p);
+}
+for (const metadata of ResearchMetadata_1.researchMetadata) {
+ addResearch(metadata);
+}
+
+
+/***/ }),
+/* 97 */
/*!****************************************!*\
!*** ./src/CodingContractGenerator.js ***!
\****************************************/
@@ -42501,13 +47756,13 @@ exports.getRandomByte = getRandomByte;
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return generateRandomContract; });
/* unused harmony export generateContract */
-/* harmony import */ var _CodingContracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CodingContracts */ 36);
+/* harmony import */ var _CodingContracts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CodingContracts */ 42);
/* harmony import */ var _CodingContracts__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_CodingContracts__WEBPACK_IMPORTED_MODULE_0__);
-/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Faction/Factions */ 13);
+/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Faction/Factions */ 14);
/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Server */ 10);
-/* harmony import */ var _utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/helpers/getRandomInt */ 17);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Server */ 11);
+/* harmony import */ var _utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/helpers/getRandomInt */ 15);
/* harmony import */ var _utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_4__);
@@ -42667,7 +47922,7 @@ function getRandomFilename(server, reward) {
/***/ }),
-/* 93 */
+/* 98 */
/*!******************************!*\
!*** ./src/CinematicText.js ***!
\******************************/
@@ -42679,12 +47934,12 @@ function getRandomFilename(server, reward) {
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return cinematicTextFlag; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return writeCinematicText; });
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./engine */ 8);
-/* harmony import */ var _utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/uiHelpers/removeChildrenFromElement */ 31);
+/* harmony import */ var _utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/uiHelpers/removeChildrenFromElement */ 29);
/* harmony import */ var _utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_removeChildrenFromElement__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/uiHelpers/createElement */ 2);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 39);
-/* harmony import */ var _utils_helpers_isString__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/helpers/isString */ 44);
+/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 44);
+/* harmony import */ var _utils_helpers_isString__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/helpers/isString */ 40);
/* harmony import */ var _utils_helpers_isString__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_isString__WEBPACK_IMPORTED_MODULE_4__);
@@ -42788,7 +48043,7 @@ function cinematicTextEnd() {
/***/ }),
-/* 94 */
+/* 99 */
/*!***********************************************!*\
!*** ./src/Company/GetNextCompanyPosition.ts ***!
\***********************************************/
@@ -42799,7 +48054,7 @@ function cinematicTextEnd() {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const CompanyPositions_1 = __webpack_require__(/*! ./CompanyPositions */ 25);
+const CompanyPositions_1 = __webpack_require__(/*! ./CompanyPositions */ 28);
function getNextCompanyPosition(currPos) {
if (currPos == null) {
return null;
@@ -42814,7 +48069,7 @@ exports.getNextCompanyPosition = getNextCompanyPosition;
/***/ }),
-/* 95 */
+/* 100 */
/*!************************************!*\
!*** ./src/ui/createStatusText.ts ***!
\************************************/
@@ -42825,7 +48080,7 @@ exports.getNextCompanyPosition = getNextCompanyPosition;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const getElementById_1 = __webpack_require__(/*! ../../utils/uiHelpers/getElementById */ 50);
+const getElementById_1 = __webpack_require__(/*! ../../utils/uiHelpers/getElementById */ 53);
const threeSeconds = 3000;
let x;
/**
@@ -42851,7 +48106,7 @@ exports.createStatusText = createStatusText;
/***/ }),
-/* 96 */
+/* 101 */
/*!*************************!*\
!*** ./src/HelpText.ts ***!
\*************************/
@@ -43092,14 +48347,356 @@ exports.HelpTexts = {
/***/ }),
-/* 97 */,
-/* 98 */,
-/* 99 */,
-/* 100 */,
-/* 101 */,
-/* 102 */,
-/* 103 */,
+/* 102 */
+/*!************************************!*\
+ !*** ./src/Corporation/Product.ts ***!
+ \************************************/
+/*! no static exports found */
+/*! exports used: Product */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const EmployeePositions_1 = __webpack_require__(/*! ./EmployeePositions */ 26);
+const MaterialSizes_1 = __webpack_require__(/*! ./MaterialSizes */ 75);
+const ProductRatingWeights_1 = __webpack_require__(/*! ./ProductRatingWeights */ 199);
+const Cities_1 = __webpack_require__(/*! ../Locations/Cities */ 198);
+const JSONReviver_1 = __webpack_require__(/*! ../../utils/JSONReviver */ 13);
+const getRandomInt_1 = __webpack_require__(/*! ../../utils/helpers/getRandomInt */ 15);
+class Product {
+ constructor(params = {}) {
+ // Product name
+ this.name = "";
+ // The demand for this Product in the market. Gradually decreases
+ this.dmd = 0;
+ // How much competition there is in the market for this Product
+ this.cmp = 0;
+ // Markup. Affects how high of a price you can charge for this Product
+ // without suffering a loss in the # of sales
+ this.mku = 0;
+ // Production cost - estimation of how much money it costs to make this Product
+ this.pCost = 0;
+ // Sell cost
+ this.sCost = 0;
+ // Variables for handling the creation process of this Product
+ this.fin = false; // Whether this Product has finished being created
+ this.prog = 0; // Creation progress - A number betwee 0-100 representing percentage
+ this.createCity = ""; // City in which the product is/was being created
+ this.designCost = 0; // How much money was invested into designing this Product
+ this.advCost = 0; // How much money was invested into advertising this Product
+ // Aggregate score for this Product's 'rating'
+ // This is based on the stats/properties below. The weighting of the
+ // stats/properties below differs between different industries
+ this.rat = 0;
+ // Stats/properties of this Product
+ this.qlt = 0;
+ this.per = 0;
+ this.dur = 0;
+ this.rel = 0;
+ this.aes = 0;
+ this.fea = 0;
+ // Data refers to the production, sale, and quantity of the products
+ // These values are specific to a city
+ // For each city, the data is [qty, prod, sell]
+ this.data = {
+ [Cities_1.Cities.Aevum]: [0, 0, 0],
+ [Cities_1.Cities.Chongqing]: [0, 0, 0],
+ [Cities_1.Cities.Sector12]: [0, 0, 0],
+ [Cities_1.Cities.NewTokyo]: [0, 0, 0],
+ [Cities_1.Cities.Ishima]: [0, 0, 0],
+ [Cities_1.Cities.Volhaven]: [0, 0, 0],
+ };
+ // Location of this Product
+ // Only applies for location-based products like restaurants/hospitals
+ this.loc = "";
+ // How much space 1 unit of the Product takes (in the warehouse)
+ // Not applicable for all Products
+ this.siz = 0;
+ // Material requirements. An object that maps the name of a material to how much it requires
+ // to make 1 unit of the product.
+ this.reqMats = {};
+ // Data to keep track of whether production/sale of this Product is
+ // manually limited. These values are specific to a city
+ // [Whether production/sale is limited, limit amount]
+ this.prdman = {
+ [Cities_1.Cities.Aevum]: [false, 0],
+ [Cities_1.Cities.Chongqing]: [false, 0],
+ [Cities_1.Cities.Sector12]: [false, 0],
+ [Cities_1.Cities.NewTokyo]: [false, 0],
+ [Cities_1.Cities.Ishima]: [false, 0],
+ [Cities_1.Cities.Volhaven]: [false, 0],
+ };
+ this.sllman = {
+ [Cities_1.Cities.Aevum]: [false, 0],
+ [Cities_1.Cities.Chongqing]: [false, 0],
+ [Cities_1.Cities.Sector12]: [false, 0],
+ [Cities_1.Cities.NewTokyo]: [false, 0],
+ [Cities_1.Cities.Ishima]: [false, 0],
+ [Cities_1.Cities.Volhaven]: [false, 0],
+ };
+ this.name = params.name ? params.name : "";
+ this.dmd = params.demand ? params.demand : 0;
+ this.cmp = params.competition ? params.competition : 0;
+ this.mku = params.markup ? params.markup : 0;
+ this.createCity = params.createCity ? params.createCity : "";
+ this.designCost = params.designCost ? params.designCost : 0;
+ this.advCost = params.advCost ? params.advCost : 0;
+ this.qlt = params.quality ? params.quality : 0;
+ this.per = params.performance ? params.performance : 0;
+ this.dur = params.durability ? params.durability : 0;
+ this.rel = params.reliability ? params.reliability : 0;
+ this.aes = params.aesthetics ? params.aesthetics : 0;
+ this.fea = params.features ? params.features : 0;
+ this.loc = params.loc ? params.loc : "";
+ this.siz = params.size ? params.size : 0;
+ this.reqMats = params.req ? params.req : {};
+ }
+ // Initiatizes a Product object from a JSON save state.
+ static fromJSON(value) {
+ return JSONReviver_1.Generic_fromJSON(Product, value.data);
+ }
+ // empWorkMult is a multiplier that increases progress rate based on
+ // productivity of employees
+ createProduct(marketCycles = 1, empWorkMult = 1) {
+ if (this.fin) {
+ return;
+ }
+ this.prog += (marketCycles * .01 * empWorkMult);
+ }
+ // @param industry - Industry object. Reference to industry that makes this Product
+ finishProduct(employeeProd, industry) {
+ this.fin = true;
+ //Calculate properties
+ var progrMult = this.prog / 100;
+ var engrRatio = employeeProd[EmployeePositions_1.EmployeePositions.Engineer] / employeeProd["total"], mgmtRatio = employeeProd[EmployeePositions_1.EmployeePositions.Management] / employeeProd["total"], rndRatio = employeeProd[EmployeePositions_1.EmployeePositions.RandD] / employeeProd["total"], opsRatio = employeeProd[EmployeePositions_1.EmployeePositions.Operations] / employeeProd["total"], busRatio = employeeProd[EmployeePositions_1.EmployeePositions.Business] / employeeProd["total"];
+ var designMult = 1 + (Math.pow(this.designCost, 0.1) / 100);
+ console.log("designMult: " + designMult);
+ var balanceMult = (1.2 * engrRatio) + (0.9 * mgmtRatio) + (1.3 * rndRatio) +
+ (1.5 * opsRatio) + (busRatio);
+ var sciMult = 1 + (Math.pow(industry.sciResearch.qty, industry.sciFac) / 800);
+ var totalMult = progrMult * balanceMult * designMult * sciMult;
+ this.qlt = totalMult * ((0.10 * employeeProd[EmployeePositions_1.EmployeePositions.Engineer]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Management]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.RandD]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Operations]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Business]));
+ this.per = totalMult * ((0.15 * employeeProd[EmployeePositions_1.EmployeePositions.Engineer]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Management]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.RandD]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Operations]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Business]));
+ this.dur = totalMult * ((0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Engineer]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Management]) +
+ (0.08 * employeeProd[EmployeePositions_1.EmployeePositions.RandD]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Operations]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Business]));
+ this.rel = totalMult * ((0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Engineer]) +
+ (0.08 * employeeProd[EmployeePositions_1.EmployeePositions.Management]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.RandD]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Operations]) +
+ (0.08 * employeeProd[EmployeePositions_1.EmployeePositions.Business]));
+ this.aes = totalMult * ((0.00 * employeeProd[EmployeePositions_1.EmployeePositions.Engineer]) +
+ (0.08 * employeeProd[EmployeePositions_1.EmployeePositions.Management]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.RandD]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.Operations]) +
+ (0.10 * employeeProd[EmployeePositions_1.EmployeePositions.Business]));
+ this.fea = totalMult * ((0.08 * employeeProd[EmployeePositions_1.EmployeePositions.Engineer]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Management]) +
+ (0.02 * employeeProd[EmployeePositions_1.EmployeePositions.RandD]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Operations]) +
+ (0.05 * employeeProd[EmployeePositions_1.EmployeePositions.Business]));
+ this.calculateRating(industry);
+ var advMult = 1 + (Math.pow(this.advCost, 0.1) / 100);
+ this.mku = 100 / (advMult * Math.pow((this.qlt + 0.001), 0.65) * (busRatio + mgmtRatio));
+ this.dmd = industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness)));
+ this.cmp = getRandomInt_1.getRandomInt(0, 70);
+ //Calculate the product's required materials
+ //For now, just set it to be the same as the requirements to make materials
+ for (var matName in industry.reqMats) {
+ if (industry.reqMats.hasOwnProperty(matName)) {
+ this.reqMats[matName] = industry.reqMats[matName];
+ }
+ }
+ //Calculate the product's size
+ //For now, just set it to be the same size as the requirements to make materials
+ this.siz = 0;
+ for (var matName in industry.reqMats) {
+ this.siz += MaterialSizes_1.MaterialSizes[matName] * industry.reqMats[matName];
+ }
+ //Delete unneeded variables
+ delete this.prog;
+ delete this.createCity;
+ delete this.designCost;
+ delete this.advCost;
+ }
+ calculateRating(industry) {
+ const weights = ProductRatingWeights_1.ProductRatingWeights[industry.type];
+ if (weights == null) {
+ console.log("ERROR: Could not find product rating weights for: " + industry);
+ return;
+ }
+ this.rat = 0;
+ this.rat += weights.Quality ? this.qlt * weights.Quality : 0;
+ this.rat += weights.Performance ? this.per * weights.Performance : 0;
+ this.rat += weights.Durability ? this.dur * weights.Durability : 0;
+ this.rat += weights.Reliability ? this.rel * weights.Reliability : 0;
+ this.rat += weights.Aesthetics ? this.aes * weights.Aesthetics : 0;
+ this.rat += weights.Features ? this.fea * weights.Features : 0;
+ }
+ // Serialize the current object to a JSON save state.
+ toJSON() {
+ return JSONReviver_1.Generic_toJSON("Product", this);
+ }
+}
+exports.Product = Product;
+JSONReviver_1.Reviver.constructors.Product = Product;
+
+
+/***/ }),
+/* 103 */
+/*!*********************************************!*\
+ !*** ./src/Corporation/IndustryUpgrades.ts ***!
+ \*********************************************/
+/*! no static exports found */
+/*! exports used: IndustryUpgrades */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+// Industry upgrades
+// The data structure is an array with the following format:
+// [index in array, base price, price mult, benefit mult (if applicable), name, desc]
+exports.IndustryUpgrades = {
+ "0": [0, 500e3, 1, 1.05,
+ "Coffee", "Provide your employees with coffee, increasing their energy by 5%."],
+ "1": [1, 1e9, 1.06, 1.03,
+ "AdVert.Inc", "Hire AdVert.Inc to advertise your company. Each level of " +
+ "this upgrade grants your company a static increase of 3 and 1 to its awareness and " +
+ "popularity, respectively. It will then increase your company's awareness by 1%, and its popularity " +
+ "by a random percentage between 1% and 3%. These effects are increased by other upgrades " +
+ "that increase the power of your advertising."]
+};
+
+
+/***/ }),
/* 104 */
+/*!*****************************************************!*\
+ !*** ./src/Corporation/data/CorporationUpgrades.ts ***!
+ \*****************************************************/
+/*! no static exports found */
+/*! exports used: CorporationUpgrades */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+// Corporation Upgrades
+// Upgrades for entire corporation, levelable upgrades
+// The data structure is an array with the following format
+// [index in Corporation upgrades array, base price, price mult, benefit mult (additive), name, desc]
+exports.CorporationUpgrades = {
+ //Smart factories, increases production
+ "0": [0, 2e9, 1.07, 0.03,
+ "Smart Factories", "Advanced AI automatically optimizes the operation and productivity " +
+ "of factories. Each level of this upgrade increases your global production by 3% (additive)."],
+ //Smart warehouses, increases storage size
+ "1": [1, 2e9, 1.07, .1,
+ "Smart Storage", "Advanced AI automatically optimizes your warehouse storage methods. " +
+ "Each level of this upgrade increases your global warehouse storage size by 10% (additive)."],
+ //Advertise through dreams, passive popularity/ awareness gain
+ "2": [2, 8e9, 1.09, .001,
+ "DreamSense", "Use DreamSense LCC Technologies to advertise your corporation " +
+ "to consumers through their dreams. Each level of this upgrade provides a passive " +
+ "increase in awareness of all of your companies (divisions) by 0.004 / market cycle," +
+ "and in popularity by 0.001 / market cycle. A market cycle is approximately " +
+ "20 seconds."],
+ //Makes advertising more effective
+ "3": [3, 4e9, 1.12, 0.005,
+ "Wilson Analytics", "Purchase data and analysis from Wilson, a marketing research " +
+ "firm. Each level of this upgrades increases the effectiveness of your " +
+ "advertising by 0.5% (additive)."],
+ //Augmentation for employees, increases cre
+ "4": [4, 1e9, 1.06, 0.1,
+ "Nuoptimal Nootropic Injector Implants", "Purchase the Nuoptimal Nootropic " +
+ "Injector augmentation for your employees. Each level of this upgrade " +
+ "globally increases the creativity of your employees by 10% (additive)."],
+ //Augmentation for employees, increases cha
+ "5": [5, 1e9, 1.06, 0.1,
+ "Speech Processor Implants", "Purchase the Speech Processor augmentation for your employees. " +
+ "Each level of this upgrade globally increases the charisma of your employees by 10% (additive)."],
+ //Augmentation for employees, increases int
+ "6": [6, 1e9, 1.06, 0.1,
+ "Neural Accelerators", "Purchase the Neural Accelerator augmentation for your employees. " +
+ "Each level of this upgrade globally increases the intelligence of your employees " +
+ "by 10% (additive)."],
+ //Augmentation for employees, increases eff
+ "7": [7, 1e9, 1.06, 0.1,
+ "FocusWires", "Purchase the FocusWire augmentation for your employees. Each level " +
+ "of this upgrade globally increases the efficiency of your employees by 10% (additive)."],
+ //Improves sales of materials/products
+ "8": [8, 1e9, 1.08, 0.01,
+ "ABC SalesBots", "Always Be Closing. Purchase these robotic salesmen to increase the amount of " +
+ "materials and products you sell. Each level of this upgrade globally increases your sales " +
+ "by 1% (additive)."],
+ //Improves scientific research rate
+ "9": [9, 5e9, 1.07, 0.05,
+ "Project Insight", "Purchase 'Project Insight', a R&D service provided by the secretive " +
+ "Fulcrum Technologies. Each level of this upgrade globally increases the amount of " +
+ "Scientific Research you produce by 5% (additive)."],
+};
+
+
+/***/ }),
+/* 105 */
+/*!***********************************************************!*\
+ !*** ./src/Corporation/data/CorporationUnlockUpgrades.ts ***!
+ \***********************************************************/
+/*! no static exports found */
+/*! exports used: CorporationUnlockUpgrades */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+// Corporation Unlock Upgrades
+// Upgrades for entire corporation, unlocks features, either you have it or you dont
+// The data structure is an array with the following format:
+// [index in Corporation feature upgrades array, price, name, description]
+exports.CorporationUnlockUpgrades = {
+ //Lets you export goods
+ "0": [0, 20e9, "Export",
+ "Develop infrastructure to export your materials to your other facilities. " +
+ "This allows you to move materials around between different divisions and cities."],
+ //Lets you buy exactly however many required materials you need for production
+ "1": [1, 25e9, "Smart Supply", "Use advanced AI to anticipate your supply needs. " +
+ "This allows you to purchase exactly however many materials you need for production."],
+ //Displays each material/product's demand
+ "2": [2, 5e9, "Market Research - Demand",
+ "Mine and analyze market data to determine the demand of all resources. " +
+ "The demand attribute, which affects sales, will be displayed for every material and product."],
+ //Display's each material/product's competition
+ "3": [3, 5e9, "Market Data - Competition",
+ "Mine and analyze market data to determine how much competition there is on the market " +
+ "for all resources. The competition attribute, which affects sales, will be displayed for " +
+ "for every material and product."],
+ "4": [4, 10e9, "VeChain",
+ "Use AI and blockchain technology to identify where you can improve your supply chain systems. " +
+ "This upgrade will allow you to view a wide array of useful statistics about your " +
+ "Corporation."]
+};
+
+
+/***/ }),
+/* 106 */,
+/* 107 */,
+/* 108 */,
+/* 109 */,
+/* 110 */,
+/* 111 */,
+/* 112 */,
+/* 113 */
/*!************************************!*\
!*** ./src/Faction/FactionInfo.ts ***!
\************************************/
@@ -43274,7 +48871,7 @@ exports.FactionInfos = {
/***/ }),
-/* 105 */
+/* 114 */
/*!*************************************!*\
!*** ./src/NetscriptEnvironment.js ***!
\*************************************/
@@ -43284,9 +48881,9 @@ exports.FactionInfos = {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Environment; });
-/* harmony import */ var _HacknetNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HacknetNode */ 63);
-/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NetscriptFunctions */ 37);
-/* harmony import */ var _NetscriptPort__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./NetscriptPort */ 68);
+/* harmony import */ var _HacknetNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HacknetNode */ 67);
+/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./NetscriptFunctions */ 43);
+/* harmony import */ var _NetscriptPort__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./NetscriptPort */ 71);
@@ -43386,7 +48983,7 @@ Environment.prototype = {
/***/ }),
-/* 106 */
+/* 115 */
/*!*************************************!*\
!*** ./src/NetscriptJSEvaluator.js ***!
\*************************************/
@@ -43510,7 +49107,7 @@ function _getScriptUrls(script, scripts, seen) {
/***/ }),
-/* 107 */
+/* 116 */
/*!************************!*\
!*** ./src/DevMenu.js ***!
\************************/
@@ -43521,25 +49118,25 @@ function _getScriptUrls(script, scripts, seen) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createDevMenu; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return closeDevMenu; });
-/* harmony import */ var _Augmentations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Augmentations */ 20);
-/* harmony import */ var _CodingContractGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CodingContractGenerator */ 92);
-/* harmony import */ var _CreateProgram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CreateProgram */ 22);
-/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Faction/Factions */ 13);
+/* harmony import */ var _Augmentations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Augmentations */ 21);
+/* harmony import */ var _CodingContractGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CodingContractGenerator */ 97);
+/* harmony import */ var _CreateProgram__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CreateProgram */ 24);
+/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Faction/Factions */ 14);
/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Server */ 10);
-/* harmony import */ var _RedPill__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./RedPill */ 55);
-/* harmony import */ var _StockMarket__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./StockMarket */ 21);
-/* harmony import */ var _Stock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Stock */ 24);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Server */ 11);
+/* harmony import */ var _RedPill__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./RedPill */ 58);
+/* harmony import */ var _StockMarket__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./StockMarket */ 22);
+/* harmony import */ var _Stock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Stock */ 27);
/* harmony import */ var _Stock__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_Stock__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _Terminal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Terminal */ 48);
+/* harmony import */ var _Terminal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Terminal */ 51);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ui/numeralFormat */ 4);
/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_10__);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 39);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_helpers_exceptionAlert__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/helpers/exceptionAlert */ 44);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/uiHelpers/createElement */ 2);
/* harmony import */ var _utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_createElement__WEBPACK_IMPORTED_MODULE_13__);
-/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/uiHelpers/removeElementById */ 38);
+/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/uiHelpers/removeElementById */ 20);
/* harmony import */ var _utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_removeElementById__WEBPACK_IMPORTED_MODULE_14__);
@@ -44090,7 +49687,7 @@ function closeDevMenu() {
/***/ }),
-/* 108 */
+/* 117 */
/*!********************************!*\
!*** ./src/ServerPurchases.js ***!
\********************************/
@@ -44104,10 +49701,10 @@ function closeDevMenu() {
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Constants */ 1);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Server */ 10);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_IPAddress__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/IPAddress */ 57);
-/* harmony import */ var _utils_YesNoBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/YesNoBox */ 19);
+/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Server */ 11);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_IPAddress__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/IPAddress */ 61);
+/* harmony import */ var _utils_YesNoBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/YesNoBox */ 17);
@@ -44180,7 +49777,57 @@ function purchaseRamForHomeComputer(cost) {
/***/ }),
-/* 109 */
+/* 118 */
+/*!*********************************************!*\
+ !*** ./src/Corporation/CorporationState.ts ***!
+ \*********************************************/
+/*! no static exports found */
+/*! exports used: AllCorporationStates, CorporationState */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+const JSONReviver_1 = __webpack_require__(/*! ../../utils/JSONReviver */ 13);
+// Array of all valid states
+exports.AllCorporationStates = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"];
+class CorporationState {
+ constructor() {
+ // Number representing what state the Corporation is in. The number
+ // is an index for the array that holds all Corporation States
+ this.state = 0;
+ }
+ // Initiatizes a CorporationState object from a JSON save state.
+ static fromJSON(value) {
+ return JSONReviver_1.Generic_fromJSON(CorporationState, value.data);
+ }
+ // Get the name of the current state
+ // NOTE: This does NOT return the number stored in the 'state' property,
+ // which is just an index for the array of all possible Corporation States.
+ getState() {
+ return exports.AllCorporationStates[this.state];
+ }
+ // Transition to the next state
+ nextState() {
+ if (this.state < 0 || this.state >= exports.AllCorporationStates.length) {
+ this.state = 0;
+ }
+ ++this.state;
+ if (this.state >= exports.AllCorporationStates.length) {
+ this.state = 0;
+ }
+ }
+ // Serialize the current object to a JSON save state.
+ toJSON() {
+ return JSONReviver_1.Generic_toJSON("CorporationState", this);
+ }
+}
+exports.CorporationState = CorporationState;
+JSONReviver_1.Reviver.constructors.CorporationState = CorporationState;
+
+
+/***/ }),
+/* 119 */
/*!************************************************!*\
!*** ./utils/uiHelpers/removeLoadingScreen.ts ***!
\************************************************/
@@ -44191,8 +49838,8 @@ function purchaseRamForHomeComputer(cost) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-const getElementById_1 = __webpack_require__(/*! ./getElementById */ 50);
-const removeElementById_1 = __webpack_require__(/*! ./removeElementById */ 38);
+const getElementById_1 = __webpack_require__(/*! ./getElementById */ 53);
+const removeElementById_1 = __webpack_require__(/*! ./removeElementById */ 20);
/**
* Routes the player from the Loading screen to the main game content.
*/
@@ -44205,14 +49852,14 @@ exports.removeLoadingScreen = removeLoadingScreen;
/***/ }),
-/* 110 */,
-/* 111 */,
-/* 112 */,
-/* 113 */,
-/* 114 */,
-/* 115 */,
-/* 116 */,
-/* 117 */
+/* 120 */,
+/* 121 */,
+/* 122 */,
+/* 123 */,
+/* 124 */,
+/* 125 */,
+/* 126 */,
+/* 127 */
/*!*************************************!*\
!*** ./src/ui/setSettingsLabels.js ***!
\*************************************/
@@ -44223,7 +49870,7 @@ exports.removeLoadingScreen = removeLoadingScreen;
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setSettingsLabels; });
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../engine */ 8);
-/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Settings */ 18);
+/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Settings */ 19);
/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Settings__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _numeralFormat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./numeralFormat */ 4);
/* harmony import */ var _numeralFormat__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_numeralFormat__WEBPACK_IMPORTED_MODULE_2__);
@@ -44338,7 +49985,7 @@ function setSettingsLabels() {
/***/ }),
-/* 118 */
+/* 128 */
/*!**********************************!*\
!*** ./src/CharacterOverview.js ***!
\**********************************/
@@ -44413,7 +50060,7 @@ CharacterOverview.prototype.update = function() {
/***/ }),
-/* 119 */
+/* 129 */
/*!******************************!*\
!*** ./src/JSInterpreter.js ***!
\******************************/
@@ -44423,7 +50070,7 @@ CharacterOverview.prototype.update = function() {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Interpreter; });
-/* harmony import */ var _utils_acorn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/acorn */ 45);
+/* harmony import */ var _utils_acorn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/acorn */ 48);
/* harmony import */ var _utils_acorn__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_utils_acorn__WEBPACK_IMPORTED_MODULE_0__);
/**
@@ -48216,7 +53863,7 @@ Interpreter.prototype['createPrimitive'] = function(x) {return x;};
/***/ }),
-/* 120 */
+/* 130 */
/*!***************************************!*\
!*** ./utils/helpers/isPowerOfTwo.ts ***!
\***************************************/
@@ -48246,7 +53893,7 @@ exports.isPowerOfTwo = isPowerOfTwo;
/***/ }),
-/* 121 */
+/* 131 */
/*!****************************************!*\
!*** ./src/data/gangmemberupgrades.ts ***!
\****************************************/
@@ -48458,7 +54105,7 @@ exports.gangMemberUpgradesMetadata = [
/***/ }),
-/* 122 */
+/* 132 */
/*!*************************************!*\
!*** ./src/data/gangmembertasks.ts ***!
\*************************************/
@@ -48723,7 +54370,7 @@ exports.gangMemberTasksMetadata = [
/***/ }),
-/* 123 */
+/* 133 */
/*!***************************************!*\
!*** ./utils/FactionInvitationBox.js ***!
\***************************************/
@@ -48733,10 +54380,10 @@ exports.gangMemberTasksMetadata = [
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return factionInvitationBoxCreate; });
-/* harmony import */ var _src_Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/Faction/FactionHelpers */ 42);
+/* harmony import */ var _src_Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/Faction/FactionHelpers */ 46);
/* harmony import */ var _src_engine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/engine */ 8);
/* harmony import */ var _src_Player__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../src/Player */ 0);
-/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _src_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../src/ui/navigationTracking */ 12);
/* harmony import */ var _src_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_src_ui_navigationTracking__WEBPACK_IMPORTED_MODULE_4__);
@@ -48807,7 +54454,7 @@ function factionInvitationBoxCreate(faction) {
/***/ }),
-/* 124 */
+/* 134 */
/*!*****************************!*\
!*** ./src/data/servers.ts ***!
\*****************************/
@@ -50280,7 +55927,7 @@ exports.serverMetadata = [
/***/ }),
-/* 125 */
+/* 135 */
/*!**********************************!*\
!*** ./utils/InfiltrationBox.js ***!
\**********************************/
@@ -50290,19 +55937,19 @@ exports.serverMetadata = [
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return infiltrationBoxCreate; });
-/* harmony import */ var _src_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/BitNodeMultipliers */ 9);
+/* harmony import */ var _src_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../src/BitNodeMultipliers */ 10);
/* harmony import */ var _src_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_src_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _src_Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../src/Constants */ 1);
/* harmony import */ var _src_Constants__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_src_Constants__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _src_Faction_Faction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../src/Faction/Faction */ 53);
+/* harmony import */ var _src_Faction_Faction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../src/Faction/Faction */ 56);
/* harmony import */ var _src_Faction_Faction__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_src_Faction_Faction__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _src_Faction_Factions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../src/Faction/Factions */ 13);
+/* harmony import */ var _src_Faction_Factions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../src/Faction/Factions */ 14);
/* harmony import */ var _src_Faction_Factions__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_src_Faction_Factions__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _src_Player__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../src/Player */ 0);
-/* harmony import */ var _DialogBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DialogBox */ 11);
-/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _DialogBox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DialogBox */ 9);
+/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _StringHelperFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./StringHelperFunctions */ 5);
+/* harmony import */ var _StringHelperFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./StringHelperFunctions */ 3);
/* harmony import */ var _StringHelperFunctions__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_7__);
@@ -50427,7 +56074,7 @@ function infiltrationBoxCreate(inst) {
/***/ }),
-/* 126 */
+/* 136 */
/*!*****************************!*\
!*** ./src/Infiltration.js ***!
\*****************************/
@@ -50437,19 +56084,19 @@ function infiltrationBoxCreate(inst) {
"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return beginInfiltration; });
-/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BitNodeMultipliers */ 9);
+/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BitNodeMultipliers */ 10);
/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Constants */ 1);
/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./engine */ 8);
/* harmony import */ var _Player__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Player */ 0);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/DialogBox */ 11);
-/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 15);
+/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/DialogBox */ 9);
+/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 16);
/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/helpers/getRandomInt */ 17);
+/* harmony import */ var _utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utils/helpers/getRandomInt */ 15);
/* harmony import */ var _utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_helpers_getRandomInt__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _utils_InfiltrationBox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/InfiltrationBox */ 125);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 5);
+/* harmony import */ var _utils_InfiltrationBox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/InfiltrationBox */ 135);
+/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 3);
/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_8__);
@@ -51296,22 +56943,46 @@ function getInfiltrationEscapeChance(inst) {
/***/ }),
-/* 127 */,
-/* 128 */,
-/* 129 */,
-/* 130 */,
-/* 131 */,
-/* 132 */,
-/* 133 */,
-/* 134 */,
-/* 135 */,
-/* 136 */,
-/* 137 */,
+/* 137 */
+/*!******************************************!*\
+ !*** ./utils/uiHelpers/clearSelector.ts ***!
+ \******************************************/
+/*! no static exports found */
+/*! exports used: clearSelector */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * Clears all