diff --git a/dist/engine.bundle.js b/dist/engine.bundle.js
index fa33f5b3c..2e594838e 100644
--- a/dist/engine.bundle.js
+++ b/dist/engine.bundle.js
@@ -1,60701 +1,2 @@
-/******/ (function(modules) { // webpackBootstrap
-/******/ // install a JSONP callback for chunk loading
-/******/ function webpackJsonpCallback(data) {
-/******/ var chunkIds = data[0];
-/******/ var moreModules = data[1];
-/******/ var executeModules = data[2];
-/******/
-/******/ // add "moreModules" to the modules object,
-/******/ // then flag all "chunkIds" as loaded and fire callback
-/******/ var moduleId, chunkId, i = 0, resolves = [];
-/******/ for(;i < chunkIds.length; i++) {
-/******/ chunkId = chunkIds[i];
-/******/ if(installedChunks[chunkId]) {
-/******/ resolves.push(installedChunks[chunkId][0]);
-/******/ }
-/******/ installedChunks[chunkId] = 0;
-/******/ }
-/******/ for(moduleId in moreModules) {
-/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
-/******/ modules[moduleId] = moreModules[moduleId];
-/******/ }
-/******/ }
-/******/ if(parentJsonpFunction) parentJsonpFunction(data);
-/******/
-/******/ while(resolves.length) {
-/******/ resolves.shift()();
-/******/ }
-/******/
-/******/ // add entry modules from loaded chunk to deferred list
-/******/ deferredModules.push.apply(deferredModules, executeModules || []);
-/******/
-/******/ // run deferred modules when all chunks ready
-/******/ return checkDeferredModules();
-/******/ };
-/******/ function checkDeferredModules() {
-/******/ var result;
-/******/ for(var i = 0; i < deferredModules.length; i++) {
-/******/ var deferredModule = deferredModules[i];
-/******/ var fulfilled = true;
-/******/ for(var j = 1; j < deferredModule.length; j++) {
-/******/ var depId = deferredModule[j];
-/******/ if(installedChunks[depId] !== 0) fulfilled = false;
-/******/ }
-/******/ if(fulfilled) {
-/******/ deferredModules.splice(i--, 1);
-/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
-/******/ }
-/******/ }
-/******/ return result;
-/******/ }
-/******/
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // object to store loaded and loading chunks
-/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
-/******/ // Promise = chunk loading, 0 = chunk loaded
-/******/ var installedChunks = {
-/******/ 2: 0
-/******/ };
-/******/
-/******/ var deferredModules = [];
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function(exports, name, getter) {
-/******/ if(!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ }
-/******/ };
-/******/
-/******/ // define __esModule on exports
-/******/ __webpack_require__.r = function(exports) {
-/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ }
-/******/ Object.defineProperty(exports, '__esModule', { value: true });
-/******/ };
-/******/
-/******/ // create a fake namespace object
-/******/ // mode & 1: value is a module id, require it
-/******/ // mode & 2: merge all properties of value into the ns
-/******/ // mode & 4: return value when already ns object
-/******/ // mode & 8|1: behave like require
-/******/ __webpack_require__.t = function(value, mode) {
-/******/ if(mode & 1) value = __webpack_require__(value);
-/******/ if(mode & 8) return value;
-/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ var ns = Object.create(null);
-/******/ __webpack_require__.r(ns);
-/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ return ns;
-/******/ };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
-/******/ };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
-/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
-/******/ jsonpArray.push = webpackJsonpCallback;
-/******/ jsonpArray = jsonpArray.slice();
-/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
-/******/ var parentJsonpFunction = oldJsonpFunction;
-/******/
-/******/
-/******/ // add entry module to deferred list
-/******/ deferredModules.push([9,0]);
-/******/ // run deferred modules when ready
-/******/ return checkDeferredModules();
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/*!***********************!*\
- !*** ./src/Player.js ***!
- \***********************/
-/*! exports provided: Player, loadPlayer */
-/*! exports used: Player, loadPlayer */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Player; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return loadPlayer; });
-/* harmony import */ var _Augmentations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Augmentations */ 20);
-/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BitNodeMultipliers */ 10);
-/* harmony import */ var _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__);
-/* harmony import */ var _CodingContracts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CodingContracts */ 42);
-/* harmony import */ var _CodingContracts__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_CodingContracts__WEBPACK_IMPORTED_MODULE_2__);
-/* harmony import */ var _Company_Company__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Company/Company */ 75);
-/* harmony import */ var _Company_Company__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_Company_Company__WEBPACK_IMPORTED_MODULE_3__);
-/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Company/Companies */ 18);
-/* harmony import */ var _Company_Companies__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_Company_Companies__WEBPACK_IMPORTED_MODULE_4__);
-/* harmony import */ var _Company_GetNextCompanyPosition__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Company/GetNextCompanyPosition */ 102);
-/* harmony import */ var _Company_GetNextCompanyPosition__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_Company_GetNextCompanyPosition__WEBPACK_IMPORTED_MODULE_5__);
-/* harmony import */ var _Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Company/GetJobRequirementText */ 94);
-/* harmony import */ var _Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_6__);
-/* harmony import */ var _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Company/CompanyPositions */ 28);
-/* harmony import */ var _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__);
-/* harmony import */ var _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Company/data/CompanyPositionNames */ 36);
-/* harmony import */ var _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__);
-/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Constants */ 1);
-/* harmony import */ var _Constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_Constants__WEBPACK_IMPORTED_MODULE_9__);
-/* harmony import */ var _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Corporation/Corporation */ 60);
-/* harmony import */ var _Programs_Programs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Programs/Programs */ 24);
-/* harmony import */ var _Programs_Programs__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_Programs_Programs__WEBPACK_IMPORTED_MODULE_11__);
-/* harmony import */ var _Crimes__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Crimes */ 38);
-/* harmony import */ var _engine__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./engine */ 9);
-/* harmony import */ var _Faction_Faction__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Faction/Faction */ 56);
-/* harmony import */ var _Faction_Faction__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_Faction_Faction__WEBPACK_IMPORTED_MODULE_14__);
-/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Faction/Factions */ 14);
-/* harmony import */ var _Faction_Factions__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_Faction_Factions__WEBPACK_IMPORTED_MODULE_15__);
-/* harmony import */ var _Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Faction/FactionHelpers */ 46);
-/* harmony import */ var _Gang__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Gang */ 50);
-/* harmony import */ var _Locations__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Locations */ 5);
-/* harmony import */ var _Locations__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_Locations__WEBPACK_IMPORTED_MODULE_18__);
-/* harmony import */ var _NetscriptFunctions__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./NetscriptFunctions */ 43);
-/* harmony import */ var _Server__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Server */ 11);
-/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Settings */ 19);
-/* harmony import */ var _Settings__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_Settings__WEBPACK_IMPORTED_MODULE_21__);
-/* harmony import */ var _SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./SpecialServerIps */ 32);
-/* harmony import */ var _SourceFile__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./SourceFile */ 70);
-/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! decimal.js */ 35);
-/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./ui/numeralFormat */ 4);
-/* harmony import */ var _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__);
-/* harmony import */ var _utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../utils/DialogBox */ 8);
-/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../utils/uiHelpers/clearEventListeners */ 16);
-/* harmony import */ var _utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__);
-/* harmony import */ var _utils_IPAddress__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../utils/IPAddress */ 62);
-/* harmony import */ var _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../utils/JSONReviver */ 13);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../utils/StringHelperFunctions */ 3);
-/* harmony import */ var _utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const CYCLES_PER_SEC = 1000 / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MilliPerCycle;
-
-function PlayerObject() {
- //Skills and stats
- this.hacking_skill = 1;
-
- //Combat stats
- this.hp = 10;
- this.max_hp = 10;
- this.strength = 1;
- this.defense = 1;
- this.dexterity = 1;
- this.agility = 1;
-
- //Labor stats
- this.charisma = 1;
-
- //Special stats
- this.intelligence = 0;
-
- //Hacking multipliers
- this.hacking_chance_mult = 1;
- this.hacking_speed_mult = 1;
- this.hacking_money_mult = 1;
- this.hacking_grow_mult = 1;
-
- //Experience and multipliers
- this.hacking_exp = 0;
- this.strength_exp = 0;
- this.defense_exp = 0;
- this.dexterity_exp = 0;
- this.agility_exp = 0;
- this.charisma_exp = 0;
- this.intelligence_exp= 0;
-
- this.hacking_mult = 1;
- this.strength_mult = 1;
- this.defense_mult = 1;
- this.dexterity_mult = 1;
- this.agility_mult = 1;
- this.charisma_mult = 1;
-
- this.hacking_exp_mult = 1;
- this.strength_exp_mult = 1;
- this.defense_exp_mult = 1;
- this.dexterity_exp_mult = 1;
- this.agility_exp_mult = 1;
- this.charisma_exp_mult = 1;
-
- this.company_rep_mult = 1;
- this.faction_rep_mult = 1;
-
- //Money
- this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](1000);
- this.total_money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](0); //Total money ever earned in this "simulation"
- this.lifetime_money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](0); //Total money ever earned
-
- //IP Address of Starting (home) computer
- this.homeComputer = "";
-
- //Location information
- this.city = _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12;
- this.location = "";
-
- //Company Information
- this.companyName = ""; // Name of Company. Must match a key value in Companies map
- this.companyPosition = ""; // Name of Company Position. Must match a key value in CompanyPositions map
-
- //Servers
- this.currentServer = ""; //IP address of Server currently being accessed through terminal
- this.purchasedServers = []; //IP Addresses of purchased servers
- this.hacknetNodes = [];
- this.totalHacknetNodeProduction = 0;
-
- //Factions
- this.factions = []; //Names of all factions player has joined
- this.factionInvitations = []; //Outstanding faction invitations
-
- //Augmentations
- this.queuedAugmentations = [];
- this.augmentations = [];
-
- this.sourceFiles = [];
-
- //Crime statistics
- this.numPeopleKilled = 0;
- this.karma = 0;
-
- this.crime_money_mult = 1;
- this.crime_success_mult = 1;
-
- //Flags/variables for working (Company, Faction, Creating Program, Taking Class)
- this.isWorking = false;
- this.workType = "";
-
- this.currentWorkFactionName = "";
- this.currentWorkFactionDescription = "";
-
- this.workHackExpGainRate = 0;
- this.workStrExpGainRate = 0;
- this.workDefExpGainRate = 0;
- this.workDexExpGainRate = 0;
- this.workAgiExpGainRate = 0;
- this.workChaExpGainRate = 0;
- this.workRepGainRate = 0;
- this.workMoneyGainRate = 0;
- this.workMoneyLossRate = 0;
-
- this.workHackExpGained = 0;
- this.workStrExpGained = 0;
- this.workDefExpGained = 0;
- this.workDexExpGained = 0;
- this.workAgiExpGained = 0;
- this.workChaExpGained = 0;
- this.workRepGained = 0;
- this.workMoneyGained = 0;
-
- this.createProgramName = "";
- this.createProgramReqLvl = 0;
-
- this.className = "";
-
- this.crimeType = "";
-
- this.timeWorked = 0; //in ms
- this.timeWorkedCreateProgram = 0;
- this.timeNeededToCompleteWork = 0;
-
- this.work_money_mult = 1;
-
- //Hacknet Node multipliers
- this.hacknet_node_money_mult = 1;
- this.hacknet_node_purchase_cost_mult = 1;
- this.hacknet_node_ram_cost_mult = 1;
- this.hacknet_node_core_cost_mult = 1;
- this.hacknet_node_level_cost_mult = 1;
-
- //Stock Market
- this.hasWseAccount = false;
- this.hasTixApiAccess = false;
- this.has4SData = false;
- this.has4SDataTixApi = false;
-
- //Gang
- this.gang = 0;
-
- //Corporation
- this.corporation = 0;
-
- //Bladeburner
- this.bladeburner = 0;
- this.bladeburner_max_stamina_mult = 1;
- this.bladeburner_stamina_gain_mult = 1;
- this.bladeburner_analysis_mult = 1; //Field Analysis Only
- this.bladeburner_success_chance_mult = 1;
-
- //bitnode
- this.bitNodeN = 1;
-
- //Flags for determining whether certain "thresholds" have been achieved
- this.firstFacInvRecvd = false;
- this.firstAugPurchased = false;
- this.firstTimeTraveled = false;
- this.firstProgramAvailable = false;
-
- //Used to store the last update time.
- this.lastUpdate = 0;
- this.totalPlaytime = 0;
- this.playtimeSinceLastAug = 0;
- this.playtimeSinceLastBitnode = 0;
-
- //Production since last Augmentation installation
- this.scriptProdSinceLastAug = 0;
- this.stockProdSinceLastAug = 0;
- this.crimeProdSinceLastAug = 0;
- this.jobProdSinceLastAug = 0;
-};
-
-PlayerObject.prototype.init = function() {
- /* Initialize Player's home computer */
- var t_homeComp = new _Server__WEBPACK_IMPORTED_MODULE_20__[/* Server */ "d"]({
- ip:Object(_utils_IPAddress__WEBPACK_IMPORTED_MODULE_28__[/* createRandomIp */ "a"])(), hostname:"home", organizationName:"Home PC",
- isConnectedTo:true, adminRights:true, purchasedByPlayer:true, maxRam:8
- });
- this.homeComputer = t_homeComp.ip;
- this.currentServer = t_homeComp.ip;
- Object(_Server__WEBPACK_IMPORTED_MODULE_20__[/* AddToAllServers */ "a"])(t_homeComp);
-
- this.getHomeComputer().programs.push(_Programs_Programs__WEBPACK_IMPORTED_MODULE_11__["Programs"].NukeProgram.name);
-}
-
-PlayerObject.prototype.prestigeAugmentation = function() {
- var homeComp = this.getHomeComputer();
- this.currentServer = homeComp.ip;
- this.homeComputer = homeComp.ip;
-
- this.numPeopleKilled = 0;
- this.karma = 0;
-
- //Reset stats
- this.hacking_skill = 1;
-
- this.strength = 1;
- this.defense = 1;
- this.dexterity = 1;
- this.agility = 1;
-
- this.charisma = 1;
-
- this.hacking_exp = 0;
- this.strength_exp = 0;
- this.defense_exp = 0;
- this.dexterity_exp = 0;
- this.agility_exp = 0;
- this.charisma_exp = 0;
-
- this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](1000);
-
- this.city = _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12;
- this.location = "";
-
- this.companyName = "";
- this.companyPosition = "";
-
- this.purchasedServers = [];
-
- this.factions = [];
- this.factionInvitations = [];
-
- this.queuedAugmentations = [];
-
- this.isWorking = false;
- this.currentWorkFactionName = "";
- this.currentWorkFactionDescription = "";
- this.createProgramName = "";
- this.className = "";
- this.crimeType = "";
-
- this.workHackExpGainRate = 0;
- this.workStrExpGainRate = 0;
- this.workDefExpGainRate = 0;
- this.workDexExpGainRate = 0;
- this.workAgiExpGainRate = 0;
- this.workChaExpGainRate = 0;
- this.workRepGainRate = 0;
- this.workMoneyGainRate = 0;
-
- this.workHackExpGained = 0;
- this.workStrExpGained = 0;
- this.workDefExpGained = 0;
- this.workDexExpGained = 0;
- this.workAgiExpGained = 0;
- this.workChaExpGained = 0;
- this.workRepGained = 0;
- this.workMoneyGained = 0;
-
- this.timeWorked = 0;
-
- this.lastUpdate = new Date().getTime();
-
- this.playtimeSinceLastAug = 0;
- this.scriptProdSinceLastAug = 0;
-
- this.hacknetNodes.length = 0;
- this.totalHacknetNodeProduction = 0;
-
- //Re-calculate skills and reset HP
- this.updateSkillLevels();
- this.hp = this.max_hp;
-}
-
-PlayerObject.prototype.prestigeSourceFile = function() {
- var homeComp = this.getHomeComputer();
- this.currentServer = homeComp.ip;
- this.homeComputer = homeComp.ip;
-
- this.numPeopleKilled = 0;
- this.karma = 0;
-
- //Reset stats
- this.hacking_skill = 1;
-
- this.strength = 1;
- this.defense = 1;
- this.dexterity = 1;
- this.agility = 1;
-
- this.charisma = 1;
-
- this.hacking_exp = 0;
- this.strength_exp = 0;
- this.defense_exp = 0;
- this.dexterity_exp = 0;
- this.agility_exp = 0;
- this.charisma_exp = 0;
-
- this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](1000);
-
- this.city = _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12;
- this.location = "";
-
- this.companyName = "";
- this.companyPosition = "";
-
- this.purchasedServers = [];
-
- this.factions = [];
- this.factionInvitations = [];
-
- this.queuedAugmentations = [];
- this.augmentations = [];
-
- this.isWorking = false;
- this.currentWorkFactionName = "";
- this.currentWorkFactionDescription = "";
- this.createProgramName = "";
- this.className = "";
- this.crimeType = "";
-
- this.workHackExpGainRate = 0;
- this.workStrExpGainRate = 0;
- this.workDefExpGainRate = 0;
- this.workDexExpGainRate = 0;
- this.workAgiExpGainRate = 0;
- this.workChaExpGainRate = 0;
- this.workRepGainRate = 0;
- this.workMoneyGainRate = 0;
-
- this.workHackExpGained = 0;
- this.workStrExpGained = 0;
- this.workDefExpGained = 0;
- this.workDexExpGained = 0;
- this.workAgiExpGained = 0;
- this.workChaExpGained = 0;
- this.workRepGained = 0;
- this.workMoneyGained = 0;
-
- this.timeWorked = 0;
-
- this.lastUpdate = new Date().getTime();
-
- this.hacknetNodes.length = 0;
- this.totalHacknetNodeProduction = 0;
-
- //Gang
- this.gang = null;
- Object(_Gang__WEBPACK_IMPORTED_MODULE_17__[/* resetGangs */ "d"])();
-
- //Reset Stock market
- this.hasWseAccount = false;
- this.hasTixApiAccess = false;
- this.has4SData = false;
- this.has4SDataTixApi = false;
-
- //BitNode 3: Corporatocracy
- if (this.bitNodeN === 3) {this.money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](150e9);}
- this.corporation = 0;
-
- this.playtimeSinceLastAug = 0;
- this.playtimeSinceLastBitnode = 0;
- this.scriptProdSinceLastAug = 0;
-
- this.updateSkillLevels();
- this.hp = this.max_hp;
-}
-
-PlayerObject.prototype.getCurrentServer = function() {
- return _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][this.currentServer];
-}
-
-PlayerObject.prototype.getHomeComputer = function() {
- return _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][this.homeComputer];
-}
-
-PlayerObject.prototype.getUpgradeHomeRamCost = function() {
- //Calculate how many times ram has been upgraded (doubled)
- const currentRam = Player.getHomeComputer().maxRam;
- const numUpgrades = Math.log2(currentRam);
-
- //Calculate cost
- //Have cost increase by some percentage each time RAM has been upgraded
- const mult = Math.pow(1.58, numUpgrades);
- var cost = currentRam * _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].BaseCostFor1GBOfRamHome * mult;
- return cost;
-}
-
-PlayerObject.prototype.receiveInvite = function(factionName) {
- if(this.factionInvitations.includes(factionName) || this.factions.includes(factionName)) {
- return;
- }
- this.firstFacInvRecvd = true;
- this.factionInvitations.push(factionName);
-}
-
-//Calculates skill level based on experience. The same formula will be used for every skill
-PlayerObject.prototype.calculateSkill = function(exp, mult=1) {
- return Math.max(Math.floor(mult*(32 * Math.log(exp + 534.5) - 200)), 1);
-}
-
-PlayerObject.prototype.updateSkillLevels = function() {
- this.hacking_skill = Math.max(1, Math.floor(this.calculateSkill(this.hacking_exp, this.hacking_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].HackingLevelMultiplier)));
- this.strength = this.calculateSkill(this.strength_exp, this.strength_mult);
- this.defense = this.calculateSkill(this.defense_exp, this.defense_mult);
- this.dexterity = this.calculateSkill(this.dexterity_exp, this.dexterity_mult);
- this.agility = this.calculateSkill(this.agility_exp, this.agility_mult);
- this.charisma = this.calculateSkill(this.charisma_exp, this.charisma_mult);
-
- if (this.intelligence > 0) {
- this.intelligence = Math.floor(this.calculateSkill(this.intelligence_exp));
- } else {
- this.intelligence = 0;
- }
-
- var ratio = this.hp / this.max_hp;
- this.max_hp = Math.floor(10 + this.defense / 10);
- Player.hp = Math.round(this.max_hp * ratio);
-}
-
-PlayerObject.prototype.resetMultipliers = function() {
- this.hacking_chance_mult = 1;
- this.hacking_speed_mult = 1;
- this.hacking_money_mult = 1;
- this.hacking_grow_mult = 1;
-
- this.hacking_mult = 1;
- this.strength_mult = 1;
- this.defense_mult = 1;
- this.dexterity_mult = 1;
- this.agility_mult = 1;
- this.charisma_mult = 1;
-
- this.hacking_exp_mult = 1;
- this.strength_exp_mult = 1;
- this.defense_exp_mult = 1;
- this.dexterity_exp_mult = 1;
- this.agility_exp_mult = 1;
- this.charisma_exp_mult = 1;
-
- this.company_rep_mult = 1;
- this.faction_rep_mult = 1;
-
- this.crime_money_mult = 1;
- this.crime_success_mult = 1;
-
- this.hacknet_node_money_mult = 1;
- this.hacknet_node_purchase_cost_mult = 1;
- this.hacknet_node_ram_cost_mult = 1;
- this.hacknet_node_core_cost_mult = 1;
- this.hacknet_node_level_cost_mult = 1;
-
- this.work_money_mult = 1;
-
- this.bladeburner_max_stamina_mult = 1;
- this.bladeburner_stamina_gain_mult = 1;
- this.bladeburner_analysis_mult = 1;
- this.bladeburner_success_chance_mult = 1;
-}
-
-PlayerObject.prototype.hasProgram = function(programName) {
- var home = Player.getHomeComputer();
- if (home == null) {return false;}
-
- for (var i = 0; i < home.programs.length; ++i) {
- if (programName.toLowerCase() == home.programs[i].toLowerCase()) {return true;}
- }
- return false;
-}
-
-PlayerObject.prototype.setMoney = function(money) {
- if (isNaN(money)) {
- console.log("ERR: NaN passed into Player.setMoney()"); return;
- }
- this.money = money;
-}
-
-PlayerObject.prototype.gainMoney = function(money) {
- if (isNaN(money)) {
- console.log("ERR: NaN passed into Player.gainMoney()"); return;
- }
- this.money = this.money.plus(money);
- this.total_money = this.total_money.plus(money);
- this.lifetime_money = this.lifetime_money.plus(money);
-}
-
-PlayerObject.prototype.loseMoney = function(money) {
- if (isNaN(money)) {
- console.log("ERR: NaN passed into Player.loseMoney()"); return;
- }
- this.money = this.money.minus(money);
-}
-
-PlayerObject.prototype.gainHackingExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERR: NaN passed into Player.gainHackingExp()"); return;
- }
- this.hacking_exp += exp;
- if(this.hacking_exp < 0) {
- this.hacking_exp = 0;
- }
-}
-
-PlayerObject.prototype.gainStrengthExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERR: NaN passed into Player.gainStrengthExp()"); return;
- }
- this.strength_exp += exp;
- if(this.strength_exp < 0) {
- this.strength_exp = 0;
- }
-}
-
-PlayerObject.prototype.gainDefenseExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERR: NaN passed into player.gainDefenseExp()"); return;
- }
- this.defense_exp += exp;
- if(this.defense_exp < 0) {
- this.defense_exp = 0;
- }
-}
-
-PlayerObject.prototype.gainDexterityExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERR: NaN passed into Player.gainDexterityExp()"); return;
- }
- this.dexterity_exp += exp;
- if(this.dexterity_exp < 0) {
- this.dexterity_exp = 0;
- }
-}
-
-PlayerObject.prototype.gainAgilityExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERR: NaN passed into Player.gainAgilityExp()"); return;
- }
- this.agility_exp += exp;
- if(this.agility_exp < 0) {
- this.agility_exp = 0;
- }
-}
-
-PlayerObject.prototype.gainCharismaExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERR: NaN passed into Player.gainCharismaExp()"); return;
- }
- this.charisma_exp += exp;
- if(this.charisma_exp < 0) {
- this.charisma_exp = 0;
- }
-}
-
-PlayerObject.prototype.gainIntelligenceExp = function(exp) {
- if (isNaN(exp)) {
- console.log("ERROR: NaN passed into Player.gainIntelligenceExp()"); return;
- }
- if (_NetscriptFunctions__WEBPACK_IMPORTED_MODULE_19__[/* hasAISF */ "b"] || this.intelligence > 0) {
- this.intelligence_exp += exp;
- }
-}
-
-//Given a string expression like "str" or "strength", returns the given stat
-PlayerObject.prototype.queryStatFromString = function(str) {
- const tempStr = str.toLowerCase();
- if (tempStr.includes("hack")) {return Player.hacking_skill;}
- if (tempStr.includes("str")) {return Player.strength;}
- if (tempStr.includes("def")) {return Player.defense;}
- if (tempStr.includes("dex")) {return Player.dexterity;}
- if (tempStr.includes("agi")) {return Player.agility;}
- if (tempStr.includes("cha")) {return Player.charisma;}
- if (tempStr.includes("int")) {return Player.intelligence;}
-}
-
-/******* Working functions *******/
-PlayerObject.prototype.resetWorkStatus = function() {
- this.workHackExpGainRate = 0;
- this.workStrExpGainRate = 0;
- this.workDefExpGainRate = 0;
- this.workDexExpGainRate = 0;
- this.workAgiExpGainRate = 0;
- this.workChaExpGainRate = 0;
- this.workRepGainRate = 0;
- this.workMoneyGainRate = 0;
- this.workMoneyLossRate = 0;
-
- this.workHackExpGained = 0;
- this.workStrExpGained = 0;
- this.workDefExpGained = 0;
- this.workDexExpGained = 0;
- this.workAgiExpGained = 0;
- this.workChaExpGained = 0;
- this.workRepGained = 0;
- this.workMoneyGained = 0;
-
- this.timeWorked = 0;
- this.timeWorkedCreateProgram = 0;
-
- this.currentWorkFactionName = "";
- this.currentWorkFactionDescription = "";
- this.createProgramName = "";
- this.className = "";
-
- document.getElementById("work-in-progress-text").innerHTML = "";
-}
-
-PlayerObject.prototype.processWorkEarnings = function(numCycles=1) {
- const hackExpGain = this.workHackExpGainRate * numCycles;
- const strExpGain = this.workStrExpGainRate * numCycles;
- const defExpGain = this.workDefExpGainRate * numCycles;
- const dexExpGain = this.workDexExpGainRate * numCycles;
- const agiExpGain = this.workAgiExpGainRate * numCycles;
- const chaExpGain = this.workChaExpGainRate * numCycles;
- const moneyGain = (this.workMoneyGainRate - this.workMoneyLossRate) * numCycles;
-
- this.gainHackingExp(hackExpGain);
- this.gainStrengthExp(strExpGain);
- this.gainDefenseExp(defExpGain);
- this.gainDexterityExp(dexExpGain);
- this.gainAgilityExp(agiExpGain);
- this.gainCharismaExp(chaExpGain);
- this.gainMoney(moneyGain);
- this.workHackExpGained += hackExpGain;
- this.workStrExpGained += strExpGain;
- this.workDefExpGained += defExpGain;
- this.workDexExpGained += dexExpGain;
- this.workAgiExpGained += agiExpGain;
- this.workChaExpGained += chaExpGain;
- this.workRepGained += this.workRepGainRate * numCycles;
- this.workMoneyGained += this.workMoneyGainRate * numCycles;
- this.workMoneyGained -= this.workMoneyLossRate * numCycles;
-}
-
-/* Working for Company */
-PlayerObject.prototype.startWork = function() {
- this.resetWorkStatus();
- this.isWorking = true;
- this.workType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCompany;
-
- this.workHackExpGainRate = this.getWorkHackExpGain();
- this.workStrExpGainRate = this.getWorkStrExpGain();
- this.workDefExpGainRate = this.getWorkDefExpGain();
- this.workDexExpGainRate = this.getWorkDexExpGain();
- this.workAgiExpGainRate = this.getWorkAgiExpGain();
- this.workChaExpGainRate = this.getWorkChaExpGain();
- this.workRepGainRate = this.getWorkRepGain();
- this.workMoneyGainRate = this.getWorkMoneyGain();
-
- this.timeNeededToCompleteWork = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours;
-
- //Remove all old event listeners from Cancel button
- var newCancelButton = Object(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__["clearEventListeners"])("work-in-progress-cancel-button");
- newCancelButton.innerHTML = "Cancel Work";
- newCancelButton.addEventListener("click", function() {
- Player.finishWork(true);
- return false;
- });
-
- //Display Work In Progress Screen
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadWorkInProgressContent();
-}
-
-PlayerObject.prototype.work = function(numCycles) {
- //Cap the number of cycles being processed to whatever would put you at
- //the work time limit (8 hours)
- var overMax = false;
- if (this.timeWorked + (_engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles) >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours) {
- overMax = true;
- numCycles = Math.round((_Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours - this.timeWorked) / _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed);
- }
- this.timeWorked += _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles;
-
- this.workRepGainRate = this.getWorkRepGain();
- this.processWorkEarnings(numCycles);
-
- //If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money
- if (overMax || this.timeWorked >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours) {
- return this.finishWork(false);
- }
-
- var comp = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName], companyRep = "0";
- if (comp == null || !(comp instanceof _Company_Company__WEBPACK_IMPORTED_MODULE_3__["Company"])) {
- console.error(`Could not find Company: ${this.companyName}`);
- } else {
- companyRep = comp.playerReputation;
- }
-
- var txt = document.getElementById("work-in-progress-text");
- txt.innerHTML = "You are currently working as a " + this.companyPosition +
- " at " + this.companyName + " (Current Company Reputation: " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(companyRep, '0,0') + ")
" +
- "You have been working for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "You have earned:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + " ($" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGainRate * CYCLES_PER_SEC, '0,0.00') + " / sec)
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) reputation for this company
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) charisma exp
" +
- "You will automatically finish after working for 8 hours. You can cancel earlier if you wish, " +
- "but you will only gain half of the reputation you've earned so far."
-}
-
-PlayerObject.prototype.finishWork = function(cancelled, sing=false) {
- //Since the work was cancelled early, player only gains half of what they've earned so far
- if (cancelled) {
- this.workRepGained /= 2;
- }
-
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- company.playerReputation += (this.workRepGained);
-
- this.updateSkillLevels();
-
- var txt = "You earned a total of:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + "
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " reputation for the company
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp
";
-
- if (cancelled) {
- txt = "You worked a short shift of " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "Since you cancelled your work early, you only gained half of the reputation you earned.
" + txt;
- } else {
- txt = "You worked a full shift of 8 hours!
" + txt;
- }
- if (!sing) {Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])(txt);}
-
- var mainMenu = document.getElementById("mainmenu-container");
- mainMenu.style.visibility = "visible";
- this.isWorking = false;
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
-
- if (sing) {
- var res = "You worked a short shift of " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + " and " +
- "earned $" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + ", " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " reputation, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp, and " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp.";
- this.resetWorkStatus();
- return res;
- }
- this.resetWorkStatus();
-}
-
-PlayerObject.prototype.startWorkPartTime = function() {
- this.resetWorkStatus();
- this.isWorking = true;
- this.workType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCompanyPartTime;
-
- this.workHackExpGainRate = this.getWorkHackExpGain();
- this.workStrExpGainRate = this.getWorkStrExpGain();
- this.workDefExpGainRate = this.getWorkDefExpGain();
- this.workDexExpGainRate = this.getWorkDexExpGain();
- this.workAgiExpGainRate = this.getWorkAgiExpGain();
- this.workChaExpGainRate = this.getWorkChaExpGain();
- this.workRepGainRate = this.getWorkRepGain();
- this.workMoneyGainRate = this.getWorkMoneyGain();
-
- this.timeNeededToCompleteWork = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours;
-
- var newCancelButton = Object(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__["clearEventListeners"])("work-in-progress-cancel-button");
- newCancelButton.innerHTML = "Stop Working";
- newCancelButton.addEventListener("click", function() {
- Player.finishWorkPartTime();
- return false;
- });
-
- //Display Work In Progress Screen
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadWorkInProgressContent();
-}
-
-PlayerObject.prototype.workPartTime = function(numCycles) {
- //Cap the number of cycles being processed to whatever would put you at the
- //work time limit (8 hours)
- var overMax = false;
- if (this.timeWorked + (_engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles) >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours) {
- overMax = true;
- numCycles = Math.round((_Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours - this.timeWorked) / _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed);
- }
- this.timeWorked += _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles;
-
- this.workRepGainRate = this.getWorkRepGain();
- this.processWorkEarnings(numCycles);
-
- //If timeWorked == 8 hours, then finish. You can only gain 8 hours worth of exp and money
- if (overMax || this.timeWorked >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer8Hours) {
- return this.finishWorkPartTime();
- }
-
- var comp = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName], companyRep = "0";
- if (comp == null || !(comp instanceof _Company_Company__WEBPACK_IMPORTED_MODULE_3__["Company"])) {
- console.log("ERROR: Could not find Company: " + this.companyName);
- } else {
- companyRep = comp.playerReputation;
- }
-
- var txt = document.getElementById("work-in-progress-text");
- txt.innerHTML = "You are currently working as a " + this.companyPosition +
- " at " + Player.companyName + " (Current Company Reputation: " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(companyRep, '0,0') + ")
" +
- "You have been working for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "You have earned:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + " ($" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGainRate * CYCLES_PER_SEC, '0,0.00') + " / sec)
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) reputation for this company
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) charisma exp
" +
- "You will automatically finish after working for 8 hours. You can cancel earlier if you wish,
" +
- "and there will be no penalty because this is a part-time job.";
-
-}
-
-PlayerObject.prototype.finishWorkPartTime = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- company.playerReputation += (this.workRepGained);
-
- this.updateSkillLevels();
-
- var txt = "You earned a total of:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + "
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " reputation for the company
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp
";
- txt = "You worked for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" + txt;
- if (!sing) {Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])(txt);}
-
- var mainMenu = document.getElementById("mainmenu-container");
- mainMenu.style.visibility = "visible";
- this.isWorking = false;
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
- if (sing) {
- var res = "You worked for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + " and " +
- "earned a total of " +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + ", " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " reputation, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp, and " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp";
- this.resetWorkStatus();
- return res;
- }
- this.resetWorkStatus();
-}
-
-/* Working for Faction */
-PlayerObject.prototype.startFactionWork = function(faction) {
- //Update reputation gain rate to account for faction favor
- var favorMult = 1 + (faction.favor / 100);
- if (isNaN(favorMult)) {favorMult = 1;}
- this.workRepGainRate *= favorMult;
- this.workRepGainRate *= _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkRepGain;
-
- this.isWorking = true;
- this.workType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeFaction;
- this.currentWorkFactionName = faction.name;
-
- this.timeNeededToCompleteWork = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer20Hours;
-
- var cancelButton = Object(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__["clearEventListeners"])("work-in-progress-cancel-button");
- cancelButton.innerHTML = "Stop Faction Work";
- cancelButton.addEventListener("click", function() {
- Player.finishFactionWork(true);
- return false;
- });
-
- //Display Work In Progress Screen
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadWorkInProgressContent();
-}
-
-PlayerObject.prototype.startFactionHackWork = function(faction) {
- this.resetWorkStatus();
-
- this.workHackExpGainRate = .15 * this.hacking_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workRepGainRate = this.workRepGainRate = (this.hacking_skill + this.intelligence) / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel * this.faction_rep_mult;
-
- this.factionWorkType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].FactionWorkHacking;
- this.currentWorkFactionDescription = "carrying out hacking contracts";
-
- this.startFactionWork(faction);
-}
-
-PlayerObject.prototype.startFactionFieldWork = function(faction) {
- this.resetWorkStatus();
-
- this.workHackExpGainRate = .1 * this.hacking_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workStrExpGainRate = .1 * this.strength_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workDefExpGainRate = .1 * this.defense_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workDexExpGainRate = .1 * this.dexterity_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workAgiExpGainRate = .1 * this.agility_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workChaExpGainRate = .1 * this.charisma_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workRepGainRate = this.getFactionFieldWorkRepGain();
-
- this.factionWorkType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].FactionWorkField;
- this.currentWorkFactionDescription = "carrying out field missions"
-
- this.startFactionWork(faction);
-}
-
-PlayerObject.prototype.startFactionSecurityWork = function(faction) {
- this.resetWorkStatus();
-
- this.workHackExpGainRate = 0.05 * this.hacking_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workStrExpGainRate = 0.15 * this.strength_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workDefExpGainRate = 0.15 * this.defense_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workDexExpGainRate = 0.15 * this.dexterity_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workAgiExpGainRate = 0.15 * this.agility_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workChaExpGainRate = 0.00 * this.charisma_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkExpGain;
- this.workRepGainRate = this.getFactionSecurityWorkRepGain();
-
- this.factionWorkType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].FactionWorkSecurity;
- this.currentWorkFactionDescription = "performing security detail"
-
- this.startFactionWork(faction);
-}
-
-PlayerObject.prototype.workForFaction = function(numCycles) {
- var faction = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"][this.currentWorkFactionName];
-
- //Constantly update the rep gain rate
- switch (this.factionWorkType) {
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].FactionWorkHacking:
- this.workRepGainRate = (this.hacking_skill + this.intelligence) / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel * this.faction_rep_mult;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].FactionWorkField:
- this.workRepGainRate = this.getFactionFieldWorkRepGain();
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].FactionWorkSecurity:
- this.workRepGainRate = this.getFactionSecurityWorkRepGain();
- break;
- default:
- break;
- }
-
- //Update reputation gain rate to account for faction favor
- var favorMult = 1 + (faction.favor / 100);
- if (isNaN(favorMult)) {favorMult = 1;}
- this.workRepGainRate *= favorMult;
- this.workRepGainRate *= _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].FactionWorkRepGain;
-
- //Cap the number of cycles being processed to whatever would put you at limit (20 hours)
- var overMax = false;
- if (this.timeWorked + (_engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles) >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer20Hours) {
- overMax = true;
- numCycles = Math.round((_Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer20Hours - this.timeWorked) / _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed);
- }
- this.timeWorked += _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles;
-
- this.processWorkEarnings(numCycles);
-
- //If timeWorked == 20 hours, then finish. You can only work for the faction for 20 hours
- if (overMax || this.timeWorked >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MillisecondsPer20Hours) {
- return this.finishFactionWork(false);
- }
-
- var txt = document.getElementById("work-in-progress-text");
- txt.innerHTML = "You are currently " + this.currentWorkFactionDescription + " for your faction " + faction.name +
- " (Current Faction Reputation: " + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(faction.playerReputation, '0,0') + ").
" +
- "You have been doing this for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "You have earned:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGainRate * CYCLES_PER_SEC, '0,0.00') + " / sec)
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) reputation for this faction
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) charisma exp
" +
-
- "You will automatically finish after working for 20 hours. You can cancel earlier if you wish.
" +
- "There is no penalty for cancelling earlier.";
-}
-
-PlayerObject.prototype.finishFactionWork = function(cancelled, sing=false) {
- var faction = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"][this.currentWorkFactionName];
- faction.playerReputation += (this.workRepGained);
-
- this.updateSkillLevels();
-
- var txt = "You worked for your faction " + faction.name + " for a total of " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "You earned a total of:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + "
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " reputation for the faction
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp
";
- if (!sing) {Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])(txt);}
-
- var mainMenu = document.getElementById("mainmenu-container");
- mainMenu.style.visibility = "visible";
-
- this.isWorking = false;
-
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadFactionContent();
- Object(_Faction_FactionHelpers__WEBPACK_IMPORTED_MODULE_16__[/* displayFactionContent */ "a"])(faction.name);
- if (sing) {
- var res="You worked for your faction " + faction.name + " for a total of " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + ". " +
- "You earned " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workRepGained, '0,0.0000') + " rep, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " str exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " def exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dex exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agi exp, and " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " cha exp.";
- this.resetWorkStatus();
- return res;
- }
- this.resetWorkStatus();
-}
-
-//Money gained per game cycle
-PlayerObject.prototype.getWorkMoneyGain = function() {
- // If player has SF-11, calculate salary multiplier from favor
- let bn11Mult = 1;
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- if (_NetscriptFunctions__WEBPACK_IMPORTED_MODULE_19__[/* hasBn11SF */ "d"]) { bn11Mult = 1 + (company.favor / 100); }
-
- // Get base salary
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (companyPosition == null) {
- console.error(`Could not find CompanyPosition object for ${this.companyPosition}. Work salary will be 0`);
- return 0;
- }
-
- return companyPosition.baseSalary * company.salaryMultiplier * this.work_money_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkMoney * bn11Mult;
-}
-
-//Hack exp gained per game cycle
-PlayerObject.prototype.getWorkHackExpGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work hack exp gain will be 0`].join(" "));
- return 0;
- }
-
- return companyPosition.hackingExpGain * company.expMultiplier * this.hacking_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkExpGain;
-}
-
-//Str exp gained per game cycle
-PlayerObject.prototype.getWorkStrExpGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work str exp gain will be 0`].join(" "));
- return 0;
- }
-
- return companyPosition.strengthExpGain * company.expMultiplier * this.strength_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkExpGain;
-}
-
-//Def exp gained per game cycle
-PlayerObject.prototype.getWorkDefExpGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work def exp gain will be 0`].join(" "));
- return 0;
- }
-
- return companyPosition.defenseExpGain * company.expMultiplier * this.defense_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkExpGain;
-}
-
-//Dex exp gained per game cycle
-PlayerObject.prototype.getWorkDexExpGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work dex exp gain will be 0`].join(" "));
- return 0;
- }
-
- return companyPosition.dexterityExpGain * company.expMultiplier * this.dexterity_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkExpGain;
-}
-
-//Agi exp gained per game cycle
-PlayerObject.prototype.getWorkAgiExpGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work agi exp gain will be 0`].join(" "));
- return 0;
- }
-
- return companyPosition.agilityExpGain * company.expMultiplier * this.agility_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkExpGain;
-}
-
-//Charisma exp gained per game cycle
-PlayerObject.prototype.getWorkChaExpGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work cha exp gain will be 0`].join(" "));
- return 0;
- }
-
- return companyPosition.charismaExpGain * company.expMultiplier * this.charisma_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CompanyWorkExpGain;
-}
-
-//Reputation gained per game cycle
-PlayerObject.prototype.getWorkRepGain = function() {
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (company == null || companyPosition == null) {
- console.error([`Could not find Company object for ${this.companyName}`,
- `or CompanyPosition object for ${this.companyPosition}.`,
- `Work rep gain will be 0`].join(" "));
- return 0;
- }
-
- var jobPerformance = companyPosition.calculateJobPerformance(this.hacking_skill, this.strength,
- this.defense, this.dexterity,
- this.agility, this.charisma);
-
- //Intelligence provides a flat bonus to job performance
- jobPerformance += (this.intelligence / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel);
-
- //Update reputation gain rate to account for company favor
- var favorMult = 1 + (company.favor / 100);
- if (isNaN(favorMult)) { favorMult = 1; }
- return jobPerformance * this.company_rep_mult * favorMult;
-}
-
-PlayerObject.prototype.getFactionSecurityWorkRepGain = function() {
- var t = 0.9 * (this.hacking_skill / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.strength / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.defense / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.dexterity / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.agility / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel) / 4.5;
- return t * this.faction_rep_mult;
-}
-
-PlayerObject.prototype.getFactionFieldWorkRepGain = function() {
- var t = 0.9 * (this.hacking_skill / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.strength / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.defense / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.dexterity / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.agility / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.charisma / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel +
- this.intelligence / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].MaxSkillLevel) / 5.5;
- return t * this.faction_rep_mult;
-}
-
-/* Creating a Program */
-PlayerObject.prototype.startCreateProgramWork = function(programName, time, reqLevel) {
- this.resetWorkStatus();
- this.isWorking = true;
- this.workType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCreateProgram;
-
- //Time needed to complete work affected by hacking skill (linearly based on
- //ratio of (your skill - required level) to MAX skill)
- //var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking_skill - reqLevel)) / CONSTANTS.MaxSkillLevel;
- //if (timeMultiplier > 1) {timeMultiplier = 1;}
- //if (timeMultiplier < 0.01) {timeMultiplier = 0.01;}
- this.createProgramReqLvl = reqLevel;
-
- this.timeNeededToCompleteWork = time;
- //Check for incomplete program
- for (var i = 0; i < this.getHomeComputer().programs.length; ++i) {
- var programFile = this.getHomeComputer().programs[i];
- if (programFile.startsWith(programName) && programFile.endsWith("%-INC")) {
- var res = programFile.split("-");
- if (res.length != 3) {break;}
- var percComplete = Number(res[1].slice(0, -1));
- if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {break;}
- this.timeWorkedCreateProgram = percComplete / 100 * this.timeNeededToCompleteWork;
- this.getHomeComputer().programs.splice(i, 1);
- }
- }
-
- this.createProgramName = programName;
-
- var cancelButton = Object(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__["clearEventListeners"])("work-in-progress-cancel-button");
- cancelButton.innerHTML = "Cancel work on creating program";
- cancelButton.addEventListener("click", function() {
- Player.finishCreateProgramWork(true);
- return false;
- });
-
- //Display Work In Progress Screen
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadWorkInProgressContent();
-}
-
-PlayerObject.prototype.createProgramWork = function(numCycles) {
- //Higher hacking skill will allow you to create programs faster
- var reqLvl = this.createProgramReqLvl;
- var skillMult = (this.hacking_skill / reqLvl); //This should always be greater than 1;
- skillMult = 1 + ((skillMult - 1) / 5); //The divider constant can be adjusted as necessary
-
- //Skill multiplier directly applied to "time worked"
- this.timeWorked += (_engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles);
- this.timeWorkedCreateProgram += (_engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles * skillMult);
- var programName = this.createProgramName;
-
- if (this.timeWorkedCreateProgram >= this.timeNeededToCompleteWork) {
- this.finishCreateProgramWork(false);
- }
-
- var txt = document.getElementById("work-in-progress-text");
- txt.innerHTML = "You are currently working on coding " + programName + ".
" +
- "You have been working for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "The program is " + (this.timeWorkedCreateProgram / this.timeNeededToCompleteWork * 100).toFixed(2) + "% complete.
" +
- "If you cancel, your work will be saved and you can come back to complete the program later.";
-}
-
-PlayerObject.prototype.finishCreateProgramWork = function(cancelled, sing=false) {
- var programName = this.createProgramName;
- if (cancelled === false) {
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("You've finished creating " + programName + "!
" +
- "The new program can be found on your home computer.");
-
- this.getHomeComputer().programs.push(programName);
- } else {
- var perc = (Math.floor(this.timeWorkedCreateProgram / this.timeNeededToCompleteWork * 10000)/100).toString();
- var incompleteName = programName + "-" + perc + "%-INC";
- this.getHomeComputer().programs.push(incompleteName);
- }
-
- if (!cancelled) {
- this.gainIntelligenceExp(this.createProgramReqLvl / _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].IntelligenceProgramBaseExpGain);
- }
-
- var mainMenu = document.getElementById("mainmenu-container");
- mainMenu.style.visibility = "visible";
-
- this.isWorking = false;
-
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadTerminalContent();
- this.resetWorkStatus();
-}
-
-/* Studying/Taking Classes */
-PlayerObject.prototype.startClass = function(costMult, expMult, className) {
- this.resetWorkStatus();
- this.isWorking = true;
- this.workType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeStudyClass;
-
- this.className = className;
-
- var gameCPS = 1000 / _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed;
-
- //Base exp gains per second
- var baseStudyComputerScienceExp = 0.5;
- var baseDataStructuresExp = 1;
- var baseNetworksExp = 2;
- var baseAlgorithmsExp = 4;
- var baseManagementExp = 2;
- var baseLeadershipExp = 4;
- var baseGymExp = 1;
-
- //Find cost and exp gain per game cycle
- var cost = 0;
- var hackExp = 0, strExp = 0, defExp = 0, dexExp = 0, agiExp = 0, chaExp = 0;
- switch (className) {
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassStudyComputerScience:
- hackExp = baseStudyComputerScienceExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassDataStructures:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassDataStructuresBaseCost * costMult / gameCPS;
- hackExp = baseDataStructuresExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassNetworks:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassNetworksBaseCost * costMult / gameCPS;
- hackExp = baseNetworksExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassAlgorithms:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassAlgorithmsBaseCost * costMult / gameCPS;
- hackExp = baseAlgorithmsExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassManagement:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassManagementBaseCost * costMult / gameCPS;
- chaExp = baseManagementExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassLeadership:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassLeadershipBaseCost * costMult / gameCPS;
- chaExp = baseLeadershipExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymStrength:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymBaseCost * costMult / gameCPS;
- strExp = baseGymExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymDefense:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymBaseCost * costMult / gameCPS;
- defExp = baseGymExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymDexterity:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymBaseCost * costMult / gameCPS;
- dexExp = baseGymExp * expMult / gameCPS;
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymAgility:
- cost = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymBaseCost * costMult / gameCPS;
- agiExp = baseGymExp * expMult / gameCPS;
- break;
- default:
- throw new Error("ERR: Invalid/unrecognized class name");
- return;
- }
-
- this.workMoneyLossRate = cost;
- this.workHackExpGainRate = hackExp * this.hacking_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].ClassGymExpGain;
- this.workStrExpGainRate = strExp * this.strength_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].ClassGymExpGain;;
- this.workDefExpGainRate = defExp * this.defense_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].ClassGymExpGain;;
- this.workDexExpGainRate = dexExp * this.dexterity_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].ClassGymExpGain;;
- this.workAgiExpGainRate = agiExp * this.agility_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].ClassGymExpGain;;
- this.workChaExpGainRate = chaExp * this.charisma_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].ClassGymExpGain;;
-
- var cancelButton = Object(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__["clearEventListeners"])("work-in-progress-cancel-button");
- if (className == _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymStrength ||
- className == _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymDefense ||
- className == _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymDexterity ||
- className == _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].ClassGymAgility) {
- cancelButton.innerHTML = "Stop training at gym";
- } else {
- cancelButton.innerHTML = "Stop taking course";
- }
- cancelButton.addEventListener("click", function() {
- Player.finishClass();
- return false;
- });
-
- //Display Work In Progress Screen
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadWorkInProgressContent();
-}
-
-PlayerObject.prototype.takeClass = function(numCycles) {
- this.timeWorked += _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles;
- var className = this.className;
-
- this.processWorkEarnings(numCycles);
-
- var txt = document.getElementById("work-in-progress-text");
- txt.innerHTML = "You have been " + className + " for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + "
" +
- "This has cost you:
" +
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + " ($" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyLossRate * CYCLES_PER_SEC, '0,0.00') + " / sec)
" +
- "You have gained:
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " (" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGainRate * CYCLES_PER_SEC, '0,0.0000') + " / sec) charisma exp
" +
- "You may cancel at any time";
-}
-
-//The 'sing' argument defines whether or not this function was called
-//through a Singularity Netscript function
-PlayerObject.prototype.finishClass = function(sing=false) {
- this.gainIntelligenceExp(_Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].IntelligenceClassBaseExpGain * Math.round(this.timeWorked / 1000));
-
- if (this.workMoneyGained > 0) {
- throw new Error("ERR: Somehow gained money while taking class");
- }
-
- this.updateSkillLevels();
- var txt = "After " + this.className + " for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + ",
" +
- "you spent a total of $" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained * -1, '0,0.00') + ".
" +
- "You earned a total of:
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp
";
- if (!sing) {Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])(txt);}
-
- var mainMenu = document.getElementById("mainmenu-container");
- mainMenu.style.visibility = "visible";
-
- this.isWorking = false;
-
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
- if (sing) {
- var res="After " + this.className + " for " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeWorked) + ", " +
- "you spent a total of $" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained * -1, '0,0.00') + ". " +
- "You earned a total of: " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility exp, and " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma exp";
- this.resetWorkStatus();
- return res;
- }
- this.resetWorkStatus();
-}
-
-//The EXP and $ gains are hardcoded. Time is in ms
-PlayerObject.prototype.startCrime = function(hackExp, strExp, defExp, dexExp, agiExp, chaExp, money, time, singParams=null) {
- this.resetWorkStatus();
- this.isWorking = true;
- this.workType = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCrime;
-
- if (singParams && singParams.workerscript) {
- this.committingCrimeThruSingFn = true;
- this.singFnCrimeWorkerScript = singParams.workerscript;
- }
-
- this.workHackExpGained = hackExp * this.hacking_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeExpGain;
- this.workStrExpGained = strExp * this.strength_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeExpGain;
- this.workDefExpGained = defExp * this.defense_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeExpGain;
- this.workDexExpGained = dexExp * this.dexterity_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeExpGain;
- this.workAgiExpGained = agiExp * this.agility_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeExpGain;
- this.workChaExpGained = chaExp * this.charisma_exp_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeExpGain;
- this.workMoneyGained = money * this.crime_money_mult * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CrimeMoney;
-
- this.timeNeededToCompleteWork = time;
-
- //Remove all old event listeners from Cancel button
- var newCancelButton = Object(_utils_uiHelpers_clearEventListeners__WEBPACK_IMPORTED_MODULE_27__["clearEventListeners"])("work-in-progress-cancel-button")
- newCancelButton.innerHTML = "Cancel crime"
- newCancelButton.addEventListener("click", function() {
- Player.finishCrime(true);
- return false;
- });
-
- //Display Work In Progress Screen
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadWorkInProgressContent();
-}
-
-PlayerObject.prototype.commitCrime = function (numCycles) {
- this.timeWorked += _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"]._idleSpeed * numCycles;
-
- if (this.timeWorked >= this.timeNeededToCompleteWork) {this.finishCrime(false); return;}
-
- var percent = Math.round(this.timeWorked / this.timeNeededToCompleteWork * 100);
- var numBars = Math.round(percent / 5);
- if (numBars < 0) {numBars = 0;}
- if (numBars > 20) {numBars = 20;}
- var progressBar = "[" + Array(numBars+1).join("|") + Array(20 - numBars + 1).join(" ") + "]";
-
- var txt = document.getElementById("work-in-progress-text");
- txt.innerHTML = "You are attempting to " + this.crimeType + ".
" +
- "Time remaining: " + Object(_utils_StringHelperFunctions__WEBPACK_IMPORTED_MODULE_30__["convertTimeMsToTimeElapsedString"])(this.timeNeededToCompleteWork - this.timeWorked) + "
" +
- progressBar.replace( / /g, " " );
-}
-
-PlayerObject.prototype.finishCrime = function(cancelled) {
- //Determine crime success/failure
- if (!cancelled) {
- var statusText = ""; //TODO, unique message for each crime when you succeed
- if (Object(_Crimes__WEBPACK_IMPORTED_MODULE_12__[/* determineCrimeSuccess */ "b"])(this.crimeType, this.workMoneyGained)) {
- //Handle Karma and crime statistics
- let crime = null;
- for(const i in _Crimes__WEBPACK_IMPORTED_MODULE_12__[/* Crimes */ "a"]) {
- if(_Crimes__WEBPACK_IMPORTED_MODULE_12__[/* Crimes */ "a"][i].type == this.crimeType) {
- crime = _Crimes__WEBPACK_IMPORTED_MODULE_12__[/* Crimes */ "a"][i];
- break;
- }
- }
- if(crime == null) {
- console.log(this.crimeType);
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("ERR: Unrecognized crime type. This is probably a bug please contact the developer");
- }
- this.karma -= crime.karma;
- this.numPeopleKilled += crime.kills;
- if(crime.intelligence_exp > 0) {
- this.gainIntelligenceExp(crime.intelligence_exp);
- }
-
- //On a crime success, gain 2x exp
- this.workHackExpGained *= 2;
- this.workStrExpGained *= 2;
- this.workDefExpGained *= 2;
- this.workDexExpGained *= 2;
- this.workAgiExpGained *= 2;
- this.workChaExpGained *= 2;
- if (this.committingCrimeThruSingFn) {
- if(this.singFnCrimeWorkerScript.disableLogs.ALL == null && this.singFnCrimeWorkerScript.disableLogs.commitCrime == null) {
- this.singFnCrimeWorkerScript.scriptRef.log("Crime successful! Gained " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, "$0.000a") + ", " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hack exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " str exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " def exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dex exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agi exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " cha exp.");
- }
- } else {
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Crime successful!
" +
- "You gained:
"+
- "$" + _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workMoneyGained, '0,0.00') + "
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma experience");
- }
-
- } else {
- //Exp halved on failure
- this.workHackExpGained /= 2;
- this.workStrExpGained /= 2;
- this.workDefExpGained /= 2;
- this.workDexExpGained /= 2;
- this.workAgiExpGained /= 2;
- this.workChaExpGained /= 2;
- if (this.committingCrimeThruSingFn) {
- if(this.singFnCrimeWorkerScript.disableLogs.ALL == null && this.singFnCrimeWorkerScript.disableLogs.commitCrime == null) {
- this.singFnCrimeWorkerScript.scriptRef.log("Crime failed! Gained " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hack exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " str exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " def exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dex exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agi exp, " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " cha exp.");
- }
- } else {
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Crime failed!
" +
- "You gained:
"+
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workHackExpGained, '0,0.0000') + " hacking experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workStrExpGained, '0,0.0000') + " strength experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDefExpGained, '0,0.0000') + " defense experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workDexExpGained, '0,0.0000') + " dexterity experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workAgiExpGained, '0,0.0000') + " agility experience
" +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.workChaExpGained, '0,0.0000') + " charisma experience");
- }
- }
-
- this.gainHackingExp(this.workHackExpGained);
- this.gainStrengthExp(this.workStrExpGained);
- this.gainDefenseExp(this.workDefExpGained);
- this.gainDexterityExp(this.workDexExpGained);
- this.gainAgilityExp(this.workAgiExpGained);
- this.gainCharismaExp(this.workChaExpGained);
- }
- this.committingCrimeThruSingFn = false;
- this.singFnCrimeWorkerScript = null;
- var mainMenu = document.getElementById("mainmenu-container");
- mainMenu.style.visibility = "visible";
- this.isWorking = false;
- this.resetWorkStatus();
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
-}
-
-//Cancels the player's current "work" assignment and gives the proper rewards
-//Used only for Singularity functions, so no popups are created
-PlayerObject.prototype.singularityStopWork = function() {
- if (!this.isWorking) {return "";}
- var res; //Earnings text for work
- switch (this.workType) {
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeStudyClass:
- res = this.finishClass(true);
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCompany:
- res = this.finishWork(true, true);
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCompanyPartTime:
- res = this.finishWorkPartTime(true);
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeFaction:
- res = this.finishFactionWork(true, true);
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCreateProgram:
- res = this.finishCreateProgramWork(true, true);
- break;
- case _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].WorkTypeCrime:
- res = this.finishCrime(true);
- break;
- default:
- console.log("ERROR: Unrecognized work type");
- return "";
- }
- return res;
-}
-
-
-//Returns true if hospitalized, false otherwise
-PlayerObject.prototype.takeDamage = function(amt) {
- this.hp -= amt;
- if (this.hp <= 0) {
- this.hospitalize();
- return true;
- } else {
- return false;
- }
-}
-
-PlayerObject.prototype.hospitalize = function() {
- if (_Settings__WEBPACK_IMPORTED_MODULE_21__["Settings"].SuppressHospitalizationPopup === false) {
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])(
- "You were in critical condition! You were taken to the hospital where " +
- "luckily they were able to save your life. You were charged " +
- _ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(this.max_hp * _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].HospitalCostPerHp, '$0.000a')
- );
- }
-
- this.loseMoney(this.max_hp * _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].HospitalCostPerHp);
- this.hp = this.max_hp;
-}
-
-/********* Company job application **********/
-//Determines the job that the Player should get (if any) at the current company
-//The 'sing' argument designates whether or not this is being called from
-//the applyToCompany() Netscript Singularity function
-PlayerObject.prototype.applyForJob = function(entryPosType, sing=false) {
- // Get current company and job
- let currCompany = null;
- if (this.companyName !== "") {
- currCompany = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- }
- const currPositionName = this.companyPosition;
-
- // Get company that's being applied to
- const company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (!(company instanceof _Company_Company__WEBPACK_IMPORTED_MODULE_3__["Company"])) {
- if (sing) {
- return "ERROR: Invalid company name: " + this.location + ". applyToCompany() failed";
- } else {
- console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);
- return;
- }
- }
-
- let pos = entryPosType;
-
- if (!this.isQualified(company, pos)) {
- var reqText = Object(_Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_6__["getJobRequirementText"])(company, pos);
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position
" + reqText);
- return;
- }
-
- while (true) {
- let newPos = Object(_Company_GetNextCompanyPosition__WEBPACK_IMPORTED_MODULE_5__["getNextCompanyPosition"])(pos);
- if (newPos == null) {break;}
-
- //Check if this company has this position
- if (company.hasPosition(newPos)) {
- if (!this.isQualified(company, newPos)) {
- //If player not qualified for next job, break loop so player will be given current job
- break;
- }
- pos = newPos;
- } else {
- break;
- }
- }
-
- //Check if the determined job is the same as the player's current job
- if (currCompany != null) {
- if (currCompany.name == company.name && pos.name == currPositionName) {
- var nextPos = Object(_Company_GetNextCompanyPosition__WEBPACK_IMPORTED_MODULE_5__["getNextCompanyPosition"])(pos);
- if (nextPos == null) {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("You are already at the highest position for your field! No promotion available");
- } else if (company.hasPosition(nextPos)) {
- if (sing) {return false;}
- var reqText = Object(_Company_GetJobRequirementText__WEBPACK_IMPORTED_MODULE_6__["getJobRequirementText"])(company, nextPos);
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unfortunately, you do not qualify for a promotion
" + reqText);
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("You are already at the highest position for your field! No promotion available");
- }
- return; //Same job, do nothing
- }
- }
-
-
- //Lose reputation from a Company if you are leaving it for another job
- let leaveCompany = false;
- let oldCompanyName = "";
- if (currCompany != null) {
- if (currCompany.name != company.name) {
- leaveCompany = true;
- oldCompanyName = currCompany.name;
- currCompany.playerReputation -= 1000;
- if (currCompany.playerReputation < 0) { currCompany.playerReputation = 0; }
- }
- }
-
- this.companyName = company.name;
- this.companyPosition = pos.name;
-
- document.getElementById("world-menu-header").click();
- document.getElementById("world-menu-header").click();
-
- if (leaveCompany) {
- if (sing) { return true; }
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])([`Congratulations! You were offered a new job at ${this.companyName} as a ${pos.name}!`,
- `You lost 1000 reputation at your old company ${oldCompanyName} because you left.`].join("
"));
- } else {
- if (sing) { return true; }
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Congratulations! You were offered a new job at " + this.companyName + " as a " + pos.name + "!");
- }
-
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
-}
-
-//Returns your next position at a company given the field (software, business, etc.)
-PlayerObject.prototype.getNextCompanyPosition = function(company, entryPosType) {
- var currCompany = null;
- if (this.companyName !== "") {
- currCompany = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- }
-
- //Not employed at this company, so return the entry position
- if (currCompany == null || (currCompany.name != company.name)) {
- return entryPosType;
- }
-
- //If the entry pos type and the player's current position have the same type,
- //return the player's "nextCompanyPosition". Otherwise return the entryposType
- //Employed at this company, so just return the next position if it exists.
- const currentPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if ((currentPosition.isSoftwareJob() && entryPosType.isSoftwareJob()) ||
- (currentPosition.isITJob() && entryPosType.isITJob()) ||
- (currentPosition.isBusinessJob() && entryPosType.isBusinessJob()) ||
- (currentPosition.isSecurityEngineerJob() && entryPosType.isSecurityEngineerJob()) ||
- (currentPosition.isNetworkEngineerJob() && entryPosType.isNetworkEngineerJob()) ||
- (currentPosition.isSecurityJob() && entryPosType.isSecurityJob()) ||
- (currentPosition.isAgentJob() && entryPosType.isAgentJob()) ||
- (currentPosition.isSoftwareConsultantJob() && entryPosType.isSoftwareConsultantJob()) ||
- (currentPosition.isBusinessConsultantJob() && entryPosType.isBusinessConsultantJob()) ||
- (currentPosition.isPartTimeJob() && entryPosType.isPartTimeJob())) {
- return Object(_Company_GetNextCompanyPosition__WEBPACK_IMPORTED_MODULE_5__["getNextCompanyPosition"])(currentPosition);
- }
-
- return entryPosType;
-}
-
-PlayerObject.prototype.applyForSoftwareJob = function(sing=false) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["SoftwareCompanyPositions"][0]], sing);
-}
-
-PlayerObject.prototype.applyForSoftwareConsultantJob = function(sing=false) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["SoftwareConsultantCompanyPositions"][0]], sing);
-}
-
-PlayerObject.prototype.applyForItJob = function(sing=false) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["ITCompanyPositions"][0]], sing);
-}
-
-PlayerObject.prototype.applyForSecurityEngineerJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["SecurityEngineerCompanyPositions"][0]])) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["SecurityEngineerCompanyPositions"][0]], sing);
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-PlayerObject.prototype.applyForNetworkEngineerJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["NetworkEngineerCompanyPositions"][0]])) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["NetworkEngineerCompanyPositions"][0]], sing);
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-PlayerObject.prototype.applyForBusinessJob = function(sing=false) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["BusinessCompanyPositions"][0]], sing);
-}
-
-PlayerObject.prototype.applyForBusinessConsultantJob = function(sing=false) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["BusinessConsultantCompanyPositions"][0]], sing);
-}
-
-PlayerObject.prototype.applyForSecurityJob = function(sing=false) {
- // TODO Police Jobs
- // Indexing starts at 2 because 0 is for police officer
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["SecurityCompanyPositions"][2]], sing);
-}
-
-PlayerObject.prototype.applyForAgentJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["AgentCompanyPositions"][0]])) {
- return this.applyForJob(_Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["AgentCompanyPositions"][0]], sing);
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-PlayerObject.prototype.applyForEmployeeJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["MiscCompanyPositions"][1]])) {
- this.companyName = company.name;
- this.companyPosition = _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["MiscCompanyPositions"][1];
- document.getElementById("world-menu-header").click();
- document.getElementById("world-menu-header").click();
- if (sing) {return true;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Congratulations, you are now employed at " + this.companyName);
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-PlayerObject.prototype.applyForPartTimeEmployeeJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["PartTimeCompanyPositions"][1]])) {
- this.companyName = company.name;
- this.companyPosition = _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["PartTimeCompanyPositions"][1];
- document.getElementById("world-menu-header").click();
- document.getElementById("world-menu-header").click();
- if (sing) {return true;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Congratulations, you are now employed part-time at " + this.companyName);
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-PlayerObject.prototype.applyForWaiterJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["MiscCompanyPositions"][0]])) {
- this.companyName = company.name;
- this.companyPosition = _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["MiscCompanyPositions"][0];
- document.getElementById("world-menu-header").click();
- document.getElementById("world-menu-header").click();
- if (sing) {return true;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Congratulations, you are now employed as a waiter at " + this.companyName);
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-PlayerObject.prototype.applyForPartTimeWaiterJob = function(sing=false) {
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.location]; //Company being applied to
- if (this.isQualified(company, _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][_Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["PartTimeCompanyPositions"][0]])) {
- this.companyName = company.name;
- this.companyPosition = _Company_data_CompanyPositionNames__WEBPACK_IMPORTED_MODULE_8__["PartTimeCompanyPositions"][0];
- document.getElementById("world-menu-header").click();
- document.getElementById("world-menu-header").click();
- if (sing) {return true;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Congratulations, you are now employed as a part-time waiter at " + this.companyName);
- _engine__WEBPACK_IMPORTED_MODULE_13__["Engine"].loadLocationContent();
- } else {
- if (sing) {return false;}
- Object(_utils_DialogBox__WEBPACK_IMPORTED_MODULE_26__["dialogBoxCreate"])("Unforunately, you do not qualify for this position");
- }
-}
-
-//Checks if the Player is qualified for a certain position
-PlayerObject.prototype.isQualified = function(company, position) {
- var offset = company.jobStatReqOffset;
- var reqHacking = position.requiredHacking > 0 ? position.requiredHacking+offset : 0;
- var reqStrength = position.requiredStrength > 0 ? position.requiredStrength+offset : 0;
- var reqDefense = position.requiredDefense > 0 ? position.requiredDefense+offset : 0;
- var reqDexterity = position.requiredDexterity > 0 ? position.requiredDexterity+offset : 0;
- var reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity+offset : 0;
- var reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma+offset : 0;
-
- if (this.hacking_skill >= reqHacking &&
- this.strength >= reqStrength &&
- this.defense >= reqDefense &&
- this.dexterity >= reqDexterity &&
- this.agility >= reqAgility &&
- this.charisma >= reqCharisma &&
- company.playerReputation >= position.requiredReputation) {
- return true;
- }
- return false;
-}
-
-/********** Reapplying Augmentations and Source File ***********/
-PlayerObject.prototype.reapplyAllAugmentations = function(resetMultipliers=true) {
- console.log("Re-applying augmentations");
- if (resetMultipliers) {
- this.resetMultipliers();
- }
-
- for (let i = 0; i < this.augmentations.length; ++i) {
- //Compatibility with new version
- if (this.augmentations[i].name === "HacknetNode NIC Architecture Neural-Upload") {
- this.augmentations[i].name = "Hacknet Node NIC Architecture Neural-Upload";
- }
-
- const augName = this.augmentations[i].name;
- var aug = _Augmentations__WEBPACK_IMPORTED_MODULE_0__[/* Augmentations */ "c"][augName];
- if (aug == null) {
- console.log(`WARNING: Invalid augmentation name in Player.reapplyAllAugmentations(). Aug ${augName} will be skipped`);
- continue;
- }
- aug.owned = true;
- if (aug.name == _Augmentations__WEBPACK_IMPORTED_MODULE_0__[/* AugmentationNames */ "b"].NeuroFluxGovernor) {
- for (let j = 0; j < aug.level; ++j) {
- Object(_Augmentations__WEBPACK_IMPORTED_MODULE_0__[/* applyAugmentation */ "e"])(this.augmentations[i], true);
- }
- continue;
- }
- Object(_Augmentations__WEBPACK_IMPORTED_MODULE_0__[/* applyAugmentation */ "e"])(this.augmentations[i], true);
- }
-}
-
-PlayerObject.prototype.reapplyAllSourceFiles = function() {
- console.log("Re-applying source files");
- //Will always be called after reapplyAllAugmentations() so multipliers do not have to be reset
- //this.resetMultipliers();
-
- for (let i = 0; i < this.sourceFiles.length; ++i) {
- var srcFileKey = "SourceFile" + this.sourceFiles[i].n;
- var sourceFileObject = _SourceFile__WEBPACK_IMPORTED_MODULE_23__[/* SourceFiles */ "b"][srcFileKey];
- if (sourceFileObject == null) {
- console.log("ERROR: Invalid source file number: " + this.sourceFiles[i].n);
- continue;
- }
- Object(_SourceFile__WEBPACK_IMPORTED_MODULE_23__[/* applySourceFile */ "c"])(this.sourceFiles[i]);
- }
-}
-
-/*************** Check for Faction Invitations *************/
-//This function sets the requirements to join a Faction. It checks whether the Player meets
-//those requirements and will return an array of all factions that the Player should
-//receive an invitation to
-PlayerObject.prototype.checkForFactionInvitations = function() {
- let invitedFactions = []; //Array which will hold all Factions the player should be invited to
-
- var numAugmentations = this.augmentations.length;
-
- var company = _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][this.companyName];
- var companyRep = 0;
- if (company != null) {
- companyRep = company.playerReputation;
- }
-
- //Illuminati
- var illuminatiFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Illuminati"];
- if (!illuminatiFac.isBanned && !illuminatiFac.isMember && !illuminatiFac.alreadyInvited &&
- numAugmentations >= 30 &&
- this.money.gte(150000000000) &&
- this.hacking_skill >= 1500 &&
- this.strength >= 1200 && this.defense >= 1200 &&
- this.dexterity >= 1200 && this.agility >= 1200) {
- invitedFactions.push(illuminatiFac);
- }
-
- //Daedalus
- var daedalusFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Daedalus"];
- if (!daedalusFac.isBanned && !daedalusFac.isMember && !daedalusFac.alreadyInvited &&
- numAugmentations >= 30 &&
- this.money.gte(100000000000) &&
- (this.hacking_skill >= 2500 ||
- (this.strength >= 1500 && this.defense >= 1500 &&
- this.dexterity >= 1500 && this.agility >= 1500))) {
- invitedFactions.push(daedalusFac);
- }
-
- //The Covenant
- var covenantFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["The Covenant"];
- if (!covenantFac.isBanned && !covenantFac.isMember && !covenantFac.alreadyInvited &&
- numAugmentations >= 30 &&
- this.money.gte(75000000000) &&
- this.hacking_skill >= 850 &&
- this.strength >= 850 &&
- this.defense >= 850 &&
- this.dexterity >= 850 &&
- this.agility >= 850) {
- invitedFactions.push(covenantFac);
- }
-
- //ECorp
- var ecorpFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["ECorp"];
- if (!ecorpFac.isBanned && !ecorpFac.isMember && !ecorpFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].AevumECorp && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(ecorpFac);
- }
-
- //MegaCorp
- var megacorpFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["MegaCorp"];
- if (!megacorpFac.isBanned && !megacorpFac.isMember && !megacorpFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12MegaCorp && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(megacorpFac);
- }
-
- //Bachman & Associates
- var bachmanandassociatesFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Bachman & Associates"];
- if (!bachmanandassociatesFac.isBanned && !bachmanandassociatesFac.isMember &&
- !bachmanandassociatesFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].AevumBachmanAndAssociates && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(bachmanandassociatesFac);
- }
-
- //Blade Industries
- var bladeindustriesFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Blade Industries"];
- if (!bladeindustriesFac.isBanned && !bladeindustriesFac.isMember && !bladeindustriesFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12BladeIndustries && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(bladeindustriesFac);
- }
-
- //NWO
- var nwoFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["NWO"];
- if (!nwoFac.isBanned && !nwoFac.isMember && !nwoFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].VolhavenNWO && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(nwoFac);
- }
-
- //Clarke Incorporated
- var clarkeincorporatedFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Clarke Incorporated"];
- if (!clarkeincorporatedFac.isBanned && !clarkeincorporatedFac.isMember && !clarkeincorporatedFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].AevumClarkeIncorporated && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(clarkeincorporatedFac);
- }
-
- //OmniTek Incorporated
- var omnitekincorporatedFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["OmniTek Incorporated"];
- if (!omnitekincorporatedFac.isBanned && !omnitekincorporatedFac.isMember && !omnitekincorporatedFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].VolhavenOmniTekIncorporated && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(omnitekincorporatedFac);
- }
-
- //Four Sigma
- var foursigmaFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Four Sigma"];
- if (!foursigmaFac.isBanned && !foursigmaFac.isMember && !foursigmaFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12FourSigma && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(foursigmaFac);
- }
-
- //KuaiGong International
- var kuaigonginternationalFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["KuaiGong International"];
- if (!kuaigonginternationalFac.isBanned && !kuaigonginternationalFac.isMember &&
- !kuaigonginternationalFac.alreadyInvited &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].ChongqingKuaiGongInternational && companyRep >= _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CorpFactionRepRequirement) {
- invitedFactions.push(kuaigonginternationalFac);
- }
-
- //Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company
- var fulcrumsecrettechonologiesFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Fulcrum Secret Technologies"];
- var fulcrumSecretServer = _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerIps */ "a"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerNames */ "b"].FulcrumSecretTechnologies]];
- if (fulcrumSecretServer == null) {
- console.log("ERROR: Could not find Fulcrum Secret Technologies Server");
- } else {
- if (!fulcrumsecrettechonologiesFac.isBanned && !fulcrumsecrettechonologiesFac.isMember &&
- !fulcrumsecrettechonologiesFac.alreadyInvited &&
- fulcrumSecretServer.manuallyHacked &&
- this.companyName == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].AevumFulcrumTechnologies && companyRep >= 250000) {
- invitedFactions.push(fulcrumsecrettechonologiesFac);
- }
- }
-
- //BitRunners
- var bitrunnersFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["BitRunners"];
- var homeComp = this.getHomeComputer();
- var bitrunnersServer = _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerIps */ "a"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerNames */ "b"].BitRunnersServer]];
- if (bitrunnersServer == null) {
- console.log("ERROR: Could not find BitRunners Server");
- } else if (!bitrunnersFac.isBanned && !bitrunnersFac.isMember && bitrunnersServer.manuallyHacked &&
- !bitrunnersFac.alreadyInvited && this.hacking_skill >= 500 && homeComp.maxRam >= 128) {
- invitedFactions.push(bitrunnersFac);
- }
-
- //The Black Hand
- var theblackhandFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["The Black Hand"];
- var blackhandServer = _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerIps */ "a"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerNames */ "b"].TheBlackHandServer]];
- if (blackhandServer == null) {
- console.log("ERROR: Could not find The Black Hand Server");
- } else if (!theblackhandFac.isBanned && !theblackhandFac.isMember && blackhandServer.manuallyHacked &&
- !theblackhandFac.alreadyInvited && this.hacking_skill >= 350 && homeComp.maxRam >= 64) {
- invitedFactions.push(theblackhandFac);
- }
-
- //NiteSec
- var nitesecFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["NiteSec"];
- var nitesecServer = _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerIps */ "a"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerNames */ "b"].NiteSecServer]];
- if (nitesecServer == null) {
- console.log("ERROR: Could not find NiteSec Server");
- } else if (!nitesecFac.isBanned && !nitesecFac.isMember && nitesecServer.manuallyHacked &&
- !nitesecFac.alreadyInvited && this.hacking_skill >= 200 && homeComp.maxRam >= 32) {
- invitedFactions.push(nitesecFac);
- }
-
- //Chongqing
- var chongqingFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Chongqing"];
- if (!chongqingFac.isBanned && !chongqingFac.isMember && !chongqingFac.alreadyInvited &&
- this.money.gte(20000000) && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Chongqing) {
- invitedFactions.push(chongqingFac);
- }
-
- //Sector-12
- var sector12Fac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Sector-12"];
- if (!sector12Fac.isBanned && !sector12Fac.isMember && !sector12Fac.alreadyInvited &&
- this.money.gte(15000000) && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12) {
- invitedFactions.push(sector12Fac);
- }
-
- //New Tokyo
- var newtokyoFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["New Tokyo"];
- if (!newtokyoFac.isBanned && !newtokyoFac.isMember && !newtokyoFac.alreadyInvited &&
- this.money.gte(20000000) && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].NewTokyo) {
- invitedFactions.push(newtokyoFac);
- }
-
- //Aevum
- var aevumFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Aevum"];
- if (!aevumFac.isBanned && !aevumFac.isMember && !aevumFac.alreadyInvited &&
- this.money.gte(40000000) && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Aevum) {
- invitedFactions.push(aevumFac);
- }
-
- //Ishima
- var ishimaFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Ishima"];
- if (!ishimaFac.isBanned && !ishimaFac.isMember && !ishimaFac.alreadyInvited &&
- this.money.gte(30000000) && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Ishima) {
- invitedFactions.push(ishimaFac);
- }
-
- //Volhaven
- var volhavenFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Volhaven"];
- if (!volhavenFac.isBanned && !volhavenFac.isMember && !volhavenFac.alreadyInvited &&
- this.money.gte(50000000) && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Volhaven) {
- invitedFactions.push(volhavenFac);
- }
-
- //Speakers for the Dead
- var speakersforthedeadFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Speakers for the Dead"];
- if (!speakersforthedeadFac.isBanned && !speakersforthedeadFac.isMember && !speakersforthedeadFac.alreadyInvited &&
- this.hacking_skill >= 100 && this.strength >= 300 && this.defense >= 300 &&
- this.dexterity >= 300 && this.agility >= 300 && this.numPeopleKilled >= 30 &&
- this.karma <= -45 && this.companyName != _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12CIA &&
- this.companyName != _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12NSA) {
- invitedFactions.push(speakersforthedeadFac);
- }
-
- //The Dark Army
- var thedarkarmyFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["The Dark Army"];
- if (!thedarkarmyFac.isBanned && !thedarkarmyFac.isMember && !thedarkarmyFac.alreadyInvited &&
- this.hacking_skill >= 300 && this.strength >= 300 && this.defense >= 300 &&
- this.dexterity >= 300 && this.agility >= 300 && this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Chongqing &&
- this.numPeopleKilled >= 5 && this.karma <= -45 && this.companyName != _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12CIA &&
- this.companyName != _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12NSA) {
- invitedFactions.push(thedarkarmyFac);
- }
-
- //The Syndicate
- var thesyndicateFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["The Syndicate"];
- if (!thesyndicateFac.isBanned && !thesyndicateFac.isMember && !thesyndicateFac.alreadyInvited &&
- this.hacking_skill >= 200 && this.strength >= 200 && this.defense >= 200 &&
- this.dexterity >= 200 && this.agility >= 200 &&
- (this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Aevum || this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12) &&
- this.money.gte(10000000) && this.karma <= -90 &&
- this.companyName != _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12CIA && this.companyName != _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Sector12NSA) {
- invitedFactions.push(thesyndicateFac);
- }
-
- //Silhouette
- var silhouetteFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Silhouette"];
- const companyPosition = _Company_CompanyPositions__WEBPACK_IMPORTED_MODULE_7__["CompanyPositions"][this.companyPosition];
- if (!silhouetteFac.isBanned && !silhouetteFac.isMember && !silhouetteFac.alreadyInvited &&
- companyPosition != null &&
- (companyPosition.name == "Chief Technology Officer" ||
- companyPosition.name == "Chief Financial Officer" ||
- companyPosition.name == "Chief Executive Officer") &&
- this.money.gte(15000000) && this.karma <= -22) {
- invitedFactions.push(silhouetteFac);
- }
-
- //Tetrads
- var tetradsFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Tetrads"];
- if (!tetradsFac.isBanned && !tetradsFac.isMember && !tetradsFac.alreadyInvited &&
- (this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Chongqing || this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].NewTokyo ||
- this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Ishima) && this.strength >= 75 && this.defense >= 75 &&
- this.dexterity >= 75 && this.agility >= 75 && this.karma <= -18) {
- invitedFactions.push(tetradsFac);
- }
-
- //SlumSnakes
- var slumsnakesFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Slum Snakes"];
- if (!slumsnakesFac.isBanned && !slumsnakesFac.isMember && !slumsnakesFac.alreadyInvited &&
- this.strength >= 30 && this.defense >= 30 && this.dexterity >= 30 &&
- this.agility >= 30 && this.karma <= -9 && this.money.gte(1000000)) {
- invitedFactions.push(slumsnakesFac);
- }
-
- //Netburners
- var netburnersFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Netburners"];
- var totalHacknetRam = 0;
- var totalHacknetCores = 0;
- var totalHacknetLevels = 0;
- for (var i = 0; i < this.hacknetNodes.length; ++i) {
- totalHacknetLevels += this.hacknetNodes[i].level;
- totalHacknetRam += this.hacknetNodes[i].ram;
- totalHacknetCores += this.hacknetNodes[i].cores;
- }
- if (!netburnersFac.isBanned && !netburnersFac.isMember && !netburnersFac.alreadyInvited &&
- this.hacking_skill >= 80 && totalHacknetRam >= 8 &&
- totalHacknetCores >= 4 && totalHacknetLevels >= 100) {
- invitedFactions.push(netburnersFac);
- }
-
- //Tian Di Hui
- var tiandihuiFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["Tian Di Hui"];
- if (!tiandihuiFac.isBanned && !tiandihuiFac.isMember && !tiandihuiFac.alreadyInvited &&
- this.money.gte(1000000) && this.hacking_skill >= 50 &&
- (this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Chongqing || this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].NewTokyo ||
- this.city == _Locations__WEBPACK_IMPORTED_MODULE_18__["Locations"].Ishima)) {
- invitedFactions.push(tiandihuiFac);
- }
-
- //CyberSec
- var cybersecFac = _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"]["CyberSec"];
- var cybersecServer = _Server__WEBPACK_IMPORTED_MODULE_20__[/* AllServers */ "b"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerIps */ "a"][_SpecialServerIps__WEBPACK_IMPORTED_MODULE_22__[/* SpecialServerNames */ "b"].CyberSecServer]];
- if (cybersecServer == null) {
- console.log("ERROR: Could not find CyberSec Server");
- } else if (!cybersecFac.isBanned && !cybersecFac.isMember && cybersecServer.manuallyHacked &&
- !cybersecFac.alreadyInvited && this.hacking_skill >= 50) {
- invitedFactions.push(cybersecFac);
- }
-
- return invitedFactions;
-}
-
-
-/*************** Gang ****************/
-//Returns true if Player is in a gang and false otherwise
-PlayerObject.prototype.inGang = function() {
- if (this.gang == null || this.gang == undefined) {return false;}
- return (this.gang instanceof _Gang__WEBPACK_IMPORTED_MODULE_17__[/* Gang */ "b"]);
-}
-
-PlayerObject.prototype.startGang = function(factionName, hacking) {
- this.gang = new _Gang__WEBPACK_IMPORTED_MODULE_17__[/* Gang */ "b"](factionName, hacking);
-}
-
-/************* BitNodes **************/
-PlayerObject.prototype.setBitNodeNumber = function(n) {
- this.bitNodeN = n;
-}
-
-PlayerObject.prototype.queueAugmentation = function(name) {
- for(const i in this.queuedAugmentations) {
- if(this.queuedAugmentations[i].name == name) {
- console.log('tried to queue '+name+' twice, this may be a bug');
- return;
- }
- }
-
- for(const i in this.augmentations) {
- if(this.augmentations[i].name == name) {
- console.log('tried to queue '+name+' but we already have that aug');
- return;
- }
- }
-
- this.firstAugPurchased = true;
- this.queuedAugmentations.push(new _Augmentations__WEBPACK_IMPORTED_MODULE_0__[/* PlayerOwnedAugmentation */ "d"](name));
-}
-
-/************* Coding Contracts **************/
-PlayerObject.prototype.gainCodingContractReward = function(reward, difficulty=1) {
- if (reward == null || reward.type == null || reward == null) {
- return `No reward for this contract`;
- }
-
- /* eslint-disable no-case-declarations */
- switch (reward.type) {
- case _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].FactionReputation:
- if (reward.name == null || !(_Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"][reward.name] instanceof _Faction_Faction__WEBPACK_IMPORTED_MODULE_14__["Faction"])) {
- // If no/invalid faction was designated, just give rewards to all factions
- reward.type = _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].FactionReputationAll;
- return this.gainCodingContractReward(reward);
- }
- var repGain = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CodingContractBaseFactionRepGain * difficulty;
- _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"][reward.name].playerReputation += repGain;
- return `Gained ${repGain} faction reputation for ${reward.name}`;
- case _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].FactionReputationAll:
- const totalGain = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CodingContractBaseFactionRepGain * difficulty;
-
- // Ignore Bladeburners and other special factions for this calculation
- const specialFactions = ["Bladeburners"];
- var factions = this.factions.slice();
- factions = factions.filter((f) => {
- return !specialFactions.includes(f);
- });
-
- // If the player was only part of the special factions, we'll just give money
- if (factions.length == 0) {
- reward.type = _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].Money;
- return this.gainCodingContractReward(reward, difficulty);
- }
-
- const gainPerFaction = Math.floor(totalGain / factions.length);
- for (const facName of factions) {
- if (!(_Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"][facName] instanceof _Faction_Faction__WEBPACK_IMPORTED_MODULE_14__["Faction"])) { continue; }
- _Faction_Factions__WEBPACK_IMPORTED_MODULE_15__["Factions"][facName].playerReputation += gainPerFaction;
- }
- return `Gained ${gainPerFaction} reputation for each of the following factions: ${factions.toString()}`;
- break;
- case _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].CompanyReputation:
- if (reward.name == null || !(_Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][reward.name] instanceof _Company_Company__WEBPACK_IMPORTED_MODULE_3__["Company"])) {
- //If no/invalid company was designated, just give rewards to all factions
- reward.type = _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].FactionReputationAll;
- return this.gainCodingContractReward(reward);
- }
- var repGain = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CodingContractBaseCompanyRepGain * difficulty;
- _Company_Companies__WEBPACK_IMPORTED_MODULE_4__["Companies"][reward.name].playerReputation += repGain;
- return `Gained ${repGain} company reputation for ${reward.name}`;
- break;
- case _CodingContracts__WEBPACK_IMPORTED_MODULE_2__["CodingContractRewardType"].Money:
- default:
- var moneyGain = _Constants__WEBPACK_IMPORTED_MODULE_9__["CONSTANTS"].CodingContractBaseMoneyGain * difficulty * _BitNodeMultipliers__WEBPACK_IMPORTED_MODULE_1__["BitNodeMultipliers"].CodingContractMoney;
- this.gainMoney(moneyGain);
- return `Gained ${_ui_numeralFormat__WEBPACK_IMPORTED_MODULE_25__["numeralWrapper"].format(moneyGain, '$0.000a')}`;
- break;
- }
- /* eslint-enable no-case-declarations */
-}
-
-/* Functions for saving and loading the Player data */
-function loadPlayer(saveString) {
- Player = JSON.parse(saveString, _utils_JSONReviver__WEBPACK_IMPORTED_MODULE_29__["Reviver"]);
-
- //Parse Decimal.js objects
- Player.money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](Player.money);
- Player.total_money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](Player.total_money);
- Player.lifetime_money = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](Player.lifetime_money);
-
- if (Player.corporation instanceof _Corporation_Corporation__WEBPACK_IMPORTED_MODULE_10__[/* Corporation */ "a"]) {
- Player.corporation.funds = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](Player.corporation.funds);
- Player.corporation.revenue = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](Player.corporation.revenue);
- Player.corporation.expenses = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](Player.corporation.expenses);
-
- for (var i = 0; i < Player.corporation.divisions.length; ++i) {
- var ind = Player.corporation.divisions[i];
- ind.lastCycleRevenue = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](ind.lastCycleRevenue);
- ind.lastCycleExpenses = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](ind.lastCycleExpenses);
- ind.thisCycleRevenue = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](ind.thisCycleRevenue);
- ind.thisCycleExpenses = new decimal_js__WEBPACK_IMPORTED_MODULE_24__[/* default */ "a"](ind.thisCycleExpenses);
- }
- }
-}
-
-PlayerObject.prototype.toJSON = function() {
- return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_29__["Generic_toJSON"])("PlayerObject", this);
-}
-
-PlayerObject.fromJSON = function(value) {
- return Object(_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_29__["Generic_fromJSON"])(PlayerObject, value.data);
-}
-
-_utils_JSONReviver__WEBPACK_IMPORTED_MODULE_29__["Reviver"].constructors.PlayerObject = PlayerObject;
-
-let Player = new PlayerObject();
-
-
-
-/***/ }),
-/* 1 */
-/*!**************************!*\
- !*** ./src/Constants.ts ***!
- \**************************/
-/*! no static exports found */
-/*! all exports used */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.CONSTANTS = {
- Version: "0.41.2",
- //Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
- //and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
- //the player will have this level assuming no multipliers. Multipliers can cause skills to go above this.
- MaxSkillLevel: 975,
- //Milliseconds per game cycle
- MilliPerCycle: 200,
- //How much reputation is needed to join a megacorporation's faction
- CorpFactionRepRequirement: 200e3,
- /* Base costs */
- BaseCostFor1GBOfRamHome: 32000,
- BaseCostFor1GBOfRamServer: 55000,
- BaseCostFor1GBOfRamHacknetNode: 30000,
- TravelCost: 200000,
- BaseCostForHacknetNode: 1000,
- BaseCostForHacknetNodeCore: 500000,
- /* Hacknet Node constants */
- HacknetNodeMoneyGainPerLevel: 1.6,
- HacknetNodePurchaseNextMult: 1.85,
- HacknetNodeUpgradeLevelMult: 1.04,
- HacknetNodeUpgradeRamMult: 1.28,
- HacknetNodeUpgradeCoreMult: 1.48,
- HacknetNodeMaxLevel: 200,
- HacknetNodeMaxRam: 64,
- HacknetNodeMaxCores: 16,
- /* Faction and Company favor */
- BaseFavorToDonate: 150,
- DonateMoneyToRepDivisor: 1e6,
- FactionReputationToFavorBase: 500,
- FactionReputationToFavorMult: 1.02,
- CompanyReputationToFavorBase: 500,
- CompanyReputationToFavorMult: 1.02,
- /* Augmentation */
- //NeuroFlux Governor cost multiplier as you level up
- NeuroFluxGovernorLevelMult: 1.14,
- /* Netscript Constants */
- //RAM Costs for different commands
- ScriptBaseRamCost: 1.6,
- ScriptDomRamCost: 25,
- ScriptWhileRamCost: 0,
- ScriptForRamCost: 0,
- ScriptIfRamCost: 0,
- ScriptHackRamCost: 0.1,
- ScriptHackAnalyzeRamCost: 1,
- ScriptGrowRamCost: 0.15,
- ScriptGrowthAnalyzeRamCost: 1,
- ScriptWeakenRamCost: 0.15,
- ScriptScanRamCost: 0.2,
- ScriptPortProgramRamCost: 0.05,
- ScriptRunRamCost: 1.0,
- ScriptExecRamCost: 1.3,
- ScriptSpawnRamCost: 2.0,
- ScriptScpRamCost: 0.6,
- ScriptKillRamCost: 0.5,
- ScriptHasRootAccessRamCost: 0.05,
- ScriptGetHostnameRamCost: 0.05,
- ScriptGetHackingLevelRamCost: 0.05,
- ScriptGetMultipliersRamCost: 4.0,
- ScriptGetServerRamCost: 0.1,
- ScriptFileExistsRamCost: 0.1,
- ScriptIsRunningRamCost: 0.1,
- ScriptHacknetNodesRamCost: 4.0,
- ScriptHNUpgLevelRamCost: 0.4,
- ScriptHNUpgRamRamCost: 0.6,
- ScriptHNUpgCoreRamCost: 0.8,
- ScriptGetStockRamCost: 2.0,
- ScriptBuySellStockRamCost: 2.5,
- ScriptGetPurchaseServerRamCost: 0.25,
- ScriptPurchaseServerRamCost: 2.25,
- ScriptGetPurchasedServerLimit: 0.05,
- ScriptGetPurchasedServerMaxRam: 0.05,
- ScriptRoundRamCost: 0.05,
- ScriptReadWriteRamCost: 1.0,
- ScriptArbScriptRamCost: 1.0,
- ScriptGetScriptRamCost: 0.1,
- ScriptGetHackTimeRamCost: 0.05,
- ScriptGetFavorToDonate: 0.10,
- ScriptCodingContractBaseRamCost: 10,
- ScriptSingularityFn1RamCost: 1,
- ScriptSingularityFn2RamCost: 2,
- ScriptSingularityFn3RamCost: 3,
- ScriptSingularityFnRamMult: 2,
- ScriptGangApiBaseRamCost: 4,
- ScriptBladeburnerApiBaseRamCost: 4,
- NumNetscriptPorts: 20,
- //Server constants
- ServerBaseGrowthRate: 1.03,
- ServerMaxGrowthRate: 1.0035,
- ServerFortifyAmount: 0.002,
- ServerWeakenAmount: 0.05,
- PurchasedServerLimit: 25,
- PurchasedServerMaxRam: 1048576,
- //Augmentation Constants
- AugmentationCostMultiplier: 5,
- AugmentationRepMultiplier: 2.5,
- MultipleAugMultiplier: 1.9,
- //How much a TOR router costs
- TorRouterCost: 200000,
- //Infiltration constants
- InfiltrationBribeBaseAmount: 100e3,
- InfiltrationMoneyValue: 5e3,
- InfiltrationRepValue: 1.4,
- //Stock market constants
- WSEAccountCost: 200e6,
- TIXAPICost: 5e9,
- MarketData4SCost: 1e9,
- MarketDataTixApi4SCost: 20e9,
- StockMarketCommission: 100e3,
- //Hospital/Health
- HospitalCostPerHp: 100e3,
- //Intelligence-related constants
- IntelligenceCrimeWeight: 0.05,
- IntelligenceInfiltrationWeight: 0.1,
- IntelligenceCrimeBaseExpGain: 0.001,
- IntelligenceProgramBaseExpGain: 500,
- IntelligenceTerminalHackBaseExpGain: 200,
- IntelligenceSingFnBaseExpGain: 0.002,
- IntelligenceClassBaseExpGain: 0.000001,
- IntelligenceHackingMissionBaseExpGain: 0.03,
- //Hacking Missions
- HackingMissionRepToDiffConversion: 10000,
- HackingMissionRepToRewardConversion: 7,
- HackingMissionSpamTimeIncrease: 25000,
- HackingMissionTransferAttackIncrease: 1.05,
- HackingMissionMiscDefenseIncrease: 1.05,
- HackingMissionDifficultyToHacking: 135,
- HackingMissionHowToPlay: "Hacking missions are a minigame that, if won, will reward you with faction reputation.
" +
- "In this game you control a set of Nodes and use them to try and defeat an enemy. Your Nodes " +
- "are colored blue, while the enemy's are red. There are also other nodes on the map colored gray " +
- "that initially belong to neither you nor the enemy. The goal of the game is " +
- "to capture all of the enemy's Database nodes within the time limit. " +
- "If you fail to do this, you will lose.
" +
- "Each Node has three stats: Attack, Defense, and HP. There are five different actions that " +
- "a Node can take:
" +
- "Attack - Targets an enemy Node and lowers its HP. The effectiveness is determined by the owner's Attack, the Player's " +
- "hacking level, and the enemy's defense.
" +
- "Scan - Targets an enemy Node and lowers its Defense. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the " +
- "enemy's defense.
" +
- "Weaken - Targets an enemy Node and lowers its Attack. The effectiveness is determined by the owner's Attack, the Player's hacking level, and the enemy's " +
- "defense.
" +
- "Fortify - Raises the Node's Defense. The effectiveness is determined by your hacking level.
" +
- "Overflow - Raises the Node's Attack but lowers its Defense. The effectiveness is determined by your hacking level.
" +
- "Note that when determining the effectiveness of the above actions, the TOTAL Attack or Defense of the team is used, not just the " +
- "Attack/Defense of the individual Node that is performing the action.
" +
- "To capture a Node, you must lower its HP down to 0.
" +
- "There are six different types of Nodes:
" +
- "CPU Core - These are your main Nodes that are used to perform actions. Capable of performing every action
" +
- "Firewall - Nodes with high defense. These Nodes can 'Fortify'
" +
- "Database - A special type of Node. The player's objective is to conquer all of the enemy's Database Nodes within " +
- "the time limit. These Nodes cannot perform any actions
" +
- "Spam - Conquering one of these Nodes will slow the enemy's trace, giving the player additional time to complete " +
- "the mission. These Nodes cannot perform any actions
" +
- "Transfer - Conquering one of these nodes will increase the Attack of all of your CPU Cores by a small fixed percentage. " +
- "These Nodes are capable of performing every action except the 'Attack' action
" +
- "Shield - Nodes with high defense. These Nodes can 'Fortify'
" +
- "To assign an action to a Node, you must first select one of your Nodes. This can be done by simply clicking on it. Double-clicking " +
- "a node will select all of your Nodes of the same type (e.g. select all CPU Core Nodes or all Transfer Nodes). Note that only Nodes " +
- "that can perform actions (CPU Core, Transfer, Shield, Firewall) can be selected. Selected Nodes will be denoted with a white highlight. After selecting a Node or multiple Nodes, " +
- "select its action using the Action Buttons near the top of the screen. Every action also has a corresponding keyboard " +
- "shortcut.
" +
- "For certain actions such as attacking, scanning, and weakening, the Node performing the action must have a target. To target " +
- "another node, simply click-and-drag from the 'source' Node to a target. A Node can only have one target, and you can target " +
- "any Node that is adjacent to one of your Nodes (immediately above, below, or to the side. NOT diagonal). Furthermore, only CPU Cores and Transfer Nodes " +
- "can target, since they are the only ones that can perform the related actions. To remove a target, you can simply click on the line that represents " +
- "the connection between one of your Nodes and its target. Alternatively, you can select the 'source' Node and click the 'Drop Connection' button, " +
- "or press 'd'.
" +
- "Other Notes:
" +
- "-Whenever a miscellenaous Node (not owned by the player or enemy) is conquered, the defense of all remaining miscellaneous Nodes that " +
- "are not actively being targeted will increase by a fixed percentage.
" +
- "-Whenever a Node is conquered, its stats are significantly reduced
" +
- "-Miscellaneous Nodes slowly raise their defense over time
" +
- "-Nodes slowly regenerate health over time.",
- /* Time Constants */
- MillisecondsPer20Hours: 72000000,
- GameCyclesPer20Hours: 72000000 / 200,
- MillisecondsPer10Hours: 36000000,
- GameCyclesPer10Hours: 36000000 / 200,
- MillisecondsPer8Hours: 28800000,
- GameCyclesPer8Hours: 28800000 / 200,
- MillisecondsPer4Hours: 14400000,
- GameCyclesPer4Hours: 14400000 / 200,
- MillisecondsPer2Hours: 7200000,
- GameCyclesPer2Hours: 7200000 / 200,
- MillisecondsPerHour: 3600000,
- GameCyclesPerHour: 3600000 / 200,
- MillisecondsPerHalfHour: 1800000,
- GameCyclesPerHalfHour: 1800000 / 200,
- MillisecondsPerQuarterHour: 900000,
- GameCyclesPerQuarterHour: 900000 / 200,
- MillisecondsPerFiveMinutes: 300000,
- GameCyclesPerFiveMinutes: 300000 / 200,
- /* Player Work / Action related Constants */
- FactionWorkHacking: "Faction Hacking Work",
- FactionWorkField: "Faction Field Work",
- FactionWorkSecurity: "Faction Security Work",
- WorkTypeCompany: "Working for Company",
- WorkTypeCompanyPartTime: "Working for Company part-time",
- WorkTypeFaction: "Working for Faction",
- WorkTypeCreateProgram: "Working on Create a Program",
- WorkTypeStudyClass: "Studying or Taking a class at university",
- WorkTypeCrime: "Committing a crime",
- ClassStudyComputerScience: "studying Computer Science",
- ClassDataStructures: "taking a Data Structures course",
- ClassNetworks: "taking a Networks course",
- ClassAlgorithms: "taking an Algorithms course",
- ClassManagement: "taking a Management course",
- ClassLeadership: "taking a Leadership course",
- ClassGymStrength: "training your strength at a gym",
- ClassGymDefense: "training your defense at a gym",
- ClassGymDexterity: "training your dexterity at a gym",
- ClassGymAgility: "training your agility at a gym",
- ClassDataStructuresBaseCost: 40,
- ClassNetworksBaseCost: 80,
- ClassAlgorithmsBaseCost: 320,
- ClassManagementBaseCost: 160,
- ClassLeadershipBaseCost: 320,
- ClassGymBaseCost: 120,
- CrimeShoplift: "shoplift",
- CrimeRobStore: "rob a store",
- CrimeMug: "mug someone",
- CrimeLarceny: "commit larceny",
- CrimeDrugs: "deal drugs",
- CrimeBondForgery: "forge corporate bonds",
- CrimeTraffickArms: "traffick illegal arms",
- CrimeHomicide: "commit homicide",
- CrimeGrandTheftAuto: "commit grand theft auto",
- CrimeKidnap: "kidnap someone for ransom",
- CrimeAssassination: "assassinate a high-profile target",
- CrimeHeist: "pull off the ultimate heist",
- /* Coding Contract Constants */
- CodingContractBaseFactionRepGain: 2500,
- CodingContractBaseCompanyRepGain: 4000,
- CodingContractBaseMoneyGain: 50e6,
- /* Tutorial related things */
- TutorialNetworkingText: "Servers are a central part of the game. You start with a single personal server (your home computer) " +
- "and you can purchase additional servers as you progress through the game. Connecting to other servers " +
- "and hacking them can be a major source of income and experience. Servers can also be used to run " +
- "scripts which can automatically hack servers for you.
" +
- "In order to navigate between machines, use the 'scan' or 'scan-analyze' Terminal command to see all servers " +
- "that are reachable from your current server. Then, you can use the 'connect [hostname/ip]' " +
- "command to connect to one of the available machines.
" +
- "The 'hostname' and 'ifconfig' commands can be used to display the hostname/IP of the " +
- "server you are currently connected to.",
- TutorialHackingText: "In the year 2077, currency has become digital and decentralized. People and corporations " +
- "store their money on servers. By hacking these servers, you can steal their money and gain " +
- "experience.
" +
- "
=p||n.segment===m[1]&&!f?a[t]:n.segment===m[0]||n.segment===m[1]&&f?s[t]:void 0},orthogonal:function(t,n,i,r,o){var s=e,a={x:-1===s.so[0]?Math.min(n,r):Math.max(n,r),y:-1===s.so[1]?Math.min(n,r):Math.max(n,r)}[t];return{x:[[a,i],[a,o],[r,o]],y:[[i,a],[o,a],[o,r]]}[t]},opposite:function(n,r,o,s){var a=e,l={x:"y",y:"x"}[n],c={x:"height",y:"width"}[n],u=a["is"+n.toUpperCase()+"GreaterThanStubTimes2"];if(t.sourceEndpoint.elementId===t.targetEndpoint.elementId){var h=o+(1-t.sourceEndpoint.anchor[l])*t.sourceInfo[c]+i.maxStub;return{x:[[r,h],[s,h]],y:[[h,r],[h,s]]}[n]}return!u||1===a.so[y]&&r>s||-1===a.so[y]&&rs?{x:[[A,a.sy],[A,a.ty]],y:[[a.sx,E],[a.tx,E]]}[n]:void 0}}[e.anchorOrientation](e.sourceAxis,w,_,C,x);if(S)for(var F=0;F>>16)){if(e===this){var n=i();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():d.settlePromises(this))}},D.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return d.fatalError(e,c.isNode);(65535&t)>0?d.settlePromises(this):this._ensurePossibleRejectionHandled()}},D.prototype._fulfillPromises=function(e,t){for(var n=1;n
",s.escapeHTML(e.snippet)].join(""))}},h=[u,l,c];t.setCompleters=function(e){h.length=0,e&&h.push.apply(h,e)},t.addCompleter=function(e){h.push(e)},t.textCompleter=l,t.keyWordCompleter=c,t.snippetCompleter=u;var d={name:"expandSnippet",exec:function(e){return i.expandWithTab(e)},bindKey:"Tab"},f=function(e,t){p(t.session.$mode)},p=function(e){var t=e.$id;i.files||(i.files={}),g(t),e.modes&&e.modes.forEach(p)},g=function(e){if(e&&!i.files[e]){var t=e.replace("mode","snippets");i.files[e]={},o.loadModule(t,function(t){t&&(i.files[e]=t,!t.snippets&&t.snippetText&&(t.snippets=i.parseSnippetFile(t.snippetText)),i.register(t.snippets||[],t.scope),t.includeScopes&&(i.snippetMap[t.scope].includeScopes=t.includeScopes,t.includeScopes.forEach(function(e){g("ace/mode/"+e)})))})}},m=function(e){var t=e.editor,n=t.completer&&t.completer.activated;if("backspace"===e.command.name)n&&!a.getCompletionPrefix(t)&&t.completer.detach();else if("insertstring"===e.command.name){a.getCompletionPrefix(t)&&!n&&(t.completer||(t.completer=new r),t.completer.autoInsert=!1,t.completer.showPopup(t))}},v=e("../editor").Editor;e("../config").defineOptions(v.prototype,"editor",{enableBasicAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.addCommand(r.startCommand)):this.commands.removeCommand(r.startCommand)},value:!1},enableLiveAutocompletion:{set:function(e){e?(this.completers||(this.completers=Array.isArray(e)?e:h),this.commands.on("afterExec",m)):this.commands.removeListener("afterExec",m)},value:!1},enableSnippets:{set:function(e){e?(this.commands.addCommand(d),this.on("changeMode",f),f(0,this)):(this.commands.removeCommand(d),this.off("changeMode",f))},value:!1}})}),ace.acequire(["ace/ext/language_tools"],function(){})},function(e,t){ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"],function(e,t,n){"use strict";var i=e("./lib/oop"),r=(e("./range").Range,e("./search").Search),o=e("./edit_session").EditSession,s=e("./search_highlight").SearchHighlight;function a(){}i.inherits(a,r),function(){this.enter=function(e,t){if(!t.needle)return!1;var n=e.getCursorPosition();this.displayOccurContent(e,t);var i=this.originalToOccurPosition(e.session,n);return e.moveCursorToPosition(i),!0},this.exit=function(e,t){var n=t.translatePosition&&e.getCursorPosition(),i=n&&this.occurToOriginalPosition(e.session,n);return this.displayOriginalContent(e),i&&e.moveCursorToPosition(i),!0},this.highlight=function(e,t){(e.$occurHighlight=e.$occurHighlight||e.addDynamicMarker(new s(null,"ace_occur-highlight","text"))).setRegexp(t),e._emit("changeBackMarker")},this.displayOccurContent=function(e,t){this.$originalSession=e.session;var n=this.matchingLines(e.session,t),i=n.map(function(e){return e.content}),r=new o(i.join("\n"));r.$occur=this,r.$occurMatchingLines=n,e.setSession(r),this.$useEmacsStyleLineStart=this.$originalSession.$useEmacsStyleLineStart,r.$useEmacsStyleLineStart=this.$useEmacsStyleLineStart,this.highlight(r,t.re),r._emit("changeBackMarker")},this.displayOriginalContent=function(e){e.setSession(this.$originalSession),this.$originalSession.$useEmacsStyleLineStart=this.$useEmacsStyleLineStart},this.originalToOccurPosition=function(e,t){var n=e.$occurMatchingLines,i={row:0,column:0};if(!n)return i;for(var r=0;r