From 3fad5050961a3259b0158763f48016174a2a690e Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Thu, 29 Apr 2021 23:52:56 -0400 Subject: [PATCH] run auto fix lint --- .eslintrc.js | 374 +++++++++--------- css/casino.scss | 26 +- css/characteroverview.scss | 6 +- package.json | 4 +- src/Alias.ts | 6 +- src/Augmentation/Augmentation.ts | 16 +- src/Augmentation/AugmentationHelpers.jsx | 8 +- src/Augmentation/Augmentations.ts | 2 +- src/Augmentation/PlayerOwnedAugmentation.ts | 6 +- src/Augmentation/data/AugmentationNames.ts | 2 +- src/Augmentation/ui/PlayerMultipliers.tsx | 20 +- .../ui/PurchasedAugmentations.tsx | 2 +- src/Augmentation/ui/SourceFileMinus1.tsx | 2 +- src/BitNode/BitNode.ts | 6 +- src/Bladeburner.jsx | 122 +++--- src/Bladeburner/Action.ts | 56 +-- src/Bladeburner/BlackOperations.ts | 26 +- src/Bladeburner/City.ts | 24 +- src/Bladeburner/GeneralActions.ts | 8 +- src/Bladeburner/Operation.ts | 10 +- src/Bladeburner/Skill.ts | 38 +- src/Bladeburner/Skills.ts | 20 +- src/Bladeburner/data/Help.ts | 18 +- src/Bladeburner/ui/BlackOperationsPage.tsx | 5 +- src/Casino/CoinFlip.tsx | 2 +- src/Casino/RNG.ts | 14 +- src/Casino/Roulette.tsx | 8 +- src/Casino/SlotMachine.tsx | 8 +- src/CinematicText.js | 2 +- src/CodingContractGenerator.ts | 12 +- src/CodingContracts.ts | 12 +- src/Company/Company.ts | 2 +- src/Company/GetJobRequirementText.ts | 4 +- src/Company/data/CompaniesMetadata.ts | 68 ++-- src/Company/data/companypositionnames.ts | 22 +- src/Constants.ts | 4 +- src/Corporation/Corporation.jsx | 20 +- src/Corporation/CorporationState.ts | 2 +- src/Corporation/IndustryData.ts | 2 +- src/Corporation/IndustryUpgrades.ts | 2 +- src/Corporation/Material.ts | 36 +- src/Corporation/Product.ts | 58 +-- src/Corporation/ProductRatingWeights.ts | 2 +- src/Corporation/Research.ts | 26 +- src/Corporation/ResearchMap.ts | 2 +- src/Corporation/ResearchTree.ts | 10 +- src/Corporation/Warehouse.ts | 16 +- src/Corporation/data/ResearchMetadata.ts | 4 +- .../ui/CorporationUIEventHandler.js | 126 +++--- src/Corporation/ui/HeaderTabs.jsx | 2 +- src/Corporation/ui/Overview.jsx | 4 +- src/Corporation/ui/Routing.ts | 6 +- src/Crime/Crime.ts | 56 +-- src/Crime/CrimeHelpers.ts | 6 +- src/DevMenu.jsx | 28 +- src/Faction/Faction.ts | 18 +- src/Faction/FactionHelpers.jsx | 6 +- src/Faction/Factions.ts | 2 +- src/Faction/ui/AugmentationsPage.tsx | 9 +- src/Faction/ui/DonateOption.tsx | 2 +- src/Faction/ui/PurchaseableAugmentation.tsx | 4 +- src/Faction/ui/Root.tsx | 2 +- src/Gang.jsx | 44 +-- src/Hacking/netscriptCanHack.ts | 4 +- src/Hacknet/HacknetHelpers.jsx | 2 +- src/Hacknet/HacknetNode.ts | 28 +- src/Hacknet/HacknetServer.ts | 18 +- src/Hacknet/HashManager.ts | 4 +- src/Hacknet/HashUpgrade.ts | 10 +- src/Hacknet/formulas/HacknetNodes.ts | 8 +- src/Hacknet/formulas/HacknetServers.ts | 14 +- src/Hacknet/ui/HashUpgradePopup.jsx | 2 +- src/InteractiveTutorial.js | 6 +- src/JSInterpreter.js | 24 +- src/Locations/City.ts | 2 +- src/Locations/Location.ts | 8 +- src/Locations/LocationsHelpers.tsx | 22 +- src/Locations/data/LocationNames.ts | 2 +- src/Locations/ui/ApplyToJobButton.tsx | 2 +- src/Locations/ui/City.tsx | 10 +- src/Locations/ui/CompanyLocation.tsx | 8 +- src/Locations/ui/GenericLocation.tsx | 18 +- src/Locations/ui/Root.tsx | 2 +- src/Locations/ui/TechVendorLocation.tsx | 2 +- src/Locations/ui/TravelAgencyLocation.tsx | 18 +- src/Message/Message.ts | 6 +- src/Milestones/MilestoneHelpers.tsx | 2 +- src/Milestones/Milestones.ts | 2 +- src/Missions.jsx | 36 +- src/Netscript/Environment.ts | 4 +- src/Netscript/RamCostGenerator.ts | 2 +- src/Netscript/WorkerScript.ts | 12 +- src/Netscript/killWorkerScript.ts | 6 +- src/NetscriptFunctions.js | 38 +- src/NetscriptJSEvaluator.js | 4 +- src/NetscriptPort.ts | 2 +- src/NetscriptWorker.js | 14 +- src/PersonObjects/Person.ts | 94 ++--- src/PersonObjects/Player/PlayerObject.js | 6 +- .../Player/PlayerObjectCorporationMethods.js | 2 +- .../Player/PlayerObjectGeneralMethods.jsx | 10 +- .../Player/PlayerObjectServerMethods.ts | 2 +- src/PersonObjects/Resleeving/Resleeve.ts | 8 +- src/PersonObjects/Resleeving/Resleeving.ts | 6 +- src/PersonObjects/Resleeving/ResleevingUI.tsx | 22 +- src/PersonObjects/Sleeve/Sleeve.ts | 42 +- .../Sleeve/SleeveAugmentationsUI.ts | 6 +- .../Sleeve/SleeveCovenantPurchases.ts | 6 +- src/PersonObjects/Sleeve/SleeveUI.tsx | 32 +- .../Sleeve/ui/CovenantPurchasesRoot.tsx | 2 +- src/PersonObjects/formulas/intelligence.ts | 2 +- src/PersonObjects/formulas/reputation.ts | 6 +- src/PersonObjects/formulas/skill.ts | 4 +- src/Prestige.js | 12 +- src/Programs/Program.ts | 2 +- src/RedPill.js | 2 +- src/Script/RamCalculations.js | 2 +- src/Script/RunningScript.ts | 34 +- src/Script/Script.ts | 20 +- src/Script/ScriptHelpers.js | 12 +- src/ScriptEditor/Ace.js | 2 +- src/ScriptEditor/AceNetscriptMode.js | 220 +++++------ src/ScriptEditor/CodeMirror.js | 6 +- src/ScriptEditor/CodeMirrorNetscriptLint.js | 3 +- src/ScriptEditor/CodeMirrorNetscriptMode.js | 10 +- src/ScriptEditor/CursorPositions.ts | 2 +- src/Server/AllServers.ts | 8 +- src/Server/BaseServer.ts | 38 +- src/Server/Server.ts | 28 +- src/Server/ServerHelpers.ts | 2 +- src/Server/ServerPurchases.ts | 4 +- src/Server/SpecialServerIps.ts | 4 +- src/SourceFile/PlayerOwnedSourceFile.ts | 4 +- src/SourceFile/SourceFile.ts | 6 +- src/StockMarket/Order.ts | 4 +- src/StockMarket/OrderProcessing.tsx | 4 +- src/StockMarket/Stock.ts | 10 +- src/StockMarket/StockMarket.tsx | 12 +- src/StockMarket/StockMarketHelpers.ts | 6 +- src/StockMarket/ui/InfoAndPurchases.tsx | 4 +- src/StockMarket/ui/StockTicker.tsx | 8 +- src/StockMarket/ui/StockTickerHeaderText.tsx | 4 +- src/StockMarket/ui/StockTickers.tsx | 2 +- src/StockMarket/ui/StockTickersConfig.tsx | 4 +- src/Terminal.jsx | 24 +- src/Terminal/DirectoryHelpers.ts | 6 +- ...termineAllPossibilitiesForTabCompletion.ts | 12 +- src/Terminal/tabCompletion.ts | 4 +- src/TextFile.ts | 4 +- src/ThirdParty/Treant.js | 84 ++-- src/ThirdParty/raphael.min.js | 2 +- src/data/codingcontracttypes.ts | 94 ++--- src/data/gangmembertasks.ts | 14 +- src/engine.jsx | 40 +- src/ui/ActiveScripts/ServerAccordion.tsx | 2 +- src/ui/CharacterInfo.tsx | 102 ++--- src/ui/React/AccordionButton.tsx | 2 +- src/ui/React/AugmentationAccordion.tsx | 4 +- src/ui/React/AutoupdatingParagraph.tsx | 4 +- src/ui/React/AutoupdatingStdButton.tsx | 6 +- src/ui/React/SourceFileAccordion.tsx | 4 +- src/ui/React/StdButton.tsx | 2 +- src/ui/React/StdButtonPurchased.tsx | 2 +- src/ui/React/createPopup.tsx | 4 +- src/ui/createStatusText.ts | 2 +- src/ui/postToTerminal.tsx | 4 +- src/utils/helpers/createRandomString.ts | 2 +- stylelint.config.js | 30 +- test/StockMarketTests.ts | 4 +- utils/GameOptions.js | 2 +- utils/JSONReviver.d.ts | 2 +- utils/LogBox.ts | 2 +- utils/StringHelperFunctions.ts | 18 +- utils/YesNoBox.ts | 2 +- utils/helpers/addOffset.ts | 2 +- utils/helpers/exceptionAlert.ts | 4 +- utils/helpers/getRandomByte.ts | 2 +- utils/helpers/getTimestamp.ts | 2 +- utils/helpers/isValidIPAddress.ts | 6 +- utils/uiHelpers/appendLineBreaks.ts | 2 +- utils/uiHelpers/createOptionElement.ts | 2 +- webpack.config-test.js | 22 +- webpack.config.js | 36 +- 183 files changed, 1547 insertions(+), 1546 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 507680fb0..c013e14e8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -76,7 +76,7 @@ module.exports = { "imports": "always-multiline", "exports": "always-multiline", "functions": "always-multiline", - } + }, ], "comma-spacing": [ "off", @@ -102,14 +102,14 @@ module.exports = { "error", ], "curly": [ - "off" + "off", ], "default-case": [ - "off" + "off", ], "dot-location": [ "error", - "property" + "property", ], "dot-notation": [ "off", @@ -310,104 +310,104 @@ module.exports = { "error", ], "no-div-regex": [ - "error" + "error", ], "no-dupe-args": [ - "error" + "error", ], "no-dupe-class-members": [ - "error" + "error", ], "no-dupe-keys": [ - "error" + "error", ], "no-duplicate-case": [ - "error" + "error", ], "no-duplicate-imports": [ "error", { - "includeExports": true - } + "includeExports": true, + }, ], "no-else-return": [ - "off" + "off", ], "no-empty": [ "off", { - "allowEmptyCatch": false - } + "allowEmptyCatch": false, + }, ], "no-empty-character-class": [ - "error" + "error", ], "no-empty-function": [ - "off" + "off", ], "no-empty-pattern": [ - "error" + "error", ], "no-eq-null": [ - "off" + "off", ], "no-ex-assign": [ - "off" + "off", ], "no-extra-boolean-cast": [ - "error" + "error", ], "no-extra-parens": [ - "off" + "off", ], "no-extra-semi": [ - "off" + "off", ], "no-eval": [ - "off" + "off", ], "no-extend-native": [ - "off" + "off", ], "no-extra-bind": [ - "error" + "error", ], "no-extra-label": [ - "error" + "error", ], "no-fallthrough": [ - "off" + "off", ], "no-floating-decimal": [ - "off" + "off", ], "no-func-assign": [ - "error" + "error", ], "no-global-assign": [ - "error" + "error", ], "no-implicit-coercion": [ - "off" + "off", ], "no-implicit-globals": [ - "error" + "error", ], "no-implied-eval": [ - "error" + "error", ], "no-inline-comments": [ - "off" + "off", ], "no-inner-declarations": [ "off", - "both" + "both", ], "no-invalid-regexp": [ - "error" + "error", ], "no-invalid-this": [ - "off" + "off", ], "no-irregular-whitespace": [ "error", @@ -415,449 +415,449 @@ module.exports = { "skipStrings": false, "skipComments": false, "skipRegExps": false, - "skipTemplates": false - } + "skipTemplates": false, + }, ], "no-iterator": [ - "error" + "error", ], "no-label-var": [ - "error" + "error", ], "no-labels": [ - "off" + "off", ], "no-lone-blocks": [ - "error" + "error", ], "no-lonely-if": [ - "off" + "off", ], "no-loop-func": [ - "off" + "off", ], "no-magic-numbers": [ - "off" + "off", ], "no-mixed-operators": [ - "off" + "off", ], "no-mixed-requires": [ - "error" + "error", ], "no-mixed-spaces-and-tabs": [ - "off" + "off", ], "no-multi-assign": [ - "off" + "off", ], "no-multi-spaces": [ - "off" + "off", ], "no-multi-str": [ - "error" + "error", ], "no-multiple-empty-lines": [ "off", { - "max": 1 - } + "max": 1, + }, ], "no-native-reassign": [ - "error" + "error", ], "no-negated-condition": [ - "off" + "off", ], "no-negated-in-lhs": [ - "error" + "error", ], "no-nested-ternary": [ - "off" + "off", ], "no-new": [ - "error" + "error", ], "no-new-func": [ - "error" + "error", ], "no-new-object": [ - "error" + "error", ], "no-new-require": [ - "error" + "error", ], "no-new-symbol": [ - "error" + "error", ], "no-new-wrappers": [ - "error" + "error", ], "no-octal": [ - "error" + "error", ], "no-octal-escape": [ - "error" + "error", ], "no-obj-calls": [ - "error" + "error", ], "no-param-reassign": [ - "off" + "off", ], "no-path-concat": [ - "error" + "error", ], "no-plusplus": [ - "off" + "off", ], "no-process-env": [ - "off" + "off", ], "no-process-exit": [ - "error" + "error", ], "no-proto": [ - "error" + "error", ], "no-prototype-builtins": [ - "off" + "off", ], "no-redeclare": [ - "off" + "off", ], "no-regex-spaces": [ - "error" + "error", ], "no-restricted-globals": [ - "error" + "error", ], "no-restricted-imports": [ - "error" + "error", ], "no-restricted-modules": [ - "error" + "error", ], "no-restricted-properties": [ "off", { "object": "console", "property": "log", - "message": "'log' is too general, use an appropriate level when logging." - } + "message": "'log' is too general, use an appropriate level when logging.", + }, ], "no-restricted-syntax": [ - "error" + "error", ], "no-return-assign": [ - "off" + "off", ], "no-return-await": [ - "error" + "error", ], "no-script-url": [ - "error" + "error", ], "no-self-assign": [ "error", { - "props": false - } + "props": false, + }, ], "no-self-compare": [ - "error" + "error", ], "no-sequences": [ - "error" + "error", ], "no-shadow": [ - "off" + "off", ], "no-shadow-restricted-names": [ - "error" + "error", ], "no-spaced-func": [ - "off" + "off", ], "no-sparse-arrays": [ - "error" + "error", ], "no-sync": [ - "error" + "error", ], "no-tabs": [ - "off" + "off", ], "no-template-curly-in-string": [ - "error" + "error", ], "no-ternary": [ - "off" + "off", ], "no-this-before-super": [ - "off" + "off", ], "no-throw-literal": [ - "error" + "error", ], "no-trailing-spaces": [ - "off" + "off", ], "no-undef": [ - "off" + "off", ], "no-undef-init": [ - "error" + "error", ], "no-undefined": [ - "off" + "off", ], "no-underscore-dangle": [ - "off" + "off", ], "no-unexpected-multiline": [ - "error" + "error", ], "no-unmodified-loop-condition": [ - "error" + "error", ], "no-unneeded-ternary": [ - "off" + "off", ], "no-unreachable": [ - "off" + "off", ], "no-unsafe-finally": [ - "error" + "error", ], "no-unsafe-negation": [ - "error" + "error", ], "no-unused-expressions": [ - "off" + "off", ], "no-unused-labels": [ - "error" + "error", ], "no-unused-vars": [ - "off" + "off", ], "no-use-before-define": [ - "off" + "off", ], "no-useless-call": [ - "off" + "off", ], "no-useless-computed-key": [ - "error" + "error", ], "no-useless-concat": [ - "off" + "off", ], "no-useless-constructor": [ - "error" + "error", ], "no-useless-escape": [ - "off" + "off", ], "no-useless-rename": [ "error", { "ignoreDestructuring": false, "ignoreExport": false, - "ignoreImport": false - } + "ignoreImport": false, + }, ], "no-useless-return": [ - "off" + "off", ], "no-var": [ - "off" + "off", ], "no-void": [ - "off" + "off", ], "no-warning-comments": [ - "off" + "off", ], "no-whitespace-before-property": [ - "error" + "error", ], "no-with": [ - "error" + "error", ], "nonblock-statement-body-position": [ "off", - "below" + "below", ], "object-curly-newline": [ - "off" + "off", ], "object-curly-spacing": [ - "off" + "off", ], "object-property-newline": [ - "off" + "off", ], "object-shorthand": [ - "off" + "off", ], "one-var": [ - "off" + "off", ], "one-var-declaration-per-line": [ - "off" + "off", ], "operator-assignment": [ - "off" + "off", ], "operator-linebreak": [ "off", - "none" + "none", ], "padded-blocks": [ - "off" + "off", ], "padding-line-between-statements": [ - "error" + "error", ], "prefer-arrow-callback": [ - "off" + "off", ], "prefer-const": [ - "off" + "off", ], "prefer-destructuring": [ - "off" + "off", ], "prefer-numeric-literals": [ - "error" + "error", ], "prefer-promise-reject-errors": [ - "off" + "off", ], "prefer-reflect": [ - "off" + "off", ], "prefer-rest-params": [ - "off" + "off", ], "prefer-spread": [ - "off" + "off", ], "prefer-template": [ - "off" + "off", ], "quote-props": [ - "off" + "off", ], "quotes": [ - "off" + "off", ], "radix": [ "off", - "as-needed" + "as-needed", ], "require-await": [ - "off" + "off", ], "require-jsdoc": [ - "off" + "off", ], "require-yield": [ - "error" + "error", ], "rest-spread-spacing": [ "error", - "never" + "never", ], "semi": [ - "off" + "off", ], "semi-spacing": [ - "off" + "off", ], "semi-style": [ "error", - "last" + "last", ], "sort-imports": [ - "off" + "off", ], "sort-keys": [ - "off" + "off", ], "sort-vars": [ - "off" + "off", ], "space-before-blocks": [ - "off" + "off", ], "space-before-function-paren": [ - "off" + "off", ], "space-in-parens": [ - "off" + "off", ], "space-infix-ops": [ - "off" + "off", ], "space-unary-ops": [ - "off" + "off", ], "spaced-comment": [ - "off" + "off", ], "strict": [ - "off" + "off", ], "switch-colon-spacing": [ "error", { "after": true, - "before": false - } + "before": false, + }, ], "symbol-description": [ - "error" + "error", ], "template-curly-spacing": [ - "error" + "error", ], "template-tag-spacing": [ - "error" + "error", ], "unicode-bom": [ "error", - "never" + "never", ], "use-isnan": [ - "error" + "error", ], "valid-jsdoc": [ - "off" + "off", ], "valid-typeof": [ - "error" + "error", ], "vars-on-top": [ - "off" + "off", ], "wrap-iife": [ "error", - "any" + "any", ], "wrap-regex": [ - "off" + "off", ], "yield-star-spacing": [ "error", - "before" + "before", ], "yoda": [ "error", - "never" - ] + "never", + ], }, "overrides": [ { @@ -888,7 +888,7 @@ module.exports = { "singleline": { "delimiter": "semi", "requireLast": false, - } + }, }], "@typescript-eslint/member-ordering": ["error", { "default": [ @@ -900,11 +900,11 @@ module.exports = { "instance-method", "abstract-method", "static-method", - ] + ], }], "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-use-before-define": "off", - } - } - ] + }, + }, + ], }; \ No newline at end of file diff --git a/css/casino.scss b/css/casino.scss index d4bc6be6f..c73ff5330 100644 --- a/css/casino.scss +++ b/css/casino.scss @@ -1,24 +1,24 @@ .casino-card { - padding: 10px; - border: solid 1px #808080; - background-color: white; - display: inline-block; - border-radius: 10px; - font-size: 14pt; - text-align: center; - margin: 3px; - font-weight: bold; + padding: 10px; + border: solid 1px #808080; + background-color: white; + display: inline-block; + border-radius: 10px; + font-size: 14pt; + text-align: center; + margin: 3px; + font-weight: bold; } .casino-card .value { - font-size:15pt; - font-family: sans-serif; + font-size:15pt; + font-family: sans-serif; } .casino-card.red { - color: red; + color: red; } .casino-card.black { - color: black; + color: black; } \ No newline at end of file diff --git a/css/characteroverview.scss b/css/characteroverview.scss index d23a8e587..ea48f9085 100644 --- a/css/characteroverview.scss +++ b/css/characteroverview.scss @@ -43,9 +43,9 @@ background-color: #444; } - .character-stat-cell { - text-align: right; - } +.character-stat-cell { + text-align: right; +} #character-hack-wrapper td, #character-agi-wrapper td { diff --git a/package.json b/package.json index c424d5095..44b6b16ea 100644 --- a/package.json +++ b/package.json @@ -117,8 +117,8 @@ "build:dev": "webpack --mode development", "build:test": "webpack --config webpack.config-test.js", "lint": "npm run lint:jsts & npm run lint:style", - "lint:jsts": "eslint '*.{js,jsx,ts,tsx}' './src/**/*.{js,jsx,ts,tsx}' './test/**/*.{js,jsx,ts,tsx}' './utils/**/*.{js,jsx,ts,tsx}'", - "lint:style": "stylelint ./css/*", + "lint:jsts": "eslint --fix '*.{js,jsx,ts,tsx}' './src/**/*.{js,jsx,ts,tsx}' './test/**/*.{js,jsx,ts,tsx}' './utils/**/*.{js,jsx,ts,tsx}'", + "lint:style": "stylelint --fix ./css/*", "preinstall": "node ./scripts/engines-check.js", "test": "mochapack --webpack-config webpack.config-test.js -r jsdom-global/register ./test/index.js", "watch": "webpack --watch --mode production", diff --git a/src/Alias.ts b/src/Alias.ts index 5d1b11357..9e6ccdfc9 100644 --- a/src/Alias.ts +++ b/src/Alias.ts @@ -36,8 +36,8 @@ export function printAliases(): void { // Returns true if successful, false otherwise export function parseAliasDeclaration(dec: string, global = false): boolean { - var re = /^([_|\w|!|%|,|@]+)="(.+)"$/; - var matches = dec.match(re); + const re = /^([_|\w|!|%|,|@]+)="(.+)"$/; + const matches = dec.match(re); if (matches == null || matches.length != 3) {return false;} if (global){ addGlobalAlias(matches[1],matches[2]); @@ -109,7 +109,7 @@ export function substituteAliases(origCommand: string): string { commandArray[0] = alias; } } - for (var i = 0; i < commandArray.length; ++i) { + for (let i = 0; i < commandArray.length; ++i) { var alias = getGlobalAlias(commandArray[i]); if (alias != null) { commandArray[i] = alias; diff --git a/src/Augmentation/Augmentation.ts b/src/Augmentation/Augmentation.ts index 509a61475..c01533d21 100644 --- a/src/Augmentation/Augmentation.ts +++ b/src/Augmentation/Augmentation.ts @@ -55,25 +55,25 @@ export class Augmentation { } // How much money this costs to buy - baseCost: number = 0; + baseCost = 0; // How much faction reputation is required to unlock this - baseRepRequirement: number = 0; + baseRepRequirement = 0; // Description of what this Aug is and what it does - info: string = ""; + info = ""; // Any Augmentation not immediately available in BitNode-1 is special (e.g. Bladeburner augs) - isSpecial: boolean = false; + isSpecial = false; // Augmentation level - for repeatable Augs like NeuroFlux Governor - level: number = 0; + level = 0; // Name of Augmentation - name: string = ""; + name = ""; // Whether the player owns this Augmentation - owned: boolean = false; + owned = false; // Array of names of all prerequisites prereqs: string[] = []; @@ -83,7 +83,7 @@ export class Augmentation { mults: IMap = {} // Initial cost. Doesn't change when you purchase multiple Augmentation - startingCost: number = 0; + startingCost = 0; constructor(params: IConstructorParams={ info: "", moneyCost: 0, name: "", repCost: 0 }) { this.name = params.name; diff --git a/src/Augmentation/AugmentationHelpers.jsx b/src/Augmentation/AugmentationHelpers.jsx index f1dc2243d..bed2846fe 100644 --- a/src/Augmentation/AugmentationHelpers.jsx +++ b/src/Augmentation/AugmentationHelpers.jsx @@ -24,7 +24,7 @@ import { createAccordionElement } from "../../utils/uiHelpers/createAccordionEle import { Reviver, Generic_toJSON, - Generic_fromJSON + Generic_fromJSON, } from "../../utils/JSONReviver"; import { formatNumber } from "../../utils/StringHelperFunctions"; import { clearObject } from "../../utils/helpers/clearObject"; @@ -1256,7 +1256,7 @@ function initAugmentations() { // Daedalus const RedPill = new Augmentation({ name:AugmentationNames.TheRedPill, repCost:1e6, moneyCost:0, - info:"It's time to leave the cave." + info:"It's time to leave the cave.", }); RedPill.addToFactions(["Daedalus"]); if (augmentationExists(AugmentationNames.TheRedPill)) { @@ -1556,7 +1556,7 @@ function initAugmentations() { and upload the assets.

This augmentation:
Lets the player start with {Money(1e6)} after a reset.
- Lets the player start with the BruteSSH.exe program after a reset. + Lets the player start with the BruteSSH.exe program after a reset., }); CashRoot.addToFactions(["Sector-12"]); if (augmentationExists(AugmentationNames.CashRoot)) { @@ -2098,7 +2098,7 @@ export function displayAugmentationsContent(contentEl) { exportGameFn={saveObject.exportGame.bind(saveObject)} installAugmentationsFn={installAugmentations} />, - contentEl + contentEl, ); } diff --git a/src/Augmentation/Augmentations.ts b/src/Augmentation/Augmentations.ts index 229a17443..ed2eab639 100644 --- a/src/Augmentation/Augmentations.ts +++ b/src/Augmentation/Augmentations.ts @@ -1,4 +1,4 @@ import { Augmentation } from "./Augmentation"; import { IMap } from "../types"; -export let Augmentations: IMap = {}; +export const Augmentations: IMap = {}; diff --git a/src/Augmentation/PlayerOwnedAugmentation.ts b/src/Augmentation/PlayerOwnedAugmentation.ts index 2455c09f8..635c9f5b2 100644 --- a/src/Augmentation/PlayerOwnedAugmentation.ts +++ b/src/Augmentation/PlayerOwnedAugmentation.ts @@ -1,8 +1,8 @@ export class PlayerOwnedAugmentation { - level: number = 1; - name: string = ""; + level = 1; + name = ""; - constructor(name: string = "") { + constructor(name = "") { this.name = name; } } diff --git a/src/Augmentation/data/AugmentationNames.ts b/src/Augmentation/data/AugmentationNames.ts index ef8c6252c..2c681008d 100644 --- a/src/Augmentation/data/AugmentationNames.ts +++ b/src/Augmentation/data/AugmentationNames.ts @@ -1,6 +1,6 @@ import { IMap } from "../../types"; -export let AugmentationNames: IMap = { +export const AugmentationNames: IMap = { Targeting1: "Augmented Targeting I", Targeting2: "Augmented Targeting II", Targeting3: "Augmented Targeting III", diff --git a/src/Augmentation/ui/PlayerMultipliers.tsx b/src/Augmentation/ui/PlayerMultipliers.tsx index 085e7d3d3..36cecbc6c 100644 --- a/src/Augmentation/ui/PlayerMultipliers.tsx +++ b/src/Augmentation/ui/PlayerMultipliers.tsx @@ -27,7 +27,7 @@ export function PlayerMultipliers(): React.ReactElement { if(r) { elems = [  {"=>"} , - {numeralWrapper.formatPercentage(r)} + {numeralWrapper.formatPercentage(r)}, ]; } return elems; @@ -51,38 +51,38 @@ export function PlayerMultipliers(): React.ReactElement { ['Hacking Chance ', Player.hacking_chance_mult, Player.hacking_chance_mult*mults.hacking_chance_mult], ['Hacking Speed ', Player.hacking_speed_mult, Player.hacking_speed_mult*mults.hacking_speed_mult], ['Hacking Money ', Player.hacking_money_mult, Player.hacking_money_mult*mults.hacking_money_mult], - ['Hacking Growth ', Player.hacking_grow_mult, Player.hacking_grow_mult*mults.hacking_grow_mult] + ['Hacking Growth ', Player.hacking_grow_mult, Player.hacking_grow_mult*mults.hacking_grow_mult], ])}
{MultiplierTable([ ['Hacking Level ', Player.hacking_mult, Player.hacking_mult*mults.hacking_mult], - ['Hacking Experience ', Player.hacking_exp_mult, Player.hacking_exp_mult*mults.hacking_exp_mult] + ['Hacking Experience ', Player.hacking_exp_mult, Player.hacking_exp_mult*mults.hacking_exp_mult], ])}
{MultiplierTable([ ['Strength Level ', Player.strength_mult, Player.strength_mult*mults.strength_mult], - ['Strength Experience ', Player.strength_exp_mult, Player.strength_exp_mult*mults.strength_exp_mult] + ['Strength Experience ', Player.strength_exp_mult, Player.strength_exp_mult*mults.strength_exp_mult], ])}
{MultiplierTable([ ['Defense Level ', Player.defense_mult, Player.defense_mult*mults.defense_mult], - ['Defense Experience ', Player.defense_exp_mult, Player.defense_exp_mult*mults.defense_exp_mult] + ['Defense Experience ', Player.defense_exp_mult, Player.defense_exp_mult*mults.defense_exp_mult], ])}
{MultiplierTable([ ['Dexterity Level ', Player.dexterity_mult, Player.dexterity_mult*mults.dexterity_mult], - ['Dexterity Experience ', Player.dexterity_exp_mult, Player.dexterity_exp_mult*mults.dexterity_exp_mult] + ['Dexterity Experience ', Player.dexterity_exp_mult, Player.dexterity_exp_mult*mults.dexterity_exp_mult], ])}
{MultiplierTable([ ['Agility Level ', Player.agility_mult, Player.agility_mult*mults.agility_mult], - ['Agility Experience ', Player.agility_exp_mult, Player.agility_exp_mult*mults.agility_exp_mult] + ['Agility Experience ', Player.agility_exp_mult, Player.agility_exp_mult*mults.agility_exp_mult], ])}
{MultiplierTable([ ['Charisma Level ', Player.charisma_mult, Player.charisma_mult*mults.charisma_mult], - ['Charisma Experience ', Player.charisma_exp_mult, Player.charisma_exp_mult*mults.charisma_exp_mult] + ['Charisma Experience ', Player.charisma_exp_mult, Player.charisma_exp_mult*mults.charisma_exp_mult], ])}
{MultiplierTable([ @@ -90,13 +90,13 @@ export function PlayerMultipliers(): React.ReactElement { ['Hacknet Node purchase cost ', Player.hacknet_node_purchase_cost_mult, Player.hacknet_node_purchase_cost_mult*mults.hacknet_node_purchase_cost_mult], ['Hacknet Node RAM upgrade cost ', Player.hacknet_node_ram_cost_mult, Player.hacknet_node_ram_cost_mult*mults.hacknet_node_ram_cost_mult], ['Hacknet Node Core purchase cost ', Player.hacknet_node_core_cost_mult, Player.hacknet_node_core_cost_mult*mults.hacknet_node_core_cost_mult], - ['Hacknet Node level upgrade cost ', Player.hacknet_node_level_cost_mult, Player.hacknet_node_level_cost_mult*mults.hacknet_node_level_cost_mult] + ['Hacknet Node level upgrade cost ', Player.hacknet_node_level_cost_mult, Player.hacknet_node_level_cost_mult*mults.hacknet_node_level_cost_mult], ])}
{MultiplierTable([ ['Company reputation gain ', Player.company_rep_mult, Player.company_rep_mult*mults.company_rep_mult], ['Faction reputation gain ', Player.faction_rep_mult, Player.faction_rep_mult*mults.faction_rep_mult], - ['Salary ', Player.work_money_mult, Player.work_money_mult*mults.work_money_mult] + ['Salary ', Player.work_money_mult, Player.work_money_mult*mults.work_money_mult], ])}
{MultiplierTable([ diff --git a/src/Augmentation/ui/PurchasedAugmentations.tsx b/src/Augmentation/ui/PurchasedAugmentations.tsx index 3bc54d837..ab0854e9a 100644 --- a/src/Augmentation/ui/PurchasedAugmentations.tsx +++ b/src/Augmentation/ui/PurchasedAugmentations.tsx @@ -22,7 +22,7 @@ export function PurchasedAugmentations(): React.ReactElement { augs.push(
  • -
  • + , ) } diff --git a/src/Augmentation/ui/SourceFileMinus1.tsx b/src/Augmentation/ui/SourceFileMinus1.tsx index b97bcbf40..bea99cc81 100644 --- a/src/Augmentation/ui/SourceFileMinus1.tsx +++ b/src/Augmentation/ui/SourceFileMinus1.tsx @@ -13,7 +13,7 @@ import { Exploit, ExploitName } from "../../Exploits/Exploit"; import { Accordion } from "../../ui/React/Accordion"; export function SourceFileMinus1(): React.ReactElement { - let exploits = Player.exploits; + const exploits = Player.exploits; if(exploits.length === 0) { return <> diff --git a/src/BitNode/BitNode.ts b/src/BitNode/BitNode.ts index 42d937351..4b6deac10 100644 --- a/src/BitNode/BitNode.ts +++ b/src/BitNode/BitNode.ts @@ -16,7 +16,7 @@ class BitNode { number: number; - constructor(n: number, name: string, desc: string="", info: string="") { + constructor(n: number, name: string, desc="", info="") { this.number = n; this.name = name; this.desc = desc; @@ -256,7 +256,7 @@ export function initBitNodeMultipliers(p: IPlayer) { if (p.bitNodeN == null) { p.bitNodeN = 1; } - for (var mult in BitNodeMultipliers) { + for (const mult in BitNodeMultipliers) { if (BitNodeMultipliers.hasOwnProperty(mult)) { BitNodeMultipliers[mult] = 1; } @@ -435,7 +435,7 @@ export function initBitNodeMultipliers(p: IPlayer) { break; case 12: //The Recursion var sf12Lvl = 0; - for (var i = 0; i < p.sourceFiles.length; i++) { + for (let i = 0; i < p.sourceFiles.length; i++) { if (p.sourceFiles[i].n === 12) { sf12Lvl = p.sourceFiles[i].lvl; } diff --git a/src/Bladeburner.jsx b/src/Bladeburner.jsx index 2808719e6..d657d14d7 100644 --- a/src/Bladeburner.jsx +++ b/src/Bladeburner.jsx @@ -17,7 +17,7 @@ import { dialogBoxCreate } from "../utils/DialogBox"; import { Reviver, Generic_toJSON, - Generic_fromJSON + Generic_fromJSON, } from "../utils/JSONReviver"; import { setTimeoutRef } from "./utils/SetTimeoutRef"; import { formatNumber } from "../utils/StringHelperFunctions"; @@ -236,7 +236,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(25, 150), countGrowth:getRandomInt(5, 75)/10, weights:{hack:0,str:0.05,def:0.05,dex:0.35,agi:0.35,cha:0.1, int:0.05}, decays:{hack:0,str:0.91,def:0.91,dex:0.91,agi:0.91,cha:0.9, int:1}, - isStealth:true + isStealth:true, }); this.contracts["Bounty Hunter"] = new Contract({ name:"Bounty Hunter", @@ -248,7 +248,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(5, 150), countGrowth:getRandomInt(5, 75)/10, weights:{hack:0,str:0.15,def:0.15,dex:0.25,agi:0.25,cha:0.1, int:0.1}, decays:{hack:0,str:0.91,def:0.91,dex:0.91,agi:0.91,cha:0.8, int:0.9}, - isKill:true + isKill:true, }); this.contracts["Retirement"] = new Contract({ name:"Retirement", @@ -260,7 +260,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(5, 150), countGrowth:getRandomInt(5, 75)/10, weights:{hack:0,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0.1, int:0.1}, decays:{hack:0,str:0.91,def:0.91,dex:0.91,agi:0.91,cha:0.8, int:0.9}, - isKill:true + isKill:true, }); this.operations["Investigation"] = new Operation({ @@ -275,7 +275,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(1, 100), countGrowth:getRandomInt(10, 40)/10, weights:{hack:0.25,str:0.05,def:0.05,dex:0.2,agi:0.1,cha:0.25, int:0.1}, decays:{hack:0.85,str:0.9,def:0.9,dex:0.9,agi:0.9,cha:0.7, int:0.9}, - isStealth:true + isStealth:true, }); this.operations["Undercover Operation"] = new Operation({ name:"Undercover Operation", @@ -288,7 +288,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(1, 100), countGrowth:getRandomInt(10, 40)/10, weights:{hack:0.2,str:0.05,def:0.05,dex:0.2,agi:0.2,cha:0.2, int:0.1}, decays:{hack:0.8,str:0.9,def:0.9,dex:0.9,agi:0.9,cha:0.7, int:0.9}, - isStealth:true + isStealth:true, }); this.operations["Sting Operation"] = new Operation({ name:"Sting Operation", @@ -299,7 +299,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(1, 150), countGrowth:getRandomInt(3, 40)/10, weights:{hack:0.25,str:0.05,def:0.05,dex:0.25,agi:0.1,cha:0.2, int:0.1}, decays:{hack:0.8,str:0.85,def:0.85,dex:0.85,agi:0.85,cha:0.7, int:0.9}, - isStealth:true + isStealth:true, }); this.operations["Raid"] = new Operation({ name:"Raid", @@ -311,7 +311,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(1, 150), countGrowth:getRandomInt(2, 40)/10, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.7,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.9}, - isKill:true + isKill:true, }); this.operations["Stealth Retirement Operation"] = new Operation({ name:"Stealth Retirement Operation", @@ -323,7 +323,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(1, 150), countGrowth:getRandomInt(1, 20)/10, weights:{hack:0.1,str:0.1,def:0.1,dex:0.3,agi:0.3,cha:0, int:0.1}, decays:{hack:0.7,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.9}, - isStealth:true, isKill:true + isStealth:true, isKill:true, }); this.operations["Assassination"] = new Operation({ name:"Assassination", @@ -335,7 +335,7 @@ Bladeburner.prototype.create = function() { count:getRandomInt(1, 150), countGrowth:getRandomInt(1, 20)/10, weights:{hack:0.1,str:0.1,def:0.1,dex:0.3,agi:0.3,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.8}, - isStealth:true, isKill:true + isStealth:true, isKill:true, }); } @@ -1271,7 +1271,7 @@ Bladeburner.prototype.createContent = function() { DomElems.consoleInput.focus(); } return false; - } + }, }); DomElems.consoleTable = createElement("table", {class:"bladeburner-console-table"}); DomElems.consoleInputRow = createElement("tr", {class:"bladeburner-console-input-row", id:"bladeburner-console-input-row"}); @@ -1279,7 +1279,7 @@ Bladeburner.prototype.createContent = function() { DomElems.consoleInputHeader = createElement("pre", {innerText:"> "}); DomElems.consoleInput = createElement("input", { type:"text", class:"bladeburner-console-input", tabIndex:1, - onfocus:() => {DomElems.consoleInput.value = DomElems.consoleInput.value} + onfocus:() => {DomElems.consoleInput.value = DomElems.consoleInput.value}, }); DomElems.consoleInputCell.appendChild(DomElems.consoleInputHeader); @@ -1363,7 +1363,7 @@ Bladeburner.prototype.createOverviewContent = function() { innerText:"Est. Synthoid Population: ", display:"inline-block", tooltip:"This is your Bladeburner division's estimate of how many Synthoids exist " + - "in your current city." + "in your current city.", }); DomElems.overviewEstPopHelpTip = createElement("div", { @@ -1381,7 +1381,7 @@ Bladeburner.prototype.createOverviewContent = function() { "The Synthoid populations of cities can change due to your " + "actions or random events. If random events occur, they will " + "be logged in the Bladeburner Console."); - } + }, }); DomElems.overviewEstComms = createElement("p", { @@ -1395,14 +1395,14 @@ Bladeburner.prototype.createOverviewContent = function() { innerText:"City Chaos: ", display:"inline-block", tooltip:"The city's chaos level due to tensions and conflicts between humans and Synthoids. " + - "Having too high of a chaos level can make contracts and operations harder." + "Having too high of a chaos level can make contracts and operations harder.", }); DomElems.overviewBonusTime = createElement("p", { innerText: "Bonus time: ", display: "inline-block", tooltip: "You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by browser). " + - "Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed." + "Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.", }); DomElems.overviewSkillPoints = createElement("p", {display:"block"}); @@ -1438,7 +1438,7 @@ Bladeburner.prototype.createOverviewContent = function() { innerText:"Cancel", class:"a-link-button", clickListener:() => { removeElementById(popupId); return false; - } + }, })) popupArguments.push(createElement("p", { // Info Text innerText:"Travel to a different city for your Bladeburner " + @@ -1460,12 +1460,12 @@ Bladeburner.prototype.createOverviewContent = function() { removeElementById(popupId); inst.updateOverviewContent(); return false; - } + }, })); })(this, i); } createPopup(popupId, popupArguments); - } + }, })); // Faction button @@ -1493,7 +1493,7 @@ Bladeburner.prototype.createOverviewContent = function() { } } return false; - } + }, })); } @@ -1526,14 +1526,14 @@ Bladeburner.prototype.createActionAndSkillsContent = function() { DomElems.currentTab = buttons[i].toLowerCase(); inst.createActionAndSkillsContent(); return false; - } + }, })); }) (buttons, i, this, currTab); } // General info/description for each action DomElems.actionsAndSkillsDesc = createElement("p", { - display:"block", margin:"4px", padding:"4px" + display:"block", margin:"4px", padding:"4px", }); // List for actions/skills @@ -1578,7 +1578,7 @@ Bladeburner.prototype.createGeneralActionsContent = function() { for (var actionName in GeneralActions) { if (GeneralActions.hasOwnProperty(actionName)) { DomElems.generalActions[actionName] = createElement("div", { - class:"bladeburner-action", name:actionName + class:"bladeburner-action", name:actionName, }); DomElems.actionsAndSkillsList.appendChild(DomElems.generalActions[actionName]); } @@ -1600,7 +1600,7 @@ Bladeburner.prototype.createContractsContent = function() { for (var contractName in this.contracts) { if (this.contracts.hasOwnProperty(contractName)) { DomElems.contracts[contractName] = createElement("div", { - class:"bladeburner-action", name:contractName + class:"bladeburner-action", name:contractName, }); DomElems.actionsAndSkillsList.appendChild(DomElems.contracts[contractName]); } @@ -1629,7 +1629,7 @@ Bladeburner.prototype.createOperationsContent = function() { for (var operationName in this.operations) { if (this.operations.hasOwnProperty(operationName)) { DomElems.operations[operationName] = createElement("div", { - class:"bladeburner-action", name:operationName + class:"bladeburner-action", name:operationName, }); DomElems.actionsAndSkillsList.appendChild(DomElems.operations[operationName]); } @@ -1667,7 +1667,7 @@ Bladeburner.prototype.createBlackOpsContent = function() { for (var i = blackops.length-1; i >= 0 ; --i) { if (this.blackops[[blackops[i].name]] == null && i !== 0 && this.blackops[[blackops[i-1].name]] == null) {continue;} // If this one nor the next are completed then this isn't unlocked yet. DomElems.blackops[blackops[i].name] = createElement("div", { - class:"bladeburner-action", name:blackops[i].name + class:"bladeburner-action", name:blackops[i].name, }); DomElems.actionsAndSkillsList.appendChild(DomElems.blackops[blackops[i].name]); } @@ -1750,7 +1750,7 @@ Bladeburner.prototype.createSkillsContent = function() { // Skill Points DomElems.skillPointsDisplay = createElement("p", { - innerHTML:"
    Skill Points: " + formatNumber(this.skillPoints, 0) + "" + innerHTML:"
    Skill Points: " + formatNumber(this.skillPoints, 0) + "", }); DomElems.actionAndSkillsDiv.appendChild(DomElems.skillPointsDisplay); @@ -1758,7 +1758,7 @@ Bladeburner.prototype.createSkillsContent = function() { for (var skillName in Skills) { if (Skills.hasOwnProperty(skillName)) { DomElems.skills[skillName] = createElement("div", { - class:"bladeburner-action", name:skillName + class:"bladeburner-action", name:skillName, }); DomElems.actionsAndSkillsList.appendChild(DomElems.skills[skillName]); } @@ -1902,7 +1902,7 @@ Bladeburner.prototype.updateGeneralActionsUIElement = function(el, action) { var progress = this.actionTimeCurrent / this.actionTimeToComplete; el.appendChild(createElement("p", { display:"block", - innerText:createProgressBarText({progress:progress}) + innerText:createProgressBarText({progress:progress}), })); } else { // Start button @@ -1915,13 +1915,13 @@ Bladeburner.prototype.updateGeneralActionsUIElement = function(el, action) { this.startAction(this.action); this.updateActionAndSkillsContent(); return false; - } + }, })); } appendLineBreaks(el, 2); el.appendChild(createElement("pre", { // Info - innerHTML:action.desc, display:"inline-block" + innerHTML:action.desc, display:"inline-block", })); @@ -1937,14 +1937,14 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) { formatNumber(this.actionTimeCurrent, 0) + " / " + formatNumber(this.actionTimeToComplete, 0) + ")" : action.name, - display:"inline-block" + display:"inline-block", })); if (isActive) { // Progress bar if its active var progress = this.actionTimeCurrent / this.actionTimeToComplete; el.appendChild(createElement("p", { display:"block", - innerText:createProgressBarText({progress:progress}) + innerText:createProgressBarText({progress:progress}), })); } else { // Start button el.appendChild(createElement("a", { @@ -1956,7 +1956,7 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) { this.startAction(this.action); this.updateActionAndSkillsContent(); return false; - } + }, })); } @@ -1967,7 +1967,7 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) { display:"inline-block", innerText:"Level: " + action.level + " / " + action.maxLevel, tooltip:action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel) + " successes " + - "needed for next level" + "needed for next level", })); el.appendChild(createElement("a", { class: maxLevel ? "a-link-button-inactive" : "a-link-button", innerHTML:"↑", @@ -1979,7 +1979,7 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) { if (isActive) {this.startAction(this.action);} // Restart Action this.updateContractsUIElement(el, action); return false; - } + }, })); el.appendChild(createElement("a", { class: (action.level <= 1) ? "a-link-button-inactive" : "a-link-button", innerHTML:"↓", @@ -1991,7 +1991,7 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) { if (isActive) {this.startAction(this.action);} // Restart Action this.updateContractsUIElement(el, action); return false; - } + }, })); var actionTime = action.getActionTime(this); @@ -2011,7 +2011,7 @@ Bladeburner.prototype.updateContractsUIElement = function(el, action) { var autolevelCheckboxId = "bladeburner-" + action.name + "-autolevel-checkbox"; el.appendChild(createElement("label", { for:autolevelCheckboxId, innerText:"Autolevel: ",color:"white", - tooltip:"Automatically increase contract level when possible" + tooltip:"Automatically increase contract level when possible", })); const checkboxInput = createElement("input", { @@ -2035,14 +2035,14 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { formatNumber(this.actionTimeCurrent, 0) + " / " + formatNumber(this.actionTimeToComplete, 0) + ")" : action.name, - display:"inline-block" + display:"inline-block", })); if (isActive) { // Progress bar if its active var progress = this.actionTimeCurrent / this.actionTimeToComplete; el.appendChild(createElement("p", { display:"block", - innerText:createProgressBarText({progress:progress}) + innerText:createProgressBarText({progress:progress}), })); } else { // Start button and set Team Size button el.appendChild(createElement("a", { @@ -2054,7 +2054,7 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { this.startAction(this.action); this.updateActionAndSkillsContent(); return false; - } + }, })); el.appendChild(createElement("a", { innerText:"Set Team Size (Curr Size: " + formatNumber(action.teamCount, 0) + ")", class:"a-link-button", @@ -2065,7 +2065,7 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { innerText:"Enter the amount of team members you would like to take on these " + "operations. If you do not have the specified number of team members, " + "then as many as possible will be used. Note that team members may " + - "be lost during operations." + "be lost during operations.", }); var input = createElement("input", { @@ -2083,17 +2083,17 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { } removeElementById(popupId); return false; - } + }, }); var cancelBtn = createElement("a", { innerText:"Cancel", class:"a-link-button", clickListener:() => { removeElementById(popupId); return false; - } + }, }); createPopup(popupId, [txt, input, setBtn, cancelBtn]); - } + }, })); } @@ -2104,7 +2104,7 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { display:"inline-block", innerText:"Level: " + action.level + " / " + action.maxLevel, tooltip:action.getSuccessesNeededForNextLevel(BladeburnerConstants.OperationSuccessesPerLevel) + " successes " + - "needed for next level" + "needed for next level", })); el.appendChild(createElement("a", { class: maxLevel ? "a-link-button-inactive" : "a-link-button", innerHTML:"↑", @@ -2116,7 +2116,7 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { if (isActive) {this.startAction(this.action);} // Restart Action this.updateOperationsUIElement(el, action); return false; - } + }, })); el.appendChild(createElement("a", { class: (action.level <= 1) ? "a-link-button-inactive" : "a-link-button", innerHTML:"↓", @@ -2128,7 +2128,7 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { if (isActive) {this.startAction(this.action);} // Restart Action this.updateOperationsUIElement(el, action); return false; - } + }, })); // General Info @@ -2150,7 +2150,7 @@ Bladeburner.prototype.updateOperationsUIElement = function(el, action) { var autolevelCheckboxId = "bladeburner-" + action.name + "-autolevel-checkbox"; el.appendChild(createElement("label", { for:autolevelCheckboxId, innerText:"Autolevel: ",color:"white", - tooltip:"Automatically increase operation level when possible" + tooltip:"Automatically increase operation level when possible", })); const checkboxInput = createElement("input", { @@ -2194,7 +2194,7 @@ Bladeburner.prototype.updateBlackOpsUIElement = function(el, action) { var progress = this.actionTimeCurrent / this.actionTimeToComplete; el.appendChild(createElement("p", { display:"block", - innerText:createProgressBarText({progress:progress}) + innerText:createProgressBarText({progress:progress}), })); } else { el.appendChild(createElement("a", { // Start button @@ -2206,7 +2206,7 @@ Bladeburner.prototype.updateBlackOpsUIElement = function(el, action) { this.startAction(this.action); this.updateActionAndSkillsContent(); return false; - } + }, })); el.appendChild(createElement("a", { // Set Team Size Button innerText:"Set Team Size (Curr Size: " + formatNumber(action.teamCount, 0) + ")", class:"a-link-button", @@ -2217,7 +2217,7 @@ Bladeburner.prototype.updateBlackOpsUIElement = function(el, action) { innerText:"Enter the amount of team members you would like to take on this " + "BlackOp. If you do not have the specified number of team members, " + "then as many as possible will be used. Note that team members may " + - "be lost during operations." + "be lost during operations.", }); var input = createElement("input", { @@ -2235,17 +2235,17 @@ Bladeburner.prototype.updateBlackOpsUIElement = function(el, action) { } removeElementById(popupId); return false; - } + }, }); var cancelBtn = createElement("a", { innerText:"Cancel", class:"a-link-button", clickListener:() => { removeElementById(popupId); return false; - } + }, }); createPopup(popupId, [txt, input, setBtn, cancelBtn]); - } + }, })); } @@ -2257,7 +2257,7 @@ Bladeburner.prototype.updateBlackOpsUIElement = function(el, action) { })); el.appendChild(createElement("p", { display:"block", color:hasReqdRank ? "white" : "red", - innerHTML:"Required Rank: " + formatNumber(action.reqdRank, 0) + "
    " + innerHTML:"Required Rank: " + formatNumber(action.reqdRank, 0) + "
    ", })); el.appendChild(createElement("p", { display:"inline-block", @@ -2297,7 +2297,7 @@ Bladeburner.prototype.updateSkillsUIElement = function(el, skill) { this.upgradeSkill(skill); this.createActionAndSkillsContent(); return false; - } + }, })); appendLineBreaks(el, 2); el.appendChild(createElement("p", { @@ -2307,7 +2307,7 @@ Bladeburner.prototype.updateSkillsUIElement = function(el, skill) { if (maxLvl) { el.appendChild(createElement("p", { color:"red", display:"block", - innerText:"MAX LEVEL" + innerText:"MAX LEVEL", })); } else { el.appendChild(createElement("p", { @@ -2508,7 +2508,7 @@ Bladeburner.prototype.executeAutomateConsoleCommand = function(args) { case "gen": if (GeneralActions[val] != null) { var action = new ActionIdentifier({ - type:ActionTypes[val], name:val + type:ActionTypes[val], name:val, }); if (highLow) { this.automateActionHigh = action; @@ -2524,7 +2524,7 @@ Bladeburner.prototype.executeAutomateConsoleCommand = function(args) { case "contracts": if (this.contracts[val] != null) { var action = new ActionIdentifier({ - type:ActionTypes.Contract, name:val + type:ActionTypes.Contract, name:val, }); if (highLow) { this.automateActionHigh = action; @@ -2542,7 +2542,7 @@ Bladeburner.prototype.executeAutomateConsoleCommand = function(args) { case "operation": if (this.operations[val] != null) { var action = new ActionIdentifier({ - type:ActionTypes.Operation, name:val + type:ActionTypes.Operation, name:val, }); if (highLow) { this.automateActionHigh = action; diff --git a/src/Bladeburner/Action.ts b/src/Bladeburner/Action.ts index d2b78a011..de16b899c 100644 --- a/src/Bladeburner/Action.ts +++ b/src/Bladeburner/Action.ts @@ -8,16 +8,16 @@ import { BladeburnerConstants } from "./data/Constants"; // import { BlackOperation } from "./BlackOperation"; class StatsMultiplier { - hack: number = 0; - str: number = 0; - def: number = 0; - dex: number = 0; - agi: number = 0; - cha: number = 0; - int: number = 0; + hack = 0; + str = 0; + def = 0; + dex = 0; + agi = 0; + cha = 0; + int = 0; [key: string]: number; -}; +} export interface IActionParams { name?: string; @@ -44,31 +44,31 @@ export interface IActionParams { } export class Action { - name: string = ""; - desc: string = ""; + name = ""; + desc = ""; // Difficulty scales with level. See getDifficulty() method - level: number = 1; - maxLevel: number = 1; - autoLevel: boolean = true; - baseDifficulty: number = 100; - difficultyFac: number = 1.01; + level = 1; + maxLevel = 1; + autoLevel = true; + baseDifficulty = 100; + difficultyFac = 1.01; // Rank increase/decrease is affected by this exponent - rewardFac: number = 1.02; + rewardFac = 1.02; - successes: number = 0; - failures: number = 0; + successes = 0; + failures = 0; // All of these scale with level/difficulty - rankGain: number = 0; - rankLoss: number = 0; - hpLoss: number = 0; - hpLost: number = 0; + rankGain = 0; + rankLoss = 0; + hpLoss = 0; + hpLost = 0; // Action Category. Current categories are stealth and kill - isStealth: boolean = false; - isKill: boolean = false; + isStealth = false; + isKill = false; /** * Number of this contract remaining, and its growth rate @@ -81,7 +81,7 @@ export class Action { weights: StatsMultiplier = {hack:1/7,str:1/7,def:1/7,dex:1/7,agi:1/7,cha:1/7,int:1/7}; // Diminishing returns of stats (stat ^ decay where 0 <= decay <= 1) decays: StatsMultiplier = { hack: 0.9, str: 0.9, def: 0.9, dex: 0.9, agi: 0.9, cha: 0.9, int: 0.9 }; - teamCount: number = 0; + teamCount = 0; // Base Class for Contracts, Operations, and BlackOps constructor(params: IActionParams| null = null) { // | null = null @@ -202,10 +202,10 @@ export class Action { if (inst == null) {throw new Error("Invalid Bladeburner instance passed into Action.getSuccessChance");} let difficulty = this.getDifficulty(); let competence = 0; - for (let stat in this.weights) { + for (const stat in this.weights) { if (this.weights.hasOwnProperty(stat)) { - let playerStatLvl = Player.queryStatFromString(stat); - let key = "eff" + stat.charAt(0).toUpperCase() + stat.slice(1); + const playerStatLvl = Player.queryStatFromString(stat); + const key = "eff" + stat.charAt(0).toUpperCase() + stat.slice(1); let effMultiplier = inst.skillMultipliers[key]; if (effMultiplier == null) { console.error(`Failed to find Bladeburner Skill multiplier for: ${stat}`); diff --git a/src/Bladeburner/BlackOperations.ts b/src/Bladeburner/BlackOperations.ts index 94adc750c..f7ed13fc6 100644 --- a/src/Bladeburner/BlackOperations.ts +++ b/src/Bladeburner/BlackOperations.ts @@ -16,7 +16,7 @@ export const BlackOperations: IMap = {}; rankGain:50, rankLoss:10, hpLoss:100, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Zero"] = new BlackOperation({ name:"Operation Zero", @@ -33,7 +33,7 @@ export const BlackOperations: IMap = {}; rankGain:60, rankLoss:15, hpLoss:50, weights:{hack:0.2,str:0.15,def:0.15,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isStealth:true + isStealth:true, }); BlackOperations["Operation X"] = new BlackOperation({ name:"Operation X", @@ -52,7 +52,7 @@ export const BlackOperations: IMap = {}; rankGain:75, rankLoss:15, hpLoss:100, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Titan"] = new BlackOperation({ name:"Operation Titan", @@ -70,7 +70,7 @@ export const BlackOperations: IMap = {}; rankGain:100, rankLoss:20, hpLoss:100, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Ares"] = new BlackOperation({ name:"Operation Ares", @@ -84,7 +84,7 @@ export const BlackOperations: IMap = {}; rankGain:125, rankLoss:20, hpLoss:200, weights:{hack:0,str:0.25,def:0.25,dex:0.25,agi:0.25,cha:0, int:0}, decays:{hack:0,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Archangel"] = new BlackOperation({ name:"Operation Archangel", @@ -152,7 +152,7 @@ export const BlackOperations: IMap = {}; rankGain:750, rankLoss:60, hpLoss:1000, weights:{hack:0.05,str:0.2,def:0.2,dex:0.25,agi:0.25,cha:0, int:0.05}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Deckard"] = new BlackOperation({ name:"Operation Deckard", @@ -202,7 +202,7 @@ export const BlackOperations: IMap = {}; rankGain:2e3, rankLoss:150, hpLoss:1500, weights:{hack:0,str:0.24,def:0.24,dex:0.24,agi:0.24,cha:0, int:0.04}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Shoulder of Orion"] = new BlackOperation({ name:"Operation Shoulder of Orion", @@ -218,7 +218,7 @@ export const BlackOperations: IMap = {}; rankGain:2.5e3, rankLoss:500, hpLoss:1500, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isStealth:true + isStealth:true, }); BlackOperations["Operation Hyron"] = new BlackOperation({ name:"Operation Hyron", @@ -240,7 +240,7 @@ export const BlackOperations: IMap = {}; rankGain:3e3, rankLoss:1e3, hpLoss:500, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Morpheus"] = new BlackOperation({ name:"Operation Morpheus", @@ -257,7 +257,7 @@ export const BlackOperations: IMap = {}; rankGain:4e3, rankLoss:1e3, hpLoss:100, weights:{hack:0.05,str:0.15,def:0.15,dex:0.3,agi:0.3,cha:0, int:0.05}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isStealth:true + isStealth:true, }); BlackOperations["Operation Ion Storm"] = new BlackOperation({ name:"Operation Ion Storm", @@ -272,7 +272,7 @@ export const BlackOperations: IMap = {}; rankGain:5e3, rankLoss:1e3, hpLoss:5000, weights:{hack:0,str:0.24,def:0.24,dex:0.24,agi:0.24,cha:0, int:0.04}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Annihilus"] = new BlackOperation({ name:"Operation Annihilus", @@ -286,7 +286,7 @@ export const BlackOperations: IMap = {}; rankGain:7.5e3, rankLoss:1e3, hpLoss:10e3, weights:{hack:0,str:0.24,def:0.24,dex:0.24,agi:0.24,cha:0, int:0.04}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Ultron"] = new BlackOperation({ name:"Operation Ultron", @@ -306,7 +306,7 @@ export const BlackOperations: IMap = {}; rankGain:10e3, rankLoss:2e3, hpLoss:10e3, weights:{hack:0.1,str:0.2,def:0.2,dex:0.2,agi:0.2,cha:0, int:0.1}, decays:{hack:0.6,str:0.8,def:0.8,dex:0.8,agi:0.8,cha:0, int:0.75}, - isKill:true + isKill:true, }); BlackOperations["Operation Centurion"] = new BlackOperation({ name:"Operation Centurion", diff --git a/src/Bladeburner/City.ts b/src/Bladeburner/City.ts index d159eab7e..ea8557ba5 100644 --- a/src/Bladeburner/City.ts +++ b/src/Bladeburner/City.ts @@ -5,13 +5,13 @@ import { Generic_fromJSON, Generic_toJSON, Reviver } from "../../utils/JSONReviv import { addOffset } from "../../utils/helpers/addOffset"; export class ChangePopulationByCountParams { - estChange: number = 0; - estOffset: number = 0; + estChange = 0; + estOffset = 0; } export class ChangePopulationByPercentageParams { - nonZero: boolean = false; - changeEstEqually: boolean = false; + nonZero = false; + changeEstEqually = false; } export class City { @@ -19,32 +19,32 @@ export class City { /** * Name of the city. */ - name: string = ""; + name = ""; /** * Population of the city. */ - pop: number = 0; + pop = 0; /** * Population estimation of the city. */ - popEst: number = 0; + popEst = 0; /** * Number of communities in the city. */ - comms: number = 0; + comms = 0; /** * Estimated number of communities in the city. */ - commsEst: number = 0; + commsEst = 0; /** * Chaos level of the city. */ - chaos: number = 0; + chaos = 0; constructor(name: string = BladeburnerConstants.CityNames[2]) { this.name = name; @@ -84,7 +84,7 @@ export class City { /** * p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%) */ - improvePopulationEstimateByPercentage(p: number, skillMult: number=1): void { + improvePopulationEstimateByPercentage(p: number, skillMult=1): void { p = p*skillMult; if (isNaN(p)) {throw new Error("NaN passed into City.improvePopulationEstimateByPercentage()");} if (this.popEst < this.pop) { @@ -97,7 +97,7 @@ export class City { } } - improveCommunityEstimate(n: number=1): void { + improveCommunityEstimate(n=1): void { if (isNaN(n)) {throw new Error("NaN passed into City.improveCommunityEstimate()");} if (this.commsEst < this.comms) { this.commsEst += n; diff --git a/src/Bladeburner/GeneralActions.ts b/src/Bladeburner/GeneralActions.ts index 209b60002..ad457befa 100644 --- a/src/Bladeburner/GeneralActions.ts +++ b/src/Bladeburner/GeneralActions.ts @@ -11,7 +11,7 @@ export const GeneralActions: IMap = {}; name:actionName, desc:"Improve your abilities at the Bladeburner unit's specialized training " + "center. Doing this gives experience for all combat stats and also " + - "increases your max stamina." + "increases your max stamina.", }); actionName = "Field Analysis"; @@ -21,7 +21,7 @@ export const GeneralActions: IMap = {}; "Bladeburner's unit intelligence on Synthoid locations and " + "activities. Completing this action will improve the accuracy " + "of your Synthoid population estimated in the current city.

    " + - "Does NOT require stamina." + "Does NOT require stamina.", }); actionName = "Recruitment"; @@ -29,7 +29,7 @@ export const GeneralActions: IMap = {}; name:actionName, desc:"Attempt to recruit members for your Bladeburner team. These members " + "can help you conduct operations.

    " + - "Does NOT require stamina." + "Does NOT require stamina.", }); actionName = "Diplomacy"; @@ -37,7 +37,7 @@ export const GeneralActions: IMap = {}; name: actionName, desc: "Improve diplomatic relations with the Synthoid population. " + "Completing this action will reduce the Chaos level in your current city.

    " + - "Does NOT require stamina." + "Does NOT require stamina.", }); actionName = "Hyperbolic Regeneration Chamber"; diff --git a/src/Bladeburner/Operation.ts b/src/Bladeburner/Operation.ts index 12718b493..0581d5812 100644 --- a/src/Bladeburner/Operation.ts +++ b/src/Bladeburner/Operation.ts @@ -8,8 +8,8 @@ export interface IOperationParams extends IActionParams { } export class Operation extends Action { - reqdRank: number = 100; - teamCount: number = 0; + reqdRank = 100; + teamCount = 0; constructor(params: IOperationParams | null = null) { super(params); @@ -21,7 +21,7 @@ export class Operation extends Action { getTeamSuccessBonus(inst: any): number { if (this.teamCount && this.teamCount > 0) { this.teamCount = Math.min(this.teamCount, inst.teamSize); - let teamMultiplier = Math.pow(this.teamCount, 0.05); + const teamMultiplier = Math.pow(this.teamCount, 0.05); return teamMultiplier; } @@ -35,8 +35,8 @@ export class Operation extends Action { getChaosDifficultyBonus(inst: any, params: any): number { const city = inst.getCurrentCity(); if (city.chaos > BladeburnerConstants.ChaosThreshold) { - let diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold); - let mult = Math.pow(diff, 0.1); + const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold); + const mult = Math.pow(diff, 0.1); return mult; } diff --git a/src/Bladeburner/Skill.ts b/src/Bladeburner/Skill.ts index d901a25ca..deb84751e 100644 --- a/src/Bladeburner/Skill.ts +++ b/src/Bladeburner/Skill.ts @@ -33,36 +33,36 @@ export class Skill { name: string; desc: string; // Cost is in Skill Points - baseCost: number = 1; + baseCost = 1; // Additive cost increase per level - costInc: number = 1; - maxLvl: number = 0; + costInc = 1; + maxLvl = 0; /** * These benefits are additive. So total multiplier will be level (handled externally) times the * effects below */ - successChanceAll: number = 0; - successChanceStealth: number = 0; - successChanceKill: number = 0; - successChanceContract: number = 0; - successChanceOperation: number = 0; + successChanceAll = 0; + successChanceStealth = 0; + successChanceKill = 0; + successChanceContract = 0; + successChanceOperation = 0; /** * This multiplier affects everything that increases synthoid population/community estimate * e.g. Field analysis, Investigation Op, Undercover Op */ - successChanceEstimate: number = 0; - actionTime: number = 0; - effHack: number = 0; - effStr: number = 0; - effDef: number = 0; - effDex: number = 0; - effAgi: number = 0; - effCha: number = 0; - stamina: number = 0; - money: number = 0; - expGain: number = 0; + successChanceEstimate = 0; + actionTime = 0; + effHack = 0; + effStr = 0; + effDef = 0; + effDex = 0; + effAgi = 0; + effCha = 0; + stamina = 0; + money = 0; + expGain = 0; constructor(params: ISkillParams={name:"foo", desc:"foo"}) { if (!params.name) { diff --git a/src/Bladeburner/Skills.ts b/src/Bladeburner/Skills.ts index f762a296e..9fccf5614 100644 --- a/src/Bladeburner/Skills.ts +++ b/src/Bladeburner/Skills.ts @@ -10,55 +10,55 @@ export const Skills: IMap = {}; desc:"Each level of this skill increases your success chance " + "for all Contracts, Operations, and BlackOps by 3%", baseCost: 3, costInc: 2.1, - successChanceAll:3 + successChanceAll:3, }); Skills[SkillNames.Cloak] = new Skill({ name:SkillNames.Cloak, desc:"Each level of this skill increases your " + "success chance in stealth-related Contracts, Operations, and BlackOps by 5.5%", baseCost: 2, costInc: 1.1, - successChanceStealth:5.5 + successChanceStealth:5.5, }); Skills[SkillNames.ShortCircuit] = new Skill({ name:SkillNames.ShortCircuit, desc:"Each level of this skill increases your success chance " + "in Contracts, Operations, and BlackOps that involve retirement by 5.5%", baseCost: 2, costInc: 2.1, - successChanceKill:5.5 + successChanceKill:5.5, }); Skills[SkillNames.DigitalObserver] = new Skill({ name:SkillNames.DigitalObserver, desc:"Each level of this skill increases your success chance in " + "all Operations and BlackOps by 4%", baseCost: 2, costInc: 2.1, - successChanceOperation:4 + successChanceOperation:4, }); Skills[SkillNames.Tracer] = new Skill({ name:SkillNames.Tracer, desc:"Each level of this skill increases your success chance in " + "all Contracts by 4%", baseCost: 2, costInc: 2.1, - successChanceContract:4 + successChanceContract:4, }); Skills[SkillNames.Overclock] = new Skill({ name:SkillNames.Overclock, desc:"Each level of this skill decreases the time it takes " + "to attempt a Contract, Operation, and BlackOp by 1% (Max Level: 90)", baseCost: 3, costInc: 1.4, maxLvl: 90, - actionTime:1 + actionTime:1, }); Skills[SkillNames.Reaper] = new Skill({ name: SkillNames.Reaper, desc: "Each level of this skill increases your effective combat stats for Bladeburner actions by 2%", baseCost: 2, costInc: 2.1, - effStr: 2, effDef: 2, effDex: 2, effAgi: 2 + effStr: 2, effDef: 2, effDex: 2, effAgi: 2, }); Skills[SkillNames.EvasiveSystem] = new Skill({ name:SkillNames.EvasiveSystem, desc:"Each level of this skill increases your effective " + "dexterity and agility for Bladeburner actions by 4%", baseCost: 2, costInc: 2.1, - effDex: 4, effAgi: 4 + effDex: 4, effAgi: 4, }); Skills[SkillNames.Datamancer] = new Skill({ name:SkillNames.Datamancer, @@ -67,13 +67,13 @@ export const Skills: IMap = {}; "This affects all actions that can potentially increase " + "the accuracy of your synthoid population/community estimates.", baseCost:3, costInc:1, - successChanceEstimate:5 + successChanceEstimate:5, }); Skills[SkillNames.CybersEdge] = new Skill({ name:SkillNames.CybersEdge, desc:"Each level of this skill increases your max stamina by 2%", baseCost:1, costInc:3, - stamina:2 + stamina:2, }); Skills[SkillNames.HandsOfMidas] = new Skill({ name: SkillNames.HandsOfMidas, diff --git a/src/Bladeburner/data/Help.ts b/src/Bladeburner/data/Help.ts index ed87118b8..9fe4cc00a 100644 --- a/src/Bladeburner/data/Help.ts +++ b/src/Bladeburner/data/Help.ts @@ -8,7 +8,7 @@ export const ConsoleHelpText: {} = { " log [en/dis] [type] Enable or disable logging for events and actions", " skill [action] [name] Level or display info about your Bladeburner skills", " start [type] [name] Start a Bladeburner action/task" , - " stop Stops your current Bladeburner action/task" + " stop Stops your current Bladeburner action/task", ], automate: [ "automate [var] [val] [hi/low]", @@ -30,17 +30,17 @@ export const ConsoleHelpText: {} = { "Using the four console commands above will set the automation to perform Tracking contracts " + "if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below " + "50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must " + - "exactly match whatever the name is in the UI." + "exactly match whatever the name is in the UI.", ], clear: [ "clear", "", - "Clears the console" + "Clears the console", ], cls: [ "cls", "", - "Clears the console" + "Clears the console", ], help: [ "help [command]", @@ -51,7 +51,7 @@ export const ConsoleHelpText: {} = { "", " help automate", "", - "will display specific information about using the automate console command" + "will display specific information about using the automate console command", ], log: [ "log [en/dis] [type]", @@ -71,7 +71,7 @@ export const ConsoleHelpText: {} = { "Logging can be universally enabled/disabled using the 'all' keyword:", "", " log dis all", - " log en all" + " log en all", ], skill: [ "skill [action] [name]", @@ -91,7 +91,7 @@ export const ConsoleHelpText: {} = { "", "This console command can also be used to level up skills:", "", - " skill level [skill name]" + " skill level [skill name]", ], start: [ "start [type] [name]", @@ -106,11 +106,11 @@ export const ConsoleHelpText: {} = { "Examples:", "", " start contract Tracking", - " start op 'Undercover Operation'" + " start op 'Undercover Operation'", ], stop:[ "stop", "", - "Stop your current action and go idle." + "Stop your current action and go idle.", ], } \ No newline at end of file diff --git a/src/Bladeburner/ui/BlackOperationsPage.tsx b/src/Bladeburner/ui/BlackOperationsPage.tsx index 134147551..ac6d1ea27 100644 --- a/src/Bladeburner/ui/BlackOperationsPage.tsx +++ b/src/Bladeburner/ui/BlackOperationsPage.tsx @@ -55,9 +55,8 @@ export function BlackOperationsPage(inst: any): React.ReactElement { Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked successively by completing the one before it.

    Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops.

    Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank losses.

    - {blackops.map( op => -
    -
    + {blackops.map( op =>
    +
    , )} ) } diff --git a/src/Casino/CoinFlip.tsx b/src/Casino/CoinFlip.tsx index a9c10948d..a3340e97d 100644 --- a/src/Casino/CoinFlip.tsx +++ b/src/Casino/CoinFlip.tsx @@ -89,7 +89,7 @@ export class CoinFlip extends Game { | | | |
    +ā€”ā€”ā€”ā€”ā€”ā€”ā€”+
    - Play for:
    + Play for:
    this.play('H'))} text={"Head!"} disabled={this.state.playLock} /> this.play('T'))} text={"Tail!"} disabled={this.state.playLock} />

    {this.state.status}

    diff --git a/src/Casino/RNG.ts b/src/Casino/RNG.ts index 483bdf3b7..3605662f5 100644 --- a/src/Casino/RNG.ts +++ b/src/Casino/RNG.ts @@ -1,6 +1,6 @@ export interface RNG { - random(): number + random(): number; } /* @@ -9,9 +9,9 @@ export interface RNG { */ class RNG0 implements RNG { x: number; - m: number = 1024; - a: number = 341; - c: number = 1; + m = 1024; + a = 341; + c = 1; constructor() { this.x = 0; @@ -39,9 +39,9 @@ export const BadRNG: RNG0 = new RNG0(); * The period is 6e12. */ export class WHRNG implements RNG { - s1: number = 0; - s2: number = 0; - s3: number = 0; + s1 = 0; + s2 = 0; + s3 = 0; constructor(totalPlaytime: number) { // This one is seeded by the players total play time. diff --git a/src/Casino/Roulette.tsx b/src/Casino/Roulette.tsx index 158dfb528..b24e6841c 100644 --- a/src/Casino/Roulette.tsx +++ b/src/Casino/Roulette.tsx @@ -102,14 +102,14 @@ const strategies: { Third2: { match: (n: number): boolean => { if (n === 0) return false; - return 13 <= n && n <= 24; + return n >= 13 && n <= 24; }, payout: 2, }, Third3: { match: (n: number): boolean => { if (n === 0) return false; - return 25 <= n; + return n >= 25; }, payout: 2, }, @@ -125,7 +125,7 @@ function Single(s: number): Strategy { } export class Roulette extends Game { - interval: number = -1; + interval = -1; rng: WHRNG; constructor(props: IProps) { @@ -226,7 +226,7 @@ export class Roulette extends Game { render() { return <>

    {this.currentNumber()}

    - +

    {this.state.status}

    diff --git a/src/Casino/SlotMachine.tsx b/src/Casino/SlotMachine.tsx index 470ef5301..04dd0ae93 100644 --- a/src/Casino/SlotMachine.tsx +++ b/src/Casino/SlotMachine.tsx @@ -20,7 +20,7 @@ type IState = { } // statically shuffled array of symbols. -let symbols = ["D", "C", "$", "?", "ā™„", "A", "C", "B", "C", "E", "B", "E", "C", +const symbols = ["D", "C", "$", "?", "ā™„", "A", "C", "B", "C", "E", "B", "E", "C", "*", "D", "ā™„", "B", "A", "A", "A", "C", "A", "D", "B", "E", "?", "D", "*", "@", "ā™„", "B", "E", "?"]; @@ -63,7 +63,7 @@ const maxPlay = 1e6; export class SlotMachine extends Game { rng: WHRNG; - interval: number = -1; + interval = -1; constructor(props: IProps) { super(props); @@ -142,7 +142,7 @@ export class SlotMachine extends Game { checkWinnings() { const t = this.getTable(); const getPaylineData = function(payline: number[][]): string[] { - let data = []; + const data = []; for(const point of payline) { data.push(t[point[0]][point[1]]); } @@ -209,7 +209,7 @@ export class SlotMachine extends Game { | | {symbols[(this.state.index[0]+1)%symbols.length]} | {symbols[(this.state.index[1]+1)%symbols.length]} | {symbols[(this.state.index[2]+1)%symbols.length]} | {symbols[(this.state.index[3]+1)%symbols.length]} | {symbols[(this.state.index[4]+1)%symbols.length]} | |
    +ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”+
    - +

    {this.state.status}

    Pay lines

    diff --git a/src/CinematicText.js b/src/CinematicText.js index f1899a5b9..31aa585f7 100644 --- a/src/CinematicText.js +++ b/src/CinematicText.js @@ -99,7 +99,7 @@ function cinematicTextEnd() { mainMenu.style.visibility = "visible"; cinematicTextFlag = false; resolve(); - } + }, })); }); } diff --git a/src/CodingContractGenerator.ts b/src/CodingContractGenerator.ts index 6b5e62ad4..c0217377e 100644 --- a/src/CodingContractGenerator.ts +++ b/src/CodingContractGenerator.ts @@ -2,7 +2,7 @@ import { CodingContract, CodingContractRewardType, CodingContractTypes, - ICodingContractReward + ICodingContractReward, } from "./CodingContracts"; import { Factions } from "./Faction/Factions"; import { Player } from "./Player"; @@ -88,7 +88,7 @@ export function generateContract(params: IGenerateContractParams) { fn = getRandomFilename(server, reward); } - let contract = new CodingContract(fn, problemType, reward); + const contract = new CodingContract(fn, problemType, reward); server.addContract(contract); } @@ -119,13 +119,13 @@ function sanitizeRewardType(rewardType: CodingContractRewardType): CodingContrac function getRandomProblemType() { const problemTypes = Object.keys(CodingContractTypes); - let randIndex = getRandomInt(0, problemTypes.length - 1); + const randIndex = getRandomInt(0, problemTypes.length - 1); return problemTypes[randIndex]; } function getRandomReward(): ICodingContractReward { - let reward: ICodingContractReward = { + const reward: ICodingContractReward = { name: "", type: getRandomInt(0, CodingContractRewardType.Money), }; @@ -145,8 +145,8 @@ function getRandomReward(): ICodingContractReward { case CodingContractRewardType.FactionReputation: { // Get a random faction that player is a part of. That // faction must allow hacking contracts - var numFactions = factionsThatAllowHacking.length; - var randFaction = factionsThatAllowHacking[getRandomInt(0, numFactions - 1)]; + const numFactions = factionsThatAllowHacking.length; + const randFaction = factionsThatAllowHacking[getRandomInt(0, numFactions - 1)]; reward.name = randFaction; break; } diff --git a/src/CodingContracts.ts b/src/CodingContracts.ts index 1af8fb5fa..9e78f6e08 100644 --- a/src/CodingContracts.ts +++ b/src/CodingContracts.ts @@ -2,7 +2,7 @@ import { codingContractTypesMetadata, DescriptionFunc, GeneratorFunc, - SolverFunc + SolverFunc, } from "./data/codingcontracttypes"; import { IMap } from "./types"; @@ -10,7 +10,7 @@ import { IMap } from "./types"; import { Generic_fromJSON, Generic_toJSON, - Reviver + Reviver, } from "../utils/JSONReviver"; import { KEY } from "../utils/helpers/keyCodes"; import { createElement } from "../utils/uiHelpers/createElement"; @@ -126,13 +126,13 @@ export class CodingContract { reward: ICodingContractReward | null; /* Number of times the Contract has been attempted */ - tries: number = 0; + tries = 0; /* String representing the contract's type. Must match type in ContractTypes */ type: string; - constructor(fn: string = "", - type: string = "Find Largest Prime Factor", + constructor(fn = "", + type = "Find Largest Prime Factor", reward: ICodingContractReward | null = null) { this.fn = fn; if (!this.fn.endsWith(".cct")) { @@ -180,7 +180,7 @@ export class CodingContract { // tslint:disable-next-line return new Promise((resolve: Function, reject: Function) => { const contractType: CodingContractType = CodingContractTypes[this.type]; - const popupId: string = `coding-contract-prompt-popup-${this.fn}`; + const popupId = `coding-contract-prompt-popup-${this.fn}`; const title: HTMLElement = createElement("h1", { innerHTML: this.type, }); diff --git a/src/Company/Company.ts b/src/Company/Company.ts index 52dc44cd1..54a673ccf 100644 --- a/src/Company/Company.ts +++ b/src/Company/Company.ts @@ -136,7 +136,7 @@ export class Company { gainFavor(): void { if (this.favor == null) { this.favor = 0; } if (this.rolloverRep == null) { this.rolloverRep = 0; } - var res = this.getFavorGain(); + const res = this.getFavorGain(); if (res.length != 2) { console.error("Invalid result from getFavorGain() function"); return; diff --git a/src/Company/GetJobRequirementText.ts b/src/Company/GetJobRequirementText.ts index b3d023aa9..c9da1b541 100644 --- a/src/Company/GetJobRequirementText.ts +++ b/src/Company/GetJobRequirementText.ts @@ -5,8 +5,8 @@ import { CompanyPosition } from "./CompanyPosition"; * Returns a string with the given CompanyPosition's stat requirements */ -export function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext: boolean = false): string { - let reqText: string = ""; +export function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext = false): string { + let reqText = ""; const offset: number = company.jobStatReqOffset; const reqHacking: number = pos.requiredHacking > 0 ? pos.requiredHacking+offset : 0; const reqStrength: number = pos.requiredStrength > 0 ? pos.requiredStrength+offset : 0; diff --git a/src/Company/data/CompaniesMetadata.ts b/src/Company/data/CompaniesMetadata.ts index 06f5dc872..a4d833fec 100644 --- a/src/Company/data/CompaniesMetadata.ts +++ b/src/Company/data/CompaniesMetadata.ts @@ -95,7 +95,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 3, salaryMultiplier: 3, @@ -107,7 +107,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 3, salaryMultiplier: 3, @@ -119,7 +119,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.6, salaryMultiplier: 2.6, @@ -131,7 +131,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.75, salaryMultiplier: 2.75, @@ -143,7 +143,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.75, salaryMultiplier: 2.75, @@ -155,7 +155,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.25, salaryMultiplier: 2.25, @@ -167,7 +167,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.25, salaryMultiplier: 2.25, @@ -179,7 +179,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.5, salaryMultiplier: 2.5, @@ -191,7 +191,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 2.2, salaryMultiplier: 2.2, @@ -202,7 +202,7 @@ export const companiesMetadata: IConstructorParams[] = [ info: "", companyPositions: Object.assign({}, AllTechnologyPositions, - AllBusinessPositions + AllBusinessPositions, ), expMultiplier: 2, salaryMultiplier: 2, @@ -214,7 +214,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllSoftwareConsultantPositions, - AllBusinessPositions + AllBusinessPositions, ), expMultiplier: 1.8, salaryMultiplier: 1.8, @@ -226,7 +226,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.75, salaryMultiplier: 1.75, @@ -238,7 +238,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.8, salaryMultiplier: 1.8, @@ -250,7 +250,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.8, salaryMultiplier: 1.8, @@ -262,7 +262,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.9, salaryMultiplier: 1.9, @@ -274,7 +274,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 2, salaryMultiplier: 2, @@ -286,7 +286,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.9, salaryMultiplier: 1.9, @@ -299,7 +299,7 @@ export const companiesMetadata: IConstructorParams[] = [ CEOOnly, OperationsManagerOnly, AllTechnologyPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 1.7, salaryMultiplier: 1.7, @@ -351,7 +351,7 @@ export const companiesMetadata: IConstructorParams[] = [ AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 1.8, salaryMultiplier: 1.8, @@ -364,7 +364,7 @@ export const companiesMetadata: IConstructorParams[] = [ AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 1.75, salaryMultiplier: 1.75, @@ -379,7 +379,7 @@ export const companiesMetadata: IConstructorParams[] = [ SecurityEngineerPositions, AllITPositions, AllSecurityPositions, - AllAgentPositions + AllAgentPositions, ), expMultiplier: 2, salaryMultiplier: 2, @@ -394,7 +394,7 @@ export const companiesMetadata: IConstructorParams[] = [ SecurityEngineerPositions, AllITPositions, AllSecurityPositions, - AllAgentPositions + AllAgentPositions, ), expMultiplier: 2, salaryMultiplier: 2, @@ -409,7 +409,7 @@ export const companiesMetadata: IConstructorParams[] = [ AllITPositions, AllSecurityPositions, AllAgentPositions, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.5, salaryMultiplier: 1.5, @@ -422,7 +422,7 @@ export const companiesMetadata: IConstructorParams[] = [ AllTechnologyPositions, AllSoftwareConsultantPositions, AllBusinessPositions, - AllSecurityPositions + AllSecurityPositions, ), expMultiplier: 1.4, salaryMultiplier: 1.4, @@ -433,7 +433,7 @@ export const companiesMetadata: IConstructorParams[] = [ info: "", companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, - BusinessPositionsUpToOperationsManager + BusinessPositionsUpToOperationsManager, ), expMultiplier: 1.3, salaryMultiplier: 1.3, @@ -445,7 +445,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, BusinessPositionsUpToOperationsManager, - AllSoftwareConsultantPositions + AllSoftwareConsultantPositions, ), expMultiplier: 1.5, salaryMultiplier: 1.5, @@ -456,7 +456,7 @@ export const companiesMetadata: IConstructorParams[] = [ info: "", companyPositions: Object.assign({}, AllSecurityPositions, - SoftwarePositionsUpToLeadDeveloper + SoftwarePositionsUpToLeadDeveloper, ), expMultiplier: 1.3, salaryMultiplier: 1.3, @@ -466,7 +466,7 @@ export const companiesMetadata: IConstructorParams[] = [ name: LocationName.VolhavenSysCoreSecurities, info: "", companyPositions: Object.assign({}, - AllTechnologyPositions + AllTechnologyPositions, ), expMultiplier: 1.3, salaryMultiplier: 1.3, @@ -476,7 +476,7 @@ export const companiesMetadata: IConstructorParams[] = [ name: LocationName.VolhavenCompuTek, info: "", companyPositions: Object.assign({}, - AllTechnologyPositions + AllTechnologyPositions, ), expMultiplier: 1.2, salaryMultiplier: 1.2, @@ -486,7 +486,7 @@ export const companiesMetadata: IConstructorParams[] = [ name: LocationName.AevumNetLinkTechnologies, info: "", companyPositions: Object.assign({}, - AllTechnologyPositions + AllTechnologyPositions, ), expMultiplier: 1.2, salaryMultiplier: 1.2, @@ -509,7 +509,7 @@ export const companiesMetadata: IConstructorParams[] = [ name: LocationName.Sector12FoodNStuff, info: "", companyPositions: Object.assign({}, - EmployeeOnly, PartTimeEmployeeOnly + EmployeeOnly, PartTimeEmployeeOnly, ), expMultiplier: 1, salaryMultiplier: 1, @@ -519,7 +519,7 @@ export const companiesMetadata: IConstructorParams[] = [ name: LocationName.Sector12JoesGuns, info: "", companyPositions: Object.assign({}, - EmployeeOnly, PartTimeEmployeeOnly + EmployeeOnly, PartTimeEmployeeOnly, ), expMultiplier: 1, salaryMultiplier: 1, @@ -531,7 +531,7 @@ export const companiesMetadata: IConstructorParams[] = [ companyPositions: Object.assign({}, AllSoftwarePositions, AllSoftwareConsultantPositions, - AllITPositions + AllITPositions, ), expMultiplier: 1.1, salaryMultiplier: 1.1, @@ -541,7 +541,7 @@ export const companiesMetadata: IConstructorParams[] = [ name: LocationName.NewTokyoNoodleBar, info: "", companyPositions: Object.assign({}, - WaiterOnly, PartTimeWaiterOnly + WaiterOnly, PartTimeWaiterOnly, ), expMultiplier: 1, salaryMultiplier: 1, diff --git a/src/Company/data/companypositionnames.ts b/src/Company/data/companypositionnames.ts index 857e1cfaf..c1d4a46b3 100644 --- a/src/Company/data/companypositionnames.ts +++ b/src/Company/data/companypositionnames.ts @@ -8,23 +8,23 @@ export const SoftwareCompanyPositions: string[] = [ "Head of Software", "Head of Engineering", "Vice President of Technology", - "Chief Technology Officer" + "Chief Technology Officer", ]; export const ITCompanyPositions: string[] = [ "IT Intern", "IT Analyst", "IT Manager", - "Systems Administrator" + "Systems Administrator", ]; export const SecurityEngineerCompanyPositions: string[] = [ - "Security Engineer" + "Security Engineer", ]; export const NetworkEngineerCompanyPositions: string[] = [ "Network Engineer", - "Network Administrator" + "Network Administrator", ]; export const BusinessCompanyPositions: string[] = [ @@ -33,7 +33,7 @@ export const BusinessCompanyPositions: string[] = [ "Business Manager", "Operations Manager", "Chief Financial Officer", - "Chief Executive Officer" + "Chief Executive Officer", ]; export const SecurityCompanyPositions: string[] = [ @@ -42,31 +42,31 @@ export const SecurityCompanyPositions: string[] = [ "Security Guard", "Security Officer", "Security Supervisor", - "Head of Security" + "Head of Security", ]; export const AgentCompanyPositions: string[] = [ "Field Agent", "Secret Agent", - "Special Operative" + "Special Operative", ]; export const MiscCompanyPositions: string[] = [ "Waiter", - "Employee" + "Employee", ]; export const SoftwareConsultantCompanyPositions: string[] = [ "Software Consultant", - "Senior Software Consultant" + "Senior Software Consultant", ]; export const BusinessConsultantCompanyPositions: string[] = [ "Business Consultant", - "Senior Business Consultant" + "Senior Business Consultant", ]; export const PartTimeCompanyPositions: string[] = [ "Part-time Waiter", - "Part-time Employee" + "Part-time Employee", ]; diff --git a/src/Constants.ts b/src/Constants.ts index 14e846d84..de47de68c 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -5,7 +5,7 @@ */ import { IMap } from "./types"; -export let CONSTANTS: IMap = { +export const CONSTANTS: IMap = { Version: "0.51.6", /** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience @@ -268,5 +268,5 @@ export let CONSTANTS: IMap = { * so many documentation and typos fixes (@Pimgd) * A corruption visual effect has been added to location with servers that have backdoor installed. (@dewint) - ` + `, } \ No newline at end of file diff --git a/src/Corporation/Corporation.jsx b/src/Corporation/Corporation.jsx index 08403439a..f364cfa70 100644 --- a/src/Corporation/Corporation.jsx +++ b/src/Corporation/Corporation.jsx @@ -122,7 +122,7 @@ function Industry(params={}) { }), [CityName.NewTokyo]: 0, [CityName.Ishima]: 0, - [CityName.Volhaven]: 0 + [CityName.Volhaven]: 0, }; this.name = params.name ? params.name : 0; @@ -183,7 +183,7 @@ function Industry(params={}) { }), [CityName.NewTokyo]: 0, [CityName.Ishima]: 0, - [CityName.Volhaven]: 0 + [CityName.Volhaven]: 0, }; this.init(); @@ -378,7 +378,7 @@ Industry.prototype.init = function() { "Metal": 5, "Energy": 5, "Water": 2, - "Hardware": 4 + "Hardware": 4, } this.prodMats = ["RealEstate"]; this.makesProducts = true; @@ -1620,7 +1620,7 @@ var OfficeSpaceTiers = { Basic: "Basic", Enhanced: "Enhanced", Luxurious: "Luxurious", - Extravagant: "Extravagant" + Extravagant: "Extravagant", } function OfficeSpace(params={}) { @@ -1800,7 +1800,7 @@ OfficeSpace.prototype.findEmployees = function(parentRefs) { office.hireEmployee(employee, parentRefs); removeElementById("cmpy-mgmt-hire-employee-popup"); return false; - } + }, }); return div; }; @@ -1812,7 +1812,7 @@ OfficeSpace.prototype.findEmployees = function(parentRefs) { clickListener:() => { removeElementById("cmpy-mgmt-hire-employee-popup"); return false; - } + }, }); var elems = [text, @@ -2111,7 +2111,7 @@ Corporation.prototype.goPublic = function() { onkeyup:(e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {yesBtn.click();} - } + }, }); var br = createElement("br", {}); yesBtn = createElement("a", { @@ -2138,7 +2138,7 @@ Corporation.prototype.goPublic = function() { dialogBoxCreate(`You took your ${this.name} public and earned ` + `${numeralWrapper.formatMoney(numShares * initialSharePrice)} in your IPO`); return false; - } + }, }); var noBtn = createElement("a", { class:"a-link-button", @@ -2146,7 +2146,7 @@ Corporation.prototype.goPublic = function() { clickListener:() => { removeElementById(goPublicPopupId); return false; - } + }, }); createPopup(goPublicPopupId, [txt, br, input, yesBtn, noBtn]); } @@ -2351,7 +2351,7 @@ Corporation.prototype.createUI = function() { companyManagementDiv = createElement("div", { id:"cmpy-mgmt-container", position:"fixed", - class:"generic-menupage-container" + class:"generic-menupage-container", }); document.getElementById("entire-game-container").appendChild(companyManagementDiv); diff --git a/src/Corporation/CorporationState.ts b/src/Corporation/CorporationState.ts index adc474496..e5c161764 100644 --- a/src/Corporation/CorporationState.ts +++ b/src/Corporation/CorporationState.ts @@ -13,7 +13,7 @@ export class CorporationState { // Number representing what state the Corporation is in. The number // is an index for the array that holds all Corporation States - state: number = 0; + state = 0; constructor() {} diff --git a/src/Corporation/IndustryData.ts b/src/Corporation/IndustryData.ts index f085f7bcc..33e736adf 100644 --- a/src/Corporation/IndustryData.ts +++ b/src/Corporation/IndustryData.ts @@ -107,7 +107,7 @@ export const IndustryDescriptions: IIndustryMap = { // Map of available Research for each Industry. This data is held in a // ResearchTree object -export let IndustryResearchTrees: IIndustryMap = { +export const IndustryResearchTrees: IIndustryMap = { Energy: getBaseResearchTreeCopy(), Utilities: getBaseResearchTreeCopy(), Agriculture: getBaseResearchTreeCopy(), diff --git a/src/Corporation/IndustryUpgrades.ts b/src/Corporation/IndustryUpgrades.ts index 71b0d7ff7..d83ada87f 100644 --- a/src/Corporation/IndustryUpgrades.ts +++ b/src/Corporation/IndustryUpgrades.ts @@ -11,5 +11,5 @@ export const IndustryUpgrades: IMap = { "this upgrade grants your company a static increase of 3 and 1 to its awareness and " + "popularity, respectively. It will then increase your company's awareness by 1%, and its popularity " + "by a random percentage between 1% and 3%. These effects are increased by other upgrades " + - "that increase the power of your advertising."] + "that increase the power of your advertising."], } diff --git a/src/Corporation/Material.ts b/src/Corporation/Material.ts index abf4bb86b..409fdea01 100644 --- a/src/Corporation/Material.ts +++ b/src/Corporation/Material.ts @@ -13,50 +13,50 @@ export class Material { } // Name of material - name: string = "InitName"; + name = "InitName"; // Amount of material owned - qty: number = 0; + qty = 0; // Material's "quality". Unbounded - qlt: number = 0; + qlt = 0; // How much demand the Material has in the market, and the range of possible // values for this "demand" - dmd: number = 0; + dmd = 0; dmdR: number[] = [0, 0]; // How much competition there is for this Material in the market, and the range // of possible values for this "competition" - cmp: number = 0; + cmp = 0; cmpR: number[] = [0, 0]; // Maximum volatility of this Materials stats - mv: number = 0; + mv = 0; // Markup. Determines how high of a price you can charge on the material // compared to the market price without suffering loss in # of sales // Quality is divided by this to determine markup limits // e,g, If mku is 10 and quality is 100 then you can markup prices by 100/10 = 10 - mku: number = 0; + mku = 0; // How much of this material is being bought, sold, imported and produced every second - buy: number = 0; - sll: number = 0; - prd: number = 0; - imp: number = 0; + buy = 0; + sll = 0; + prd = 0; + imp = 0; // Exports of this material to another warehouse/industry exp: any[] = []; // Total amount of this material exported in the last cycle - totalExp: number = 0; + totalExp = 0; // Cost / sec to buy this material. AKA Market Price - bCost: number = 0; + bCost = 0; // Cost / sec to sell this material - sCost: number = 0; + sCost = 0; // Flags to keep track of whether production and/or sale of this material is limited // [Whether production/sale is limited, limit amount] @@ -64,9 +64,9 @@ export class Material { sllman: any[] = [false, 0]; // Sale // Flags that signal whether automatic sale pricing through Market TA is enabled - marketTa1: boolean = false; - marketTa2: boolean = false; - marketTa2Price: number = 0; + marketTa1 = false; + marketTa2 = false; + marketTa2Price = 0; constructor(params: IConstructorParams = {}) { if (params.name) { this.name = params.name; } @@ -166,7 +166,7 @@ export class Material { const compChange: number = 1 + compVolatility; if (Math.random() < 0.5) { this.cmp *= compChange; - if (this.cmp > this.cmpR[1]) {this.cmp = this.cmpR[1]}; + if (this.cmp > this.cmpR[1]) {this.cmp = this.cmpR[1]} this.bCost *= (1 / priceChange); // Competition increases, so price goes down } else { this.cmp *= (1 / compChange); diff --git a/src/Corporation/Product.ts b/src/Corporation/Product.ts index 902b0015b..3a00a98e6 100644 --- a/src/Corporation/Product.ts +++ b/src/Corporation/Product.ts @@ -48,43 +48,43 @@ export class Product { } // Product name - name: string = ""; + name = ""; // The demand for this Product in the market. Gradually decreases - dmd: number = 0; + dmd = 0; // How much competition there is in the market for this Product - cmp: number = 0; + cmp = 0; // Markup. Affects how high of a price you can charge for this Product // without suffering a loss in the # of sales - mku: number = 0; + mku = 0; // Production cost - estimation of how much money it costs to make this Product - pCost: number = 0; + pCost = 0; // Sell cost - sCost: number = 0; + sCost = 0; // Variables for handling the creation process of this Product - fin: boolean = false; // Whether this Product has finished being created - prog: number = 0; // Creation progress - A number betwee 0-100 representing percentage - createCity: string = ""; // City in which the product is/was being created - designCost: number = 0; // How much money was invested into designing this Product - advCost: number = 0; // How much money was invested into advertising this Product + fin = false; // Whether this Product has finished being created + prog = 0; // Creation progress - A number betwee 0-100 representing percentage + createCity = ""; // City in which the product is/was being created + designCost = 0; // How much money was invested into designing this Product + advCost = 0; // How much money was invested into advertising this Product // Aggregate score for this Product's 'rating' // This is based on the stats/properties below. The weighting of the // stats/properties below differs between different industries - rat: number = 0; + rat = 0; // Stats/properties of this Product - qlt: number = 0; - per: number = 0; - dur: number = 0; - rel: number = 0; - aes: number = 0; - fea: number = 0; + qlt = 0; + per = 0; + dur = 0; + rel = 0; + aes = 0; + fea = 0; // Data refers to the production, sale, and quantity of the products // These values are specific to a city @@ -93,11 +93,11 @@ export class Product { // Location of this Product // Only applies for location-based products like restaurants/hospitals - loc: string = ""; + loc = ""; // How much space 1 unit of the Product takes (in the warehouse) // Not applicable for all Products - siz: number = 0; + siz = 0; // Material requirements. An object that maps the name of a material to how much it requires // to make 1 unit of the product. @@ -110,8 +110,8 @@ export class Product { sllman: IMap = createCityMap([false, 0]); // Flags that signal whether automatic sale pricing through Market TA is enabled - marketTa1: boolean = false; - marketTa2: boolean = false; + marketTa1 = false; + marketTa2 = false; marketTa2Price: IMap = createCityMap(0); constructor(params: IConstructorParams={}) { @@ -135,7 +135,7 @@ export class Product { // empWorkMult is a multiplier that increases progress rate based on // productivity of employees - createProduct(marketCycles: number=1, empWorkMult: number=1): void { + createProduct(marketCycles=1, empWorkMult=1): void { if (this.fin) { return; } this.prog += (marketCycles * .01 * empWorkMult); } @@ -145,18 +145,18 @@ export class Product { this.fin = true; //Calculate properties - var progrMult = this.prog / 100; + const progrMult = this.prog / 100; const engrRatio = employeeProd[EmployeePositions.Engineer] / employeeProd["total"]; const mgmtRatio = employeeProd[EmployeePositions.Management] / employeeProd["total"]; const rndRatio = employeeProd[EmployeePositions.RandD] / employeeProd["total"]; const opsRatio = employeeProd[EmployeePositions.Operations] / employeeProd["total"]; const busRatio = employeeProd[EmployeePositions.Business] / employeeProd["total"]; - var designMult = 1 + (Math.pow(this.designCost, 0.1) / 100); - var balanceMult = (1.2 * engrRatio) + (0.9 * mgmtRatio) + (1.3 * rndRatio) + + const designMult = 1 + (Math.pow(this.designCost, 0.1) / 100); + const balanceMult = (1.2 * engrRatio) + (0.9 * mgmtRatio) + (1.3 * rndRatio) + (1.5 * opsRatio) + (busRatio); - var sciMult = 1 + (Math.pow(industry.sciResearch.qty, industry.sciFac) / 800); - var totalMult = progrMult * balanceMult * designMult * sciMult; + const sciMult = 1 + (Math.pow(industry.sciResearch.qty, industry.sciFac) / 800); + const totalMult = progrMult * balanceMult * designMult * sciMult; this.qlt = totalMult * ((0.10 * employeeProd[EmployeePositions.Engineer]) + (0.05 * employeeProd[EmployeePositions.Management]) + @@ -189,7 +189,7 @@ export class Product { (0.05 * employeeProd[EmployeePositions.Operations]) + (0.05 * employeeProd[EmployeePositions.Business])); this.calculateRating(industry); - var advMult = 1 + (Math.pow(this.advCost, 0.1) / 100); + const advMult = 1 + (Math.pow(this.advCost, 0.1) / 100); this.mku = 100 / (advMult * Math.pow((this.qlt + 0.001), 0.65) * (busRatio + mgmtRatio)); this.dmd = industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness))); this.cmp = getRandomInt(0, 70); diff --git a/src/Corporation/ProductRatingWeights.ts b/src/Corporation/ProductRatingWeights.ts index e19e9298d..1934ba507 100644 --- a/src/Corporation/ProductRatingWeights.ts +++ b/src/Corporation/ProductRatingWeights.ts @@ -73,5 +73,5 @@ export const ProductRatingWeights: IMap = { Reliability: 0.1, Aesthetics: 0.35, Features: 0.1, - } + }, } diff --git a/src/Corporation/Research.ts b/src/Corporation/Research.ts index ee017ec06..6c370e8ab 100644 --- a/src/Corporation/Research.ts +++ b/src/Corporation/Research.ts @@ -16,25 +16,25 @@ export interface IConstructorParams { export class Research { // Name of research. This will be used to identify researches in the Research Tree - name: string = ""; + name = ""; // How much scientific research it costs to unlock this - cost: number = 0; + cost = 0; // Description of what the Research does - desc: string = ""; + desc = ""; // All possible generic upgrades for the company, in the form of multipliers - advertisingMult: number = 1; - employeeChaMult: number = 1; - employeeCreMult: number = 1; - employeeEffMult: number = 1; - employeeIntMult: number = 1; - productionMult: number = 1; - productProductionMult: number = 1; - salesMult: number = 1; - sciResearchMult: number = 1; - storageMult: number = 1; + advertisingMult = 1; + employeeChaMult = 1; + employeeCreMult = 1; + employeeEffMult = 1; + employeeIntMult = 1; + productionMult = 1; + productProductionMult = 1; + salesMult = 1; + sciResearchMult = 1; + storageMult = 1; constructor(p: IConstructorParams={name: "", cost: 0, desc: ""}) { this.name = p.name; diff --git a/src/Corporation/ResearchMap.ts b/src/Corporation/ResearchMap.ts index b38b8356b..560fb1f5c 100644 --- a/src/Corporation/ResearchMap.ts +++ b/src/Corporation/ResearchMap.ts @@ -5,7 +5,7 @@ import { Research, import { researchMetadata } from "./data/ResearchMetadata"; import { IMap } from "../types"; -export let ResearchMap: IMap = {}; +export const ResearchMap: IMap = {}; function addResearch(p: IConstructorParams) { if (ResearchMap[p.name] != null) { diff --git a/src/Corporation/ResearchTree.ts b/src/Corporation/ResearchTree.ts index 8414631c8..1b5414f93 100644 --- a/src/Corporation/ResearchTree.ts +++ b/src/Corporation/ResearchTree.ts @@ -26,10 +26,10 @@ export class Node { // How much Scientific Research is needed for this // Necessary to show it on the UI - cost: number = 0; + cost = 0; // Whether or not this Research has been unlocked - researched: boolean = false; + researched = false; // Parent node in the tree // The parent node defines the prerequisite Research (there can only be one) @@ -37,7 +37,7 @@ export class Node { parent: Node | null = null; // Name of the Research held in this Node - text: string = ""; + text = ""; constructor(p: IConstructorParams = {cost: 0, text: ""}) { if (ResearchMap[p.text] == null) { @@ -70,7 +70,7 @@ export class Node { } // Determine what css class this Node should have in the diagram - let htmlClass: string = ""; + let htmlClass = ""; if (this.researched) { htmlClass = "researched"; } else if (this.parent && this.parent.researched === false) { @@ -205,7 +205,7 @@ export class ResearchTree { // Helper function for all the multiplier getter fns getMultiplierHelper(propName: string): number { - let res: number = 1; + let res = 1; if (this.root == null) { return res; } const queue: Node[] = []; diff --git a/src/Corporation/Warehouse.ts b/src/Corporation/Warehouse.ts index 15bdf03b6..4b97ec316 100644 --- a/src/Corporation/Warehouse.ts +++ b/src/Corporation/Warehouse.ts @@ -26,10 +26,10 @@ export class Warehouse { // Text that describes how the space in this Warehouse is being used // Used to create a tooltip in the UI - breakdown: string = ""; + breakdown = ""; // Warehouse's level, which affects its maximum size - level: number = 1; + level = 1; // City that this Warehouse is in loc: string; @@ -41,19 +41,19 @@ export class Warehouse { size: number; // Amount of space currently used by warehouse - sizeUsed: number = 0; + sizeUsed = 0; // Whether Smart Supply is enabled for this Industry (the Industry that this Warehouse is for) - smartSupplyEnabled: boolean = false; + smartSupplyEnabled = false; // Flag that indicates whether Smart Supply accounts for imports when calculating // the amount fo purchase - smartSupplyConsiderExports: boolean = false; + smartSupplyConsiderExports = false; // Stores the amount of product to be produced. Used for Smart Supply unlock. // The production tracked by smart supply is always based on the previous cycle, // so it will always trail the "true" production by 1 cycle - smartSupplyStore: number = 0; + smartSupplyStore = 0; constructor(params: IConstructorParams = {}) { this.loc = params.loc ? params.loc : ""; @@ -70,7 +70,7 @@ export class Warehouse { Drugs: new Material({name: "Drugs"}), Robots: new Material({name: "Robots"}), AICores: new Material({name: "AI Cores"}), - RealEstate: new Material({name: "Real Estate"}) + RealEstate: new Material({name: "Real Estate"}), } if (params.corp && params.industry) { @@ -83,7 +83,7 @@ export class Warehouse { this.sizeUsed = 0; this.breakdown = ""; for (const matName in this.materials) { - var mat = this.materials[matName]; + const mat = this.materials[matName]; if (MaterialSizes.hasOwnProperty(matName)) { this.sizeUsed += (mat.qty * MaterialSizes[matName]); if (mat.qty > 0) { diff --git a/src/Corporation/data/ResearchMetadata.ts b/src/Corporation/data/ResearchMetadata.ts index e19d730b2..921989bb8 100644 --- a/src/Corporation/data/ResearchMetadata.ts +++ b/src/Corporation/data/ResearchMetadata.ts @@ -82,7 +82,7 @@ export const researchMetadata: IConstructorParams[] = [ cost: 15e3, desc: "Use automated software to handle the hiring of employees. With this " + "research, each office will automatically hire one employee per " + - "market cycle if there is available space." + "market cycle if there is available space.", }, { @@ -90,7 +90,7 @@ export const researchMetadata: IConstructorParams[] = [ cost: 20e3, desc: "Use automated software to handle the training of employees. With this " + "research, each employee hired with HRBuddy-Recruitment will automatically " + - "be assigned to 'Training', rather than being unassigned." + "be assigned to 'Training', rather than being unassigned.", }, { name: "JoyWire", diff --git a/src/Corporation/ui/CorporationUIEventHandler.js b/src/Corporation/ui/CorporationUIEventHandler.js index 0d1eaa336..04920fab3 100644 --- a/src/Corporation/ui/CorporationUIEventHandler.js +++ b/src/Corporation/ui/CorporationUIEventHandler.js @@ -61,13 +61,13 @@ export class CorporationEventHandler { createBribeFactionsPopup() { const popupId = "cmpy-mgmt-bribe-factions-popup"; const txt = createElement("p", { - innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation" + innerText:"You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation", }); const factionSelector = createElement("select", { margin:"3px" }); for (let i = 0; i < Player.factions.length; ++i) { const facName = Player.factions[i]; factionSelector.add(createElement("option", { - text: facName, value: facName + text: facName, value: facName, })); } var repGainText = createElement("p"); @@ -93,7 +93,7 @@ export class CorporationEventHandler { factionSelector.options[factionSelector.selectedIndex].value + " with this bribe"; } - } + }, }); stockSharesInput = createElement("input", { type:"number", placeholder:"Stock Shares", margin: "5px", @@ -115,7 +115,7 @@ export class CorporationEventHandler { factionSelector.options[factionSelector.selectedIndex].value + " with this bribe"; } - } + }, }); var confirmButton = createElement("button", { class:"a-link-button", innerText:"Bribe", display:"inline-block", @@ -145,7 +145,7 @@ export class CorporationEventHandler { removeElementById(popupId); return false; } - } + }, }); const cancelButton = createPopupCloseButton(popupId, { class: "std-button", @@ -187,7 +187,7 @@ export class CorporationEventHandler { costIndicator.innerText = "Purchase " + numShares + " shares for a total of " + numeralWrapper.format(numShares * buybackPrice, '$0.000a'); } - } + }, }); var confirmBtn = createElement("button", { class:"a-link-button", innerText:"Buy shares", display:"inline-block", @@ -221,7 +221,7 @@ export class CorporationEventHandler { } return false; - } + }, }); var cancelBtn = createPopupCloseButton(popupId, { class: "std-button", @@ -249,7 +249,7 @@ export class CorporationEventHandler { removeElementById(popupId); this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { innerText: "Cancel" }); @@ -264,7 +264,7 @@ export class CorporationEventHandler { const exportTxt = createElement("p", { innerText:"Select the industry and city to export this material to, as well as " + "how much of this material to export per second. You can set the export " + - "amount to 'MAX' to export all of the materials in this warehouse." + "amount to 'MAX' to export all of the materials in this warehouse.", }); //Select industry and city to export to @@ -286,7 +286,7 @@ export class CorporationEventHandler { return; } } - } + }, }); for (let i = 0; i < corp.divisions.length; ++i) { @@ -299,7 +299,7 @@ export class CorporationEventHandler { //Select amount to export const exportAmount = createElement("input", { class: "text-input", - placeholder:"Export amount / s" + placeholder:"Export amount / s", }); const exportBtn = createElement("button", { @@ -328,14 +328,14 @@ export class CorporationEventHandler { mat.exp.push(exportObj); removeElementById(popupId); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { innerText: "Cancel" }); const currExportsText = createElement("p", { innerText:"Below is a list of all current exports of this material from this warehouse. " + - "Clicking on one of the exports below will REMOVE that export." + "Clicking on one of the exports below will REMOVE that export.", }); const currExports = []; for (var i = 0; i < mat.exp.length; ++i) { @@ -349,7 +349,7 @@ export class CorporationEventHandler { mat.exp.splice(i, 1); //Remove export object removeElementById(popupId); createExportMaterialPopup(mat); - } + }, })); })(i, mat, currExports); } @@ -385,7 +385,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {allocateBtn.click();} - } + }, }); allocateBtn = createElement("button", { @@ -404,7 +404,7 @@ export class CorporationEventHandler { this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { @@ -478,7 +478,7 @@ export class CorporationEventHandler { } else { updateDynamicText(this.corp); } - } + }, }); issueBtn = createElement("button", { @@ -523,7 +523,7 @@ export class CorporationEventHandler { this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { @@ -541,7 +541,7 @@ export class CorporationEventHandler { const popupId = "cmpy-mgmt-limit-product-production-popup"; const txt = createElement("p", { innerText:"Enter a limit to the amount of this product you would " + - "like to product per second. Leave the box empty to set no limit." + "like to product per second. Leave the box empty to set no limit.", }); let confirmBtn; const input = createElement("input", { @@ -551,7 +551,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) { confirmBtn.click(); } - } + }, }); confirmBtn = createElement("button", { class: "std-button", @@ -578,7 +578,7 @@ export class CorporationEventHandler { removeElementById(popupId); this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { innerText: "Cancel" }); cancelBtn.style.margin = "6px"; @@ -600,7 +600,7 @@ export class CorporationEventHandler { if (division.offices[cityName] instanceof OfficeSpace) { designCity.add(createElement("option", { value: cityName, - text: cityName + text: cityName, })); } } @@ -630,7 +630,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) { confirmBtn.click(); } - } + }, }); confirmBtn = createElement("button", { class: "std-button", @@ -665,7 +665,7 @@ export class CorporationEventHandler { } this.rerender(); return false; - } + }, }) const cancelBtn = createPopupCloseButton(popupId, { class: "std-button", @@ -699,7 +699,7 @@ export class CorporationEventHandler { for: useTa1AutoSaleId, innerText: "Use Market-TA.I for Auto-Sale Price", tooltip: "If this is enabled, then this Material will automatically " + - "be sold at the price identified by Market-TA.I (i.e. the price shown above)" + "be sold at the price identified by Market-TA.I (i.e. the price shown above)", }) const useTa1AutoSaleCheckbox = createElement("input", { checked: mat.marketTa1, @@ -708,7 +708,7 @@ export class CorporationEventHandler { type: "checkbox", changeListener: (e) => { mat.marketTa1 = e.target.checked; - } + }, }); useTa1AutoSaleDiv.appendChild(useTa1AutoSaleLabel); useTa1AutoSaleDiv.appendChild(useTa1AutoSaleCheckbox); @@ -766,7 +766,7 @@ export class CorporationEventHandler { tooltip: "If this is enabled, then this Material will automatically " + "be sold at the optimal price such that the amount sold matches the " + "amount produced. (i.e. the highest possible price, while still ensuring " + - " that all produced materials will be sold)" + " that all produced materials will be sold)", }) const useTa2AutoSaleCheckbox = createElement("input", { checked: mat.marketTa2, @@ -775,14 +775,14 @@ export class CorporationEventHandler { type: "checkbox", changeListener: (e) => { mat.marketTa2 = e.target.checked; - } + }, }); useTa2AutoSaleDiv.appendChild(useTa2AutoSaleLabel); useTa2AutoSaleDiv.appendChild(useTa2AutoSaleCheckbox); const ta2OverridesTa1 = createElement("p", { innerText: "Note that Market-TA.II overrides Market-TA.I. This means that if " + - "both are enabled, then Market-TA.II will take effect, not Market-TA.I" + "both are enabled, then Market-TA.II will take effect, not Market-TA.I", }); createPopup(popupId, [ta1, useTa1AutoSaleDiv, ta2Text, ta2Input, useTa2AutoSaleDiv, ta2OverridesTa1, closeBtn]); @@ -805,7 +805,7 @@ export class CorporationEventHandler { if (!(division.offices[cityName] instanceof OfficeSpace)) { citySelector.add(createElement("option", { text: cityName, - value: cityName + value: cityName, })); } } @@ -832,7 +832,7 @@ export class CorporationEventHandler { removeElementById(popupId); this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { class: "std-button", @@ -852,7 +852,7 @@ export class CorporationEventHandler { innerHTML: "Create a new division to expand into a new industry:", }); var selector = createElement("select", { - class:"dropdown" + class:"dropdown", }); var industryDescription = createElement("p", {}); var yesBtn; @@ -866,11 +866,11 @@ export class CorporationEventHandler { onkeyup:(e)=>{ e.preventDefault(); if (e.keyCode === KEY.ENTER) {yesBtn.click();} - } + }, }); var nameLabel = createElement("label", { for:"cmpy-mgmt-expand-industry-name-input", - innerText:"Division name: " + innerText:"Division name: ", }); yesBtn = createElement("span", { class:"popup-box-button", @@ -905,7 +905,7 @@ export class CorporationEventHandler { this.rerender(); } return false; - } + }, }); const noBtn = createPopupCloseButton(popupId, { @@ -923,7 +923,7 @@ export class CorporationEventHandler { // Have Agriculture be first as recommended option if (!ownedIndustries["Agriculture"]) { selector.add(createElement("option", { - text:Industries["Agriculture"], value:"Agriculture" + text:Industries["Agriculture"], value:"Agriculture", })); } @@ -984,7 +984,7 @@ export class CorporationEventHandler { for: useTa1AutoSaleId, innerText: "Use Market-TA.I for Auto-Sale Price", tooltip: "If this is enabled, then this Product will automatically " + - "be sold at the price identified by Market-TA.I (i.e. the price shown above)" + "be sold at the price identified by Market-TA.I (i.e. the price shown above)", }) const useTa1AutoSaleCheckbox = createElement("input", { checked: product.marketTa1, @@ -993,7 +993,7 @@ export class CorporationEventHandler { type: "checkbox", changeListener: (e) => { product.marketTa1 = e.target.checked; - } + }, }); useTa1AutoSaleDiv.appendChild(useTa1AutoSaleLabel); useTa1AutoSaleDiv.appendChild(useTa1AutoSaleCheckbox); @@ -1043,7 +1043,7 @@ export class CorporationEventHandler { tooltip: "If this is enabled, then this Product will automatically " + "be sold at the optimal price such that the amount sold matches the " + "amount produced. (i.e. the highest possible price, while still ensuring " + - " that all produced materials will be sold)" + " that all produced materials will be sold)", }) const useTa2AutoSaleCheckbox = createElement("input", { checked: product.marketTa2, @@ -1052,14 +1052,14 @@ export class CorporationEventHandler { type: "checkbox", changeListener: (e) => { product.marketTa2 = e.target.checked; - } + }, }); useTa2AutoSaleDiv.appendChild(useTa2AutoSaleLabel); useTa2AutoSaleDiv.appendChild(useTa2AutoSaleCheckbox); const ta2OverridesTa1 = createElement("p", { innerText: "Note that Market-TA.II overrides Market-TA.I. This means that if " + - "both are enabled, then Market-TA.II will take effect, not Market-TA.I" + "both are enabled, then Market-TA.II will take effect, not Market-TA.I", }); createPopup(popupId, [ta1, useTa1AutoSaleDiv, ta2Text, ta2Input, useTa2AutoSaleDiv, ta2OverridesTa1, closeBtn]); @@ -1076,7 +1076,7 @@ export class CorporationEventHandler { const purchasePopupId = "cmpy-mgmt-material-purchase-popup"; const txt = createElement("p", { innerHTML: "Enter the amount of " + mat.name + " you would like " + - "to purchase per second. This material's cost changes constantly" + "to purchase per second. This material's cost changes constantly", }); let confirmBtn; let input = createElement("input", { @@ -1087,7 +1087,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {confirmBtn.click();} - } + }, }); confirmBtn = createElement("button", { innerText: "Confirm", class: "std-button", @@ -1101,7 +1101,7 @@ export class CorporationEventHandler { this.rerender(); return false; } - } + }, }); const clearButton = createElement("button", { innerText: "Clear Purchase", class: "std-button", @@ -1110,7 +1110,7 @@ export class CorporationEventHandler { removeElementById(purchasePopupId); this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(purchasePopupId, { class: "std-button", @@ -1153,7 +1153,7 @@ export class CorporationEventHandler { e.preventDefault(); updateBulkPurchaseText(e.target.value); if (e.keyCode === KEY.ENTER) {bulkPurchaseConfirmBtn.click();} - } + }, }); bulkPurchaseConfirmBtn = createElement("button", { @@ -1184,7 +1184,7 @@ export class CorporationEventHandler { removeElementById(purchasePopupId); return false; } - } + }, }) elems.push(bulkPurchaseInfo); @@ -1224,7 +1224,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {confirmBtn.click();} - } + }, }); let inputButtonInitValue = mat.sCost ? mat.sCost : null; @@ -1241,7 +1241,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {confirmBtn.click();} - } + }, }); confirmBtn = createElement("button", { class: "std-button", @@ -1307,7 +1307,7 @@ export class CorporationEventHandler { removeElementById(sellPopupId); this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(sellPopupId, { class: "std-button", @@ -1347,7 +1347,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {confirmBtn.click();} - } + }, }); let inputButtonInitValue = product.sCost ? product.sCost : null; @@ -1365,7 +1365,7 @@ export class CorporationEventHandler { onkeyup: (e) => { e.preventDefault(); if (e.keyCode === KEY.ENTER) {confirmBtn.click();} - } + }, }); const checkboxDiv = createElement("div", { border: "1px solid white", @@ -1478,7 +1478,7 @@ export class CorporationEventHandler { removeElementById(popupId); this.rerender(); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { class: "std-button" }); @@ -1520,7 +1520,7 @@ export class CorporationEventHandler { profitIndicator.innerText = "Sell " + numShares + " shares for a total of " + numeralWrapper.format(profit, '$0.000a'); } - } + }, }); const confirmBtn = createElement("button", { class:"a-link-button", innerText:"Sell shares", display:"inline-block", @@ -1562,7 +1562,7 @@ export class CorporationEventHandler { return false; } - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { class: "std-button", @@ -1579,10 +1579,10 @@ export class CorporationEventHandler { const popupId = "cmpy-mgmt-throw-office-party-popup"; const txt = createElement("p", { innerText:"Enter the amount of money you would like to spend PER EMPLOYEE " + - "on this office party" + "on this office party", }); const totalCostTxt = createElement("p", { - innerText:"Throwing this party will cost a total of $0" + innerText:"Throwing this party will cost a total of $0", }); let confirmBtn; const input = createElement("input", { @@ -1598,7 +1598,7 @@ export class CorporationEventHandler { onkeyup:(e)=>{ e.preventDefault(); if (e.keyCode === KEY.ENTER) {confirmBtn.click();} - } + }, }); confirmBtn = createElement("button", { class: "std-button", @@ -1622,7 +1622,7 @@ export class CorporationEventHandler { } } return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { class: "std-button", innerText: "Cancel" }); @@ -1661,7 +1661,7 @@ export class CorporationEventHandler { const upgradeCostMax = OfficeInitialCost * mult; const text = createElement("p", { - innerText:"Increase the size of your office space to fit additional employees!" + innerText:"Increase the size of your office space to fit additional employees!", }); const text2 = createElement("p", { innerText: "Upgrade size: " }); @@ -1680,7 +1680,7 @@ export class CorporationEventHandler { } removeElementById(popupId); return false; - } + }, }); const confirmBtn15 = createElement("button", { class: this.corp.funds.lt(upgradeCost15) ? "a-link-button-inactive" : "a-link-button", @@ -1697,7 +1697,7 @@ export class CorporationEventHandler { } removeElementById(popupId); return false; - } + }, }); const confirmBtnMax = createElement("button", { class:this.corp.funds.lt(upgradeCostMax) ? "a-link-button-inactive" : "a-link-button", @@ -1714,7 +1714,7 @@ export class CorporationEventHandler { } removeElementById(popupId); return false; - } + }, }); const cancelBtn = createPopupCloseButton(popupId, { innerText: "Cancel" }); cancelBtn.style.margin = "4px"; diff --git a/src/Corporation/ui/HeaderTabs.jsx b/src/Corporation/ui/HeaderTabs.jsx index a0e6fd1da..b83b02d63 100644 --- a/src/Corporation/ui/HeaderTabs.jsx +++ b/src/Corporation/ui/HeaderTabs.jsx @@ -71,7 +71,7 @@ export class HeaderTabs extends BaseReactComponent { { this.renderTab({ onClick: this.eventHandler().createNewIndustryPopup.bind(this.eventHandler()), - text: "Expand into new Industry" + text: "Expand into new Industry", }) } diff --git a/src/Corporation/ui/Overview.jsx b/src/Corporation/ui/Overview.jsx index 0c7c26d33..c33297e3c 100644 --- a/src/Corporation/ui/Overview.jsx +++ b/src/Corporation/ui/Overview.jsx @@ -158,7 +158,7 @@ export class Overview extends BaseReactComponent { onClick: findInvestorsOnClick, style: "inline-block", text: "Find Investors", - tooltip: findInvestorsTooltip + tooltip: findInvestorsTooltip, }); const goPublicBtn = this.createButton({ class: "std-button", @@ -167,7 +167,7 @@ export class Overview extends BaseReactComponent { text: "Go Public", tooltip: "Become a publicly traded and owned entity. Going public " + "involves issuing shares for an IPO. Once you are a public " + - "company, your shares will be traded on the stock market." + "company, your shares will be traded on the stock market.", }); return ( diff --git a/src/Corporation/ui/Routing.ts b/src/Corporation/ui/Routing.ts index 5e2c023fb..ec863bdfe 100644 --- a/src/Corporation/ui/Routing.ts +++ b/src/Corporation/ui/Routing.ts @@ -1,6 +1,6 @@ import { IMap } from "../../types"; -export const overviewPage: string = "Overview"; +export const overviewPage = "Overview"; // Interfaces for whatever's required to sanitize routing with Corporation Data interface IOfficeSpace { @@ -9,7 +9,7 @@ interface IOfficeSpace { interface IDivision { name: string; - offices: IMap + offices: IMap; } interface ICorporation { @@ -76,7 +76,7 @@ export class CorporationRouting { for (let i = 0; i < this.corp.divisions.length; ++i) { if (this.corp.divisions[i].name === page) { this.currentDivision = this.corp.divisions[i]; - }; + } } // 'currentDivision' should not be null, since the routing is either on diff --git a/src/Crime/Crime.ts b/src/Crime/Crime.ts index 176069cf7..bbff32d4b 100644 --- a/src/Crime/Crime.ts +++ b/src/Crime/Crime.ts @@ -22,49 +22,49 @@ export interface IConstructorParams { export class Crime { // Number representing the difficulty of the crime. Used for success chance calculations - difficulty: number = 0; + difficulty = 0; // Amount of karma lost for SUCCESSFULLY committing this crime - karma: number = 0; + karma = 0; // How many people die as a result of this crime - kills: number = 0; + kills = 0; // How much money is given by the - money: number = 0; + money = 0; // Name of crime - name: string = ""; + name = ""; // Milliseconds it takes to attempt the crime - time: number = 0; + time = 0; // Corresponding type in CONSTANTS. Contains a description for the crime activity - type: string = ""; + type = ""; // Weighting factors that determine how stats affect the success rate of this crime - hacking_success_weight: number = 0; - strength_success_weight: number = 0; - defense_success_weight: number = 0; - dexterity_success_weight: number = 0; - agility_success_weight: number = 0; - charisma_success_weight: number = 0; + hacking_success_weight = 0; + strength_success_weight = 0; + defense_success_weight = 0; + dexterity_success_weight = 0; + agility_success_weight = 0; + charisma_success_weight = 0; // How much stat experience is granted by this crime - hacking_exp: number = 0; - strength_exp: number = 0; - defense_exp: number = 0; - dexterity_exp: number = 0; - agility_exp: number = 0; - charisma_exp: number = 0; - intelligence_exp: number = 0; + hacking_exp = 0; + strength_exp = 0; + defense_exp = 0; + dexterity_exp = 0; + agility_exp = 0; + charisma_exp = 0; + intelligence_exp = 0; - constructor(name: string = "", - type: string = "", - time: number = 0, - money: number = 0, - difficulty: number = 0, - karma: number = 0, + constructor(name = "", + type = "", + time = 0, + money = 0, + difficulty = 0, + karma = 0, params: IConstructorParams={}) { this.name = name; this.type = type; @@ -91,7 +91,7 @@ export class Crime { this.kills = params.kills ? params.kills : 0; } - commit(p: IPlayer, div: number=1, singParams: any=null): number { + commit(p: IPlayer, div=1, singParams: any=null): number { if (div <= 0) { div = 1; } p.startCrime( this.type, @@ -103,7 +103,7 @@ export class Crime { this.charisma_exp/div, this.money/div, this.time, - singParams + singParams, ); return this.time; diff --git a/src/Crime/CrimeHelpers.ts b/src/Crime/CrimeHelpers.ts index 27b2fd233..40b2786d3 100644 --- a/src/Crime/CrimeHelpers.ts +++ b/src/Crime/CrimeHelpers.ts @@ -4,10 +4,10 @@ import { IPlayer } from "../PersonObjects/IPlayer"; import { dialogBoxCreate } from "../../utils/DialogBox"; export function determineCrimeSuccess(p: IPlayer, type: string) { - let chance: number = 0; - let found: boolean = false; + let chance = 0; + let found = false; for (const i in Crimes) { - let crime = Crimes[i]; + const crime = Crimes[i]; if (crime.type == type) { chance = crime.successRate(p); found = true; diff --git a/src/DevMenu.jsx b/src/DevMenu.jsx index b1c9167e7..f6b75ba55 100644 --- a/src/DevMenu.jsx +++ b/src/DevMenu.jsx @@ -3,7 +3,7 @@ import { CodingContractTypes } from "./CodingContracts"; import { generateContract, generateRandomContract, - generateRandomContractOnHome + generateRandomContractOnHome, } from "./CodingContractGenerator"; import { Companies } from "./Company/Companies"; import { Company } from "./Company/Company"; @@ -47,9 +47,11 @@ class ValueAdjusterComponent extends Component { this.state = { value: '' }; this.setValue = this.setValue.bind(this); } + setValue(event) { this.setState({ value: parseFloat(event.target.value) }); } + render() { const { title, add, subtract, reset } = this.props; const { value } = this.state; @@ -496,7 +498,7 @@ class DevMenuComponent extends Component { modifyBladeburnerRank(modify) { return function(rank) { - if (!!Player.bladeburner) { + if (Player.bladeburner) { Player.bladeburner.changeRank(rank*modify); } } @@ -508,67 +510,67 @@ class DevMenuComponent extends Component { } addTonsBladeburnerRank() { - if (!!Player.bladeburner) { + if (Player.bladeburner) { Player.bladeburner.changeRank(tonsP); } } modifyBladeburnerCycles(modify) { return function(cycles) { - if (!!Player.bladeburner) { + if (Player.bladeburner) { Player.bladeburner.storedCycles += cycles*modify; } } } resetBladeburnerCycles() { - if (!!Player.bladeburner) { + if (Player.bladeburner) { Player.bladeburner.storedCycles = 0; } } addTonsBladeburnerCycles() { - if (!!Player.bladeburner) { + if (Player.bladeburner) { Player.bladeburner.storedCycles += tonsP; } } addTonsGangCycles() { - if (!!Player.gang) { + if (Player.gang) { Player.gang.storedCycles = tonsP; } } modifyGangCycles(modify) { return function(cycles) { - if (!!Player.gang) { + if (Player.gang) { Player.gang.storedCycles += cycles*modify; } } } resetGangCycles() { - if (!!Player.gang) { + if (Player.gang) { Player.gang.storedCycles = 0; } } addTonsCorporationCycles() { - if (!!Player.corporation) { + if (Player.corporation) { Player.corporation.storedCycles = tonsP; } } modifyCorporationCycles(modify) { return function(cycles) { - if (!!Player.corporation) { + if (Player.corporation) { Player.corporation.storedCycles += cycles*modify; } } } resetCorporationCycles() { - if (!!Player.corporation) { + if (Player.corporation) { Player.corporation.storedCycles = 0; } } @@ -674,7 +676,7 @@ class DevMenuComponent extends Component { - + , )); diff --git a/src/Faction/Faction.ts b/src/Faction/Faction.ts index 2bf4b372e..4052398b3 100644 --- a/src/Faction/Faction.ts +++ b/src/Faction/Faction.ts @@ -15,7 +15,7 @@ export class Faction { * Flag signalling whether the player has already received an invitation * to this faction */ - alreadyInvited: boolean = false; + alreadyInvited = false; /** * Holds names of all augmentations that this Faction offers @@ -25,35 +25,35 @@ export class Faction { /** * Amount of favor the player has with this faction. */ - favor: number = 0; + favor = 0; /** * Flag signalling whether player has been banned from this faction */ - isBanned: boolean = false; + isBanned = false; /** * Flag signalling whether player is a member of this faction */ - isMember: boolean = false; + isMember = false; /** * Name of faction */ - name: string = ""; + name = ""; /** * Amount of reputation player has with this faction */ - playerReputation: number = 0; + playerReputation = 0; /** * Reputation from the last "prestige" that was not converted to favor. * This reputation rolls over and is used for the next favor calculation */ - rolloverRep: number = 0; + rolloverRep = 0; - constructor(name: string="") { + constructor(name="") { this.name = name; } @@ -82,7 +82,7 @@ export class Faction { getFavorGain(): number[] { if (this.favor == null) { this.favor = 0; } if (this.rolloverRep == null) { this.rolloverRep = 0; } - var favorGain = 0, rep = this.playerReputation + this.rolloverRep; + let favorGain = 0, rep = this.playerReputation + this.rolloverRep; let reqdRep = CONSTANTS.FactionReputationToFavorBase * Math.pow(CONSTANTS.FactionReputationToFavorMult, this.favor); while(rep > 0) { diff --git a/src/Faction/FactionHelpers.jsx b/src/Faction/FactionHelpers.jsx index 0926b2faf..c50343976 100644 --- a/src/Faction/FactionHelpers.jsx +++ b/src/Faction/FactionHelpers.jsx @@ -27,7 +27,7 @@ import { factionInvitationBoxCreate } from "../../utils/FactionInvitationBox"; import { Reviver, Generic_toJSON, - Generic_fromJSON + Generic_fromJSON, } from "../../utils/JSONReviver"; import { formatNumber } from "../../utils/StringHelperFunctions"; import { numeralWrapper } from "../ui/numeralFormat"; @@ -36,7 +36,7 @@ import { yesNoBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, - yesNoBoxClose + yesNoBoxClose, } from "../../utils/YesNoBox"; export function inviteToFaction(faction) { @@ -90,7 +90,7 @@ export function displayFactionContent(factionName, initiallyOnAugmentationsPage= p={Player} startHackingMissionFn={startHackingMission} />, - Engine.Display.factionContent + Engine.Display.factionContent, ) } diff --git a/src/Faction/Factions.ts b/src/Faction/Factions.ts index a5c05e809..2fa0b8f2f 100644 --- a/src/Faction/Factions.ts +++ b/src/Faction/Factions.ts @@ -25,7 +25,7 @@ export function factionExists(name: string): boolean { return Factions.hasOwnProperty(name); } -export function initFactions(bitNode: number=1) { +export function initFactions(bitNode=1) { for (const name in FactionInfos) { resetFaction(new Faction(name)); } diff --git a/src/Faction/ui/AugmentationsPage.tsx b/src/Faction/ui/AugmentationsPage.tsx index c950c8291..69c008ebe 100644 --- a/src/Faction/ui/AugmentationsPage.tsx +++ b/src/Faction/ui/AugmentationsPage.tsx @@ -77,7 +77,7 @@ export class AugmentationsPage extends React.Component { getAugsSortedByCost(): string[] { const augs = this.getAugs(); augs.sort((augName1, augName2)=>{ - var aug1 = Augmentations[augName1], aug2 = Augmentations[augName2]; + const aug1 = Augmentations[augName1], aug2 = Augmentations[augName2]; if (aug1 == null || aug2 == null) { throw new Error("Invalid Augmentation Names"); } @@ -91,7 +91,7 @@ export class AugmentationsPage extends React.Component { getAugsSortedByReputation(): string[] { const augs = this.getAugs(); augs.sort((augName1, augName2)=>{ - var aug1 = Augmentations[augName1], aug2 = Augmentations[augName2]; + const aug1 = Augmentations[augName1], aug2 = Augmentations[augName2]; if (aug1 == null || aug2 == null) { throw new Error("Invalid Augmentation Names"); } @@ -120,10 +120,9 @@ export class AugmentationsPage extends React.Component { render() { const augs = this.getAugsSorted(); - const purchasable = augs.filter((aug: string) => - aug === AugmentationNames.NeuroFluxGovernor || + const purchasable = augs.filter((aug: string) => aug === AugmentationNames.NeuroFluxGovernor || (!this.props.p.augmentations.some(a => a.name === aug) && - !this.props.p.queuedAugmentations.some(a => a.name === aug)) + !this.props.p.queuedAugmentations.some(a => a.name === aug)), ) const parent = this; diff --git a/src/Faction/ui/DonateOption.tsx b/src/Faction/ui/DonateOption.tsx index acb2e9222..325148d36 100644 --- a/src/Faction/ui/DonateOption.tsx +++ b/src/Faction/ui/DonateOption.tsx @@ -91,7 +91,7 @@ export class DonateOption extends React.Component { return (
    - + { const repCost = this.getRepCost(); // Determine UI properties - let disabled: boolean = false; + let disabled = false; let status: JSX.Element = <>; - let color: string = ""; + let color = ""; if (!this.hasPrereqs()) { disabled = true; status = <>LOCKED (Requires {this.aug.prereqs.map(aug => AugFormat(aug))} as prerequisite); diff --git a/src/Faction/ui/Root.tsx b/src/Faction/ui/Root.tsx index aa0c2a935..64b12e276 100644 --- a/src/Faction/ui/Root.tsx +++ b/src/Faction/ui/Root.tsx @@ -69,7 +69,7 @@ const GangNames = [ "The Dark Army", "Speakers for the Dead", "NiteSec", - "The Black Hand" + "The Black Hand", ]; export class FactionRoot extends React.Component { diff --git a/src/Gang.jsx b/src/Gang.jsx index c9d4a4e91..826a03544 100644 --- a/src/Gang.jsx +++ b/src/Gang.jsx @@ -19,7 +19,7 @@ import { dialogBoxCreate } from "../utils/DialogBox"; import { Reviver, Generic_toJSON, - Generic_fromJSON + Generic_fromJSON, } from "../utils/JSONReviver"; import { formatNumber } from "../utils/StringHelperFunctions"; @@ -90,7 +90,7 @@ const GangNames = [ "The Dark Army", "Speakers for the Dead", "NiteSec", - "The Black Hand" + "The Black Hand", ]; export let AllGangs = { @@ -1055,14 +1055,14 @@ Gang.prototype.createGangMemberUpgradeBox = function(player, initialFilter="") { onkeyup:() => { var filterValue = UIElems.gangMemberUpgradeBoxFilter.value.toString(); this.createGangMemberUpgradeBox(player, filterValue); - } + }, }); UIElems.gangMemberUpgradeBoxDiscount = createElement("p", { innerText: "Discount: -" + numeralWrapper.formatPercentage(1 - 1 / this.getDiscount()), marginLeft: "6px", tooltip: "You get a discount on equipment and upgrades based on your gang's " + - "respect and power. More respect and power leads to more discounts." + "respect and power. More respect and power leads to more discounts.", }); UIElems.gangMemberUpgradeBoxElements = [UIElems.gangMemberUpgradeBoxFilter, UIElems.gangMemberUpgradeBoxDiscount]; @@ -1087,7 +1087,7 @@ GangMember.prototype.createGangMemberUpgradePanel = function(gangObj, player) { }); var header = createElement("h1", { - innerText: this.name + " (" + this.task + ")" + innerText: this.name + " (" + this.task + ")", }); container.appendChild(header); @@ -1192,7 +1192,7 @@ GangMember.prototype.createGangMemberUpgradePanel = function(gangObj, player) { clickListener:() => { memberObj.buyUpgrade(upg, player, gangObj); return false; - } + }, } // For the last two divs, tooltip should be on the left @@ -1278,7 +1278,7 @@ Gang.prototype.displayGangContent = function(player) { Engine.loadFactionContent(); displayFactionContent(facName); return false; - } + }, })); // Buttons to switch between panels @@ -1294,7 +1294,7 @@ Gang.prototype.displayGangContent = function(player) { UIElems.territoryButton.classList.toggle("a-link-button"); this.updateGangContent(); return false; - } + }, }) UIElems.territoryButton = createElement("a", { id:"gang-territory-subpage-button", class:"a-link-button", @@ -1308,7 +1308,7 @@ Gang.prototype.displayGangContent = function(player) { UIElems.territoryButton.classList.toggle("a-link-button"); this.updateGangContent(); return false; - } + }, }); UIElems.gangContainer.appendChild(UIElems.managementButton); UIElems.gangContainer.appendChild(UIElems.territoryButton); @@ -1338,7 +1338,7 @@ Gang.prototype.displayGangContent = function(player) { "Installing Augmentations does NOT reset your progress with your Gang. " + "Furthermore, after installing Augmentations, you will " + "automatically be a member of whatever Faction you created your gang with.

    " + - "You can also manage your gang programmatically through Netscript using the Gang API" + "You can also manage your gang programmatically through Netscript using the Gang API", }); UIElems.gangManagementSubpage.appendChild(UIElems.gangDesc); @@ -1399,7 +1399,7 @@ Gang.prototype.displayGangContent = function(player) { }); createPopup(popupId, [txt, br, nameInput, yesBtn, noBtn]); nameInput.focus(); - } + }, }); UIElems.gangManagementSubpage.appendChild(UIElems.gangRecruitMemberButton); @@ -1425,7 +1425,7 @@ Gang.prototype.displayGangContent = function(player) { } } return false; - } + }, }); UIElems.gangCollapseAllButton = createElement("a", { class:"a-link-button", display:"inline-block", @@ -1439,21 +1439,21 @@ Gang.prototype.displayGangContent = function(player) { } } return false; - } + }, }); UIElems.gangMemberFilter = createElement("input", { type:"text", placeholder:"Filter gang members", margin:"5px", padding:"5px", class:"text-input", onkeyup:() => { this.displayGangMemberList(); - } + }, }); UIElems.gangManageEquipmentButton = createElement("a", { class:"a-link-button", display:"inline-block", innerHTML:"Manage Equipment", clickListener: () => { this.createGangMemberUpgradeBox(player); - } + }, }); UIElems.gangManagementSubpage.appendChild(UIElems.gangExpandAllButton); UIElems.gangManagementSubpage.appendChild(UIElems.gangCollapseAllButton); @@ -1467,7 +1467,7 @@ Gang.prototype.displayGangContent = function(player) { // Subpage for seeing gang territory information UIElems.gangTerritorySubpage = createElement("div", { - id:"gang-territory-subpage", display:"none" + id:"gang-territory-subpage", display:"none", }); // Info text for territory page @@ -1485,7 +1485,7 @@ Gang.prototype.displayGangContent = function(player) { "NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of whether you win " + "or lose the clash. A gang member being killed results in both respect and power loss for your gang.

    " + "The amount of territory you have affects all aspects of your Gang members' production, including " + - "money, respect, and wanted level. It is very beneficial to have high territory control.

    " + "money, respect, and wanted level. It is very beneficial to have high territory control.

    ", }); UIElems.gangTerritorySubpage.appendChild(UIElems.gangTerritoryDescText); @@ -1654,7 +1654,7 @@ Gang.prototype.updateGangContent = function() { tooltip: "Represents the amount of respect your gang has from other gangs and criminal " + "organizations. Your respect affects the amount of money " + "your gang members will earn, and also determines how much " + - "reputation you are earning with your gang's corresponding Faction." + "reputation you are earning with your gang's corresponding Faction.", })); UIElems.gangInfo.appendChild(createElement("br")); @@ -1664,7 +1664,7 @@ Gang.prototype.updateGangContent = function() { " (" + numeralWrapper.formatWanted(5*this.wantedGainRate) + " / sec)", tooltip: "Represents how much the gang is wanted by law enforcement. The higher " + "your gang's wanted level, the harder it will be for your gang members " + - "to make money and earn respect. Note that the minimum wanted level is 1." + "to make money and earn respect. Note that the minimum wanted level is 1.", })); UIElems.gangInfo.appendChild(createElement("br")); @@ -1673,7 +1673,7 @@ Gang.prototype.updateGangContent = function() { UIElems.gangInfo.appendChild(createElement("p", { // Wanted Level multiplier display: "inline-block", innerText: `Wanted Level Penalty: -${formatNumber(wantedPenalty, 2)}%`, - tooltip: "Penalty for respect and money gain rates due to Wanted Level" + tooltip: "Penalty for respect and money gain rates due to Wanted Level", })); UIElems.gangInfo.appendChild(createElement("br")); @@ -1695,7 +1695,7 @@ Gang.prototype.updateGangContent = function() { UIElems.gangInfo.appendChild(createElement("p", { // Territory multiplier display: "inline-block", innerText: `Territory: ${formatNumber(displayNumber, 3)}%`, - tooltip: "The percentage of total territory your Gang controls" + tooltip: "The percentage of total territory your Gang controls", })); UIElems.gangInfo.appendChild(createElement("br")); @@ -1819,7 +1819,7 @@ Gang.prototype.createGangMemberDisplayElement = function(memberObj) { innerText: "Cancel", }); createPopup(popupId, [txt, confirmBtn, cancelBtn]); - } + }, }); const ascendHelpTip = createElement("div", { class: "help-tip", diff --git a/src/Hacking/netscriptCanHack.ts b/src/Hacking/netscriptCanHack.ts index 204d959a5..ee48ace6a 100644 --- a/src/Hacking/netscriptCanHack.ts +++ b/src/Hacking/netscriptCanHack.ts @@ -15,7 +15,7 @@ function baseCheck(server: Server, fnName: string): IReturnStatus { if (!("requiredHackingSkill" in server)) { return { res: false, - msg: `Cannot ${fnName} ${hostname} server because it is a Hacknet Node` + msg: `Cannot ${fnName} ${hostname} server because it is a Hacknet Node`, } } @@ -33,7 +33,7 @@ export function netscriptCanHack(server: Server, p: IPlayer): IReturnStatus { const initialCheck = baseCheck(server, "hack"); if (!initialCheck.res) { return initialCheck; } - let s = server; + const s = server; if (s.requiredHackingSkill > p.hacking_skill) { return { res: false, diff --git a/src/Hacknet/HacknetHelpers.jsx b/src/Hacknet/HacknetHelpers.jsx index 01877da3e..6a6701591 100644 --- a/src/Hacknet/HacknetHelpers.jsx +++ b/src/Hacknet/HacknetHelpers.jsx @@ -20,7 +20,7 @@ import { generateRandomContract } from "../CodingContractGenerator"; import { iTutorialSteps, iTutorialNextStep, - ITutorial + ITutorial, } from "../InteractiveTutorial"; import { Player } from "../Player"; import { AllServers } from "../Server/AllServers"; diff --git a/src/Hacknet/HacknetNode.ts b/src/Hacknet/HacknetNode.ts index ea3204f29..4fb157a73 100644 --- a/src/Hacknet/HacknetNode.ts +++ b/src/Hacknet/HacknetNode.ts @@ -31,50 +31,50 @@ export class HacknetNode implements IHacknetNode { } // Node's number of cores - cores: number = 1; + cores = 1; // Node's Level - level: number = 1; + level = 1; // Node's production per second - moneyGainRatePerSecond: number = 0; + moneyGainRatePerSecond = 0; // Identifier for Node. Includes the full "name" (hacknet-node-N) name: string; // How long this Node has existed, in seconds - onlineTimeSeconds: number = 0; + onlineTimeSeconds = 0; // Node's RAM (GB) - ram: number = 1; + ram = 1; // Total money earned by this Node - totalMoneyGenerated: number = 0; + totalMoneyGenerated = 0; - constructor(name: string="", prodMult: number=1) { + constructor(name="", prodMult=1) { this.name = name; this.updateMoneyGainRate(prodMult); } // Get the cost to upgrade this Node's number of cores - calculateCoreUpgradeCost(levels: number=1, costMult: number): number { + calculateCoreUpgradeCost(levels=1, costMult: number): number { return calculateCoreUpgradeCost(this.cores, levels, costMult); } // Get the cost to upgrade this Node's level - calculateLevelUpgradeCost(levels: number=1, costMult: number): number { + calculateLevelUpgradeCost(levels=1, costMult: number): number { return calculateLevelUpgradeCost(this.level, levels, costMult); } // Get the cost to upgrade this Node's RAM - calculateRamUpgradeCost(levels: number=1, costMult: number): number { + calculateRamUpgradeCost(levels=1, costMult: number): number { return calculateRamUpgradeCost(this.ram, levels, costMult); } // Process this Hacknet Node in the game loop. // Returns the amount of money generated - process(numCycles: number=1): number { + process(numCycles=1): number { const seconds = numCycles * CONSTANTS.MilliPerCycle / 1000; let gain = this.moneyGainRatePerSecond * seconds; if (isNaN(gain)) { @@ -90,21 +90,21 @@ export class HacknetNode implements IHacknetNode { // Upgrade this Node's number of cores, if possible // Returns a boolean indicating whether new cores were successfully bought - upgradeCore(levels: number=1, prodMult: number): void { + upgradeCore(levels=1, prodMult: number): void { this.cores = Math.min(HacknetNodeConstants.MaxCores, Math.round(this.cores + levels)); this.updateMoneyGainRate(prodMult); } // Upgrade this Node's level, if possible // Returns a boolean indicating whether the level was successfully updated - upgradeLevel(levels: number=1, prodMult: number): void { + upgradeLevel(levels=1, prodMult: number): void { this.level = Math.min(HacknetNodeConstants.MaxLevel, Math.round(this.level + levels)); this.updateMoneyGainRate(prodMult); } // Upgrade this Node's RAM, if possible // Returns a boolean indicating whether the RAM was successfully upgraded - upgradeRam(levels: number=1, prodMult: number): void { + upgradeRam(levels=1, prodMult: number): void { for (let i = 0; i < levels; ++i) { this.ram *= 2; // Ram is always doubled } diff --git a/src/Hacknet/HacknetServer.ts b/src/Hacknet/HacknetServer.ts index 9ea3f53ea..e556bda88 100644 --- a/src/Hacknet/HacknetServer.ts +++ b/src/Hacknet/HacknetServer.ts @@ -22,7 +22,7 @@ import { createRandomIp } from "../../utils/IPAddress"; import { Generic_fromJSON, Generic_toJSON, - Reviver + Reviver, } from "../../utils/JSONReviver"; interface IConstructorParams { @@ -41,25 +41,25 @@ export class HacknetServer extends BaseServer implements IHacknetNode { } // Cache level. Affects hash Capacity - cache: number = 1; + cache = 1; // Number of cores. Improves hash production - cores: number = 1; + cores = 1; // Number of hashes that can be stored by this Hacknet Server - hashCapacity: number = 0; + hashCapacity = 0; // Hashes produced per second - hashRate: number = 0; + hashRate = 0; // Similar to Node level. Improves hash production - level: number = 1; + level = 1; // How long this HacknetServer has existed, in seconds - onlineTimeSeconds: number = 0; + onlineTimeSeconds = 0; // Total number of hashes earned by this server - totalHashesGenerated: number = 0; + totalHashesGenerated = 0; constructor(params: IConstructorParams={ hostname: "", ip: createRandomIp() }) { super(params); @@ -85,7 +85,7 @@ export class HacknetServer extends BaseServer implements IHacknetNode { } // Process this Hacknet Server in the game loop. Returns the number of hashes generated - process(numCycles: number=1): number { + process(numCycles=1): number { const seconds = numCycles * CONSTANTS.MilliPerCycle / 1000; return this.hashRate * seconds; diff --git a/src/Hacknet/HashManager.ts b/src/Hacknet/HashManager.ts index aba43f9ec..49c74e1a1 100644 --- a/src/Hacknet/HashManager.ts +++ b/src/Hacknet/HashManager.ts @@ -22,10 +22,10 @@ export class HashManager { // Max number of hashes this can hold. Equal to the sum of capacities of // all Hacknet Servers - capacity: number = 0; + capacity = 0; // Number of hashes currently in storage - hashes: number = 0; + hashes = 0; // Map of Hash Upgrade Name -> levels in that upgrade upgrades: IMap = {}; diff --git a/src/Hacknet/HashUpgrade.ts b/src/Hacknet/HashUpgrade.ts index db7518518..fe59838ca 100644 --- a/src/Hacknet/HashUpgrade.ts +++ b/src/Hacknet/HashUpgrade.ts @@ -23,25 +23,25 @@ export class HashUpgrade { * Base cost for this upgrade. Every time the upgrade is purchased, * its cost increases by this same amount (so its 1x, 2x, 3x, 4x, etc.) */ - costPerLevel: number = 0; + costPerLevel = 0; /** * Description of what the upgrade does */ - desc: string = ""; + desc = ""; /** * Boolean indicating that this upgrade's effect affects a single server, * the "target" server */ - hasTargetServer: boolean = false; + hasTargetServer = false; // Name of upgrade - name: string = ""; + name = ""; // Generic value used to indicate the potency/amount of this upgrade's effect // The meaning varies between different upgrades - value: number = 0; + value = 0; constructor(p: IConstructorParams) { if (p.cost != null) { this.cost = p.cost; } diff --git a/src/Hacknet/formulas/HacknetNodes.ts b/src/Hacknet/formulas/HacknetNodes.ts index 717ab3aeb..176027c98 100644 --- a/src/Hacknet/formulas/HacknetNodes.ts +++ b/src/Hacknet/formulas/HacknetNodes.ts @@ -14,7 +14,7 @@ export function calculateMoneyGainRate(level: number, ram: number, cores: number BitNodeMultipliers.HacknetNodeMoney; } -export function calculateLevelUpgradeCost(startingLevel: number, extraLevels: number=1, costMult: number=1): number { +export function calculateLevelUpgradeCost(startingLevel: number, extraLevels=1, costMult=1): number { const sanitizedLevels = Math.round(extraLevels); if (isNaN(sanitizedLevels) || sanitizedLevels < 1) { return 0; @@ -35,7 +35,7 @@ export function calculateLevelUpgradeCost(startingLevel: number, extraLevels: nu return HacknetNodeConstants.BaseCost / 2 * totalMultiplier * costMult; } -export function calculateRamUpgradeCost(startingRam: number, extraLevels: number=1, costMult: number=1): number { +export function calculateRamUpgradeCost(startingRam: number, extraLevels=1, costMult=1): number { const sanitizedLevels = Math.round(extraLevels); if (isNaN(sanitizedLevels) || sanitizedLevels < 1) { return 0; @@ -64,7 +64,7 @@ export function calculateRamUpgradeCost(startingRam: number, extraLevels: number return totalCost; } -export function calculateCoreUpgradeCost(startingCore: number, extraLevels: number=1, costMult: number=1): number { +export function calculateCoreUpgradeCost(startingCore: number, extraLevels=1, costMult=1): number { const sanitizedCores = Math.round(extraLevels); if (isNaN(sanitizedCores) || sanitizedCores < 1) { return 0; @@ -88,7 +88,7 @@ export function calculateCoreUpgradeCost(startingCore: number, extraLevels: numb return totalCost; } -export function calculateNodeCost(n: number, mult: number=1): number { +export function calculateNodeCost(n: number, mult=1): number { if(n <= 0) { return 0; } diff --git a/src/Hacknet/formulas/HacknetServers.ts b/src/Hacknet/formulas/HacknetServers.ts index ef73b12b2..8908da045 100644 --- a/src/Hacknet/formulas/HacknetServers.ts +++ b/src/Hacknet/formulas/HacknetServers.ts @@ -15,7 +15,7 @@ export function calculateHashGainRate(level: number, ramUsed: number, maxRam: nu BitNodeMultipliers.HacknetNodeMoney; } -export function calculateLevelUpgradeCost(startingLevel: number, extraLevels: number=1, costMult: number=1): number { +export function calculateLevelUpgradeCost(startingLevel: number, extraLevels=1, costMult=1): number { const sanitizedLevels = Math.round(extraLevels); if (isNaN(sanitizedLevels) || sanitizedLevels < 1) { return 0; @@ -36,7 +36,7 @@ export function calculateLevelUpgradeCost(startingLevel: number, extraLevels: nu return 10 * HacknetServerConstants.BaseCost * totalMultiplier * costMult; } -export function calculateRamUpgradeCost(startingRam: number, extraLevels: number=1, costMult: number=1): number { +export function calculateRamUpgradeCost(startingRam: number, extraLevels=1, costMult=1): number { const sanitizedLevels = Math.round(extraLevels); if (isNaN(sanitizedLevels) || sanitizedLevels < 1) { return 0; @@ -50,8 +50,8 @@ export function calculateRamUpgradeCost(startingRam: number, extraLevels: number let numUpgrades = Math.round(Math.log2(startingRam)); let currentRam = startingRam; for (let i = 0; i < sanitizedLevels; ++i) { - let baseCost = currentRam * HacknetServerConstants.RamBaseCost; - let mult = Math.pow(HacknetServerConstants.UpgradeRamMult, numUpgrades); + const baseCost = currentRam * HacknetServerConstants.RamBaseCost; + const mult = Math.pow(HacknetServerConstants.UpgradeRamMult, numUpgrades); totalCost += (baseCost * mult); @@ -63,7 +63,7 @@ export function calculateRamUpgradeCost(startingRam: number, extraLevels: number return totalCost; } -export function calculateCoreUpgradeCost(startingCores: number, extraLevels: number=1, costMult: number=1): number { +export function calculateCoreUpgradeCost(startingCores: number, extraLevels=1, costMult=1): number { const sanitizedLevels = Math.round(extraLevels); if (isNaN(sanitizedLevels) || sanitizedLevels < 1) { return 0; @@ -86,7 +86,7 @@ export function calculateCoreUpgradeCost(startingCores: number, extraLevels: num return totalCost; } -export function calculateCacheUpgradeCost(startingCache: number, extraLevels: number=1): number { +export function calculateCacheUpgradeCost(startingCache: number, extraLevels=1): number { const sanitizedLevels = Math.round(extraLevels); if (isNaN(sanitizedLevels) || sanitizedLevels < 1) { return 0; @@ -108,7 +108,7 @@ export function calculateCacheUpgradeCost(startingCache: number, extraLevels: nu return totalCost; } -export function calculateServerCost(n: number, mult: number=1): number { +export function calculateServerCost(n: number, mult=1): number { if (n-1 >= HacknetServerConstants.MaxServers) { return Infinity; } return HacknetServerConstants.BaseCost * Math.pow(HacknetServerConstants.PurchaseMult, n-1) * mult; diff --git a/src/Hacknet/ui/HashUpgradePopup.jsx b/src/Hacknet/ui/HashUpgradePopup.jsx index 7c79b7e3a..77271450c 100644 --- a/src/Hacknet/ui/HashUpgradePopup.jsx +++ b/src/Hacknet/ui/HashUpgradePopup.jsx @@ -36,7 +36,7 @@ class HashUpgrade extends React.Component { changeTargetServer(e) { this.setState({ - selectedServer: e.target.value + selectedServer: e.target.value, }); } diff --git a/src/InteractiveTutorial.js b/src/InteractiveTutorial.js index 064bcefd0..a8e93b71f 100644 --- a/src/InteractiveTutorial.js +++ b/src/InteractiveTutorial.js @@ -42,7 +42,7 @@ const orderedITutorialSteps = [ "HacknetNodesGoToWorldPage", "WorldDescription", "TutorialPageInfo", - "End" + "End", ] // Create an 'enum' for the Steps @@ -500,13 +500,13 @@ function iTutorialEnd() { "Getting Started Guide" + "Documentation

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

    cat " + LiteratureNames.HackersStartingHandbook + "To read it, go to Terminal and enter

    cat " + LiteratureNames.HackersStartingHandbook, }); var gotitBtn = createElement("a", { class:"a-link-button", float:"right", padding:"6px", innerText:"Got it!", clickListener:()=>{ removeElementById(popupId); - } + }, }); createPopup(popupId, [txt, gotitBtn]); diff --git a/src/JSInterpreter.js b/src/JSInterpreter.js index 145423c44..179ca0b74 100644 --- a/src/JSInterpreter.js +++ b/src/JSInterpreter.js @@ -85,7 +85,7 @@ var Interpreter = function(code, opt_initFunc, lineOffset=0) { */ Interpreter.PARSE_OPTIONS = { ecmaVersion: 5, - locations: true + locations: true, }; /** @@ -94,7 +94,7 @@ Interpreter.PARSE_OPTIONS = { Interpreter.READONLY_DESCRIPTOR = { configurable: true, enumerable: true, - writable: false + writable: false, }; /** @@ -103,7 +103,7 @@ Interpreter.READONLY_DESCRIPTOR = { Interpreter.NONENUMERABLE_DESCRIPTOR = { configurable: true, enumerable: false, - writable: true + writable: true, }; /** @@ -112,7 +112,7 @@ Interpreter.NONENUMERABLE_DESCRIPTOR = { Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR = { configurable: true, enumerable: false, - writable: false + writable: false, }; /** @@ -121,7 +121,7 @@ Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR = { Interpreter.VARIABLE_DESCRIPTOR = { configurable: false, enumerable: true, - writable: true + writable: true, }; /** @@ -312,7 +312,7 @@ Interpreter.prototype.initGlobalScope = function(scope) { var strFunctions = [ [escape, 'escape'], [unescape, 'unescape'], [decodeURI, 'decodeURI'], [decodeURIComponent, 'decodeURIComponent'], - [encodeURI, 'encodeURI'], [encodeURIComponent, 'encodeURIComponent'] + [encodeURI, 'encodeURI'], [encodeURIComponent, 'encodeURIComponent'], ]; for (var i = 0; i < strFunctions.length; i++) { var wrapper = (function(nativeFunc) { @@ -1985,8 +1985,8 @@ Interpreter.prototype.nativeToPseudo = function(nativeObj) { Array.prototype.slice.call(arguments) .map(function(i) { return interpreter.pseudoToNative(i); - }) - ) + }), + ), ); }; return this.createNativeFunction(wrapper, undefined); @@ -2033,7 +2033,7 @@ Interpreter.prototype.pseudoToNative = function(pseudoObj, opt_cycles) { var cycles = opt_cycles || { pseudo: [], - native: [] + native: [], }; var i = cycles.pseudo.indexOf(pseudoObj); if (i !== -1) { @@ -2610,7 +2610,7 @@ Interpreter.prototype.setValue = function(ref, value) { BREAK: 1, CONTINUE: 2, RETURN: 3, - THROW: 4 + THROW: 4, }; /** @@ -2691,7 +2691,7 @@ Interpreter.prototype.unwind = function(type, value, label, lineNumberMsg="") { 'ReferenceError': ReferenceError, 'SyntaxError': SyntaxError, 'TypeError': TypeError, - 'URIError': URIError + 'URIError': URIError, }; var name = this.getProperty(value, 'name').toString(); var message = this.getProperty(value, 'message').valueOf(); @@ -3485,7 +3485,7 @@ Interpreter.prototype['stepObjectExpression'] = function(stack, state, node) { configurable: true, enumerable: true, get: kinds['get'], - set: kinds['set'] + set: kinds['set'], }; this.setProperty(state.object_, key, null, descriptor); } else { diff --git a/src/Locations/City.ts b/src/Locations/City.ts index 374b70f09..ed02e1933 100644 --- a/src/Locations/City.ts +++ b/src/Locations/City.ts @@ -20,7 +20,7 @@ export class City { */ asciiArt: string; - constructor(name: CityName, locations: LocationName[]=[], asciiArt: string='') { + constructor(name: CityName, locations: LocationName[]=[], asciiArt='') { this.name = name; this.locations = locations; this.asciiArt = asciiArt; diff --git a/src/Locations/Location.ts b/src/Locations/Location.ts index 7c67efc85..f3c421870 100644 --- a/src/Locations/Location.ts +++ b/src/Locations/Location.ts @@ -33,12 +33,12 @@ export class Location { /** * Cost multiplier that influences how expensive a gym/university is */ - costMult: number = 0; + costMult = 0; /** * Exp multiplier that influences how effective a gym/university is */ - expMult: number = 0; + expMult = 0; /** * Companies can be infiltrated. This contains the data required for that @@ -61,13 +61,13 @@ export class Location { * Tech vendors allow you to purchase servers. * This property defines the max RAM server you can purchase from this vendor */ - techVendorMaxRam: number = 0; + techVendorMaxRam = 0; /** * Tech vendors allow you to purchase servers. * This property defines the max RAM server you can purchase from this vendor */ - techVendorMinRam: number = 0; + techVendorMinRam = 0; constructor(p: IConstructorParams) { if (p.city) { this.city = p.city; } diff --git a/src/Locations/LocationsHelpers.tsx b/src/Locations/LocationsHelpers.tsx index 83465a600..439893c19 100644 --- a/src/Locations/LocationsHelpers.tsx +++ b/src/Locations/LocationsHelpers.tsx @@ -15,7 +15,7 @@ import { safetlyCreateUniqueServer } from "../Server/ServerHelpers"; import { getPurchaseServerCost, purchaseRamForHomeComputer, - purchaseServer + purchaseServer, } from "../Server/ServerPurchases"; import { SpecialServerIps } from "../Server/SpecialServerIps"; import { Settings } from "../Settings/Settings"; @@ -32,7 +32,7 @@ import { yesNoTxtInpBoxGetYesButton, yesNoTxtInpBoxGetNoButton, yesNoTxtInpBoxClose, - yesNoTxtInpBoxCreate + yesNoTxtInpBoxCreate, } from "../../utils/YesNoBox"; import { createElement } from "../../utils/uiHelpers/createElement"; @@ -94,8 +94,8 @@ export function createPurchaseServerPopup(ram: number, p: IPlayer): void { return; } - var yesBtn = yesNoTxtInpBoxGetYesButton(); - var noBtn = yesNoTxtInpBoxGetNoButton(); + const yesBtn = yesNoTxtInpBoxGetYesButton(); + const noBtn = yesNoTxtInpBoxGetNoButton(); if (yesBtn == null || noBtn == null) { return; } yesBtn.innerHTML = "Purchase Server"; noBtn.innerHTML = "Cancel"; @@ -158,7 +158,7 @@ export function createStartCorporationPopup(p: IPlayer) { "and manage your company in the City"); removeElementById(popupId); return false; - } + }, }); const seedMoneyButton = createElement("button", { @@ -179,11 +179,11 @@ export function createStartCorporationPopup(p: IPlayer) { } dialogBoxCreate( "Congratulations! You just started your own corporation with government seed money. " + - "You can visit and manage your company in the City" + "You can visit and manage your company in the City", ); removeElementById(popupId); return false; - } + }, }) const cancelBtn = createPopupCloseButton(popupId, { class: "popup-box-button" }); @@ -214,7 +214,7 @@ export function createUpgradeHomeCoresPopup(p: IPlayer) { 100e12, 1e15, 20e15, - 200e15 + 200e15, ]; const cost: number = allCosts[currentCores]; @@ -231,7 +231,7 @@ export function createUpgradeHomeCoresPopup(p: IPlayer) { p.getHomeComputer().cpuCores++; dialogBoxCreate( "You purchased an additional CPU Core for your home computer! It now has " + - p.getHomeComputer().cpuCores + " cores." + p.getHomeComputer().cpuCores + " cores.", ); } yesNoBoxClose(); @@ -304,7 +304,7 @@ export function purchaseTorRouter(p: IPlayer) { const darkweb = safetlyCreateUniqueServer({ ip: createUniqueRandomIp(), hostname:"darkweb", organizationName:"", - isConnectedTo:false, adminRights:false, purchasedByPlayer:false, maxRam:1 + isConnectedTo:false, adminRights:false, purchasedByPlayer:false, maxRam:1, }); AddToAllServers(darkweb); SpecialServerIps.addIp("Darkweb Server", darkweb.ip); @@ -314,6 +314,6 @@ export function purchaseTorRouter(p: IPlayer) { dialogBoxCreate( "You have purchased a Tor router!
    " + "You now have access to the dark web from your home computer
    " + - "Use the scan/scan-analyze commands to search for the dark web connection." + "Use the scan/scan-analyze commands to search for the dark web connection.", ); } diff --git a/src/Locations/data/LocationNames.ts b/src/Locations/data/LocationNames.ts index 0d9f8d532..dfb48c353 100644 --- a/src/Locations/data/LocationNames.ts +++ b/src/Locations/data/LocationNames.ts @@ -78,4 +78,4 @@ export enum LocationName { // Default name for Location objects Void = "The Void", -}; +} diff --git a/src/Locations/ui/ApplyToJobButton.tsx b/src/Locations/ui/ApplyToJobButton.tsx index 58f464257..0aa369a0a 100644 --- a/src/Locations/ui/ApplyToJobButton.tsx +++ b/src/Locations/ui/ApplyToJobButton.tsx @@ -28,7 +28,7 @@ export class ApplyToJobButton extends React.Component { getJobRequirementTooltip(): string { const pos = this.props.p.getNextCompanyPosition(this.props.company, this.props.entryPosType); - if (pos == null) { return "" }; + if (pos == null) { return "" } if (!this.props.company.hasPosition(pos)) { return ""; } diff --git a/src/Locations/ui/City.tsx b/src/Locations/ui/City.tsx index 79c170d8b..121836e1c 100644 --- a/src/Locations/ui/City.tsx +++ b/src/Locations/ui/City.tsx @@ -23,7 +23,7 @@ export class LocationCity extends React.Component { function LocationLetter(location: LocationName) { if (location) - return + return X return * @@ -37,8 +37,8 @@ export class LocationCity extends React.Component { let locI = 0; function lineElems(s: string) { - let elems: any[] = []; - let matches: any[] = []; + const elems: any[] = []; + const matches: any[] = []; let match: any; while ((match = locationLettersRegex.exec(s)) !== null) { matches.push(match); @@ -48,7 +48,7 @@ export class LocationCity extends React.Component { return elems; } - let parts: any[] = []; + const parts: any[] = []; for(let i = 0; i < matches.length; i++) { const startI = i === 0 ? 0 : matches[i-1].index+1; const endI = matches[i].index; @@ -61,7 +61,7 @@ export class LocationCity extends React.Component { return elems; } - let elems: any[] = []; + const elems: any[] = []; const lines = this.props.city.asciiArt.split('\n'); for(const i in lines) { elems.push(
    {lineElems(lines[i])}
    ) diff --git a/src/Locations/ui/CompanyLocation.tsx b/src/Locations/ui/CompanyLocation.tsx index e3bcd1129..07f7b0441 100644 --- a/src/Locations/ui/CompanyLocation.tsx +++ b/src/Locations/ui/CompanyLocation.tsx @@ -30,7 +30,7 @@ import { yesNoBoxGetYesButton, yesNoBoxGetNoButton, yesNoBoxClose, - yesNoBoxCreate + yesNoBoxCreate, } from "../../../utils/YesNoBox"; type IProps = { @@ -186,7 +186,7 @@ export class CompanyLocation extends React.Component { if (updateState) { this.setState({ - employedHere: this.jobTitle != null + employedHere: this.jobTitle != null, }); } } @@ -218,8 +218,8 @@ export class CompanyLocation extends React.Component { quit(e: React.MouseEvent) { if (!e.isTrusted) { return false; } - var yesBtn = yesNoBoxGetYesButton(); - var noBtn = yesNoBoxGetNoButton(); + const yesBtn = yesNoBoxGetYesButton(); + const noBtn = yesNoBoxGetNoButton(); if (yesBtn == null || noBtn == null) { return; } yesBtn.innerHTML = "Quit job"; noBtn.innerHTML = "Cancel"; diff --git a/src/Locations/ui/GenericLocation.tsx b/src/Locations/ui/GenericLocation.tsx index 5de2e7921..c79a12e71 100644 --- a/src/Locations/ui/GenericLocation.tsx +++ b/src/Locations/ui/GenericLocation.tsx @@ -64,7 +64,7 @@ export class GenericLocation extends React.Component { key={"companylocation"} locName={this.props.loc.name} p={this.props.p} - /> + />, ) } @@ -74,7 +74,7 @@ export class GenericLocation extends React.Component { key={"gymlocation"} loc={this.props.loc} p={this.props.p} - /> + />, ) } @@ -83,7 +83,7 @@ export class GenericLocation extends React.Component { + />, ) } @@ -92,7 +92,7 @@ export class GenericLocation extends React.Component { + />, ) } @@ -103,7 +103,7 @@ export class GenericLocation extends React.Component { key={"speciallocation"} loc={this.props.loc} p={this.props.p} - /> + />, ) } @@ -113,7 +113,7 @@ export class GenericLocation extends React.Component { key={"techvendorlocation"} loc={this.props.loc} p={this.props.p} - /> + />, ) } @@ -123,7 +123,7 @@ export class GenericLocation extends React.Component { key={"travelagencylocation"} p={this.props.p} travel={this.props.travel} - /> + />, ) } @@ -133,7 +133,7 @@ export class GenericLocation extends React.Component { key={"universitylocation"} loc={this.props.loc} p={this.props.p} - /> + />, ) } @@ -142,7 +142,7 @@ export class GenericLocation extends React.Component { + />, ) } diff --git a/src/Locations/ui/Root.tsx b/src/Locations/ui/Root.tsx index 351741c19..3d7a3ebbc 100644 --- a/src/Locations/ui/Root.tsx +++ b/src/Locations/ui/Root.tsx @@ -136,7 +136,7 @@ export class LocationRoot extends React.Component { if (this.props.p.travel(to)) { this.setState({ inCity: true, - city: to + city: to, }); } } diff --git a/src/Locations/ui/TechVendorLocation.tsx b/src/Locations/ui/TechVendorLocation.tsx index d0a13b389..906a81e0e 100644 --- a/src/Locations/ui/TechVendorLocation.tsx +++ b/src/Locations/ui/TechVendorLocation.tsx @@ -72,7 +72,7 @@ export class TechVendorLocation extends React.Component { onClick={() => createPurchaseServerPopup(i, this.props.p)} style={this.btnStyle} text={<>Purchase {i}GB Server - {Money(cost)}} - /> + />, ) } diff --git a/src/Locations/ui/TravelAgencyLocation.tsx b/src/Locations/ui/TravelAgencyLocation.tsx index 7d33b4bac..f84f80599 100644 --- a/src/Locations/ui/TravelAgencyLocation.tsx +++ b/src/Locations/ui/TravelAgencyLocation.tsx @@ -38,8 +38,8 @@ export class TravelAgencyLocation extends React.Component { function LocationLetter(props: any) { if(props.city !== thisTravelAgencyLocation.props.p.city) { - return - {props.city} + return + {props.city} {props.city[0]} } @@ -55,20 +55,20 @@ export class TravelAgencyLocation extends React.Component {
                   ,_   .  ._. _.  .
               , _-\','|~\~      ~/      ;-'_   _-'     ,;_;_,    ~~-
      /~~-\_/-'~'--' \~~| ',    ,'      /  / ~|-_\_/~/~      ~~--~~~~'--_
    -
      /              ,/'-/~ '\ ,' _  , ','|~                   ._/-, /~
    +
      /              ,/'-/~ '\ ,' _  , ','|~                   ._/-, /~
      ~/-'~\_,       '-,| '|. '   ~  ,\ /'~                /    /_  /~
    -
    .-~      '|        '',\~|\       _\~     ,_  ,              /,
    -
              '\       /'~          |_/~\\,-,~  \ "         ,_,/ |
    -
               |       /            ._-~'\_ _~|              \ ) 
    +
    .-~      '|        '',\~|\       _\~     ,_  ,              /,
    +
              '\       /'~          |_/~\\,-,~  \ "         ,_,/ |
    +
               |       /            ._-~'\_ _~|              \ ) 
                \   __-\           '/      ~ |\  \_          /  ~
      .,         '\ |,  ~-_      - |          \\_' ~|  /\  \~ ,
                   ~-_'  _;       '\           '-,   \,' /\/  |
                     '\_,~'\_       \_ _,       /'    '  |, /|'
                       /     \_       ~ |      /         \  ~'; -,_.
                       |       ~\        |    |  ,        '-_, ,; ~ ~\
    -
                        \,     /        \    / /|            ,-, ,   -,
    +
                        \,     /        \    / /|            ,-, ,   -,
                         |    ,/          |  |' |/          ,-   ~ \   '.
    -
                        ,|   ,/           \ ,/              \      |
    +
                        ,|   ,/           \ ,/              \      |
                        /    |             ~                 -~~-, /   _
                        | ,-'                                    ~    /
                        / ,'                                      ~
    @@ -93,7 +93,7 @@ export class TravelAgencyLocation extends React.Component { onClick={createTravelPopup.bind(null, city, this.props.travel)} style={this.btnStyle} text={`Travel to ${city}`} - /> + />, ) } diff --git a/src/Message/Message.ts b/src/Message/Message.ts index 90e24aa2c..5138b696b 100644 --- a/src/Message/Message.ts +++ b/src/Message/Message.ts @@ -9,13 +9,13 @@ export class Message { } // Name of Message file - filename: string = ""; + filename = ""; // The text contains in the Message - msg: string = ""; + msg = ""; // Flag indicating whether this Message has been received by the player - recvd: boolean = false; + recvd = false; constructor(filename="", msg="") { this.filename = filename; diff --git a/src/Milestones/MilestoneHelpers.tsx b/src/Milestones/MilestoneHelpers.tsx index 330aee209..94073d44e 100644 --- a/src/Milestones/MilestoneHelpers.tsx +++ b/src/Milestones/MilestoneHelpers.tsx @@ -23,7 +23,7 @@ export function displayMilestonesContent() { if (milestonesContainer instanceof HTMLElement) { ReactDOM.render( , - milestonesContainer + milestonesContainer, ); } } \ No newline at end of file diff --git a/src/Milestones/Milestones.ts b/src/Milestones/Milestones.ts index e08b0e297..f545b3973 100644 --- a/src/Milestones/Milestones.ts +++ b/src/Milestones/Milestones.ts @@ -6,7 +6,7 @@ import { Faction } from "../Faction/Faction"; import { GetServerByHostname } from "../Server/ServerHelpers"; function allFactionAugs(p: IPlayer, f: Faction): boolean { - const factionAugs = f.augmentations.slice().filter((aug)=> "NeuroFlux Governor" !== aug); + const factionAugs = f.augmentations.slice().filter((aug)=> aug !== "NeuroFlux Governor"); for(const factionAug of factionAugs) { if(!p.augmentations.some(aug => {return aug.name == factionAug})) return false; } diff --git a/src/Missions.jsx b/src/Missions.jsx index fad515ca2..ade2d55ff 100644 --- a/src/Missions.jsx +++ b/src/Missions.jsx @@ -65,7 +65,7 @@ let NodeTypes = { Database: "Database Node", // No actions available Spam: "Spam Node", // No actions Available Transfer: "Transfer Node", // Can Weaken, Scan, Fortify and Overflow - Shield: "Shield Node" // Can Fortify + Shield: "Shield Node", // Can Fortify } let NodeActions = { @@ -252,7 +252,7 @@ HackingMission.prototype.init = function() { var stats = { atk: randMult * getRandomInt(80, 86), def: randMult * getRandomInt(5, 10), - hp: randMult * getRandomInt(210, 230) + hp: randMult * getRandomInt(210, 230), } this.enemyCores.push(new Node(NodeTypes.Core, stats)); this.enemyCores[i].setControlledByEnemy(); @@ -262,7 +262,7 @@ HackingMission.prototype.init = function() { var stats = { atk: 0, def: randMult * getRandomInt(10, 20), - hp: randMult * getRandomInt(275, 300) + hp: randMult * getRandomInt(275, 300), } this.enemyNodes.push(new Node(NodeTypes.Firewall, stats)); this.enemyNodes[i].setControlledByEnemy(); @@ -272,7 +272,7 @@ HackingMission.prototype.init = function() { var stats = { atk: 0, def: randMult * getRandomInt(30, 55), - hp: randMult * getRandomInt(210, 275) + hp: randMult * getRandomInt(210, 275), } var node = new Node(NodeTypes.Database, stats); node.setControlledByEnemy(); @@ -674,7 +674,7 @@ HackingMission.prototype.createMap = function() { var stats = { atk: 0, def: averageAttack * 1.1 + getRandomInt(15, 45), - hp: randMult * getRandomInt(200, 225) + hp: randMult * getRandomInt(200, 225), } node = new Node(NodeTypes.Spam, stats); break; @@ -682,7 +682,7 @@ HackingMission.prototype.createMap = function() { var stats = { atk: 0, def: averageAttack * 1.1 + getRandomInt(15, 45), - hp: randMult * getRandomInt(250, 275) + hp: randMult * getRandomInt(250, 275), } node = new Node(NodeTypes.Transfer, stats); break; @@ -691,7 +691,7 @@ HackingMission.prototype.createMap = function() { var stats = { atk: 0, def: averageAttack * 1.1 + getRandomInt(30, 70), - hp: randMult * getRandomInt(300, 320) + hp: randMult * getRandomInt(300, 320), } node = new Node(NodeTypes.Shield, stats); break; @@ -971,10 +971,10 @@ HackingMission.prototype.initJsPlumb = function() { PaintStyle: { gradient: { stops: [ [ 0, "#FFFFFF" ], - [ 1, "#FFFFFF" ] + [ 1, "#FFFFFF" ], ] }, stroke: "#FFFFFF", - strokeWidth: 8 + strokeWidth: 8, }, }); @@ -986,7 +986,7 @@ HackingMission.prototype.initJsPlumb = function() { deleteEndpointsOnEmpty:true, maxConnections:1, anchor:"Continuous", - connector:"Flowchart" + connector:"Flowchart", }); } @@ -995,28 +995,28 @@ HackingMission.prototype.initJsPlumb = function() { instance.makeTarget(this.enemyCores[i].el, { maxConnections:-1, anchor:"Continuous", - connector:"Flowchart" + connector:"Flowchart", }); } for (var i = 0; i < this.enemyDatabases.length; ++i) { instance.makeTarget(this.enemyDatabases[i].el, { maxConnections:-1, anchor:"Continuous", - connector:["Flowchart"] + connector:["Flowchart"], }); } for (var i = 0; i < this.enemyNodes.length; ++i) { instance.makeTarget(this.enemyNodes[i].el, { maxConnections:-1, anchor:"Continuous", - connector:"Flowchart" + connector:"Flowchart", }); } for (var i = 0; i < this.miscNodes.length; ++i) { instance.makeTarget(this.miscNodes[i].el, { maxConnections:-1, anchor:"Continuous", - connector:"Flowchart" + connector:"Flowchart", }); } @@ -1264,7 +1264,7 @@ HackingMission.prototype.processNode = function(nodeObj, numCycles=1) { deleteEndpointsOnEmpty:true, maxConnections:1, anchor:"Continuous", - connector:"Flowchart" + connector:"Flowchart", }); } else { targetNode.setControlledByEnemy(); @@ -1273,7 +1273,7 @@ HackingMission.prototype.processNode = function(nodeObj, numCycles=1) { this.jsplumbinstance.makeTarget(targetNode.el, { maxConnections:-1, anchor:"Continuous", - connector:["Flowchart"] + connector:["Flowchart"], }); } @@ -1393,7 +1393,7 @@ HackingMission.prototype.enemyAISelectAction = function(nodeObj) { // Create connection nodeObj.conn = this.jsplumbinstance.connect({ source:nodeObj.el, - target:node.el + target:node.el, }); ++node.targetedCount; } else { @@ -1409,7 +1409,7 @@ HackingMission.prototype.enemyAISelectAction = function(nodeObj) { // Create connection nodeObj.conn = this.jsplumbinstance.connect({ source:nodeObj.el, - target:node.el + target:node.el, }); ++node.targetedCount; } diff --git a/src/Netscript/Environment.ts b/src/Netscript/Environment.ts index 97de95001..ea808f906 100644 --- a/src/Netscript/Environment.ts +++ b/src/Netscript/Environment.ts @@ -13,7 +13,7 @@ export class Environment { /** * Whether or not the script that uses this Environment should stop running */ - stopFlag: boolean = false; + stopFlag = false; /** * Environment variables (currently only Netscript functions) @@ -54,7 +54,7 @@ export class Environment { //Sets the value of a variable in any scope set(name: string, value: any) { - var scope = this.lookup(name); + const scope = this.lookup(name); //If scope has a value, then this variable is already set in a higher scope, so //set is there. Otherwise, create a new variable in the local scope diff --git a/src/Netscript/RamCostGenerator.ts b/src/Netscript/RamCostGenerator.ts index 01cc550c4..9c9d3bb87 100644 --- a/src/Netscript/RamCostGenerator.ts +++ b/src/Netscript/RamCostGenerator.ts @@ -307,7 +307,7 @@ export const RamCosts: IMap = { heart: { // Easter egg function break : () => 0, - } + }, } export function getRamCost(...args: string[]): number { diff --git a/src/Netscript/WorkerScript.ts b/src/Netscript/WorkerScript.ts index 23c5d48e6..f55b0fb9c 100644 --- a/src/Netscript/WorkerScript.ts +++ b/src/Netscript/WorkerScript.ts @@ -24,7 +24,7 @@ export class WorkerScript { /** * Copy of the script's code */ - code: string = ""; + code = ""; /** * Holds the timeoutID (numeric value) for whenever this script is blocked by a @@ -62,7 +62,7 @@ export class WorkerScript { /** * Status message in case of script error. Currently unused I think */ - errorMessage: string = ""; + errorMessage = ""; /** * Used for static RAM calculation. Stores names of all functions that have @@ -78,7 +78,7 @@ export class WorkerScript { /** * Script's output/return value. Currently not used or implemented */ - output: string = ""; + output = ""; /** * Process ID. Must be an integer. Used for efficient script @@ -89,12 +89,12 @@ export class WorkerScript { /** * Script's Static RAM usage. Equivalent to underlying script's RAM usage */ - ramUsage: number = 0; + ramUsage = 0; /** * Whether or not this workerScript is currently running */ - running: boolean = false; + running = false; /** * Reference to underlying RunningScript object @@ -155,7 +155,7 @@ export class WorkerScript { * Returns null if it cannot be found (which would be a bug) */ getScript(): Script | null { - let server = this.getServer(); + const server = this.getServer(); for (let i = 0; i < server.scripts.length; ++i) { if (server.scripts[i].filename === this.name) { return server.scripts[i]; diff --git a/src/Netscript/killWorkerScript.ts b/src/Netscript/killWorkerScript.ts index dc33af1f6..3edc816f7 100644 --- a/src/Netscript/killWorkerScript.ts +++ b/src/Netscript/killWorkerScript.ts @@ -50,7 +50,7 @@ export function killWorkerScript(script: RunningScript | WorkerScript | number, } } -function killWorkerScriptByPid(pid: number, rerenderUi: boolean=true): boolean { +function killWorkerScriptByPid(pid: number, rerenderUi=true): boolean { const ws = workerScripts.get(pid); if (ws instanceof WorkerScript) { stopAndCleanUpWorkerScript(ws, rerenderUi); @@ -61,7 +61,7 @@ function killWorkerScriptByPid(pid: number, rerenderUi: boolean=true): boolean { return false; } -function stopAndCleanUpWorkerScript(workerScript: WorkerScript, rerenderUi: boolean=true): void { +function stopAndCleanUpWorkerScript(workerScript: WorkerScript, rerenderUi=true): void { workerScript.env.stopFlag = true; killNetscriptDelay(workerScript); removeWorkerScript(workerScript, rerenderUi); @@ -74,7 +74,7 @@ function stopAndCleanUpWorkerScript(workerScript: WorkerScript, rerenderUi: bool * @param {WorkerScript | number} - Identifier for WorkerScript. Either the object itself, or * its index in the global workerScripts array */ -function removeWorkerScript(workerScript: WorkerScript, rerenderUi: boolean=true): void { +function removeWorkerScript(workerScript: WorkerScript, rerenderUi=true): void { if (workerScript instanceof WorkerScript) { const ip = workerScript.serverIp; const name = workerScript.name; diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 4a3d81986..385edd537 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -9,7 +9,7 @@ import { Augmentation } from "./Augmentation/Augmentation"; import { Augmentations } from "./Augmentation/Augmentations"; import { augmentationExists, - installAugmentations + installAugmentations, } from "./Augmentation/AugmentationHelpers"; import { prestigeAugmentation } from "./Prestige"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; @@ -28,13 +28,13 @@ import { calculatePercentMoneyHacked, calculateHackingTime, calculateGrowTime, - calculateWeakenTime + calculateWeakenTime, } from "./Hacking"; import { calculateServerGrowth } from "./Server/formulas/grow"; import { AllGangs, GangMemberUpgrades, - GangMemberTasks + GangMemberTasks, } from "./Gang"; import { Faction } from "./Faction/Faction"; import { Factions, factionExists } from "./Faction/Factions"; @@ -43,7 +43,7 @@ import { FactionWorkType } from "./Faction/FactionWorkTypeEnum"; import { netscriptCanGrow, netscriptCanHack, - netscriptCanWeaken + netscriptCanWeaken, } from "./Hacking/netscriptCanHack"; import { @@ -114,7 +114,7 @@ import { import { getPurchaseServerCost, getPurchaseServerLimit, - getPurchaseServerMaxRam + getPurchaseServerMaxRam, } from "./Server/ServerPurchases"; import { Settings } from "./Settings/Settings"; import { SpecialServerIps } from "./Server/SpecialServerIps"; @@ -146,13 +146,13 @@ import { PositionTypes } from "./StockMarket/data/PositionTypes"; import { StockSymbols } from "./StockMarket/data/StockSymbols"; import { getStockMarket4SDataCost, - getStockMarket4STixApiCost + getStockMarket4STixApiCost, } from "./StockMarket/StockMarketCosts"; import { isValidFilePath } from "./Terminal/DirectoryHelpers"; import { TextFile, getTextFile, createTextFile } from "./TextFile"; import { - unknownBladeburnerActionErrorMessage + unknownBladeburnerActionErrorMessage, } from"./NetscriptBladeburner"; import { Gang } from "./Gang"; import { @@ -351,7 +351,7 @@ function NetscriptFunctions(workerScript) { throw makeRuntimeRejectMsg( workerScript, `Invalid scriptArgs argument passed into getRunningScript() from ${callingFnName}(). ` + - `This is probably a bug. Please report to game developer` + `This is probably a bug. Please report to game developer`, ); } @@ -489,7 +489,7 @@ function NetscriptFunctions(workerScript) { } return null; } - let call = {line: "-1", func: "unknown"};; + let call = {line: "-1", func: "unknown"}; let chromeCall = parseChromeStackline(stackline); if (chromeCall) { call = chromeCall; @@ -1343,7 +1343,7 @@ function NetscriptFunctions(workerScript) { scriptname.forEach(function(script) { if (NetscriptFunctions(workerScript).scp(script, ip1, ip2)) { res = true; - }; + } }); return res; } @@ -1965,7 +1965,7 @@ function NetscriptFunctions(workerScript) { shares: shares, price: price, type: orderType, - pos: orderPos + pos: orderPos, }; return cancelOrder(params, workerScript); }, @@ -2832,7 +2832,7 @@ function NetscriptFunctions(workerScript) { var darkweb = safetlyCreateUniqueServer({ ip: createUniqueRandomIp(), hostname:"darkweb", organizationName:"", - isConnectedTo:false, adminRights:false, purchasedByPlayer:false, maxRam:1 + isConnectedTo:false, adminRights:false, purchasedByPlayer:false, maxRam:1, }); AddToAllServers(darkweb); SpecialServerIps.addIp("Darkweb Server", darkweb.ip); @@ -2943,7 +2943,7 @@ function NetscriptFunctions(workerScript) { dexterity: Player.dexterity, agility: Player.agility, charisma: Player.charisma, - intelligence: Player.intelligence + intelligence: Player.intelligence, } }, getCharacterInformation: function() { @@ -4087,7 +4087,7 @@ function NetscriptFunctions(workerScript) { updateDynamicRam("getBonusTime", getRamCost("bladeburner", "getBonusTime")); checkBladeburnerAccess("getBonusTime"); return Math.round(Player.bladeburner.storedCycles / 5); - } + }, }, // End Bladeburner // Coding Contract API @@ -4373,7 +4373,7 @@ function NetscriptFunctions(workerScript) { } return Player.sleeves[sleeveNumber].tryBuyAugmentation(Player, aug); - } + }, }, // End sleeve formulas: { basic: { @@ -4438,7 +4438,7 @@ function NetscriptFunctions(workerScript) { constants: function() { checkFormulasAccess("hacknetNodes.constants", 5); return Object.assign({}, HacknetNodeConstants, HacknetServerConstants); - } + }, }, hacknetServers: { hashGainRate: function(level, ram, cores, mult=1) { @@ -4476,14 +4476,14 @@ function NetscriptFunctions(workerScript) { constants: function() { checkFormulasAccess("hacknetServers.constants", 9); return Object.assign({}, HacknetServerConstants); - } + }, }, }, // end formulas heart: { // Easter egg function break: function() { return Player.karma; - } + }, }, exploit: function() { Player.giveExploit(Exploit.UndocumentedFunctionCall); @@ -4515,7 +4515,7 @@ function NetscriptFunctions(workerScript) { ret[key.slice(2)] = value; } return ret; - } + }, } // End return } // End NetscriptFunction() diff --git a/src/NetscriptJSEvaluator.js b/src/NetscriptJSEvaluator.js index 257992797..61d660ffb 100644 --- a/src/NetscriptJSEvaluator.js +++ b/src/NetscriptJSEvaluator.js @@ -49,7 +49,7 @@ export async function executeJSScript(scripts = [], workerScript) { if (urls != null) { for (const b in urls) URL.revokeObjectURL(b.url); } - }; + } } /** Returns whether we should compile the script parameter. @@ -121,7 +121,7 @@ export function _getScriptUrls(script, scripts, seen) { // The top url in the stack is the replacement import file for this script. urlStack.push(...urls); return [prefix, urls[urls.length - 1].url, suffix].join(''); - } + }, ); // We automatically define a print function() in the NetscriptJS module so that diff --git a/src/NetscriptPort.ts b/src/NetscriptPort.ts index d9c5ea2a7..85504c1b0 100644 --- a/src/NetscriptPort.ts +++ b/src/NetscriptPort.ts @@ -32,7 +32,7 @@ export class NetscriptPort { if (this.data.length === 0) { return "NULL PORT DATA"; } else { - var foo = this.data.slice(); + const foo = this.data.slice(); return foo[0]; } } diff --git a/src/NetscriptWorker.js b/src/NetscriptWorker.js index 7b9803ab3..d0126d12b 100644 --- a/src/NetscriptWorker.js +++ b/src/NetscriptWorker.js @@ -111,7 +111,7 @@ function startNetscript2Script(workerScript) { return result; } } - }; + } for (let prop in workerScript.env.vars) { if (typeof workerScript.env.vars[prop] !== "function") continue; @@ -330,7 +330,7 @@ function processNetscript1Imports(code, workerScript) { FunctionDeclaration: (node) => { fnNames.push(node.id.name); fnDeclarations.push(node); - } + }, }); //Now we have to generate the code that would create the namespace @@ -370,7 +370,7 @@ function processNetscript1Imports(code, workerScript) { if (fnsToImport.includes(node.id.name)) { fnDeclarations.push(node); } - } + }, }); //Convert FunctionDeclarations into code @@ -379,7 +379,7 @@ function processNetscript1Imports(code, workerScript) { generatedCode += "\n"; }); } - } + }, }); //If there are no imports, just return the original code @@ -408,7 +408,7 @@ function processNetscript1Imports(code, workerScript) { var res = { code: code, - lineOffset: lineOffset + lineOffset: lineOffset, } return res; } @@ -459,7 +459,7 @@ export function createAndAddWorkerScript(runningScriptObj, server) { `Not enough RAM to run script ${runningScriptObj.filename} with args ` + `${arrayToString(runningScriptObj.args)}. This likely occurred because you re-loaded ` + `the game and the script's RAM usage increased (either because of an update to the game or ` + - `your changes to the script.)` + `your changes to the script.)`, ); return false; } @@ -470,7 +470,7 @@ export function createAndAddWorkerScript(runningScriptObj, server) { if (pid === -1) { throw new Error( `Failed to start script because could not find available PID. This is most ` + - `because you have too many scripts running.` + `because you have too many scripts running.`, ); } diff --git a/src/PersonObjects/Person.ts b/src/PersonObjects/Person.ts index 8e6619156..a8ce56f35 100644 --- a/src/PersonObjects/Person.ts +++ b/src/PersonObjects/Person.ts @@ -36,67 +36,67 @@ export abstract class Person { /** * Stats */ - hacking_skill: number = 1; - strength: number = 1; - defense: number = 1; - dexterity: number = 1; - agility: number = 1; - charisma: number = 1; - intelligence: number = 1; - hp: number = 10; - max_hp: number = 10; + hacking_skill = 1; + strength = 1; + defense = 1; + dexterity = 1; + agility = 1; + charisma = 1; + intelligence = 1; + hp = 10; + max_hp = 10; /** * Experience */ - hacking_exp: number = 0; - strength_exp: number = 0; - defense_exp: number = 0; - dexterity_exp: number = 0; - agility_exp: number = 0; - charisma_exp: number = 0; - intelligence_exp: number = 0; + hacking_exp = 0; + strength_exp = 0; + defense_exp = 0; + dexterity_exp = 0; + agility_exp = 0; + charisma_exp = 0; + intelligence_exp = 0; /** * Multipliers */ - hacking_mult: number = 1; - strength_mult: number = 1; - defense_mult: number = 1; - dexterity_mult: number = 1; - agility_mult: number = 1; - charisma_mult: number = 1; + hacking_mult = 1; + strength_mult = 1; + defense_mult = 1; + dexterity_mult = 1; + agility_mult = 1; + charisma_mult = 1; - hacking_exp_mult: number = 1; - strength_exp_mult: number = 1; - defense_exp_mult: number = 1; - dexterity_exp_mult: number = 1; - agility_exp_mult: number = 1; - charisma_exp_mult: number = 1; + hacking_exp_mult = 1; + strength_exp_mult = 1; + defense_exp_mult = 1; + dexterity_exp_mult = 1; + agility_exp_mult = 1; + charisma_exp_mult = 1; - hacking_chance_mult: number = 1; - hacking_speed_mult: number = 1; - hacking_money_mult: number = 1; - hacking_grow_mult: number = 1; + hacking_chance_mult = 1; + hacking_speed_mult = 1; + hacking_money_mult = 1; + hacking_grow_mult = 1; - company_rep_mult: number = 1; - faction_rep_mult: number = 1; + company_rep_mult = 1; + faction_rep_mult = 1; - crime_money_mult: number = 1; - crime_success_mult: number = 1; + crime_money_mult = 1; + crime_success_mult = 1; - work_money_mult: number = 1; + work_money_mult = 1; - hacknet_node_money_mult: number = 1; - hacknet_node_purchase_cost_mult: number = 1; - hacknet_node_ram_cost_mult: number = 1; - hacknet_node_core_cost_mult: number = 1; - hacknet_node_level_cost_mult: number = 1; + hacknet_node_money_mult = 1; + hacknet_node_purchase_cost_mult = 1; + hacknet_node_ram_cost_mult = 1; + hacknet_node_core_cost_mult = 1; + hacknet_node_level_cost_mult = 1; - bladeburner_max_stamina_mult: number = 1; - bladeburner_stamina_gain_mult: number = 1; - bladeburner_analysis_mult: number = 1; - bladeburner_success_chance_mult : number = 1; + bladeburner_max_stamina_mult = 1; + bladeburner_stamina_gain_mult = 1; + bladeburner_analysis_mult = 1; + bladeburner_success_chance_mult = 1; /** * Augmentations @@ -128,7 +128,7 @@ export abstract class Person { * Given an experience amount and stat multiplier, calculates the * stat level. Stat-agnostic (same formula for every stat) */ - calculateStat(exp: number, mult: number=1): number { + calculateStat(exp: number, mult=1): number { return calculateSkill(exp, mult); } diff --git a/src/PersonObjects/Player/PlayerObject.js b/src/PersonObjects/Player/PlayerObject.js index c3b736719..cf30a50d9 100644 --- a/src/PersonObjects/Player/PlayerObject.js +++ b/src/PersonObjects/Player/PlayerObject.js @@ -12,7 +12,7 @@ import { MoneySourceTracker } from "../../utils/MoneySourceTracker"; import { Reviver, Generic_toJSON, - Generic_fromJSON + Generic_fromJSON, } from "../../../utils/JSONReviver"; import Decimal from "decimal.js"; @@ -203,7 +203,7 @@ export function PlayerObject() { this.scriptProdSinceLastAug = 0; this.exploits = []; -}; +} // Apply player methods to the prototype using Object.assign() Object.assign( @@ -213,7 +213,7 @@ Object.assign( bladeburnerMethods, corporationMethods, gangMethods, - augmentationMethods + augmentationMethods, ); PlayerObject.prototype.toJSON = function() { diff --git a/src/PersonObjects/Player/PlayerObjectCorporationMethods.js b/src/PersonObjects/Player/PlayerObjectCorporationMethods.js index a1d358232..216109d3d 100644 --- a/src/PersonObjects/Player/PlayerObjectCorporationMethods.js +++ b/src/PersonObjects/Player/PlayerObjectCorporationMethods.js @@ -12,7 +12,7 @@ export function hasCorporation() { export function startCorporation(corpName, additionalShares=0) { this.corporation = new Corporation({ - name: corpName + name: corpName, }); this.corporation.totalShares += additionalShares; diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.jsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.jsx index 922721b61..ca40799f5 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.jsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.jsx @@ -1313,11 +1313,11 @@ export function startClass(costMult, expMult, className) { this.workMoneyLossRate = cost; this.workHackExpGainRate = hackExp * this.hacking_exp_mult * BitNodeMultipliers.ClassGymExpGain; - this.workStrExpGainRate = strExp * this.strength_exp_mult * BitNodeMultipliers.ClassGymExpGain;; - this.workDefExpGainRate = defExp * this.defense_exp_mult * BitNodeMultipliers.ClassGymExpGain;; - this.workDexExpGainRate = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain;; - this.workAgiExpGainRate = agiExp * this.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain;; - this.workChaExpGainRate = chaExp * this.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain;; + this.workStrExpGainRate = strExp * this.strength_exp_mult * BitNodeMultipliers.ClassGymExpGain; + this.workDefExpGainRate = defExp * this.defense_exp_mult * BitNodeMultipliers.ClassGymExpGain; + this.workDexExpGainRate = dexExp * this.dexterity_exp_mult * BitNodeMultipliers.ClassGymExpGain; + this.workAgiExpGainRate = agiExp * this.agility_exp_mult * BitNodeMultipliers.ClassGymExpGain; + this.workChaExpGainRate = chaExp * this.charisma_exp_mult * BitNodeMultipliers.ClassGymExpGain; var cancelButton = clearEventListeners("work-in-progress-cancel-button"); if (className == CONSTANTS.ClassGymStrength || diff --git a/src/PersonObjects/Player/PlayerObjectServerMethods.ts b/src/PersonObjects/Player/PlayerObjectServerMethods.ts index 84ec0a79f..43c0297bc 100644 --- a/src/PersonObjects/Player/PlayerObjectServerMethods.ts +++ b/src/PersonObjects/Player/PlayerObjectServerMethods.ts @@ -34,7 +34,7 @@ export function getUpgradeHomeRamCost(this: IPlayer) { //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.BaseCostFor1GBOfRamHome * mult * BitNodeMultipliers.HomeComputerRamCost; + const cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome * mult * BitNodeMultipliers.HomeComputerRamCost; return cost; } diff --git a/src/PersonObjects/Resleeving/Resleeve.ts b/src/PersonObjects/Resleeving/Resleeve.ts index 0cd330ad0..f35bdadca 100644 --- a/src/PersonObjects/Resleeving/Resleeve.ts +++ b/src/PersonObjects/Resleeving/Resleeve.ts @@ -23,13 +23,13 @@ export class Resleeve extends Person { getCost(): number { // Each experience point adds this to the cost - const CostPerExp: number = 25e3; + const CostPerExp = 25e3; // Final cost is multiplied by this constant ^ # Augs - const NumAugsExponent: number = 1.2; + const NumAugsExponent = 1.2; // Get total exp in this re-sleeve - let totalExp: number = this.hacking_exp + + const totalExp: number = this.hacking_exp + this.strength_exp + this.defense_exp + this.dexterity_exp + @@ -37,7 +37,7 @@ export class Resleeve extends Person { this.charisma_exp; // Get total base Augmentation cost for this re-sleeve - let totalAugmentationCost: number = 0; + let totalAugmentationCost = 0; for (let i = 0; i < this.augmentations.length; ++i) { const aug: Augmentation | null = Augmentations[this.augmentations[i].name]; if (aug == null) { diff --git a/src/PersonObjects/Resleeving/Resleeving.ts b/src/PersonObjects/Resleeving/Resleeving.ts index 9b158145c..c0b7515c8 100644 --- a/src/PersonObjects/Resleeving/Resleeving.ts +++ b/src/PersonObjects/Resleeving/Resleeving.ts @@ -76,12 +76,12 @@ export function purchaseResleeve(r: Resleeve, p: IPlayer): boolean { // Creates all of the Re-sleeves that will be available for purchase at VitaLife export function generateResleeves(): Resleeve[] { - const NumResleeves: number = 40; // Total number of Resleeves to generate + const NumResleeves = 40; // Total number of Resleeves to generate - let ret: Resleeve[] = []; + const ret: Resleeve[] = []; for (let i = 0; i < NumResleeves; ++i) { // i will be a number indicating how "powerful" the Re-sleeve should be - let r: Resleeve = new Resleeve(); + const r: Resleeve = new Resleeve(); // Generate experience const expMult: number = (5 * i) + 1; diff --git a/src/PersonObjects/Resleeving/ResleevingUI.tsx b/src/PersonObjects/Resleeving/ResleevingUI.tsx index 4957e6dd1..b6436fb28 100644 --- a/src/PersonObjects/Resleeving/ResleevingUI.tsx +++ b/src/PersonObjects/Resleeving/ResleevingUI.tsx @@ -98,7 +98,7 @@ export function createResleevesPage(p: IPlayer) { // Create a selector for sorting the list of Resleeves UIElems.sortTag = createElement("p", { display: "inline-block", - innerText: "Sort By: " + innerText: "Sort By: ", }); UIElems.sortSelector = createElement("select", { class: "dropdown" }) as HTMLSelectElement; @@ -133,7 +133,7 @@ export function createResleevesPage(p: IPlayer) { // Helper function for averaging function getAverage(...values: number[]) { - let sum: number = 0; + let sum = 0; for (let i = 0; i < values.length; ++i) { sum += values[i]; } @@ -175,16 +175,16 @@ export function createResleevesPage(p: IPlayer) { break; case SortOption.AverageCombatStats: p.resleeves.sort((a, b) => { - let aAvg = getAverage(a.strength, a.defense, a.dexterity, a.agility); - let bAvg = getAverage(b.strength, b.defense, b.dexterity, b.agility); + const aAvg = getAverage(a.strength, a.defense, a.dexterity, a.agility); + const bAvg = getAverage(b.strength, b.defense, b.dexterity, b.agility); return aAvg - bAvg; }); break; case SortOption.AverageAllStats: p.resleeves.sort((a, b) => { - let aAvg = getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma); - let bAvg = getAverage(b.hacking_skill, b.strength, b.defense, b.dexterity, b.agility, b.charisma); + const aAvg = getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma); + const bAvg = getAverage(b.hacking_skill, b.strength, b.defense, b.dexterity, b.agility, b.charisma); return aAvg - bAvg; }); @@ -304,10 +304,10 @@ function createResleeveUi(resleeve: Resleeve): IResleeveUIElems { `Bladeburner Max Stamina multiplier: ${numeralWrapper.formatPercentage(resleeve.bladeburner_max_stamina_mult)}`, `Bladeburner Stamina Gain multiplier: ${numeralWrapper.formatPercentage(resleeve.bladeburner_stamina_gain_mult)}`, `Bladeburner Field Analysis multiplier: ${numeralWrapper.formatPercentage(resleeve.bladeburner_analysis_mult)}`, - `Bladeburner Success Chance multiplier: ${numeralWrapper.formatPercentage(resleeve.bladeburner_success_chance_mult)}` - ].join("
    "), false + `Bladeburner Success Chance multiplier: ${numeralWrapper.formatPercentage(resleeve.bladeburner_success_chance_mult)}`, + ].join("
    "), false, ) - } + }, }); elems.statsPanel.appendChild(elems.stats); elems.statsPanel.appendChild(elems.multipliersButton); @@ -317,7 +317,7 @@ function createResleeveUi(resleeve: Resleeve): IResleeveUIElems { elems.augDescription = createElement("p"); for (let i = 0; i < resleeve.augmentations.length; ++i) { elems.augSelector.add(createOptionElement(resleeve.augmentations[i].name)); - }; + } elems.augSelector.addEventListener("change", () => { updateAugDescription(elems); }); @@ -340,7 +340,7 @@ function createResleeveUi(resleeve: Resleeve): IResleeveUIElems { } else { dialogBoxCreate(`You cannot afford to re-sleeve into this body`, false); } - } + }, }); elems.costPanel.appendChild(elems.costText); elems.costPanel.appendChild(elems.buyButton); diff --git a/src/PersonObjects/Sleeve/Sleeve.ts b/src/PersonObjects/Sleeve/Sleeve.ts index 34f63312d..629cce066 100644 --- a/src/PersonObjects/Sleeve/Sleeve.ts +++ b/src/PersonObjects/Sleeve/Sleeve.ts @@ -12,7 +12,7 @@ import { IPlayer } from "../IPlayer"; import { Person, ITaskTracker, - createTaskTracker + createTaskTracker, } from "../Person"; import { Augmentation } from "../../Augmentation/Augmentation"; @@ -49,13 +49,13 @@ export class Sleeve extends Person { /** * Stores the name of the class that the player is currently taking */ - className: string = ""; + className = ""; /** * Stores the type of crime the sleeve is currently attempting * Must match the name of a Crime object */ - crimeType: string = ""; + crimeType = ""; /** * Enum value for current task @@ -70,17 +70,17 @@ export class Sleeve extends Person { * Crime: Money earned if successful * Class/Gym: Name of university/gym */ - currentTaskLocation: string = ""; + currentTaskLocation = ""; /** * Maximum amount of time (in milliseconds) that can be spent on current task. */ - currentTaskMaxTime: number = 0; + currentTaskMaxTime = 0; /** * Milliseconds spent on current task */ - currentTaskTime: number = 0; + currentTaskTime = 0; /** * Keeps track of experience earned for other sleeves @@ -110,7 +110,7 @@ export class Sleeve extends Person { /** * String that stores what stat the sleeve is training at the gym */ - gymStatType: string = ""; + gymStatType = ""; /** * Keeps track of events/notifications for this sleeve @@ -120,7 +120,7 @@ export class Sleeve extends Person { /** * Clone retains 'memory' synchronization (and maybe exp?) upon prestige/installing Augs */ - memory: number = 1; + memory = 1; /** * Sleeve shock. Number between 0 and 100 @@ -129,19 +129,19 @@ export class Sleeve extends Person { * * Reputation earned is also multiplied by shock% */ - shock: number = 1; + shock = 1; /** * Stored number of game "loop" cycles */ - storedCycles: number = 0; + storedCycles = 0; /** * Synchronization. Number between 0 and 100 * When experience is earned by sleeve, both the player and the sleeve get * sync% of the experience earned. Other sleeves get sync^2% of exp */ - sync: number = 1; + sync = 1; constructor(p: IPlayer | null = null) { super(); @@ -228,7 +228,7 @@ export class Sleeve extends Person { * Earn experience for any stats (supports multiple) * This function also handles experience propogating to Player and other sleeves */ - gainExperience(p: IPlayer, exp: ITaskTracker, numCycles: number=1, fromOtherSleeve: boolean=false): ITaskTracker { + gainExperience(p: IPlayer, exp: ITaskTracker, numCycles=1, fromOtherSleeve=false): ITaskTracker { // If the experience is coming from another sleeve, it is not multiplied by anything. // Also the player does not earn anything if (fromOtherSleeve) { @@ -335,7 +335,7 @@ export class Sleeve extends Person { /** * Earn money for player */ - gainMoney(p: IPlayer, task: ITaskTracker, numCycles: number=1): void { + gainMoney(p: IPlayer, task: ITaskTracker, numCycles=1): void { const gain: number = (task.money * numCycles); this.earningsForTask.money += gain; this.earningsForPlayer.money += gain; @@ -373,7 +373,7 @@ export class Sleeve extends Person { */ getRepGain(p: IPlayer): number { if (this.currentTask === SleeveTaskType.Faction) { - let favorMult: number = 1; + let favorMult = 1; const fac: Faction | null = Factions[this.currentTaskLocation]; if (fac != null) { favorMult = 1 + (fac!.favor / 100); @@ -429,7 +429,7 @@ export class Sleeve extends Person { } log(entry: string): void { - const MaxLogSize: number = 50; + const MaxLogSize = 50; this.logs.push(entry); if (this.logs.length > MaxLogSize) { this.logs.shift(); @@ -471,7 +471,7 @@ export class Sleeve extends Person { * Returns an object containing the amount of experience that should be * transferred to all other sleeves */ - process(p: IPlayer, numCycles: number=1): ITaskTracker | null { + process(p: IPlayer, numCycles=1): ITaskTracker | null { // Only process once every second (5 cycles) const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle; this.storedCycles += numCycles; @@ -605,7 +605,7 @@ export class Sleeve extends Person { // Set exp/money multipliers based on which university. // Also check that the sleeve is in the right city - let costMult: number = 1; + let costMult = 1; switch (universityName.toLowerCase()) { case LocationName.AevumSummitUniversity.toLowerCase(): if (this.city !== CityName.Aevum) { return false; } @@ -676,7 +676,7 @@ export class Sleeve extends Person { updateTaskGainRates(p: IPlayer): void { if (this.currentTask === SleeveTaskType.Class) { - let expMult: number = 1; + let expMult = 1; switch (this.currentTaskLocation.toLowerCase()) { case LocationName.AevumSummitUniversity.toLowerCase(): expMult = 3; @@ -720,7 +720,7 @@ export class Sleeve extends Person { if (this.currentTask === SleeveTaskType.Gym) { // Get gym exp multiplier - let expMult: number = 1; + let expMult = 1; switch (this.currentTaskLocation.toLowerCase()) { case LocationName.AevumCrushFitnessGym.toLowerCase(): expMult = 2; @@ -742,7 +742,7 @@ export class Sleeve extends Person { } // Set stat gain rate - const baseGymExp: number = 1; + const baseGymExp = 1; const totalExpMultiplier = p.hashManager.getTrainingMult() * expMult; const sanitizedStat: string = this.gymStatType.toLowerCase(); if (sanitizedStat.includes("str")) { @@ -889,7 +889,7 @@ export class Sleeve extends Person { // Set exp/money multipliers based on which university. // Also check that the sleeve is in the right city - let costMult: number = 1; + let costMult = 1; switch (gymName.toLowerCase()) { case LocationName.AevumCrushFitnessGym.toLowerCase(): if (this.city != CityName.Aevum) { return false; } diff --git a/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts b/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts index 756987369..95f142eb4 100644 --- a/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts +++ b/src/PersonObjects/Sleeve/SleeveAugmentationsUI.ts @@ -73,7 +73,7 @@ export function createSleevePurchaseAugsPopup(sleeve: Sleeve, p: IPlayer) { `that you have unlocked through Factions.

    `, `When purchasing an Augmentation for a Duplicate Sleeve, they are immediately`, `installed. This means that the Duplicate Sleeve will immediately lose all of`, - `its stat experience.` + `its stat experience.`, ].join(" "), }); @@ -90,7 +90,7 @@ export function createSleevePurchaseAugsPopup(sleeve: Sleeve, p: IPlayer) { [ `

    ${aug.name}


    `, `Cost: ${renderToStaticMarkup(Money(aug.startingCost))}

    `, - `${aug.info}` + `${aug.info}`, ].join(" "), padding: "2px", clickListener: () => { @@ -101,7 +101,7 @@ export function createSleevePurchaseAugsPopup(sleeve: Sleeve, p: IPlayer) { } else { dialogBoxCreate(`You cannot afford ${aug.name}`, false); } - } + }, })); popupElems.push(div); diff --git a/src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts b/src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts index 1ead77eeb..9dd0807ad 100644 --- a/src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts +++ b/src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts @@ -8,9 +8,9 @@ import { CovenantPurchasesRoot } from "./ui/CovenantPurchasesRoot"; import { createPopup, removePopup } from "../../ui/React/createPopup"; -export const MaxSleevesFromCovenant: number = 5; -export const BaseCostPerSleeve: number = 10e12; -export const PopupId: string = "covenant-sleeve-purchases-popup"; +export const MaxSleevesFromCovenant = 5; +export const BaseCostPerSleeve = 10e12; +export const PopupId = "covenant-sleeve-purchases-popup"; export function createSleevePurchasesFromCovenantPopup(p: IPlayer) { const removePopupFn = removePopup.bind(null, PopupId); diff --git a/src/PersonObjects/Sleeve/SleeveUI.tsx b/src/PersonObjects/Sleeve/SleeveUI.tsx index 405a94095..eeffb243d 100644 --- a/src/PersonObjects/Sleeve/SleeveUI.tsx +++ b/src/PersonObjects/Sleeve/SleeveUI.tsx @@ -117,7 +117,7 @@ export function createSleevesPage(p: IPlayer) { innerText: "FAQ", clickListener: () => { dialogBoxCreate(SleeveFaq, false); - } + }, }); UIElems.docButton = createElement("a", { @@ -212,13 +212,13 @@ function createSleeveUi(sleeve: Sleeve, allSleeves: Sleeve[]): ISleeveUIElems { innerText: "More Stats", clickListener: () => { dialogBoxCreate(MoreStatsContent(sleeve)); - } + }, }); elems.travelButton = createElement("button", { class: "std-button", innerText: "Travel", clickListener: () => { - const popupId: string = "sleeve-travel-popup"; + const popupId = "sleeve-travel-popup"; const popupArguments: HTMLElement[] = []; popupArguments.push(createPopupCloseButton(popupId, { class: "std-button" })); popupArguments.push(createElement("p", { @@ -247,13 +247,13 @@ function createSleeveUi(sleeve: Sleeve, allSleeves: Sleeve[]): ISleeveUIElems { updateSleeveUi(sleeve, elems); updateSleeveTaskSelector(sleeve, elems, allSleeves); return false; - } + }, })); })(sleeve, cityName); } createPopup(popupId, popupArguments); - } + }, }); elems.purchaseAugsButton = createElement("button", { class: "std-button", @@ -261,7 +261,7 @@ function createSleeveUi(sleeve: Sleeve, allSleeves: Sleeve[]): ISleeveUIElems { innerText: "Manage Augmentations", clickListener: () => { createSleevePurchaseAugsPopup(sleeve, playerRef!); - } + }, }); elems.statsPanel.appendChild(elems.stats); elems.statsPanel.appendChild(elems.moreStatsButton); @@ -296,7 +296,7 @@ function createSleeveUi(sleeve: Sleeve, allSleeves: Sleeve[]): ISleeveUIElems { innerText: "Set Task", clickListener: () => { setSleeveTask(sleeve, elems); - } + }, }); elems.taskPanel.appendChild(elems.taskSelector); elems.taskPanel.appendChild(elems.taskDetailsSelector); @@ -312,7 +312,7 @@ function createSleeveUi(sleeve: Sleeve, allSleeves: Sleeve[]): ISleeveUIElems { innerText: "More Earnings Info", clickListener: () => { dialogBoxCreate(MoreEarningsContent(sleeve)); - } + }, }); elems.earningsPanel.appendChild(elems.currentEarningsInfo); @@ -341,7 +341,7 @@ function updateSleeveUi(sleeve: Sleeve, elems: ISleeveUIElems) { [`Defense Exp`, numeralWrapper.formatExp(sleeve.gainRatesForTask.def), `(2x on success)`], [`Dexterity Exp`, numeralWrapper.formatExp(sleeve.gainRatesForTask.dex), `(2x on success)`], [`Agility Exp`, numeralWrapper.formatExp(sleeve.gainRatesForTask.agi), `(2x on success)`], - [`Charisma Exp`, numeralWrapper.formatExp(sleeve.gainRatesForTask.cha), `(2x on success)`] + [`Charisma Exp`, numeralWrapper.formatExp(sleeve.gainRatesForTask.cha), `(2x on success)`], ]; ReactDOM.render(EarningsTableElement('Earnings (Pre-Synchronization)', data), elems.currentEarningsInfo!) @@ -357,9 +357,9 @@ function updateSleeveUi(sleeve: Sleeve, elems: ISleeveUIElems) { [`Defense Exp:`, `${numeralWrapper.formatExp(5 * sleeve.gainRatesForTask.def)} / s`], [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * sleeve.gainRatesForTask.dex)} / s`], [`Agility Exp:`, `${numeralWrapper.formatExp(5 * sleeve.gainRatesForTask.agi)} / s`], - [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * sleeve.gainRatesForTask.cha)} / s`] + [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * sleeve.gainRatesForTask.cha)} / s`], ]; - let repGainText: string = ""; + const repGainText = ""; if (sleeve.currentTask === SleeveTaskType.Company || sleeve.currentTask === SleeveTaskType.Faction) { const repGain: number = sleeve.getRepGain(playerRef!); data.push([`Reputation:`, ReputationRate(5 * repGain)]); @@ -376,14 +376,14 @@ const universitySelectorOptions: string[] = [ "Networks", "Algorithms", "Management", - "Leadership" + "Leadership", ]; const gymSelectorOptions: string[] = [ "Train Strength", "Train Defense", "Train Dexterity", - "Train Agility" + "Train Agility", ]; // Whenever a new task is selected, the "details" selector must update accordingly @@ -418,7 +418,7 @@ function updateSleeveTaskSelector(sleeve: Sleeve, elems: ISleeveUIElems, allSlee const value: string = getSelectValue(elems.taskSelector); switch(value) { case "Work for Company": - let companyCount: number = 0; + let companyCount = 0; const allJobs: string[] = Object.keys(playerRef!.jobs!); for (let i = 0; i < allJobs.length; ++i) { if (!forbiddenCompanies.includes(allJobs[i])) { @@ -436,7 +436,7 @@ function updateSleeveTaskSelector(sleeve: Sleeve, elems: ISleeveUIElems, allSlee } break; case "Work for Faction": - let factionCount: number = 0; + let factionCount = 0; for (let i = 0; i < playerRef!.factions!.length; ++i) { const fac: string = playerRef!.factions[i]!; if (!forbiddenFactions.includes(fac)) { @@ -599,7 +599,7 @@ function setSleeveTask(sleeve: Sleeve, elems: ISleeveUIElems): boolean { const detailValue: string = getSelectValue(elems.taskDetailsSelector); const detailValue2: string = getSelectValue(elems.taskDetailsSelector2); - let res: boolean = false; + let res = false; switch(taskValue) { case "------": elems.taskDescription!.innerText = "This sleeve is currently idle"; diff --git a/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx b/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx index 1a5c707ae..0bfa5c294 100644 --- a/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx +++ b/src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx @@ -84,7 +84,7 @@ export class CovenantPurchasesRoot extends React.Component { for (let i = 0; i < this.props.p.sleeves.length; ++i) { const sleeve = this.props.p.sleeves[i]; upgradePanels.push( - + , ) } diff --git a/src/PersonObjects/formulas/intelligence.ts b/src/PersonObjects/formulas/intelligence.ts index ac0f66f97..1875e77c4 100644 --- a/src/PersonObjects/formulas/intelligence.ts +++ b/src/PersonObjects/formulas/intelligence.ts @@ -1,3 +1,3 @@ -export function calculateIntelligenceBonus(intelligence: number, weight: number = 1): number { +export function calculateIntelligenceBonus(intelligence: number, weight = 1): number { return 1+(weight*Math.pow(intelligence, 0.8)/600); } \ No newline at end of file diff --git a/src/PersonObjects/formulas/reputation.ts b/src/PersonObjects/formulas/reputation.ts index b9006ecaa..6e52ad264 100644 --- a/src/PersonObjects/formulas/reputation.ts +++ b/src/PersonObjects/formulas/reputation.ts @@ -4,7 +4,7 @@ import { CONSTANTS } from '../../Constants'; import { BitNodeMultipliers } from '../../BitNode/BitNodeMultipliers'; function mult(f: Faction): number { - var favorMult = 1 + (f.favor / 100); + let favorMult = 1 + (f.favor / 100); if (isNaN(favorMult)) {favorMult = 1;} return favorMult * BitNodeMultipliers.FactionWorkRepGain; } @@ -16,7 +16,7 @@ export function getHackingWorkRepGain(p: IPlayer, f: Faction): number { } export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number { - var t = 0.9 * (p.hacking_skill / CONSTANTS.MaxSkillLevel + + const t = 0.9 * (p.hacking_skill / CONSTANTS.MaxSkillLevel + p.strength / CONSTANTS.MaxSkillLevel + p.defense / CONSTANTS.MaxSkillLevel + p.dexterity / CONSTANTS.MaxSkillLevel + @@ -25,7 +25,7 @@ export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number { } export function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number { - var t = 0.9 * (p.hacking_skill / CONSTANTS.MaxSkillLevel + + const t = 0.9 * (p.hacking_skill / CONSTANTS.MaxSkillLevel + p.strength / CONSTANTS.MaxSkillLevel + p.defense / CONSTANTS.MaxSkillLevel + p.dexterity / CONSTANTS.MaxSkillLevel + diff --git a/src/PersonObjects/formulas/skill.ts b/src/PersonObjects/formulas/skill.ts index 3adba0d39..4cf687aa1 100644 --- a/src/PersonObjects/formulas/skill.ts +++ b/src/PersonObjects/formulas/skill.ts @@ -1,7 +1,7 @@ -export function calculateSkill(exp: number, mult: number = 1): number { +export function calculateSkill(exp: number, mult = 1): number { return Math.max(Math.floor(mult*(32 * Math.log(exp + 534.5) - 200)), 1); } -export function calculateExp(skill: number, mult: number = 1): number { +export function calculateExp(skill: number, mult = 1): number { return Math.exp((skill / mult + 200) / 32) - 534.6 } \ No newline at end of file diff --git a/src/Prestige.js b/src/Prestige.js index 19bc56089..9b3589eec 100755 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -1,7 +1,7 @@ import { Augmentations } from "./Augmentation/Augmentations"; import { augmentationExists, - initAugmentations + initAugmentations, } from "./Augmentation/AugmentationHelpers"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { initBitNodeMultipliers } from "./BitNode/BitNode"; @@ -27,18 +27,18 @@ import { AllServers, AddToAllServers, initForeignServers, - prestigeAllServers + prestigeAllServers, } from "./Server/AllServers"; import { Server } from "./Server/Server"; import { prestigeHomeComputer } from "./Server/ServerHelpers"; import { SourceFileFlags, - updateSourceFileFlags + updateSourceFileFlags, } from "./SourceFile/SourceFileFlags"; import { SpecialServerIps, prestigeSpecialServerIps, - SpecialServerNames + SpecialServerNames, } from "./Server/SpecialServerIps"; import { deleteStockMarket, @@ -289,7 +289,7 @@ function prestigeSourceFile() { var popupId = "bladeburner-bitnode-start-nsa-notification"; var txt = createElement("p", { innerText:"Visit the National Security Agency (NSA) to apply for their Bladeburner " + - "division! You will need 100 of each combat stat before doing this." + "division! You will need 100 of each combat stat before doing this.", }) var brEl = createElement("br"); var okBtn = createElement("a", { @@ -297,7 +297,7 @@ function prestigeSourceFile() { clickListener:()=>{ removeElementById(popupId); return false; - } + }, }); createPopup(popupId, [txt, brEl, okBtn]); }).catch(function(e) { diff --git a/src/Programs/Program.ts b/src/Programs/Program.ts index 96ad7ce04..959cafb5d 100644 --- a/src/Programs/Program.ts +++ b/src/Programs/Program.ts @@ -11,7 +11,7 @@ export interface IProgramCreate { } export class Program { - name: string = ""; + name = ""; create: IProgramCreate | null; constructor(name: string, create: IProgramCreate | null) { diff --git a/src/RedPill.js b/src/RedPill.js index 05892b359..4a5979b51 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -16,7 +16,7 @@ import { yesNoBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, - yesNoBoxClose + yesNoBoxClose, } from "../utils/YesNoBox"; import { clearEventListeners } from "../utils/uiHelpers/clearEventListeners"; import { removeChildrenFromElement } from "../utils/uiHelpers/removeChildrenFromElement"; diff --git a/src/Script/RamCalculations.js b/src/Script/RamCalculations.js index 8bffd43b4..a2e8ee6cb 100644 --- a/src/Script/RamCalculations.js +++ b/src/Script/RamCalculations.js @@ -324,7 +324,7 @@ export async function calculateRamUsage(codeCopy, otherScripts) { loadedFns: {}, env: { vars: RamCosts, - } + }, } try { diff --git a/src/Script/RunningScript.ts b/src/Script/RunningScript.ts index f3f9b617c..d728033b1 100644 --- a/src/Script/RunningScript.ts +++ b/src/Script/RunningScript.ts @@ -11,7 +11,7 @@ import { post } from "../ui/postToTerminal"; import { Generic_fromJSON, Generic_toJSON, - Reviver + Reviver, } from "../../utils/JSONReviver"; import { getTimestamp } from "../../utils/helpers/getTimestamp"; @@ -29,44 +29,44 @@ export class RunningScript { dataMap: IMap = {}; // Script filename - filename: string = ""; + filename = ""; // This script's logs. An array of log entries logs: string[] = []; // Flag indicating whether the logs have been updated since // the last time the UI was updated - logUpd: boolean = false; + logUpd = false; // Total amount of hacking experience earned from this script when offline - offlineExpGained: number = 0; + offlineExpGained = 0; // Total amount of money made by this script when offline - offlineMoneyMade: number = 0; + offlineMoneyMade = 0; // Number of seconds that the script has been running offline - offlineRunningTime: number = 0.01; + offlineRunningTime = 0.01; // Total amount of hacking experience earned from this script when online - onlineExpGained: number = 0; + onlineExpGained = 0; // Total amount of money made by this script when online - onlineMoneyMade: number = 0; + onlineMoneyMade = 0; // Number of seconds that this script has been running online - onlineRunningTime: number = 0.01; + onlineRunningTime = 0.01; // Process ID. Must be an integer and equals the PID of corresponding WorkerScript - pid: number = -1; + pid = -1; // How much RAM this script uses for ONE thread - ramUsage: number = 0; + ramUsage = 0; // IP of the server on which this script is running - server: string = ""; + server = ""; // Number of threads that this script is running with - threads: number = 1; + threads = 1; constructor(script: Script | null = null, args: any[] = []) { if (script == null) { return; } @@ -91,7 +91,7 @@ export class RunningScript { } displayLog(): void { - for (var i = 0; i < this.logs.length; ++i) { + for (let i = 0; i < this.logs.length; ++i) { post(this.logs[i]); } } @@ -101,7 +101,7 @@ export class RunningScript { } // Update the moneyStolen and numTimesHack maps when hacking - recordHack(serverIp: string, moneyGained: number, n: number=1) { + recordHack(serverIp: string, moneyGained: number, n=1) { if (this.dataMap[serverIp] == null || this.dataMap[serverIp].constructor !== Array) { this.dataMap[serverIp] = [0, 0, 0, 0]; } @@ -110,7 +110,7 @@ export class RunningScript { } // Update the grow map when calling grow() - recordGrow(serverIp: string, n: number=1) { + recordGrow(serverIp: string, n=1) { if (this.dataMap[serverIp] == null || this.dataMap[serverIp].constructor !== Array) { this.dataMap[serverIp] = [0, 0, 0, 0]; } @@ -118,7 +118,7 @@ export class RunningScript { } // Update the weaken map when calling weaken() { - recordWeaken(serverIp: string, n: number=1) { + recordWeaken(serverIp: string, n=1) { if (this.dataMap[serverIp] == null || this.dataMap[serverIp].constructor !== Array) { this.dataMap[serverIp] = [0, 0, 0, 0]; } diff --git a/src/Script/Script.ts b/src/Script/Script.ts index cb3c8d112..71374200c 100644 --- a/src/Script/Script.ts +++ b/src/Script/Script.ts @@ -12,7 +12,7 @@ import { setTimeoutRef } from "../utils/SetTimeoutRef"; import { Generic_fromJSON, Generic_toJSON, - Reviver + Reviver, } from "../../utils/JSONReviver"; import { roundToTwo } from "../../utils/helpers/roundToTwo"; @@ -25,13 +25,13 @@ export class Script { } // Code for this script - code: string = ""; + code = ""; // Filename for the script file - filename: string = ""; + filename = ""; // url of the script if any, only for NS2. - url: string = ""; + url = ""; // The dynamic module generated for this script when it is run. // This is only applicable for NetscriptJS @@ -46,12 +46,12 @@ export class Script { dependencies: ScriptUrl[] = []; // Amount of RAM this Script requres to run - ramUsage: number = 0; + ramUsage = 0; // IP of server that this script is on. - server: string = ""; + server = ""; - constructor(fn: string="", code: string="", server: string="", otherScripts: Script[]=[]) { + constructor(fn="", code="", server="", otherScripts: Script[]=[]) { this.filename = fn; this.code = code; this.ramUsage = 0; @@ -59,7 +59,7 @@ export class Script { this.module = ""; this.moduleSequenceNumber = ++globalModuleSequenceNumber; if (this.code !== "") { this.updateRamUsage(otherScripts); } - }; + } /** * Download the script as a file @@ -70,7 +70,7 @@ export class Script { if (window.navigator.msSaveOrOpenBlob) {// IE10+ window.navigator.msSaveOrOpenBlob(file, filename); } else { // Others - var a = document.createElement("a"), + const a = document.createElement("a"), url = URL.createObjectURL(file); a.href = url; a.download = filename; @@ -119,7 +119,7 @@ export class Script { * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports */ async updateRamUsage(otherScripts: Script[]) { - var res = await calculateRamUsage(this.code, otherScripts); + const res = await calculateRamUsage(this.code, otherScripts); if (res > 0) { this.ramUsage = roundToTwo(res); } diff --git a/src/Script/ScriptHelpers.js b/src/Script/ScriptHelpers.js index 1662c35ad..57da816cc 100644 --- a/src/Script/ScriptHelpers.js +++ b/src/Script/ScriptHelpers.js @@ -11,7 +11,7 @@ import { FconfSettings } from "../Fconf/FconfSettings"; import { iTutorialSteps, iTutorialNextStep, - ITutorial + ITutorial, } from "../InteractiveTutorial"; import { Player } from "../Player"; import { AceEditor } from "../ScriptEditor/Ace"; @@ -31,7 +31,7 @@ import { dialogBoxCreate } from "../../utils/DialogBox"; import { Reviver, Generic_toJSON, - Generic_fromJSON + Generic_fromJSON, } from "../../utils/JSONReviver"; import { compareArrays } from "../../utils/helpers/compareArrays"; import { createElement } from "../../utils/uiHelpers/createElement"; @@ -56,12 +56,12 @@ export function scriptEditorInit() { editor.beautifyScript(); } return false; - } + }, }); // Text that displays RAM calculation scriptEditorRamText = createElement("p", { - display:"inline-block", margin:"10px", id:"script-editor-status-text" + display:"inline-block", margin:"10px", id:"script-editor-status-text", }); // Label for checkbox (defined below) @@ -70,7 +70,7 @@ export function scriptEditorInit() { innerText:"Dynamic RAM Usage Checker", color:"white", tooltip:"Enable/Disable the dynamic RAM Usage display. You may " + "want to disable it for very long scripts because there may be " + - "performance issues" + "performance issues", }); // Checkbox for enabling/disabling dynamic RAM calculation @@ -97,7 +97,7 @@ export function scriptEditorInit() { clickListener:()=>{ saveAndCloseScriptEditor(); return false; - } + }, }); // Add all buttons to the UI diff --git a/src/ScriptEditor/Ace.js b/src/ScriptEditor/Ace.js index 60f8e93a3..684ab5e47 100644 --- a/src/ScriptEditor/Ace.js +++ b/src/ScriptEditor/Ace.js @@ -287,7 +287,7 @@ class AceEditorWrapper extends ScriptEditor { changeListener: () => { this.editor.getSession().$worker.send("changeOptions", [{maxerr:flex1Input.value}]); flex1ValueLabel.innerText = flex1Input.value; - } + }, }); flex1Fieldset.appendChild(flex1Input); flex1Fieldset.appendChild(flex1ValueLabel); diff --git a/src/ScriptEditor/AceNetscriptMode.js b/src/ScriptEditor/AceNetscriptMode.js index 15e70087a..c278769b3 100644 --- a/src/ScriptEditor/AceNetscriptMode.js +++ b/src/ScriptEditor/AceNetscriptMode.js @@ -11,13 +11,13 @@ var DocCommentHighlightRules = function() { this.$rules = { "start" : [ { token : "comment.doc.tag", - regex : "@[\\w\\d_]+" // TODO: fix email addresses + regex : "@[\\w\\d_]+", // TODO: fix email addresses }, DocCommentHighlightRules.getTagRule(), { defaultToken : "comment.doc", - caseInsensitive: true - }] + caseInsensitive: true, + }], }; }; @@ -26,7 +26,7 @@ oop.inherits(DocCommentHighlightRules, TextHighlightRules); DocCommentHighlightRules.getTagRule = function(start) { return { token : "comment.doc.tag.storage.type", - regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b" + regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b", }; } @@ -34,7 +34,7 @@ DocCommentHighlightRules.getStartRule = function(start) { return { token : "comment.doc", // doc comment regex : "\\/\\*(?=\\*)", - next : start + next : start, }; }; @@ -42,7 +42,7 @@ DocCommentHighlightRules.getEndRule = function (start) { return { token : "comment.doc", // closing comment regex : "\\*\\/", - next : start + next : start, }; }; @@ -101,7 +101,7 @@ var NetscriptHighlightRules = function(options) { "null|Infinity|NaN|undefined", "support.function": "alert", - "constant.language.boolean": "true|false" + "constant.language.boolean": "true|false", }, "identifier"); var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void"; @@ -120,136 +120,136 @@ var NetscriptHighlightRules = function(options) { { token : "string", regex : "'(?=.)", - next : "qstring" + next : "qstring", }, { token : "string", regex : '"(?=.)', - next : "qqstring" + next : "qqstring", }, { token : "constant.numeric", // hex - regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/ + regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/, }, { token : "constant.numeric", // float - regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/ + regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/, }, { token : [ "storage.type", "punctuation.operator", "support.function", - "punctuation.operator", "entity.name.function", "text","keyword.operator" + "punctuation.operator", "entity.name.function", "text","keyword.operator", ], regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)", - next: "function_arguments" + next: "function_arguments", }, { token : [ "storage.type", "punctuation.operator", "entity.name.function", "text", - "keyword.operator", "text", "storage.type", "text", "paren.lparen" + "keyword.operator", "text", "storage.type", "text", "paren.lparen", ], regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : [ "entity.name.function", "text", "keyword.operator", "text", "storage.type", - "text", "paren.lparen" + "text", "paren.lparen", ], regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : [ "storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "storage.type", "text", "entity.name.function", "text", "paren.lparen", ], regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : [ - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "storage.type", "text", "entity.name.function", "text", "paren.lparen", ], regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : [ "entity.name.function", "text", "punctuation.operator", - "text", "storage.type", "text", "paren.lparen" + "text", "storage.type", "text", "paren.lparen", ], regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : [ - "text", "text", "storage.type", "text", "paren.lparen" + "text", "text", "storage.type", "text", "paren.lparen", ], regex : "(:)(\\s*)(function)(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : "keyword", regex : "(?:" + kwBeforeRe + ")\\b", - next : "start" + next : "start", }, { token : ["support.constant"], - regex : /that\b/ + regex : /that\b/, }, { token : ["storage.type", "punctuation.operator", "support.function.firebug"], - regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ + regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/, }, { token : keywordMapper, - regex : identifierRe + regex : identifierRe, }, { token : "punctuation.operator", regex : /[.](?![.])/, - next : "property" + next : "property", }, { token : "keyword.operator", regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, - next : "start" + next : "start", }, { token : "punctuation.operator", regex : /[?:,;.]/, - next : "start" + next : "start", }, { token : "paren.lparen", regex : /[\[({]/, - next : "start" + next : "start", }, { token : "paren.rparen", - regex : /[\])}]/ + regex : /[\])}]/, }, { token: "comment", - regex: /^#!.*$/ - } + regex: /^#!.*$/, + }, ], property: [{ token : "text", - regex : "\\s+" + regex : "\\s+", }, { token : [ "storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", - "storage.type", "text", "entity.name.function", "text", "paren.lparen" + "storage.type", "text", "entity.name.function", "text", "paren.lparen", ], regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()", - next: "function_arguments" + next: "function_arguments", }, { token : "punctuation.operator", - regex : /[.](?![.])/ + regex : /[.](?![.])/, }, { token : "support.function", - regex : "/|" + functions + "|/" + regex : "/|" + functions + "|/", }, { token : "support.function", - regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ + regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/, }, { token : "support.function.dom", - regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ + regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/, }, { token : "support.constant", - regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ + regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/, }, { token : "identifier", - regex : identifierRe + regex : identifierRe, }, { regex: "", token: "empty", - next: "no_regex" - } + next: "no_regex", + }, ], "start": [ DocCommentHighlightRules.getStartRule("doc-start"), @@ -257,113 +257,113 @@ var NetscriptHighlightRules = function(options) { { token: "string.regexp", regex: "\\/", - next: "regex" + next: "regex", }, { token : "text", regex : "\\s+|^$", - next : "start" + next : "start", }, { token: "empty", regex: "", - next: "no_regex" - } + next: "no_regex", + }, ], "regex": [ { token: "regexp.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)", }, { token: "string.regexp", regex: "/[sxngimy]*", - next: "no_regex" + next: "no_regex", }, { token : "invalid", - regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ + regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/, }, { token : "constant.language.escape", - regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ + regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/, }, { token : "constant.language.delimiter", - regex: /\|/ + regex: /\|/, }, { token: "constant.language.escape", regex: /\[\^?/, - next: "regex_character_class" + next: "regex_character_class", }, { token: "empty", regex: "$", - next: "no_regex" + next: "no_regex", }, { - defaultToken: "string.regexp" - } + defaultToken: "string.regexp", + }, ], "regex_character_class": [ { token: "regexp.charclass.keyword.operator", - regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" + regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)", }, { token: "constant.language.escape", regex: "]", - next: "regex" + next: "regex", }, { token: "constant.language.escape", - regex: "-" + regex: "-", }, { token: "empty", regex: "$", - next: "no_regex" + next: "no_regex", }, { - defaultToken: "string.regexp.charachterclass" - } + defaultToken: "string.regexp.charachterclass", + }, ], "function_arguments": [ { token: "variable.parameter", - regex: identifierRe + regex: identifierRe, }, { token: "punctuation.operator", - regex: "[, ]+" + regex: "[, ]+", }, { token: "punctuation.operator", - regex: "$" + regex: "$", }, { token: "empty", regex: "", - next: "no_regex" - } + next: "no_regex", + }, ], "qqstring" : [ { token : "constant.language.escape", - regex : escapedRe + regex : escapedRe, }, { token : "string", regex : "\\\\$", - next : "qqstring" + next : "qqstring", }, { token : "string", regex : '"|$', - next : "no_regex" + next : "no_regex", }, { - defaultToken: "string" - } + defaultToken: "string", + }, ], "qstring" : [ { token : "constant.language.escape", - regex : escapedRe + regex : escapedRe, }, { token : "string", regex : "\\\\$", - next : "qstring" + next : "qstring", }, { token : "string", regex : "'|$", - next : "no_regex" + next : "no_regex", }, { - defaultToken: "string" - } - ] + defaultToken: "string", + }, + ], }; @@ -382,24 +382,24 @@ var NetscriptHighlightRules = function(options) { } return val == "{" ? "paren.lparen" : "paren.rparen"; }, - nextState: "start" + nextState: "start", }, { token : "string.quasi.start", regex : /`/, push : [{ token : "constant.language.escape", - regex : escapedRe + regex : escapedRe, }, { token : "paren.quasi.start", regex : /\${/, - push : "start" + push : "start", }, { token : "string.quasi.end", regex : /`/, - next : "pop" + next : "pop", }, { - defaultToken: "string.quasi" - }] + defaultToken: "string.quasi", + }], }); if (!options || options.jsx != false) @@ -436,27 +436,27 @@ function JSX() { } return [{ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml", - value: val.slice(0, offset) + value: val.slice(0, offset), }, { type: "meta.tag.tag-name.xml", - value: val.substr(offset) + value: val.substr(offset), }]; }, regex : "!?|~^@]/; var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; @@ -576,7 +576,7 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) { if (type == wanted) return cont(); else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass(); else return cont(exp); - }; + } return exp; } @@ -1067,7 +1067,7 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) { lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), localVars: parserConfig.localVars, context: parserConfig.localVars && new Context(null, null, false), - indented: basecolumn || 0 + indented: basecolumn || 0, }; if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") state.globalVars = parserConfig.globalVars; @@ -1135,7 +1135,7 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) { skipExpression: function(state) { var top = state.cc[state.cc.length - 1] if (top == expression || top == expressionNoComma) state.cc.pop() - } + }, }; }); diff --git a/src/ScriptEditor/CursorPositions.ts b/src/ScriptEditor/CursorPositions.ts index a31493f50..0702aa3db 100644 --- a/src/ScriptEditor/CursorPositions.ts +++ b/src/ScriptEditor/CursorPositions.ts @@ -24,6 +24,6 @@ export class PositionTracker { } return position; } -}; +} export const CursorPositions: PositionTracker = new PositionTracker(); \ No newline at end of file diff --git a/src/Server/AllServers.ts b/src/Server/AllServers.ts index c91dce857..28d6ab907 100644 --- a/src/Server/AllServers.ts +++ b/src/Server/AllServers.ts @@ -33,7 +33,7 @@ export function createUniqueRandomIp(): string { // Saftely add a Server to the AllServers map export function AddToAllServers(server: Server | HacknetServer): void { - var serverIp = server.ip; + const serverIp = server.ip; if (ipExists(serverIp)) { console.warn(`IP of server that's being added: ${serverIp}`); console.warn(`Hostname of the server thats being added: ${server.hostname}`); @@ -71,7 +71,7 @@ export function initForeignServers(homeComputer: Server) { "hackDifficulty", "moneyAvailable", "requiredHackingSkill", - "serverGrowth" + "serverGrowth", ]; const toNumber = (value: any) => { @@ -90,7 +90,7 @@ export function initForeignServers(homeComputer: Server) { hostname: metadata.hostname, ip: createUniqueRandomIp(), numOpenPortsRequired: metadata.numOpenPortsRequired, - organizationName: metadata.organizationName + organizationName: metadata.organizationName, }; if (metadata.maxRamExponent !== undefined) { @@ -140,7 +140,7 @@ export function initForeignServers(homeComputer: Server) { } export function prestigeAllServers() { - for (var member in AllServers) { + for (const member in AllServers) { delete AllServers[member]; } AllServers = {}; diff --git a/src/Server/BaseServer.ts b/src/Server/BaseServer.ts index f5351787f..20d0c396b 100644 --- a/src/Server/BaseServer.ts +++ b/src/Server/BaseServer.ts @@ -29,28 +29,28 @@ export class BaseServer { // How many CPU cores this server has. Maximum of 8. // Currently, this only affects hacking missions - cpuCores: number = 1; + cpuCores = 1; // Flag indicating whether the FTP port is open - ftpPortOpen: boolean = false; + ftpPortOpen = false; // Flag indicating whether player has admin/root access to this server - hasAdminRights: boolean = false; + hasAdminRights = false; // Hostname. Must be unique - hostname: string = ""; + hostname = ""; // Flag indicating whether HTTP Port is open - httpPortOpen: boolean = false; + httpPortOpen = false; // IP Address. Must be unique - ip: string = ""; + ip = ""; // Flag indicating whether player is curently connected to this server - isConnectedTo: boolean = false; + isConnectedTo = false; // RAM (GB) available on this server - maxRam: number = 0; + maxRam = 0; // Message files AND Literature files on this Server // For Literature files, this array contains only the filename (string) @@ -60,13 +60,13 @@ export class BaseServer { // Name of company/faction/etc. that this server belongs to. // Optional, not applicable to all Servers - organizationName: string = ""; + organizationName = ""; // Programs on this servers. Contains only the names of the programs programs: string[] = []; // RAM (GB) used. i.e. unavailable RAM - ramUsed: number = 0; + ramUsed = 0; // RunningScript files on this server runningScripts: RunningScript[] = []; @@ -79,13 +79,13 @@ export class BaseServer { serversOnNetwork: string[] = []; // Flag indicating whether SMTP Port is open - smtpPortOpen: boolean = false; + smtpPortOpen = false; // Flag indicating whether SQL Port is open - sqlPortOpen: boolean = false; + sqlPortOpen = false; // Flag indicating whether the SSH Port is open - sshPortOpen: boolean = false; + sshPortOpen = false; // Text files on this server textFiles: TextFile[] = []; @@ -122,7 +122,7 @@ export class BaseServer { * Returns null if no such script can be found */ getRunningScript(scriptName: string, scriptArgs: any[]): RunningScript | null { - for (let rs of this.runningScripts) { + for (const rs of this.runningScripts) { if (rs.filename === scriptName && compareArrays(rs.args, scriptArgs)) { return rs; } @@ -199,7 +199,7 @@ export class BaseServer { } } else if (fn.endsWith(".lit")) { for (let i = 0; i < this.messages.length; ++i) { - let f = this.messages[i]; + const f = this.messages[i]; if (typeof f === "string" && f === fn) { this.messages.splice(i, 1); return { res: true }; @@ -243,13 +243,13 @@ export class BaseServer { * Overwrites existing files. Creates new files if the script does not eixst */ writeToScriptFile(fn: string, code: string) { - var ret = { success: false, overwritten: false }; + const ret = { success: false, overwritten: false }; if (!isValidFilePath(fn) || !isScriptFilename(fn)) { return ret; } // Check if the script already exists, and overwrite it if it does for (let i = 0; i < this.scripts.length; ++i) { if (fn === this.scripts[i].filename) { - let script = this.scripts[i]; + const script = this.scripts[i]; script.code = code; script.updateRamUsage(this.scripts); script.markUpdated(); @@ -269,7 +269,7 @@ export class BaseServer { // Write to a text file // Overwrites existing files. Creates new files if the text file does not exist writeToTextFile(fn: string, txt: string) { - var ret = { success: false, overwritten: false }; + const ret = { success: false, overwritten: false }; if (!isValidFilePath(fn) || !fn.endsWith("txt")) { return ret; } // Check if the text file already exists, and overwrite if it does @@ -283,7 +283,7 @@ export class BaseServer { } // Otherwise create a new text file - var newFile = new TextFile(fn, txt); + const newFile = new TextFile(fn, txt); this.textFiles.push(newFile); ret.success = true; return ret; diff --git a/src/Server/Server.ts b/src/Server/Server.ts index 4dc8bb201..2bc97092a 100644 --- a/src/Server/Server.ts +++ b/src/Server/Server.ts @@ -31,39 +31,39 @@ export class Server extends BaseServer { } // Flag indicating whether this server has a backdoor installed by a player - backdoorInstalled: boolean = false; + backdoorInstalled = false; // Initial server security level // (i.e. security level when the server was created) - baseDifficulty: number = 1; + baseDifficulty = 1; // Server Security Level - hackDifficulty: number = 1; + hackDifficulty = 1; // Minimum server security level that this server can be weakened to - minDifficulty: number = 1; + minDifficulty = 1; // How much money currently resides on the server and can be hacked - moneyAvailable: number = 0; + moneyAvailable = 0; // Maximum amount of money that this server can hold - moneyMax: number = 0; + moneyMax = 0; // Number of open ports required in order to gain admin/root access - numOpenPortsRequired: number = 5; + numOpenPortsRequired = 5; // How many ports are currently opened on the server - openPortCount: number = 0; + openPortCount = 0; // Flag indicating wehther this is a purchased server - purchasedByPlayer: boolean = false; + purchasedByPlayer = false; // Hacking level required to hack this server - requiredHackingSkill: number = 1; + requiredHackingSkill = 1; // Parameter that affects how effectively this server's money can // be increased using the grow() Netscript function - serverGrowth: number = 1; + serverGrowth = 1; constructor(params: IConstructorParams={hostname: "", ip: createRandomIp() }) { super(params); @@ -91,7 +91,7 @@ export class Server extends BaseServer { //Port information, required for porthacking servers to get admin rights this.numOpenPortsRequired = params.numOpenPortsRequired != null ? params.numOpenPortsRequired : 5; - }; + } /** * Ensures that the server's difficulty (server security) doesn't get too high @@ -110,7 +110,7 @@ export class Server extends BaseServer { * @param n - Value by which to increase/decrease the server's minimum security * @param perc - Whether it should be changed by a percentage, or a flat value */ - changeMinimumSecurity(n: number, perc: boolean=false): void { + changeMinimumSecurity(n: number, perc=false): void { if (perc) { this.minDifficulty *= n; } else { @@ -126,7 +126,7 @@ export class Server extends BaseServer { * @param n - Value by which to change the server's maximum money * @param perc - Whether it should be changed by a percentage, or a flat value */ - changeMaximumMoney(n: number, perc: boolean=false): void { + changeMaximumMoney(n: number, perc=false): void { if (perc) { this.moneyMax *= n; } else { diff --git a/src/Server/ServerHelpers.ts b/src/Server/ServerHelpers.ts index 1f7c026d7..533653a53 100644 --- a/src/Server/ServerHelpers.ts +++ b/src/Server/ServerHelpers.ts @@ -113,7 +113,7 @@ export function prestigeHomeComputer(homeComp: Server) { //Returns server object with corresponding hostname // Relatively slow, would rather not use this a lot export function GetServerByHostname(hostname: string): Server | HacknetServer | null { - for (var ip in AllServers) { + for (const ip in AllServers) { if (AllServers.hasOwnProperty(ip)) { if (AllServers[ip].hostname == hostname) { return AllServers[ip]; diff --git a/src/Server/ServerPurchases.ts b/src/Server/ServerPurchases.ts index 4cf47549a..8ec4f8fb2 100644 --- a/src/Server/ServerPurchases.ts +++ b/src/Server/ServerPurchases.ts @@ -64,7 +64,7 @@ export function purchaseServer(ram: number, p: IPlayer) { return; } - var hostname = yesNoTxtInpBoxGetInput(); + const hostname = yesNoTxtInpBoxGetInput(); if (hostname == "") { dialogBoxCreate("You must enter a hostname for your new server!"); return; @@ -86,7 +86,7 @@ export function purchaseServer(ram: number, p: IPlayer) { p.purchasedServers.push(newServ.ip); // Connect new server to home computer - var homeComputer = p.getHomeComputer(); + const homeComputer = p.getHomeComputer(); homeComputer.serversOnNetwork.push(newServ.ip); newServ.serversOnNetwork.push(homeComputer.ip); diff --git a/src/Server/SpecialServerIps.ts b/src/Server/SpecialServerIps.ts index a5a73e90f..b55651479 100644 --- a/src/Server/SpecialServerIps.ts +++ b/src/Server/SpecialServerIps.ts @@ -4,7 +4,7 @@ import { Reviver, Generic_fromJSON } from "../../utils/JSONReviver"; /* Holds IP of Special Servers */ -export let SpecialServerNames: IMap = { +export const SpecialServerNames: IMap = { FulcrumSecretTechnologies: "Fulcrum Secret Technologies Server", CyberSecServer: "CyberSec Server", NiteSecServer: "NiteSec Server", @@ -44,7 +44,7 @@ Reviver.constructors.SpecialServerIpsMap = SpecialServerIpsMap; export let SpecialServerIps: SpecialServerIpsMap = new SpecialServerIpsMap(); export function prestigeSpecialServerIps() { - for (var member in SpecialServerIps) { + for (const member in SpecialServerIps) { delete SpecialServerIps[member]; } diff --git a/src/SourceFile/PlayerOwnedSourceFile.ts b/src/SourceFile/PlayerOwnedSourceFile.ts index 2f641136d..6eb40f3f9 100644 --- a/src/SourceFile/PlayerOwnedSourceFile.ts +++ b/src/SourceFile/PlayerOwnedSourceFile.ts @@ -1,9 +1,9 @@ export class PlayerOwnedSourceFile { // Source-File level - lvl: number = 1; + lvl = 1; // Source-File number - n: number = 1; + n = 1; constructor(n: number, level: number) { this.n = n; diff --git a/src/SourceFile/SourceFile.ts b/src/SourceFile/SourceFile.ts index 96290507a..67c217e0f 100644 --- a/src/SourceFile/SourceFile.ts +++ b/src/SourceFile/SourceFile.ts @@ -2,12 +2,12 @@ import { BitNodes } from "../BitNode/BitNode"; export class SourceFile { info: string; - lvl: number = 1; + lvl = 1; n: number; name: string; - owned: boolean = false; + owned = false; - constructor(number: number, info: string="") { + constructor(number: number, info="") { const bitnodeKey = "BitNode" + number; const bitnode = BitNodes[bitnodeKey]; if (bitnode == null) { diff --git a/src/StockMarket/Order.ts b/src/StockMarket/Order.ts index 7fe880713..fed972051 100644 --- a/src/StockMarket/Order.ts +++ b/src/StockMarket/Order.ts @@ -25,9 +25,9 @@ export class Order { readonly stockSymbol: string; readonly type: OrderTypes; - constructor(stockSymbol: string="", shares: number=0, price: number=0, typ: OrderTypes=OrderTypes.LimitBuy, pos: PositionTypes=PositionTypes.Long) { + constructor(stockSymbol="", shares=0, price=0, typ: OrderTypes=OrderTypes.LimitBuy, pos: PositionTypes=PositionTypes.Long) { // Validate arguments - let invalidArgs: boolean = false; + let invalidArgs = false; if (typeof shares !== "number" || typeof price !== "number") { invalidArgs = true; } diff --git a/src/StockMarket/OrderProcessing.tsx b/src/StockMarket/OrderProcessing.tsx index 7d35c2f21..7f9109723 100644 --- a/src/StockMarket/OrderProcessing.tsx +++ b/src/StockMarket/OrderProcessing.tsx @@ -39,7 +39,7 @@ export interface IProcessOrderRefs { * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function */ export function processOrders(stock: Stock, orderType: OrderTypes, posType: PositionTypes, refs: IProcessOrderRefs): void { - let orderBook = refs.stockMarket["Orders"]; + const orderBook = refs.stockMarket["Orders"]; if (orderBook == null) { const orders: IOrderBook = {}; for (const name in refs.stockMarket) { @@ -115,7 +115,7 @@ function executeOrder(order: Order, refs: IProcessOrderRefs) { // emit popup dialog boxes. This options object configures the functions for that const opts = { rerenderFn: refs.rerenderFn, - suppressDialog: true + suppressDialog: true, } let res = true; diff --git a/src/StockMarket/Stock.ts b/src/StockMarket/Stock.ts index a95455eba..ca8f65be0 100644 --- a/src/StockMarket/Stock.ts +++ b/src/StockMarket/Stock.ts @@ -2,7 +2,7 @@ import { IMinMaxRange } from "../types"; import { Generic_fromJSON, Generic_toJSON, - Reviver + Reviver, } from "../../utils/JSONReviver"; import { getRandomInt } from "../../utils/helpers/getRandomInt"; @@ -181,11 +181,11 @@ export class Stock { this.shareTxUntilMovement = this.shareTxForMovement; // Total shares is determined by market cap, and is rounded to nearest 100k - let totalSharesUnrounded: number = (p.marketCap / this.price); + const totalSharesUnrounded: number = (p.marketCap / this.price); this.totalShares = Math.round(totalSharesUnrounded / 1e5) * 1e5; // Max Shares (Outstanding shares) is a percentage of total shares - const outstandingSharePercentage: number = 0.2; + const outstandingSharePercentage = 0.2; this.maxShares = Math.round((this.totalShares * outstandingSharePercentage) / 1e5) * 1e5; } @@ -214,7 +214,7 @@ export class Stock { * The way a stock's forecast changes depends on various internal properties, * but is ultimately determined by RNG */ - cycleForecast(changeAmt: number=0.1): void { + cycleForecast(changeAmt=0.1): void { const increaseChance = this.getForecastIncreaseChance(); if (Math.random() < increaseChance) { @@ -244,7 +244,7 @@ export class Stock { * Change's the stock's second-order forecast during a stock market 'tick'. * The change for the second-order forecast to increase is 50/50 */ - cycleForecastForecast(changeAmt: number=0.1): void { + cycleForecastForecast(changeAmt=0.1): void { if (Math.random() < 0.5) { this.changeForecastForecast(this.otlkMagForecast + changeAmt); } else { diff --git a/src/StockMarket/StockMarket.tsx b/src/StockMarket/StockMarket.tsx index 307dd5d80..1aec8ab61 100644 --- a/src/StockMarket/StockMarket.tsx +++ b/src/StockMarket/StockMarket.tsx @@ -32,7 +32,7 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; export let StockMarket: IStockMarket | IMap = {}; // Maps full stock name -> Stock object -export let SymbolToStockMap: IMap = {}; // Maps symbol -> Stock object +export const SymbolToStockMap: IMap = {}; // Maps symbol -> Stock object export function placeOrder(stock: Stock, shares: number, price: number, type: OrderTypes, position: PositionTypes, workerScript: WorkerScript | null=null): boolean { const tixApi = (workerScript instanceof WorkerScript); @@ -87,7 +87,7 @@ interface ICancelOrderParams { type?: OrderTypes; } export function cancelOrder(params: ICancelOrderParams, workerScript: WorkerScript | null=null): boolean { - var tixApi = (workerScript instanceof WorkerScript); + const tixApi = (workerScript instanceof WorkerScript); if (StockMarket["Orders"] == null) {return false;} if (params.order && params.order instanceof Order) { const order = params.order; @@ -105,10 +105,10 @@ export function cancelOrder(params: ICancelOrderParams, workerScript: WorkerScri params.pos && params.stock instanceof Stock) { // Order properties are passed in. Need to look for the order var stockOrders = StockMarket["Orders"][params.stock.symbol]; - var orderTxt = params.stock.symbol + " - " + params.shares + " @ " + + const orderTxt = params.stock.symbol + " - " + params.shares + " @ " + numeralWrapper.formatMoney(params.price); for (var i = 0; i < stockOrders.length; ++i) { - var order = stockOrders[i]; + const order = stockOrders[i]; if (params.shares === order.shares && params.price === order.price && params.type === order.type && @@ -221,7 +221,7 @@ export function processStockPrices(numCycles=1) { stockMarketCycle(); } - var v = Math.random(); + const v = Math.random(); for (const name in StockMarket) { const stock = StockMarket[name]; if (!(stock instanceof Stock)) { continue; } @@ -315,7 +315,7 @@ export function displayStockMarketContent() { sellStockShort={sellShort} stockMarket={castedStockMarket} />, - stockMarketContainer + stockMarketContainer, ) } } diff --git a/src/StockMarket/StockMarketHelpers.ts b/src/StockMarket/StockMarketHelpers.ts index 476305668..20675398f 100644 --- a/src/StockMarket/StockMarketHelpers.ts +++ b/src/StockMarket/StockMarketHelpers.ts @@ -87,7 +87,7 @@ export function processTransactionForecastMovement(stock: Stock, shares: number) } // Calculate how many iterations of price changes we need to account for - let remainingShares = shares - firstShares; + const remainingShares = shares - firstShares; let numIterations = 1 + Math.ceil(remainingShares / stock.shareTxForMovement); // If on the offchance we end up perfectly at the next price movement @@ -118,8 +118,8 @@ export function calculateBuyMaxAmount(stock: Stock, posType: PositionTypes, mone const isLong = (posType === PositionTypes.Long); - let remainingMoney = money - CONSTANTS.StockMarketCommission; - let currPrice = isLong ? stock.getAskPrice() : stock.getBidPrice(); + const remainingMoney = money - CONSTANTS.StockMarketCommission; + const currPrice = isLong ? stock.getAskPrice() : stock.getBidPrice(); return Math.floor(remainingMoney / currPrice); } diff --git a/src/StockMarket/ui/InfoAndPurchases.tsx b/src/StockMarket/ui/InfoAndPurchases.tsx index f927b71df..e74d7c54f 100644 --- a/src/StockMarket/ui/InfoAndPurchases.tsx +++ b/src/StockMarket/ui/InfoAndPurchases.tsx @@ -7,7 +7,7 @@ import * as React from "react"; import { getStockMarket4SDataCost, - getStockMarket4STixApiCost + getStockMarket4STixApiCost, } from "../StockMarketCosts"; import { CONSTANTS } from "../../Constants"; @@ -55,7 +55,7 @@ export class InfoAndPurchases extends React.Component { "can change every tick (a tick occurs every few seconds while the game " + "is running).

    " + "A stock's price forecast can change over time. This is also affected by volatility. " + - "The more volatile a stock is, the more its price forecast will change." + "The more volatile a stock is, the more its price forecast will change.", ); } diff --git a/src/StockMarket/ui/StockTicker.tsx b/src/StockMarket/ui/StockTicker.tsx index d3915eb34..22e76aba4 100644 --- a/src/StockMarket/ui/StockTicker.tsx +++ b/src/StockMarket/ui/StockTicker.tsx @@ -166,7 +166,7 @@ export class StockTicker extends React.Component { "Enter the price for your Limit Order", (price: number) => { this.props.placeOrder(this.props.stock, shares, price, OrderTypes.LimitBuy, this.state.position); - } + }, ); break; } @@ -176,7 +176,7 @@ export class StockTicker extends React.Component { "Enter the price for your Stop Order", (price: number) => { this.props.placeOrder(this.props.stock, shares, price, OrderTypes.StopBuy, this.state.position); - } + }, ); break; } @@ -289,7 +289,7 @@ export class StockTicker extends React.Component { "Enter the price for your Limit Order", (price: number) => { this.props.placeOrder(this.props.stock, shares, price, OrderTypes.LimitSell, this.state.position); - } + }, ); break; } @@ -299,7 +299,7 @@ export class StockTicker extends React.Component { "Enter the price for your Stop Order", (price: number) => { this.props.placeOrder(this.props.stock, shares, price, OrderTypes.StopSell, this.state.position); - } + }, ) break; } diff --git a/src/StockMarket/ui/StockTickerHeaderText.tsx b/src/StockMarket/ui/StockTickerHeaderText.tsx index 5b6b0911e..bed2784cb 100644 --- a/src/StockMarket/ui/StockTickerHeaderText.tsx +++ b/src/StockMarket/ui/StockTickerHeaderText.tsx @@ -43,8 +43,8 @@ export function StockTickerHeaderText(props: IProps): React.ReactElement { // hdrText += ` - ${stock.getAbsoluteForecast()} / ${stock.otlkMagForecast}`; } - let styleMarkup = { - color: "#66ff33" + const styleMarkup = { + color: "#66ff33", }; if (stock.lastPrice === stock.price) { styleMarkup.color = "white"; diff --git a/src/StockMarket/ui/StockTickers.tsx b/src/StockMarket/ui/StockTickers.tsx index 1771b7679..d111b80e9 100644 --- a/src/StockMarket/ui/StockTickers.tsx +++ b/src/StockMarket/ui/StockTickers.tsx @@ -168,7 +168,7 @@ export class StockTickers extends React.Component { sellStockLong={this.props.sellStockLong} sellStockShort={this.props.sellStockShort} stock={val} - /> + />, ) } } diff --git a/src/StockMarket/ui/StockTickersConfig.tsx b/src/StockMarket/ui/StockTickersConfig.tsx index 115da22b8..8c78733f1 100644 --- a/src/StockMarket/ui/StockTickersConfig.tsx +++ b/src/StockMarket/ui/StockTickersConfig.tsx @@ -26,8 +26,8 @@ export class StockTickersConfig extends React.Component { } renderDisplayModeButton() { - let txt: string = ""; - let tooltip: string = ""; + let txt = ""; + let tooltip = ""; if (this.props.tickerDisplayMode === TickerDisplayMode.Portfolio) { txt = "Switch to 'All Stocks' Mode"; tooltip = "Displays all stocks on the WSE"; diff --git a/src/Terminal.jsx b/src/Terminal.jsx index cfe596851..ce4a29ee3 100644 --- a/src/Terminal.jsx +++ b/src/Terminal.jsx @@ -6,7 +6,7 @@ import { isValidDirectoryPath, isValidFilename, removeLeadingSlash, - removeTrailingSlash + removeTrailingSlash, } from "./Terminal/DirectoryHelpers"; import { determineAllPossibilitiesForTabCompletion } from "./Terminal/determineAllPossibilitiesForTabCompletion"; import { TerminalHelpText, HelpTexts } from "./Terminal/HelpText"; @@ -18,19 +18,19 @@ import { parseAliasDeclaration, printAliases, removeAlias, - substituteAliases + substituteAliases, } from "./Alias"; import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers"; import { CodingContract, CodingContractResult, - CodingContractRewardType + CodingContractRewardType, } from "./CodingContracts"; import { CONSTANTS } from "./Constants"; import { Programs } from "./Programs/Programs"; import { executeDarkwebTerminalCommand, - checkIfConnectedToDarkweb + checkIfConnectedToDarkweb, } from "./DarkWeb/DarkWeb"; import { DarkWebItems } from "./DarkWeb/DarkWebItems"; import { Engine } from "./engine"; @@ -42,13 +42,13 @@ import { calculatePercentMoneyHacked, calculateHackingTime, calculateGrowTime, - calculateWeakenTime + calculateWeakenTime, } from "./Hacking"; import { HacknetServer } from "./Hacknet/HacknetServer"; import { iTutorialNextStep, iTutorialSteps, - ITutorial + ITutorial, } from "./InteractiveTutorial"; import { showLiterature } from "./Literature/LiteratureHelpers"; import { Message } from "./Message/Message"; @@ -67,12 +67,12 @@ import { Server } from "./Server/Server"; import { GetServerByHostname, getServer, - getServerOnNetwork + getServerOnNetwork, } from "./Server/ServerHelpers"; import { Settings } from "./Settings/Settings"; import { SpecialServerIps, - SpecialServerNames + SpecialServerNames, } from "./Server/SpecialServerIps"; import { getTextFile } from "./TextFile"; import { setTimeoutRef } from "./utils/SetTimeoutRef"; @@ -88,7 +88,7 @@ import { yesNoBoxCreate, yesNoBoxGetYesButton, yesNoBoxGetNoButton, - yesNoBoxClose + yesNoBoxClose, } from "../utils/YesNoBox"; import { post, @@ -96,7 +96,7 @@ import { postContent, postError, hackProgressBarPost, - hackProgressPost + hackProgressPost, } from "./ui/postToTerminal"; import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions"; import { Money } from "./ui/React/Money"; @@ -136,7 +136,7 @@ $(document).keydown(function(event) { "[" + (FconfSettings.ENABLE_TIMESTAMPS ? getTimestamp() + " " : "") + Player.getCurrentServer().hostname + - ` ~${dir}]> ${command}` + ` ~${dir}]>
    ${command}`, ); if (command.length > 0) { @@ -1543,7 +1543,7 @@ let Terminal = { spacesPid, script.threads, spacesThread, - ramUsage + ramUsage, ].join(""); post(entry); } diff --git a/src/Terminal/DirectoryHelpers.ts b/src/Terminal/DirectoryHelpers.ts index 0a3692e54..700e72b3f 100644 --- a/src/Terminal/DirectoryHelpers.ts +++ b/src/Terminal/DirectoryHelpers.ts @@ -99,7 +99,7 @@ export function isValidDirectoryPath(path: string): boolean { */ export function isValidFilePath(path: string): boolean { if (path == null || typeof path !== "string") { return false; } - let t_path = path; + const t_path = path; // Impossible for filename to have less than length of 3 if (t_path.length < 3) { return false; } @@ -132,7 +132,7 @@ export function getFirstParentDirectory(path: string): string { if (t_path.lastIndexOf("/") === -1) { return "/"; } - let dirs = t_path.split("/"); + const dirs = t_path.split("/"); if (dirs.length === 0) { return "/"; } return dirs[0] + "/"; @@ -146,7 +146,7 @@ export function getFirstParentDirectory(path: string): string { * If there are no parent directories, it returns the empty string */ export function getAllParentDirectories(path: string): string { - let t_path = path; + const t_path = path; const lastSlash = t_path.lastIndexOf("/"); if (lastSlash === -1) { return ""; } diff --git a/src/Terminal/determineAllPossibilitiesForTabCompletion.ts b/src/Terminal/determineAllPossibilitiesForTabCompletion.ts index 2753c5267..58dbe0c9b 100644 --- a/src/Terminal/determineAllPossibilitiesForTabCompletion.ts +++ b/src/Terminal/determineAllPossibilitiesForTabCompletion.ts @@ -6,7 +6,7 @@ import { getSubdirectories } from "./DirectoryServerHelpers"; import { Aliases, - GlobalAliases + GlobalAliases, } from "../Alias"; import { DarkWebItems } from "../DarkWeb/DarkWebItems"; import { Message } from "../Message/Message"; @@ -48,16 +48,16 @@ const commands = [ "sudov", "tail", "theme", - "top" + "top", ]; -export function determineAllPossibilitiesForTabCompletion(p: IPlayer, input: string, index: number, currPath: string=""): string[] { +export function determineAllPossibilitiesForTabCompletion(p: IPlayer, input: string, index: number, currPath=""): string[] { let allPos: string[] = []; allPos = allPos.concat(Object.keys(GlobalAliases)); const currServ = p.getCurrentServer(); const homeComputer = p.getHomeComputer(); - let parentDirPath: string = ""; + let parentDirPath = ""; let evaledParentDirPath: string | null = null; // Helper functions @@ -208,7 +208,7 @@ export function determineAllPossibilitiesForTabCompletion(p: IPlayer, input: str } if (isCommand("buy")) { - let options = []; + const options = []; for (const i in DarkWebItems) { const item = DarkWebItems[i] options.push(item.program); @@ -238,7 +238,7 @@ export function determineAllPossibilitiesForTabCompletion(p: IPlayer, input: str if (isCommand("connect")) { // All network connections for (var i = 0; i < currServ.serversOnNetwork.length; ++i) { - var serv = AllServers[currServ.serversOnNetwork[i]]; + const serv = AllServers[currServ.serversOnNetwork[i]]; if (serv == null) { continue; } allPos.push(serv.ip); allPos.push(serv.hostname); diff --git a/src/Terminal/tabCompletion.ts b/src/Terminal/tabCompletion.ts index 033323d2d..19b6bd479 100644 --- a/src/Terminal/tabCompletion.ts +++ b/src/Terminal/tabCompletion.ts @@ -1,10 +1,10 @@ import { - post + post, } from "../ui/postToTerminal"; import { containsAllStrings, - longestCommonStart + longestCommonStart, } from "../../utils/StringHelperFunctions"; /** diff --git a/src/TextFile.ts b/src/TextFile.ts index 0e5a6bd3e..1cf2e1d72 100644 --- a/src/TextFile.ts +++ b/src/TextFile.ts @@ -3,7 +3,7 @@ import { dialogBoxCreate } from "../utils/DialogBox"; import { Generic_fromJSON, Generic_toJSON, - Reviver + Reviver, } from "../utils/JSONReviver"; @@ -28,7 +28,7 @@ export class TextFile { */ text: string; - constructor(fn: string = "", txt: string = "") { + constructor(fn = "", txt = "") { this.fn = (fn.endsWith(".txt") ? fn : `${fn}.txt`).replace(/\s+/g, ""); this.text = txt; } diff --git a/src/ThirdParty/Treant.js b/src/ThirdParty/Treant.js index d6c70e515..2ac51885a 100644 --- a/src/ThirdParty/Treant.js +++ b/src/ThirdParty/Treant.js @@ -17,7 +17,7 @@ * Dave Goodchild, https://github.com/dlgoodchild */ -;( function() { +( function() { // Polyfill for IE to use startsWith if (!String.prototype.startsWith) { String.prototype.startsWith = function(searchString, position){ @@ -161,7 +161,7 @@ + UTIL.getStyle( element, 'border-bottom-width', true ) + UTIL.getStyle( element, 'padding-top', true ) + UTIL.getStyle( element, 'padding-bottom', true ) - + nRoundingCompensation + + nRoundingCompensation, ); } }, @@ -181,7 +181,7 @@ + UTIL.getStyle( element, 'border-right-width', true ) + UTIL.getStyle( element, 'padding-left', true ) + UTIL.getStyle( element, 'padding-right', true ) - + nRoundingCompensation + + nRoundingCompensation, ); } }, @@ -195,7 +195,7 @@ strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){ return p1.toUpperCase(); - } + }, ); strValue = element.currentStyle[strCssRule]; } @@ -332,7 +332,7 @@ */ isNotLoading: function() { return ( this.loading.length === 0 ); - } + }, }; /** @@ -392,7 +392,7 @@ this.store[treeId] = null; } return this; - } + }, }; /** @@ -513,7 +513,7 @@ function() { root.toggleCollapse(); }, - this.CONFIG.animateOnInitDelay + this.CONFIG.animateOnInitDelay, ); } @@ -531,7 +531,7 @@ setTimeout( function() { self.positionTree( callback ); - }, 10 + }, 10, ); } return this; @@ -751,7 +751,7 @@ var self = this, treeSize = { x: self.nodeDB.getMinMaxCoord('X', null, null), - y: self.nodeDB.getMinMaxCoord('Y', null, null) + y: self.nodeDB.getMinMaxCoord('Y', null, null), }, treeWidth = treeSize.x.max - treeSize.x.min, @@ -759,7 +759,7 @@ treeCenter = { x: treeSize.x.max - treeWidth/2, - y: treeSize.y.max - treeHeight/2 + y: treeSize.y.max - treeHeight/2, }; this.handleOverflow(treeWidth, treeHeight); @@ -767,7 +767,7 @@ var containerCenter = { x: self.drawArea.clientWidth/2, - y: self.drawArea.clientHeight/2 + y: self.drawArea.clientHeight/2, }, deltaX = containerCenter.x - treeCenter.x, @@ -857,7 +857,7 @@ if (jq_drawArea.hasClass('ps-container')) { // znaci da je 'fancy' vec inicijaliziran, treba updateat jq_drawArea.find('.Treant').css({ width: viewWidth, - height: viewHeight + height: viewHeight, }); jq_drawArea.perfectScrollbar('update'); @@ -868,7 +868,7 @@ child.css({ width: viewWidth, - height: viewHeight + height: viewHeight, }); mainContainer.perfectScrollbar(); @@ -948,7 +948,7 @@ { path: pathString.charAt(0) === "_"? pathString.substring(1): - pathString // remove the "_" prefix if it exists + pathString, // remove the "_" prefix if it exists }, this.CONFIG.animation.connectorsSpeed, this.CONFIG.animation.connectorsAnimation, @@ -957,7 +957,7 @@ path.hide(); path.hidden = true; } - } + }, ); return this; }, @@ -1064,7 +1064,7 @@ calcLevelDim: function( node, level ) { // root node is on level 0 this.levelMaxDim[level] = { width: Math.max( this.levelMaxDim[level]? this.levelMaxDim[level].width: 0, node.width ), - height: Math.max( this.levelMaxDim[level]? this.levelMaxDim[level].height: 0, node.height ) + height: Math.max( this.levelMaxDim[level]? this.levelMaxDim[level].height: 0, node.height ), }; return this; }, @@ -1083,7 +1083,7 @@ */ root: function() { return this.nodeDB.get( 0 ); - } + }, }; /** @@ -1232,7 +1232,7 @@ else { parent.children.splice( Math.max( position, parent.children.length - 1 ), - 0, node.id + 0, node.id, ); } } @@ -1256,7 +1256,7 @@ MinMax = MinMax || { // start with root node dimensions min: parent[dim], - max: parent[dim] + ( ( dim === 'X' )? parent.width: parent.height ) + max: parent[dim] + ( ( dim === 'X' )? parent.width: parent.height ), }; var i = parent.childrenCount(); @@ -1290,7 +1290,7 @@ } } return false; - } + }, }; /** @@ -1622,7 +1622,7 @@ self.toggleCollapse(); self.getTreeConfig().callback.onAfterClickCollapseSwitch.apply( self, [ nodeSwitch, e ] ); - } + }, ); }, @@ -1669,7 +1669,7 @@ }, ( oTree.CONFIG.animation.nodeSpeed > oTree.CONFIG.animation.connectorsSpeed )? oTree.CONFIG.animation.nodeSpeed: - oTree.CONFIG.animation.connectorsSpeed + oTree.CONFIG.animation.connectorsSpeed, ); } return this; @@ -1686,7 +1686,7 @@ var tree = this.getTree(), config = this.getTreeConfig(), oNewState = { - opacity: 0 + opacity: 0, }; if ( collapse_to_point ) { @@ -1713,7 +1713,7 @@ oNewState, config.animation.nodeSpeed, config.animation.nodeAnimation, function () { this.style.visibility = 'hidden'; - } + }, ); } else { @@ -1752,7 +1752,7 @@ oPath.animate( { 'opacity': 0 }, oTree.CONFIG.animation.connectorsSpeed, - oTree.CONFIG.animation.connectorsAnimation + oTree.CONFIG.animation.connectorsAnimation, ); } return this; @@ -1769,7 +1769,7 @@ var oNewState = { left: this.X, top: this.Y, - opacity: 1 + opacity: 1, }, config = this.getTreeConfig(); @@ -1781,7 +1781,7 @@ function () { // $.animate applies "overflow:hidden" to the node, remove it to avoid visual problems this.style.overflow = ""; - } + }, ); } else { @@ -1810,11 +1810,11 @@ oPath.animate( { 'opacity': 1 }, oTree.CONFIG.animation.connectorsSpeed, - oTree.CONFIG.animation.connectorsAnimation + oTree.CONFIG.animation.connectorsAnimation, ); } return this; - } + }, }; @@ -1868,8 +1868,8 @@ textElement.className = "node-"+key; textElement.appendChild(document.createTextNode( this.text[key].val ? this.text[key].val : - this.text[key] instanceof Object ? "'val' param missing!" : this.text[key] - ) + this.text[key] instanceof Object ? "'val' param missing!" : this.text[key], + ), ); node.appendChild(textElement); @@ -1941,7 +1941,7 @@ } else { node.data = { - 'treenode': this + 'treenode': this, }; } @@ -2017,9 +2017,9 @@ connectors: { type: 'curve', // 'curve' || 'step' || 'straight' || 'bCurve' style: { - stroke: 'black' + stroke: 'black', }, - stackIndent: 15 + stackIndent: 15, }, node: { // each node inherits this, it can all be overridden in node config @@ -2028,15 +2028,15 @@ // drawLineThrough: false, // collapsable: false, link: { - target: '_self' - } + target: '_self', + }, }, animation: { // each node inherits this, it can all be overridden in node config nodeSpeed: 450, nodeAnimation: 'linear', connectorsSpeed: 450, - connectorsAnimation: 'linear' + connectorsAnimation: 'linear', }, callback: { @@ -2049,12 +2049,12 @@ onToggleCollapseFinished: function ( treeNode, bIsCollapsed ) {}, // this = Tree onAfterClickCollapseSwitch: function( nodeSwitch, event ) {}, // this = TreeNode onBeforeClickCollapseSwitch: function( nodeSwitch, event ) {}, // this = TreeNode - onTreeLoaded: function( rootTreeNode ) {} // this = Tree - } + onTreeLoaded: function( rootTreeNode ) {}, // this = Tree + }, }; TreeNode.CONFIG = { - nodeHTMLclass: 'node' + nodeHTMLclass: 'node', }; // ############################################# @@ -2068,7 +2068,7 @@ this.jsonStructure = { chart: null, - nodeStructure: null + nodeStructure: null, }; //fist loop: find config, find root; while(i--) { @@ -2141,7 +2141,7 @@ return i++; }; } - )() + )(), }; /** diff --git a/src/ThirdParty/raphael.min.js b/src/ThirdParty/raphael.min.js index 75a545b54..16fd7b4b0 100644 --- a/src/ThirdParty/raphael.min.js +++ b/src/ThirdParty/raphael.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Raphael=e():t.Raphael=e()}(window,function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=4)}([function(t,e,r){var i,n;i=[r(3)],void 0===(n=function(t){function e(i){if(e.is(i,"function"))return r?i():t.on("raphael.DOMload",i);if(e.is(i,T))return e._engine.create[c](e,i.splice(0,3+e.is(i[0],A))).add(i);var n=Array.prototype.slice.call(arguments,0);if(e.is(n[n.length-1],"function")){var a=n.pop();return r?a.call(e._engine.create[c](e,n)):t.on("raphael.DOMload",function(){a.call(e._engine.create[c](e,n))})}return e._engine.create[c](e,arguments)}e.version="2.2.0",e.eve=t;var r,i,n=/[, ]+/,a={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},s=/\{(\d+)\}/g,o="hasOwnProperty",l={doc:document,win:window},h={was:Object.prototype[o].call(l.win,"Raphael"),is:l.win.Raphael},u=function(){this.ca=this.customAttributes={}},c="apply",f="concat",p="ontouchstart"in l.win||l.win.DocumentTouch&&l.doc instanceof DocumentTouch,d="",g=" ",x=String,v="split",y="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[v](g),m={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},b=x.prototype.toLowerCase,_=Math,w=_.max,k=_.min,B=_.abs,C=_.pow,S=_.PI,A="number",T="array",M=Object.prototype.toString,E=(e._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),N={NaN:1,Infinity:1,"-Infinity":1},L=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,P=_.round,z=parseFloat,F=parseInt,R=x.prototype.toUpperCase,j=e._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0,class:""},I=e._availableAnimAttrs={blur:A,"clip-rect":"csv",cx:A,cy:A,fill:"colour","fill-opacity":A,"font-size":A,height:A,opacity:A,path:"path",r:A,rx:A,ry:A,stroke:"colour","stroke-opacity":A,"stroke-width":A,transform:"transform",width:A,x:A,y:A},D=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,q={hs:1,rg:1},O=/,?([achlmqrstvxz]),?/gi,V=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,Y=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,W=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,G=(e._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),H=function(t,e){return z(t)-z(e)},X=function(t){return t},U=e._rectPath=function(t,e,r,i,n){return n?[["M",t+n,e],["l",r-2*n,0],["a",n,n,0,0,1,n,n],["l",0,i-2*n],["a",n,n,0,0,1,-n,n],["l",2*n-r,0],["a",n,n,0,0,1,-n,-n],["l",0,2*n-i],["a",n,n,0,0,1,n,-n],["z"]]:[["M",t,e],["l",r,0],["l",0,i],["l",-r,0],["z"]]},$=function(t,e,r,i){return null==i&&(i=r),[["M",t,e],["m",0,-i],["a",r,i,0,1,1,0,2*i],["a",r,i,0,1,1,0,-2*i],["z"]]},Z=e._getPath={path:function(t){return t.attr("path")},circle:function(t){var e=t.attrs;return $(e.cx,e.cy,e.r)},ellipse:function(t){var e=t.attrs;return $(e.cx,e.cy,e.rx,e.ry)},rect:function(t){var e=t.attrs;return U(e.x,e.y,e.width,e.height,e.r)},image:function(t){var e=t.attrs;return U(e.x,e.y,e.width,e.height)},text:function(t){var e=t._getBBox();return U(e.x,e.y,e.width,e.height)},set:function(t){var e=t._getBBox();return U(e.x,e.y,e.width,e.height)}},Q=e.mapPath=function(t,e){if(!e)return t;var r,i,n,a,s,o,l;for(n=0,s=(t=At(t)).length;n',(J=K.firstChild).style.behavior="url(#default#VML)",!J||"object"!=typeof J.adj)return e.type=d;K=null}function tt(t){if("function"==typeof t||Object(t)!==t)return t;var e=new t.constructor;for(var r in t)t[o](r)&&(e[r]=tt(t[r]));return e}e.svg=!(e.vml="VML"==e.type),e._Paper=u,e.fn=i=u.prototype=e.prototype,e._id=0,e.is=function(t,e){return"finite"==(e=b.call(e))?!N[o](+t):"array"==e?t instanceof Array:"null"==e&&null===t||e==typeof t&&null!==t||"object"==e&&t===Object(t)||"array"==e&&Array.isArray&&Array.isArray(t)||M.call(t).slice(8,-1).toLowerCase()==e},e.angle=function(t,r,i,n,a,s){if(null==a){var o=t-i,l=r-n;return o||l?(180+180*_.atan2(-l,-o)/S+360)%360:0}return e.angle(t,r,a,s)-e.angle(i,n,a,s)},e.rad=function(t){return t%360*S/180},e.deg=function(t){return Math.round(180*t/S%360*1e3)/1e3},e.snapTo=function(t,r,i){if(i=e.is(i,"finite")?i:10,e.is(t,T)){for(var n=t.length;n--;)if(B(t[n]-r)<=i)return t[n]}else{var a=r%(t=+t);if(at-i)return r-a+t}return r};var et,rt;e.createUUID=(et=/[xy]/g,rt=function(t){var e=16*_.random()|0;return("x"==t?e:3&e|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(et,rt).toUpperCase()});e.setWindow=function(r){t("raphael.setWindow",e,l.win,r),l.win=r,l.doc=l.win.document,e._engine.initWin&&e._engine.initWin(l.win)};var it=function(t){if(e.vml){var r,i=/^\s+|\s+$/g;try{var n=new ActiveXObject("htmlfile");n.write(""),n.close(),r=n.body}catch(t){r=createPopup().document.body}var a=r.createTextRange();it=ht(function(t){try{r.style.color=x(t).replace(i,d);var e=a.queryCommandValue("ForeColor");return"#"+("000000"+(e=(255&e)<<16|65280&e|(16711680&e)>>>16).toString(16)).slice(-6)}catch(t){return"none"}})}else{var s=l.doc.createElement("i");s.title="RaphaĆ«l Colour Picker",s.style.display="none",l.doc.body.appendChild(s),it=ht(function(t){return s.style.color=t,l.doc.defaultView.getComputedStyle(s,d).getPropertyValue("color")})}return it(t)},nt=function(){return"hsb("+[this.h,this.s,this.b]+")"},at=function(){return"hsl("+[this.h,this.s,this.l]+")"},st=function(){return this.hex},ot=function(t,r,i){if(null==r&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,r=t.g,t=t.r),null==r&&e.is(t,"string")){var n=e.getRGB(t);t=n.r,r=n.g,i=n.b}return(t>1||r>1||i>1)&&(t/=255,r/=255,i/=255),[t,r,i]},lt=function(t,r,i,n){var a={r:t*=255,g:r*=255,b:i*=255,hex:e.rgb(t,r,i),toString:st};return e.is(n,"finite")&&(a.opacity=n),a};function ht(t,e,r){return function i(){var n=Array.prototype.slice.call(arguments,0),a=n.join("ā€"),s=i.cache=i.cache||{},l=i.count=i.count||[];return s[o](a)?(function(t,e){for(var r=0,i=t.length;r=1e3&&delete s[l.shift()],l.push(a),s[a]=t[c](e,n),r?r(s[a]):s[a])}}e.color=function(t){var r;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(r=e.hsb2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(r=e.hsl2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):(e.is(t,"string")&&(t=e.getRGB(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(r=e.rgb2hsl(t),t.h=r.h,t.s=r.s,t.l=r.l,r=e.rgb2hsb(t),t.v=r.b):(t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1),t.toString=st,t},e.hsb2rgb=function(t,e,r,i){var n,a,s,o,l;return this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(r=t.b,e=t.s,i=t.o,t=t.h),o=(l=r*e)*(1-B((t=(t*=360)%360/60)%2-1)),n=a=s=r-l,lt(n+=[l,o,0,0,o,l][t=~~t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],i)},e.hsl2rgb=function(t,e,r,i){var n,a,s,o,l;return this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(r=t.l,e=t.s,t=t.h),(t>1||e>1||r>1)&&(t/=360,e/=100,r/=100),t=(t*=360)%360/60,o=(l=2*e*(r<.5?r:1-r))*(1-B(t%2-1)),n=a=s=r-l/2,lt(n+=[l,o,0,0,o,l][t=~~t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],i)},e.rgb2hsb=function(t,e,r){var i,n;return t=(r=ot(t,e,r))[0],e=r[1],r=r[2],{h:((0==(n=(i=w(t,e,r))-k(t,e,r))?null:i==t?(e-r)/n:i==e?(r-t)/n+2:(t-e)/n+4)+360)%6*60/360,s:0==n?0:n/i,b:i,toString:nt}},e.rgb2hsl=function(t,e,r){var i,n,a,s;return t=(r=ot(t,e,r))[0],e=r[1],r=r[2],i=((n=w(t,e,r))+(a=k(t,e,r)))/2,{h:((0==(s=n-a)?null:n==t?(e-r)/s:n==e?(r-t)/s+2:(t-e)/s+4)+360)%6*60/360,s:0==s?0:i<.5?s/(2*i):s/(2-2*i),l:i,toString:at}},e._path2string=function(){return this.join(",").replace(O,"$1")};e._preload=function(t,e){var r=l.doc.createElement("img");r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){e.call(this),this.onload=null,l.doc.body.removeChild(this)},r.onerror=function(){l.doc.body.removeChild(this)},l.doc.body.appendChild(r),r.src=t};function ut(){return this.hex}function ct(t,e){for(var r=[],i=0,n=t.length;n-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?n-4==i?a[3]={x:+t[0],y:+t[1]}:n-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[n-2],y:+t[n-1]}:n-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}e.getRGB=ht(function(t){if(!t||(t=x(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:ut};if("none"==t)return{r:-1,g:-1,b:-1,hex:"none",toString:ut};!q[o](t.toLowerCase().substring(0,2))&&"#"!=t.charAt()&&(t=it(t));var r,i,n,a,s,l,h=t.match(E);return h?(h[2]&&(n=F(h[2].substring(5),16),i=F(h[2].substring(3,5),16),r=F(h[2].substring(1,3),16)),h[3]&&(n=F((s=h[3].charAt(3))+s,16),i=F((s=h[3].charAt(2))+s,16),r=F((s=h[3].charAt(1))+s,16)),h[4]&&(l=h[4][v](D),r=z(l[0]),"%"==l[0].slice(-1)&&(r*=2.55),i=z(l[1]),"%"==l[1].slice(-1)&&(i*=2.55),n=z(l[2]),"%"==l[2].slice(-1)&&(n*=2.55),"rgba"==h[1].toLowerCase().slice(0,4)&&(a=z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100)),h[5]?(l=h[5][v](D),r=z(l[0]),"%"==l[0].slice(-1)&&(r*=2.55),i=z(l[1]),"%"==l[1].slice(-1)&&(i*=2.55),n=z(l[2]),"%"==l[2].slice(-1)&&(n*=2.55),("deg"==l[0].slice(-3)||"Ā°"==l[0].slice(-1))&&(r/=360),"hsba"==h[1].toLowerCase().slice(0,4)&&(a=z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),e.hsb2rgb(r,i,n,a)):h[6]?(l=h[6][v](D),r=z(l[0]),"%"==l[0].slice(-1)&&(r*=2.55),i=z(l[1]),"%"==l[1].slice(-1)&&(i*=2.55),n=z(l[2]),"%"==l[2].slice(-1)&&(n*=2.55),("deg"==l[0].slice(-3)||"Ā°"==l[0].slice(-1))&&(r/=360),"hsla"==h[1].toLowerCase().slice(0,4)&&(a=z(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),e.hsl2rgb(r,i,n,a)):((h={r:r,g:i,b:n,toString:ut}).hex="#"+(16777216|n|i<<8|r<<16).toString(16).slice(1),e.is(a,"finite")&&(h.opacity=a),h)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:ut}},e),e.hsb=ht(function(t,r,i){return e.hsb2rgb(t,r,i).hex}),e.hsl=ht(function(t,r,i){return e.hsl2rgb(t,r,i).hex}),e.rgb=ht(function(t,e,r){function i(t){return t+.5|0}return"#"+(16777216|i(r)|i(e)<<8|i(t)<<16).toString(16).slice(1)}),e.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),r.hex},e.getColor.reset=function(){delete this.start},e.parsePathString=function(t){if(!t)return null;var r=ft(t);if(r.arr)return mt(r.arr);var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},n=[];return e.is(t,T)&&e.is(t[0],T)&&(n=mt(t)),n.length||x(t).replace(V,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(W,function(t,e){e&&a.push(+e)}),"m"==s&&a.length>2&&(n.push([e][f](a.splice(0,2))),s="l",e="m"==e?"l":"L"),"r"==s)n.push([e][f](a));else for(;a.length>=i[s]&&(n.push([e][f](a.splice(0,i[s]))),i[s]););}),n.toString=e._path2string,r.arr=mt(n),n},e.parseTransformString=ht(function(t){if(!t)return null;var r=[];return e.is(t,T)&&e.is(t[0],T)&&(r=mt(t)),r.length||x(t).replace(Y,function(t,e,i){var n=[];b.call(e);i.replace(W,function(t,e){e&&n.push(+e)}),r.push([e][f](n))}),r.toString=e._path2string,r});var ft=function(t){var e=ft.ps=ft.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var r in e)e[o](r)&&r!=t&&(e[r].sleep--,!e[r].sleep&&delete e[r])}),e[t]};function pt(t,e,r,i,n){return t*(t*(-3*e+9*r-9*i+3*n)+6*e-12*r+6*i)-3*e+3*r}function dt(t,e,r,i,n,a,s,o,l){null==l&&(l=1);for(var h=(l=l>1?1:l<0?0:l)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],c=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,p=0;p<12;p++){var d=h*u[p]+h,g=pt(d,t,r,n,s),x=pt(d,e,i,a,o),v=g*g+x*x;f+=c[p]*_.sqrt(v)}return h*f}function gt(t,e,r,i,n,a,s,o){if(!(w(t,r)w(n,s)||w(e,i)w(a,o))){var l=(t-r)*(a-o)-(e-i)*(n-s);if(l){var h=((t*i-e*r)*(n-s)-(t-r)*(n*o-a*s))/l,u=((t*i-e*r)*(a-o)-(e-i)*(n*o-a*s))/l,c=+h.toFixed(2),f=+u.toFixed(2);if(!(c<+k(t,r).toFixed(2)||c>+w(t,r).toFixed(2)||c<+k(n,s).toFixed(2)||c>+w(n,s).toFixed(2)||f<+k(e,i).toFixed(2)||f>+w(e,i).toFixed(2)||f<+k(a,o).toFixed(2)||f>+w(a,o).toFixed(2)))return{x:h,y:u}}}}function xt(t,r,i){var n=e.bezierBBox(t),a=e.bezierBBox(r);if(!e.isBBoxIntersect(n,a))return i?0:[];for(var s=dt.apply(0,t),o=dt.apply(0,r),l=w(~~(s/5),1),h=w(~~(o/5),1),u=[],c=[],f={},p=i?0:[],d=0;d=0&&A<=1.001&&T>=0&&T<=1.001&&(i?p++:p.push({x:S.x,y:S.y,t1:k(A,1),t2:k(T,1)}))}}return p}function vt(t,r,i){t=e._path2curve(t),r=e._path2curve(r);for(var n,a,s,o,l,h,u,c,f,p,d=i?0:[],g=0,x=t.length;gy||v=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},e.isBBoxIntersect=function(t,r){var i=e.isPointInsideBBox;return i(r,t.x,t.y)||i(r,t.x2,t.y)||i(r,t.x,t.y2)||i(r,t.x2,t.y2)||i(t,r.x,r.y)||i(t,r.x2,r.y)||i(t,r.x,r.y2)||i(t,r.x2,r.y2)||(t.xr.x||r.xt.x)&&(t.yr.y||r.yt.y)},e.pathIntersection=function(t,e){return vt(t,e)},e.pathIntersectionNumber=function(t,e){return vt(t,e,1)},e.isPointInsidePath=function(t,r,i){var n=e.pathBBox(t);return e.isPointInsideBBox(n,r,i)&&vt(t,[["M",r,i],["H",n.x2+10]],1)%2==1},e._removedFactory=function(e){return function(){t("raphael.log",null,"RaphaĆ«l: you are calling to method ā€œ"+e+"ā€ of removed object",e)}};var yt=e.pathBBox=function(t){var e=ft(t);if(e.bbox)return tt(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var r,i=0,n=0,a=[],s=[],o=0,l=(t=At(t)).length;o1&&(r*=m=_.sqrt(m),i*=m);var b=r*r,w=i*i,k=(a==s?-1:1)*_.sqrt(B((b*w-b*y*y-w*x*x)/(b*y*y+w*x*x))),C=k*r*y/i+(t+o)/2,A=k*-i*x/r+(e+l)/2,T=_.asin(((e-A)/i).toFixed(9)),M=_.asin(((l-A)/i).toFixed(9));T=tM&&(T-=2*S),!s&&M>T&&(M-=2*S)}var E=M-T;if(B(E)>c){var N=M,L=o,P=l;M=T+c*(s&&M>T?1:-1),o=C+r*_.cos(M),l=A+i*_.sin(M),d=Bt(o,l,r,i,n,0,s,L,P,[M,N,C,A])}E=M-T;var z=_.cos(T),F=_.sin(T),R=_.cos(M),j=_.sin(M),I=_.tan(E/4),D=4/3*r*I,q=4/3*i*I,O=[t,e],V=[t+D*F,e-q*z],Y=[o+D*j,l-q*R],W=[o,l];if(V[0]=2*O[0]-V[0],V[1]=2*O[1]-V[1],h)return[V,Y,W][f](d);for(var G=[],H=0,X=(d=[V,Y,W][f](d).join()[v](",")).length;H"1e12"&&(p=.5),B(d)>"1e12"&&(d=.5),p>0&&p<1&&(l=Ct(t,e,r,i,n,a,s,o,p),x.push(l.x),g.push(l.y)),d>0&&d<1&&(l=Ct(t,e,r,i,n,a,s,o,d),x.push(l.x),g.push(l.y)),h=a-2*i+e-(o-2*a+i),f=e-i,p=(-(u=2*(i-e)-2*(a-i))+_.sqrt(u*u-4*h*f))/2/h,d=(-u-_.sqrt(u*u-4*h*f))/2/h,B(p)>"1e12"&&(p=.5),B(d)>"1e12"&&(d=.5),p>0&&p<1&&(l=Ct(t,e,r,i,n,a,s,o,p),x.push(l.x),g.push(l.y)),d>0&&d<1&&(l=Ct(t,e,r,i,n,a,s,o,d),x.push(l.x),g.push(l.y)),{min:{x:k[c](0,x),y:k[c](0,g)},max:{x:w[c](0,x),y:w[c](0,g)}}}),At=e._path2curve=ht(function(t,e){var r=!e&&ft(t);if(!e&&r.curve)return mt(r.curve);for(var i=_t(t),n=e&&_t(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=function(t,e,r){var i,n;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M":e.X=t[1],e.Y=t[2];break;case"A":t=["C"][f](Bt[c](0,[e.x,e.y][f](t.slice(1))));break;case"S":"C"==r||"S"==r?(i=2*e.x-e.bx,n=2*e.y-e.by):(i=e.x,n=e.y),t=["C",i,n][f](t.slice(1));break;case"T":"Q"==r||"T"==r?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][f](kt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q":e.qx=t[1],e.qy=t[2],t=["C"][f](kt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L":t=["C"][f](wt(e.x,e.y,t[1],t[2]));break;case"H":t=["C"][f](wt(e.x,e.y,t[1],e.y));break;case"V":t=["C"][f](wt(e.x,e.y,e.x,t[1]));break;case"Z":t=["C"][f](wt(e.x,e.y,e.X,e.Y))}return t},l=function(t,e){if(t[e].length>7){t[e].shift();for(var r=t[e];r.length;)u[e]="A",n&&(p[e]="A"),t.splice(e++,0,["C"][f](r.splice(0,6)));t.splice(e,1),v=w(i.length,n&&n.length||0)}},h=function(t,e,r,a,s){t&&e&&"M"==t[s][0]&&"M"!=e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[s][1],r.y=t[s][2],v=w(i.length,n&&n.length||0))},u=[],p=[],d="",g="",x=0,v=w(i.length,n&&n.length||0);x.01;)u/=2,h=dt(t,e,r,i,n,a,s,o,c+=(hn){if(r&&!f.start){if(c+=["C"+(u=Xt(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p)).start.x,u.start.y,u.m.x,u.m.y,u.x,u.y],a)return c;f.start=c,c=["M"+u.x,u.y+"C"+u.n.x,u.n.y,u.end.x,u.end.y,l[5],l[6]].join(),p+=h,s=+l[5],o=+l[6];continue}if(!t&&!r)return{x:(u=Xt(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p)).x,y:u.y,alpha:u.alpha}}p+=h,s=+l[5],o=+l[6]}c+=l.shift()+l}return f.end=c,(u=t?p:r?f:e.findDotsAtSegment(s,o,l[0],l[1],l[2],l[3],l[4],l[5],1)).alpha&&(u={x:u.x,y:u.y,alpha:u.alpha}),u}},$t=Ut(1),Zt=Ut(),Qt=Ut(0,1);e.getTotalLength=$t,e.getPointAtLength=Zt,e.getSubpath=function(t,e,r){if(this.getTotalLength(t)-r<1e-6)return Qt(t,e).end;var i=Qt(t,r,1);return e?Qt(i,e).end:i},Yt.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():$t(t)},Yt.getPointAtLength=function(t){var e=this.getPath();if(e)return Zt(e,t)},Yt.getPath=function(){var t,r=e._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return r&&(t=r(this)),t},Yt.getSubpath=function(t,r){var i=this.getPath();if(i)return e.getSubpath(i,t,r)};var Jt=e.easing_formulas={linear:function(t){return t},"<":function(t){return C(t,1.7)},">":function(t){return C(t,.48)},"<>":function(t){var e=.48-t/1.04,r=_.sqrt(.1734+e*e),i=r-e,n=-r-e,a=C(B(i),1/3)*(i<0?-1:1)+C(B(n),1/3)*(n<0?-1:1)+.5;return 3*(1-a)*a*a+a*a*a},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:C(2,-10*t)*_.sin(2*S*(t-.075)/.3)+1},bounce:function(t){var e=7.5625,r=2.75;return t<1/r?e*t*t:t<2/r?e*(t-=1.5/r)*t+.75:t<2.5/r?e*(t-=2.25/r)*t+.9375:e*(t-=2.625/r)*t+.984375}};Jt.easeIn=Jt["ease-in"]=Jt["<"],Jt.easeOut=Jt["ease-out"]=Jt[">"],Jt.easeInOut=Jt["ease-in-out"]=Jt["<>"],Jt["back-in"]=Jt.backIn,Jt["back-out"]=Jt.backOut;var Kt=[],te=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},ee=function(){for(var r=+new Date,i=0;i1&&!n.next){for(s in d)d[o](s)&&(y[s]=n.totalOrigin[s]);n.el.attr(y),ae(n.anim,n.el,n.anim.percents[0],null,n.totalOrigin,n.repeat-1)}n.next&&!n.stop&&ae(n.anim,n.el,n.next,null,n.totalOrigin,n.repeat)}}}Kt.length&&te(ee)},re=function(t){return t>255?255:t<0?0:t};function ie(t,e,r,i,n,a){var s=3*e,o=3*(i-e)-s,l=1-s-o,h=3*r,u=3*(n-r)-h,c=1-h-u;function f(t){return((l*t+o)*t+s)*t}return function(t,e){var r=function(t,e){var r,i,n,a,h,u;for(n=t,u=0;u<8;u++){if(a=f(n)-t,B(a)i)return i;for(;ra?r=n:i=n,n=(i-r)/2+r}return n}(t,e);return((c*r+u)*r+h)*r}(t,1/(200*a))}function ne(t,e){var r=[],i={};if(this.ms=e,this.times=1,t){for(var n in t)t[o](n)&&(i[z(n)]=t[n],r.push(z(n)));r.sort(H)}this.anim=i,this.top=r[r.length-1],this.percents=r}function ae(r,i,a,s,l,h){a=z(a);var u,c,p,d,g,y,m=r.ms,b={},_={},w={};if(s)for(B=0,C=Kt.length;Bs*r.top){a=r.percents[B],g=r.percents[B-1]||0,m=m/r.top*(a-g),d=r.percents[B+1],u=r.anim[a];break}s&&i.attr(r.anim[r.percents[B]])}if(u){if(c)c.initstatus=s,c.start=new Date-c.ms*s;else{for(var S in u)if(u[o](S)&&(I[o](S)||i.paper.customAttributes[o](S)))switch(b[S]=i.attr(S),null==b[S]&&(b[S]=j[S]),_[S]=u[S],I[S]){case A:w[S]=(_[S]-b[S])/m;break;case"colour":b[S]=e.getRGB(b[S]);var T=e.getRGB(_[S]);w[S]={r:(T.r-b[S].r)/m,g:(T.g-b[S].g)/m,b:(T.b-b[S].b)/m};break;case"path":var M=At(b[S],_[S]),E=M[1];for(b[S]=M[0],w[S]=[],B=0,C=b[S].length;Bh&&(h=c)}!t[h+="%"].callback&&(t[h].callback=n)}return new ne(t,r)},Yt.animate=function(t,r,i,n){if(this.removed)return n&&n.call(this),this;var a=t instanceof ne?t:e.animation(t,r,i,n);return ae(a,this,a.percents[0],null,this.attr()),this},Yt.setTime=function(t,e){return t&&null!=e&&this.status(t,k(e,t.ms)/t.ms),this},Yt.status=function(t,e){var r,i,n=[],a=0;if(null!=e)return ae(t,this,-1,k(e,1)),this;for(r=Kt.length;a"));var U=H.getBoundingClientRect();A.W=g.w=(U.right-U.left)/100,A.H=g.h=(U.bottom-U.top)/100,A.X=g.x,A.Y=g.y+A.H/2,("x"in l||"y"in l)&&(A.path.v=t.format("m{0},{1}l{2},{1}",a(g.x*y),a(g.y*y),a(g.x*y)+1));for(var $=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,Q=$.length;Z.25&&(r=n.sqrt(.25-o(e-.5,2))*(2*(r>.5)-1)+.5),h=e+c+r),f})).split(/\s*\-\s*/),"linear"==l){var u=a.shift();if(u=-i(u),isNaN(u))return null}var p=t._parseDots(a);if(!p)return null;if(e=e.shape||e.node,p.length){e.removeChild(s),s.on=!0,s.method="none",s.color=p[0].color,s.color2=p[p.length-1].color;for(var d=[],g=0,x=p.length;g')}}catch(t){k=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),r=e.container,i=e.height,n=e.width,a=e.x,s=e.y;if(!r)throw new Error("VML container not found.");var o=new t._Paper,l=o.canvas=t._g.doc.createElement("div"),h=l.style;return a=a||0,s=s||0,n=n||512,i=i||342,o.width=n,o.height=i,n==+n&&(n+="px"),i==+i&&(i+="px"),o.coordsize=216e5+c+216e5,o.coordorigin="0 0",o.span=t._g.doc.createElement("span"),o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(o.span),h.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",n,i),1==r?(t._g.doc.body.appendChild(l),h.left=a+"px",h.top=s+"px",h.position="absolute"):r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),o.renderfix=function(){},o},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=f,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){for(var e in t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[e]="function"==typeof this[e]?t._removedFactory(e):null;return!0};var M=t.st;for(var E in T)T[e](E)&&!M[e](E)&&(M[E]=function(t){return function(){var e=arguments;return this.forEach(function(r){r[t].apply(r,e)})}}(E))}}.apply(e,i))||(t.exports=n)},function(t,e,r){var i,n;i=[r(0)],void 0===(n=function(t){if(!t||t.svg){var e="hasOwnProperty",r=String,i=parseFloat,n=parseInt,a=Math,s=a.max,o=a.abs,l=a.pow,h=/[, ]+/,u=t.eve,c="",f=" ",p="http://www.w3.org/1999/xlink",d={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running RaphaĆ«l "+this.version};var x=function(i,n){if(n)for(var a in"string"==typeof i&&(i=x(i)),n)n[e](a)&&("xlink:"==a.substring(0,6)?i.setAttributeNS(p,a.substring(6),r(n[a])):i.setAttribute(a,r(n[a])));else(i=t._g.doc.createElementNS("http://www.w3.org/2000/svg",i)).style&&(i.style.webkitTapHighlightColor="rgba(0,0,0,0)");return i},v=function(e,n){var h="linear",u=e.id+n,f=.5,p=.5,d=e.node,g=e.paper,v=d.style,m=t._g.doc.getElementById(u);if(!m){if(n=(n=r(n).replace(t._radial_gradient,function(t,e,r){if(h="radial",e&&r){f=i(e);var n=2*((p=i(r))>.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(f-.5,2))*n+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*n)}return c})).split(/\s*\-\s*/),"linear"==h){var b=n.shift();if(b=-i(b),isNaN(b))return null;var _=[0,0,a.cos(t.rad(b)),a.sin(t.rad(b))],w=1/(s(o(_[2]),o(_[3]))||1);_[2]*=w,_[3]*=w,_[2]<0&&(_[0]=-_[2],_[2]=0),_[3]<0&&(_[1]=-_[3],_[3]=0)}var k=t._parseDots(n);if(!k)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){m=x(h+"Gradient",{id:u}),e.gradient=m,x(m,"radial"==h?{fx:f,fy:p}:{x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(m);for(var B=0,C=k.length;B1?P.opacity/100:P.opacity});case"stroke":P=t.getRGB(g),l.setAttribute(d,P.hex),"stroke"==d&&P[e]("opacity")&&x(l,{"stroke-opacity":P.opacity>1?P.opacity/100:P.opacity}),"stroke"==d&&i._.arrows&&("startString"in i._.arrows&&b(i,i._.arrows.startString),"endString"in i._.arrows&&b(i,i._.arrows.endString,1));break;case"gradient":("circle"==i.type||"ellipse"==i.type||"r"!=r(g).charAt())&&v(i,g);break;case"opacity":u.gradient&&!u[e]("stroke-opacity")&&x(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){(z=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c)))&&(F=z.getElementsByTagName("stop"),x(F[F.length-1],{"stop-opacity":g}));break}default:"font-size"==d&&(g=n(g,10)+"px");var R=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[R]=g,i._.dirty=1,l.setAttribute(d,g)}}B(i,a),l.style.visibility=f},B=function(i,a){if("text"==i.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=i.attrs,o=i.node,l=o.firstChild?n(t._g.doc.defaultView.getComputedStyle(o.firstChild,c).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var h,u=r(a.text).split("\n"),f=[],p=0,d=u.length;p1)for(var i=0,n=r.length;i',(J=K.firstChild).style.behavior="url(#default#VML)",!J||typeof J.adj!="object")return e.type=d;K=null}function tt(t){if(typeof t=="function"||Object(t)!==t)return t;var e=new t.constructor;for(var r in t)t[o](r)&&(e[r]=tt(t[r]));return e}e.svg=!(e.vml=e.type=="VML"),e._Paper=u,e.fn=i=u.prototype=e.prototype,e._id=0,e.is=function(t,e){return(e=b.call(e))=="finite"?!N[o](+t):e=="array"?t instanceof Array:e=="null"&&t===null||e==typeof t&&t!==null||e=="object"&&t===Object(t)||e=="array"&&Array.isArray&&Array.isArray(t)||M.call(t).slice(8,-1).toLowerCase()==e},e.angle=function(t,r,i,n,a,s){if(a==null){var o=t-i,l=r-n;return o||l?(180+180*_.atan2(-l,-o)/S+360)%360:0}return e.angle(t,r,a,s)-e.angle(i,n,a,s)},e.rad=function(t){return t%360*S/180},e.deg=function(t){return Math.round(180*t/S%360*1e3)/1e3},e.snapTo=function(t,r,i){if(i=e.is(i,"finite")?i:10,e.is(t,T)){for(var n=t.length;n--;)if(B(t[n]-r)<=i)return t[n]}else{var a=r%(t=+t);if(at-i)return r-a+t}return r};var et,rt;e.createUUID=(et=/[xy]/g,rt=function(t){var e=16*_.random()|0;return(t=="x"?e:3&e|8).toString(16)},function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(et,rt).toUpperCase()});e.setWindow=function(r){t("raphael.setWindow",e,l.win,r),l.win=r,l.doc=l.win.document,e._engine.initWin&&e._engine.initWin(l.win)};var it=function(t){if(e.vml){var r,i=/^\s+|\s+$/g;try{var n=new ActiveXObject("htmlfile");n.write(""),n.close(),r=n.body}catch(t){r=createPopup().document.body}var a=r.createTextRange();it=ht(function(t){try{r.style.color=x(t).replace(i,d);var e=a.queryCommandValue("ForeColor");return"#"+("000000"+(e=(255&e)<<16|65280&e|(16711680&e)>>>16).toString(16)).slice(-6)}catch(t){return"none"}})}else{var s=l.doc.createElement("i");s.title="RaphaĆ«l Colour Picker",s.style.display="none",l.doc.body.appendChild(s),it=ht(function(t){return s.style.color=t,l.doc.defaultView.getComputedStyle(s,d).getPropertyValue("color")})}return it(t)},nt=function(){return"hsb("+[this.h,this.s,this.b]+")"},at=function(){return"hsl("+[this.h,this.s,this.l]+")"},st=function(){return this.hex},ot=function(t,r,i){if(r==null&&e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t&&(i=t.b,r=t.g,t=t.r),r==null&&e.is(t,"string")){var n=e.getRGB(t);t=n.r,r=n.g,i=n.b}return(t>1||r>1||i>1)&&(t/=255,r/=255,i/=255),[t,r,i]},lt=function(t,r,i,n){var a={r:t*=255,g:r*=255,b:i*=255,hex:e.rgb(t,r,i),toString:st};return e.is(n,"finite")&&(a.opacity=n),a};function ht(t,e,r){return function i(){var n=Array.prototype.slice.call(arguments,0),a=n.join("ā€"),s=i.cache=i.cache||{},l=i.count=i.count||[];return s[o](a)?((function(t,e){for(var r=0,i=t.length;r=1e3&&delete s[l.shift()],l.push(a),s[a]=t[c](e,n),r?r(s[a]):s[a])}}e.color=function(t){var r;return e.is(t,"object")&&"h"in t&&"s"in t&&"b"in t?(r=e.hsb2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):e.is(t,"object")&&"h"in t&&"s"in t&&"l"in t?(r=e.hsl2rgb(t),t.r=r.r,t.g=r.g,t.b=r.b,t.hex=r.hex):(e.is(t,"string")&&(t=e.getRGB(t)),e.is(t,"object")&&"r"in t&&"g"in t&&"b"in t?(r=e.rgb2hsl(t),t.h=r.h,t.s=r.s,t.l=r.l,r=e.rgb2hsb(t),t.v=r.b):(t={hex:"none"}).r=t.g=t.b=t.h=t.s=t.v=t.l=-1),t.toString=st,t},e.hsb2rgb=function(t,e,r,i){var n,a,s,o,l;return this.is(t,"object")&&"h"in t&&"s"in t&&"b"in t&&(r=t.b,e=t.s,i=t.o,t=t.h),o=(l=r*e)*(1-B((t=(t*=360)%360/60)%2-1)),n=a=s=r-l,lt(n+=[l,o,0,0,o,l][t=~~t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],i)},e.hsl2rgb=function(t,e,r,i){var n,a,s,o,l;return this.is(t,"object")&&"h"in t&&"s"in t&&"l"in t&&(r=t.l,e=t.s,t=t.h),(t>1||e>1||r>1)&&(t/=360,e/=100,r/=100),t=(t*=360)%360/60,o=(l=2*e*(r<.5?r:1-r))*(1-B(t%2-1)),n=a=s=r-l/2,lt(n+=[l,o,0,0,o,l][t=~~t],a+=[o,l,l,o,0,0][t],s+=[0,0,o,l,l,o][t],i)},e.rgb2hsb=function(t,e,r){var i,n;return t=(r=ot(t,e,r))[0],e=r[1],r=r[2],{h:(((n=(i=w(t,e,r))-k(t,e,r))==0?null:i==t?(e-r)/n:i==e?(r-t)/n+2:(t-e)/n+4)+360)%6*60/360,s:n==0?0:n/i,b:i,toString:nt}},e.rgb2hsl=function(t,e,r){var i,n,a,s;return t=(r=ot(t,e,r))[0],e=r[1],r=r[2],i=((n=w(t,e,r))+(a=k(t,e,r)))/2,{h:(((s=n-a)==0?null:n==t?(e-r)/s:n==e?(r-t)/s+2:(t-e)/s+4)+360)%6*60/360,s:s==0?0:i<.5?s/(2*i):s/(2-2*i),l:i,toString:at}},e._path2string=function(){return this.join(",").replace(O,"$1")};e._preload=function(t,e){var r=l.doc.createElement("img");r.style.cssText="position:absolute;left:-9999em;top:-9999em",r.onload=function(){e.call(this),this.onload=null,l.doc.body.removeChild(this)},r.onerror=function(){l.doc.body.removeChild(this)},l.doc.body.appendChild(r),r.src=t};function ut(){return this.hex}function ct(t,e){for(var r=[],i=0,n=t.length;n-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?n-4==i?a[3]={x:+t[0],y:+t[1]}:n-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[n-2],y:+t[n-1]}:n-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),r.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return r}e.getRGB=ht(function(t){if(!t||(t=x(t)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:ut};if(t=="none")return{r:-1,g:-1,b:-1,hex:"none",toString:ut};!q[o](t.toLowerCase().substring(0,2))&&t.charAt()!="#"&&(t=it(t));var r,i,n,a,s,l,h=t.match(E);return h?(h[2]&&(n=F(h[2].substring(5),16),i=F(h[2].substring(3,5),16),r=F(h[2].substring(1,3),16)),h[3]&&(n=F((s=h[3].charAt(3))+s,16),i=F((s=h[3].charAt(2))+s,16),r=F((s=h[3].charAt(1))+s,16)),h[4]&&(l=h[4][v](D),r=z(l[0]),l[0].slice(-1)=="%"&&(r*=2.55),i=z(l[1]),l[1].slice(-1)=="%"&&(i*=2.55),n=z(l[2]),l[2].slice(-1)=="%"&&(n*=2.55),h[1].toLowerCase().slice(0,4)=="rgba"&&(a=z(l[3])),l[3]&&l[3].slice(-1)=="%"&&(a/=100)),h[5]?(l=h[5][v](D),r=z(l[0]),l[0].slice(-1)=="%"&&(r*=2.55),i=z(l[1]),l[1].slice(-1)=="%"&&(i*=2.55),n=z(l[2]),l[2].slice(-1)=="%"&&(n*=2.55),(l[0].slice(-3)=="deg"||l[0].slice(-1)=="Ā°")&&(r/=360),h[1].toLowerCase().slice(0,4)=="hsba"&&(a=z(l[3])),l[3]&&l[3].slice(-1)=="%"&&(a/=100),e.hsb2rgb(r,i,n,a)):h[6]?(l=h[6][v](D),r=z(l[0]),l[0].slice(-1)=="%"&&(r*=2.55),i=z(l[1]),l[1].slice(-1)=="%"&&(i*=2.55),n=z(l[2]),l[2].slice(-1)=="%"&&(n*=2.55),(l[0].slice(-3)=="deg"||l[0].slice(-1)=="Ā°")&&(r/=360),h[1].toLowerCase().slice(0,4)=="hsla"&&(a=z(l[3])),l[3]&&l[3].slice(-1)=="%"&&(a/=100),e.hsl2rgb(r,i,n,a)):((h={r:r,g:i,b:n,toString:ut}).hex="#"+(16777216|n|i<<8|r<<16).toString(16).slice(1),e.is(a,"finite")&&(h.opacity=a),h)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:ut}},e),e.hsb=ht(function(t,r,i){return e.hsb2rgb(t,r,i).hex}),e.hsl=ht(function(t,r,i){return e.hsl2rgb(t,r,i).hex}),e.rgb=ht(function(t,e,r){function i(t){return t+.5|0}return"#"+(16777216|i(r)|i(e)<<8|i(t)<<16).toString(16).slice(1)}),e.getColor=function(t){var e=this.getColor.start=this.getColor.start||{h:0,s:1,b:t||.75},r=this.hsb2rgb(e.h,e.s,e.b);return e.h+=.075,e.h>1&&(e.h=0,e.s-=.2,e.s<=0&&(this.getColor.start={h:0,s:1,b:e.b})),r.hex},e.getColor.reset=function(){delete this.start},e.parsePathString=function(t){if(!t)return null;var r=ft(t);if(r.arr)return mt(r.arr);var i={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},n=[];return e.is(t,T)&&e.is(t[0],T)&&(n=mt(t)),n.length||x(t).replace(V,function(t,e,r){var a=[],s=e.toLowerCase();if(r.replace(W,function(t,e){e&&a.push(+e)}),s=="m"&&a.length>2&&(n.push([e][f](a.splice(0,2))),s="l",e=e=="m"?"l":"L"),s=="r")n.push([e][f](a));else for(;a.length>=i[s]&&(n.push([e][f](a.splice(0,i[s]))),i[s]););}),n.toString=e._path2string,r.arr=mt(n),n},e.parseTransformString=ht(function(t){if(!t)return null;var r=[];return e.is(t,T)&&e.is(t[0],T)&&(r=mt(t)),r.length||x(t).replace(Y,function(t,e,i){var n=[];b.call(e);i.replace(W,function(t,e){e&&n.push(+e)}),r.push([e][f](n))}),r.toString=e._path2string,r});var ft=function(t){var e=ft.ps=ft.ps||{};return e[t]?e[t].sleep=100:e[t]={sleep:100},setTimeout(function(){for(var r in e)e[o](r)&&r!=t&&(e[r].sleep--,!e[r].sleep&&delete e[r])}),e[t]};function pt(t,e,r,i,n){return t*(t*(-3*e+9*r-9*i+3*n)+6*e-12*r+6*i)-3*e+3*r}function dt(t,e,r,i,n,a,s,o,l){l==null&&(l=1);for(var h=(l=l>1?1:l<0?0:l)/2,u=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],c=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],f=0,p=0;p<12;p++){var d=h*u[p]+h,g=pt(d,t,r,n,s),x=pt(d,e,i,a,o),v=g*g+x*x;f+=c[p]*_.sqrt(v)}return h*f}function gt(t,e,r,i,n,a,s,o){if(!(w(t,r)w(n,s)||w(e,i)w(a,o))){var l=(t-r)*(a-o)-(e-i)*(n-s);if(l){var h=((t*i-e*r)*(n-s)-(t-r)*(n*o-a*s))/l,u=((t*i-e*r)*(a-o)-(e-i)*(n*o-a*s))/l,c=+h.toFixed(2),f=+u.toFixed(2);if(!(c<+k(t,r).toFixed(2)||c>+w(t,r).toFixed(2)||c<+k(n,s).toFixed(2)||c>+w(n,s).toFixed(2)||f<+k(e,i).toFixed(2)||f>+w(e,i).toFixed(2)||f<+k(a,o).toFixed(2)||f>+w(a,o).toFixed(2)))return{x:h,y:u}}}}function xt(t,r,i){var n=e.bezierBBox(t),a=e.bezierBBox(r);if(!e.isBBoxIntersect(n,a))return i?0:[];for(var s=dt.apply(0,t),o=dt.apply(0,r),l=w(~~(s/5),1),h=w(~~(o/5),1),u=[],c=[],f={},p=i?0:[],d=0;d=0&&A<=1.001&&T>=0&&T<=1.001&&(i?p++:p.push({x:S.x,y:S.y,t1:k(A,1),t2:k(T,1)}))}}return p}function vt(t,r,i){t=e._path2curve(t),r=e._path2curve(r);for(var n,a,s,o,l,h,u,c,f,p,d=i?0:[],g=0,x=t.length;gy||v=t.x&&e<=t.x2&&r>=t.y&&r<=t.y2},e.isBBoxIntersect=function(t,r){var i=e.isPointInsideBBox;return i(r,t.x,t.y)||i(r,t.x2,t.y)||i(r,t.x,t.y2)||i(r,t.x2,t.y2)||i(t,r.x,r.y)||i(t,r.x2,r.y)||i(t,r.x,r.y2)||i(t,r.x2,r.y2)||(t.xr.x||r.xt.x)&&(t.yr.y||r.yt.y)},e.pathIntersection=function(t,e){return vt(t,e)},e.pathIntersectionNumber=function(t,e){return vt(t,e,1)},e.isPointInsidePath=function(t,r,i){var n=e.pathBBox(t);return e.isPointInsideBBox(n,r,i)&&vt(t,[["M",r,i],["H",n.x2+10]],1)%2==1},e._removedFactory=function(e){return function(){t("raphael.log",null,"RaphaĆ«l: you are calling to method ā€œ"+e+"ā€ of removed object",e)}};var yt=e.pathBBox=function(t){var e=ft(t);if(e.bbox)return tt(e.bbox);if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0};for(var r,i=0,n=0,a=[],s=[],o=0,l=(t=At(t)).length;o1&&(r*=m=_.sqrt(m),i*=m);var b=r*r,w=i*i,k=(a==s?-1:1)*_.sqrt(B((b*w-b*y*y-w*x*x)/(b*y*y+w*x*x))),C=k*r*y/i+(t+o)/2,A=k*-i*x/r+(e+l)/2,T=_.asin(((e-A)/i).toFixed(9)),M=_.asin(((l-A)/i).toFixed(9));T=tM&&(T-=2*S),!s&&M>T&&(M-=2*S)}var E=M-T;if(B(E)>c){var N=M,L=o,P=l;M=T+c*(s&&M>T?1:-1),o=C+r*_.cos(M),l=A+i*_.sin(M),d=Bt(o,l,r,i,n,0,s,L,P,[M,N,C,A])}E=M-T;var z=_.cos(T),F=_.sin(T),R=_.cos(M),j=_.sin(M),I=_.tan(E/4),D=4/3*r*I,q=4/3*i*I,O=[t,e],V=[t+D*F,e-q*z],Y=[o+D*j,l-q*R],W=[o,l];if(V[0]=2*O[0]-V[0],V[1]=2*O[1]-V[1],h)return[V,Y,W][f](d);for(var G=[],H=0,X=(d=[V,Y,W][f](d).join()[v](",")).length;H"1e12"&&(p=.5),B(d)>"1e12"&&(d=.5),p>0&&p<1&&(l=Ct(t,e,r,i,n,a,s,o,p),x.push(l.x),g.push(l.y)),d>0&&d<1&&(l=Ct(t,e,r,i,n,a,s,o,d),x.push(l.x),g.push(l.y)),h=a-2*i+e-(o-2*a+i),f=e-i,p=(-(u=2*(i-e)-2*(a-i))+_.sqrt(u*u-4*h*f))/2/h,d=(-u-_.sqrt(u*u-4*h*f))/2/h,B(p)>"1e12"&&(p=.5),B(d)>"1e12"&&(d=.5),p>0&&p<1&&(l=Ct(t,e,r,i,n,a,s,o,p),x.push(l.x),g.push(l.y)),d>0&&d<1&&(l=Ct(t,e,r,i,n,a,s,o,d),x.push(l.x),g.push(l.y)),{min:{x:k[c](0,x),y:k[c](0,g)},max:{x:w[c](0,x),y:w[c](0,g)}}}),At=e._path2curve=ht(function(t,e){var r=!e&&ft(t);if(!e&&r.curve)return mt(r.curve);for(var i=_t(t),n=e&&_t(e),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=function(t,e,r){var i,n;if(!t)return["C",e.x,e.y,e.x,e.y,e.x,e.y];switch(!(t[0]in{T:1,Q:1})&&(e.qx=e.qy=null),t[0]){case"M": e.X=t[1],e.Y=t[2];break;case"A": t=["C"][f](Bt[c](0,[e.x,e.y][f](t.slice(1))));break;case"S": r=="C"||r=="S"?(i=2*e.x-e.bx,n=2*e.y-e.by):(i=e.x,n=e.y),t=["C",i,n][f](t.slice(1));break;case"T": r=="Q"||r=="T"?(e.qx=2*e.x-e.qx,e.qy=2*e.y-e.qy):(e.qx=e.x,e.qy=e.y),t=["C"][f](kt(e.x,e.y,e.qx,e.qy,t[1],t[2]));break;case"Q": e.qx=t[1],e.qy=t[2],t=["C"][f](kt(e.x,e.y,t[1],t[2],t[3],t[4]));break;case"L": t=["C"][f](wt(e.x,e.y,t[1],t[2]));break;case"H": t=["C"][f](wt(e.x,e.y,t[1],e.y));break;case"V": t=["C"][f](wt(e.x,e.y,e.x,t[1]));break;case"Z": t=["C"][f](wt(e.x,e.y,e.X,e.Y))}return t},l=function(t,e){if(t[e].length>7){t[e].shift();for(var r=t[e];r.length;)u[e]="A",n&&(p[e]="A"),t.splice(e++,0,["C"][f](r.splice(0,6)));t.splice(e,1),v=w(i.length,n&&n.length||0)}},h=function(t,e,r,a,s){t&&e&&t[s][0]=="M"&&e[s][0]!="M"&&(e.splice(s,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[s][1],r.y=t[s][2],v=w(i.length,n&&n.length||0))},u=[],p=[],d="",g="",x=0,v=w(i.length,n&&n.length||0);x.01;)u/=2,h=dt(t,e,r,i,n,a,s,o,c+=(hn){if(r&&!f.start){if(c+=["C"+(u=Xt(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p)).start.x,u.start.y,u.m.x,u.m.y,u.x,u.y],a)return c;f.start=c,c=["M"+u.x,u.y+"C"+u.n.x,u.n.y,u.end.x,u.end.y,l[5],l[6]].join(),p+=h,s=+l[5],o=+l[6];continue}if(!t&&!r)return{x:(u=Xt(s,o,l[1],l[2],l[3],l[4],l[5],l[6],n-p)).x,y:u.y,alpha:u.alpha}}p+=h,s=+l[5],o=+l[6]}c+=l.shift()+l}return f.end=c,(u=t?p:r?f:e.findDotsAtSegment(s,o,l[0],l[1],l[2],l[3],l[4],l[5],1)).alpha&&(u={x:u.x,y:u.y,alpha:u.alpha}),u}},$t=Ut(1),Zt=Ut(),Qt=Ut(0,1);e.getTotalLength=$t,e.getPointAtLength=Zt,e.getSubpath=function(t,e,r){if(this.getTotalLength(t)-r<1e-6)return Qt(t,e).end;var i=Qt(t,r,1);return e?Qt(i,e).end:i},Yt.getTotalLength=function(){var t=this.getPath();if(t)return this.node.getTotalLength?this.node.getTotalLength():$t(t)},Yt.getPointAtLength=function(t){var e=this.getPath();if(e)return Zt(e,t)},Yt.getPath=function(){var t,r=e._getPath[this.type];if(this.type!="text"&&this.type!="set")return r&&(t=r(this)),t},Yt.getSubpath=function(t,r){var i=this.getPath();if(i)return e.getSubpath(i,t,r)};var Jt=e.easing_formulas={linear:function(t){return t},"<":function(t){return C(t,1.7)},">":function(t){return C(t,.48)},"<>":function(t){var e=.48-t/1.04,r=_.sqrt(.1734+e*e),i=r-e,n=-r-e,a=C(B(i),1/3)*(i<0?-1:1)+C(B(n),1/3)*(n<0?-1:1)+.5;return 3*(1-a)*a*a+a*a*a},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},elastic:function(t){return t==!!t?t:C(2,-10*t)*_.sin(2*S*(t-.075)/.3)+1},bounce:function(t){var e=7.5625,r=2.75;return t<1/r?e*t*t:t<2/r?e*(t-=1.5/r)*t+.75:t<2.5/r?e*(t-=2.25/r)*t+.9375:e*(t-=2.625/r)*t+.984375}};Jt.easeIn=Jt["ease-in"]=Jt["<"],Jt.easeOut=Jt["ease-out"]=Jt[">"],Jt.easeInOut=Jt["ease-in-out"]=Jt["<>"],Jt["back-in"]=Jt.backIn,Jt["back-out"]=Jt.backOut;var Kt=[],te=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,16)},ee=function(){for(var r=+new Date,i=0;i1&&!n.next){for(s in d)d[o](s)&&(y[s]=n.totalOrigin[s]);n.el.attr(y),ae(n.anim,n.el,n.anim.percents[0],null,n.totalOrigin,n.repeat-1)}n.next&&!n.stop&&ae(n.anim,n.el,n.next,null,n.totalOrigin,n.repeat)}}}Kt.length&&te(ee)},re=function(t){return t>255?255:t<0?0:t};function ie(t,e,r,i,n,a){var s=3*e,o=3*(i-e)-s,l=1-s-o,h=3*r,u=3*(n-r)-h,c=1-h-u;function f(t){return((l*t+o)*t+s)*t}return (function(t,e){var r=(function(t,e){var r,i,n,a,h,u;for(n=t,u=0;u<8;u++){if(a=f(n)-t,B(a)i)return i;for(;ra?r=n:i=n,n=(i-r)/2+r}return n}(t,e));return((c*r+u)*r+h)*r}(t,1/(200*a)))}function ne(t,e){var r=[],i={};if(this.ms=e,this.times=1,t){for(var n in t)t[o](n)&&(i[z(n)]=t[n],r.push(z(n)));r.sort(H)}this.anim=i,this.top=r[r.length-1],this.percents=r}function ae(r,i,a,s,l,h){a=z(a);var u,c,p,d,g,y,m=r.ms,b={},_={},w={};if(s)for(B=0,C=Kt.length;Bs*r.top){a=r.percents[B],g=r.percents[B-1]||0,m=m/r.top*(a-g),d=r.percents[B+1],u=r.anim[a];break}s&&i.attr(r.anim[r.percents[B]])}if(u){if(c)c.initstatus=s,c.start=new Date-c.ms*s;else{for(var S in u)if(u[o](S)&&(I[o](S)||i.paper.customAttributes[o](S)))switch(b[S]=i.attr(S),b[S]==null&&(b[S]=j[S]),_[S]=u[S],I[S]){case A: w[S]=(_[S]-b[S])/m;break;case"colour": b[S]=e.getRGB(b[S]);var T=e.getRGB(_[S]);w[S]={r:(T.r-b[S].r)/m,g:(T.g-b[S].g)/m,b:(T.b-b[S].b)/m};break;case"path": var M=At(b[S],_[S]),E=M[1];for(b[S]=M[0],w[S]=[],B=0,C=b[S].length;Bh&&(h=c)}!t[h+="%"].callback&&(t[h].callback=n)}return new ne(t,r)},Yt.animate=function(t,r,i,n){if(this.removed)return n&&n.call(this),this;var a=t instanceof ne?t:e.animation(t,r,i,n);return ae(a,this,a.percents[0],null,this.attr()),this},Yt.setTime=function(t,e){return t&&e!=null&&this.status(t,k(e,t.ms)/t.ms),this},Yt.status=function(t,e){var r,i,n=[],a=0;if(e!=null)return ae(t,this,-1,k(e,1)),this;for(r=Kt.length;a"));var U=H.getBoundingClientRect();A.W=g.w=(U.right-U.left)/100,A.H=g.h=(U.bottom-U.top)/100,A.X=g.x,A.Y=g.y+A.H/2,("x"in l||"y"in l)&&(A.path.v=t.format("m{0},{1}l{2},{1}",a(g.x*y),a(g.y*y),a(g.x*y)+1));for(var $=["x","y","text","font","font-family","font-weight","font-style","font-size"],Z=0,Q=$.length;Z.25&&(r=n.sqrt(.25-o(e-.5,2))*(2*(r>.5)-1)+.5),h=e+c+r),f})).split(/\s*\-\s*/),l=="linear"){var u=a.shift();if(u=-i(u),isNaN(u))return null}var p=t._parseDots(a);if(!p)return null;if(e=e.shape||e.node,p.length){e.removeChild(s),s.on=!0,s.method="none",s.color=p[0].color,s.color2=p[p.length-1].color;for(var d=[],g=0,x=p.length;g')}}catch(t){k=function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},t._engine.initWin(t._g.win),t._engine.create=function(){var e=t._getContainer.apply(0,arguments),r=e.container,i=e.height,n=e.width,a=e.x,s=e.y;if(!r)throw new Error("VML container not found.");var o=new t._Paper,l=o.canvas=t._g.doc.createElement("div"),h=l.style;return a=a||0,s=s||0,n=n||512,i=i||342,o.width=n,o.height=i,n==+n&&(n+="px"),i==+i&&(i+="px"),o.coordsize=216e5+c+216e5,o.coordorigin="0 0",o.span=t._g.doc.createElement("span"),o.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(o.span),h.cssText=t.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",n,i),r==1?(t._g.doc.body.appendChild(l),h.left=a+"px",h.top=s+"px",h.position="absolute"):r.firstChild?r.insertBefore(l,r.firstChild):r.appendChild(l),o.renderfix=function(){},o},t.prototype.clear=function(){t.eve("raphael.clear",this),this.canvas.innerHTML=f,this.span=t._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},t.prototype.remove=function(){for(var e in t.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas),this)this[e]=typeof this[e]=="function"?t._removedFactory(e):null;return!0};var M=t.st;for(var E in T)T[e](E)&&!M[e](E)&&(M[E]=(function(t){return function(){var e=arguments;return this.forEach(function(r){r[t].apply(r,e)})}}(E)))}}.apply(e,i))||(t.exports=n)},function(t,e,r){var i,n;i=[r(0)],void 0===(n=function(t){if(!t||t.svg){var e="hasOwnProperty",r=String,i=parseFloat,n=parseInt,a=Math,s=a.max,o=a.abs,l=a.pow,h=/[, ]+/,u=t.eve,c="",f=" ",p="http://www.w3.org/1999/xlink",d={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},g={};t.toString=function(){return"Your browser supports SVG.\nYou are running RaphaĆ«l "+this.version};var x=function(i,n){if(n)for(var a in typeof i=="string"&&(i=x(i)),n)n[e](a)&&(a.substring(0,6)=="xlink:"?i.setAttributeNS(p,a.substring(6),r(n[a])):i.setAttribute(a,r(n[a])));else(i=t._g.doc.createElementNS("http://www.w3.org/2000/svg",i)).style&&(i.style.webkitTapHighlightColor="rgba(0,0,0,0)");return i},v=function(e,n){var h="linear",u=e.id+n,f=.5,p=.5,d=e.node,g=e.paper,v=d.style,m=t._g.doc.getElementById(u);if(!m){if(n=(n=r(n).replace(t._radial_gradient,function(t,e,r){if(h="radial",e&&r){f=i(e);var n=2*((p=i(r))>.5)-1;l(f-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(f-.5,2))*n+.5)&&p!=.5&&(p=p.toFixed(5)-1e-5*n)}return c})).split(/\s*\-\s*/),h=="linear"){var b=n.shift();if(b=-i(b),isNaN(b))return null;var _=[0,0,a.cos(t.rad(b)),a.sin(t.rad(b))],w=1/(s(o(_[2]),o(_[3]))||1);_[2]*=w,_[3]*=w,_[2]<0&&(_[0]=-_[2],_[2]=0),_[3]<0&&(_[1]=-_[3],_[3]=0)}var k=t._parseDots(n);if(!k)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(g.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){m=x(h+"Gradient",{id:u}),e.gradient=m,x(m,h=="radial"?{fx:f,fy:p}:{x1:_[0],y1:_[1],x2:_[2],y2:_[3],gradientTransform:e.matrix.invert()}),g.defs.appendChild(m);for(var B=0,C=k.length;B1?P.opacity/100:P.opacity});case"stroke": P=t.getRGB(g),l.setAttribute(d,P.hex),d=="stroke"&&P[e]("opacity")&&x(l,{"stroke-opacity":P.opacity>1?P.opacity/100:P.opacity}),d=="stroke"&&i._.arrows&&("startString"in i._.arrows&&b(i,i._.arrows.startString),"endString"in i._.arrows&&b(i,i._.arrows.endString,1));break;case"gradient": (i.type=="circle"||i.type=="ellipse"||r(g).charAt()!="r")&&v(i,g);break;case"opacity": u.gradient&&!u[e]("stroke-opacity")&&x(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity": if(u.gradient){(z=t._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,c)))&&(F=z.getElementsByTagName("stop"),x(F[F.length-1],{"stop-opacity":g}));break}default: d=="font-size"&&(g=n(g,10)+"px");var R=d.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[R]=g,i._.dirty=1,l.setAttribute(d,g)}}B(i,a),l.style.visibility=f},B=function(i,a){if(i.type=="text"&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var s=i.attrs,o=i.node,l=o.firstChild?n(t._g.doc.defaultView.getComputedStyle(o.firstChild,c).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(s.text=a.text;o.firstChild;)o.removeChild(o.firstChild);for(var h,u=r(a.text).split("\n"),f=[],p=0,d=u.length;p1)for(var i=0,n=r.length;i { - let fac: number = 2; + let fac = 2; let n: number = data; while (n > ((fac-1) * (fac-1))) { while (n % fac === 0) { @@ -87,7 +87,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const len: number = getRandomInt(5, 40); const arr: number[] = []; arr.length = len; - for (let i: number = 0; i < len; ++i) { + for (let i = 0; i < len; ++i) { arr[i] = getRandomInt(-10, 10); } @@ -97,7 +97,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ numTries: 10, solver: (data: number[], ans: string) => { const nums: number[] = data.slice(); - for (let i: number = 1; i < nums.length; i++) { + for (let i = 1; i < nums.length; i++) { nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]); } @@ -124,7 +124,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const ways: number[] = [1]; ways.length = data + 1; ways.fill(0, 1); - for (let i: number = 1; i < data; ++i) { + for (let i = 1; i < data; ++i) { for (let j: number = i; j <= data; ++j) { ways[j] += ways[j - i]; } @@ -162,13 +162,13 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const n: number = getRandomInt(1, 15); const matrix: number[][] = []; matrix.length = m; - for (let i: number = 0; i < m; ++i) { + for (let i = 0; i < m; ++i) { matrix[i] = []; matrix[i].length = n; } - for (let i: number = 0; i < m; ++i) { - for (let j: number = 0; j < n; ++j) { + for (let i = 0; i < m; ++i) { + for (let j = 0; j < n; ++j) { matrix[i][j] = getRandomInt(1, 50); } } @@ -181,11 +181,11 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const spiral: number[] = []; const m: number = data.length; const n: number = data[0].length; - let u: number = 0; + let u = 0; let d: number = m - 1; - let l: number = 0; + let l = 0; let r: number = n - 1; - let k: number = 0; + let k = 0; while (true) { // Up for (let col: number = l; col <= r; col++) { @@ -219,11 +219,11 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans) .replace(/\s/g, ""); const playerAns: any[] = sanitizedPlayerAns.split(","); - for (let i: number = 0; i < playerAns.length; ++i) { + for (let i = 0; i < playerAns.length; ++i) { playerAns[i] = parseInt(playerAns[i], 10); } if (spiral.length !== playerAns.length) { return false; } - for (let i: number = 0; i < spiral.length; ++i) { + for (let i = 0; i < spiral.length; ++i) { if (spiral[i] !== playerAns[i]) { return false; } @@ -250,7 +250,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const len: number = getRandomInt(3, 25); const arr: number[] = []; arr.length = len; - for (let i: number = 0; i < arr.length; ++i) { + for (let i = 0; i < arr.length; ++i) { if (Math.random() < 0.2) { arr[i] = 0; // 20% chance of being 0 } else { @@ -264,8 +264,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ numTries: 1, solver: (data: number[], ans: string) => { const n: number = data.length; - let i: number = 0; - for (let reach: number = 0; i < n && i <= reach; ++i) { + let i = 0; + for (let reach = 0; i < n && i <= reach; ++i) { reach = Math.max(i + data[i], reach); } const solution: boolean = (i === n); @@ -292,7 +292,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ gen: () => { const intervals: number[][] = []; const numIntervals: number = getRandomInt(3, 20); - for (let i: number = 0; i < numIntervals; ++i) { + for (let i = 0; i < numIntervals; ++i) { const start: number = getRandomInt(1, 25); const end: number = start + getRandomInt(1, 10); intervals.push([start, end]); @@ -343,8 +343,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ }, difficulty: 3, gen: () => { - let str: string = ""; - for (let i: number = 0; i < 4; ++i) { + let str = ""; + for (let i = 0; i < 4; ++i) { const num: number = getRandomInt(0, 255); const convNum: string = num.toString(); str += convNum; @@ -356,10 +356,10 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ numTries: 10, solver: (data: string, ans: string) => { const ret: string[] = []; - for (let a: number = 1; a <= 3; ++a) { - for (let b: number = 1; b <= 3; ++b) { - for (let c: number = 1; c <= 3; ++c) { - for (let d: number = 1; d <= 3; ++d) { + for (let a = 1; a <= 3; ++a) { + for (let b = 1; b <= 3; ++b) { + for (let c = 1; c <= 3; ++c) { + for (let d = 1; d <= 3; ++d) { if (a + b + c + d === data.length) { const A: number = parseInt(data.substring(0, a), 10); const B: number = parseInt(data.substring(a, a + b), 10); @@ -406,7 +406,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const len: number = getRandomInt(3, 50); const arr: number[] = []; arr.length = len; - for (let i: number = 0; i < len; ++i) { + for (let i = 0; i < len; ++i) { arr[i] = getRandomInt(1, 200); } @@ -415,9 +415,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ name: "Algorithmic Stock Trader I", numTries: 5, solver: (data: number[], ans: string) => { - let maxCur: number = 0; - let maxSoFar: number = 0; - for (let i: number = 1; i < data.length; ++i) { + let maxCur = 0; + let maxSoFar = 0; + for (let i = 1; i < data.length; ++i) { maxCur = Math.max(0, maxCur += data[i] - data[i - 1]); maxSoFar = Math.max(maxCur, maxSoFar); } @@ -442,7 +442,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const len: number = getRandomInt(3, 50); const arr: number[] = []; arr.length = len; - for (let i: number = 0; i < len; ++i) { + for (let i = 0; i < len; ++i) { arr[i] = getRandomInt(1, 200); } @@ -451,8 +451,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ name: "Algorithmic Stock Trader II", numTries: 10, solver: (data: number[], ans: string) => { - let profit: number = 0; - for (let p: number = 1; p < data.length; ++p) { + let profit = 0; + for (let p = 1; p < data.length; ++p) { profit += Math.max(data[p] - data[p - 1], 0); } @@ -476,7 +476,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const len: number = getRandomInt(3, 50); const arr: number[] = []; arr.length = len; - for (let i: number = 0; i < len; ++i) { + for (let i = 0; i < len; ++i) { arr[i] = getRandomInt(1, 200); } @@ -487,8 +487,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ solver: (data: number[], ans: string) => { let hold1: number = Number.MIN_SAFE_INTEGER; let hold2: number = Number.MIN_SAFE_INTEGER; - let release1: number = 0; - let release2: number = 0; + let release1 = 0; + let release2 = 0; for (const price of data) { release2 = Math.max(release2, hold2 + price); hold2 = Math.max(hold2, release1 - price); @@ -536,7 +536,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const len = prices.length; if (len < 2) { return (parseInt(ans) === 0); } if (k > len / 2) { - let res: number = 0; + let res = 0; for (let i = 1; i < len; ++i) { res += Math.max(prices[i] - prices[i-1], 0); } @@ -567,7 +567,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ }, { desc: (data: number[][]) => { - function createTriangleRecurse(data: number[][], level: number = 0): string { + function createTriangleRecurse(data: number[][], level = 0): string { const numLevels: number = data.length; if (level >= numLevels) { return ""; } const numSpaces = numLevels - level + 1; @@ -618,8 +618,8 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ name: "Minimum Path Sum in a Triangle", numTries: 10, solver: (data: number[][], ans: string) => { - let n: number = data.length; - let dp: number[] = data[n-1].slice(); + const n: number = data.length; + const dp: number[] = data[n-1].slice(); for (let i = n-2; i > -1; --i) { for (let j = 0; j < data[i].length; ++j) { dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j]; @@ -653,9 +653,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ name: "Unique Paths in a Grid I", numTries: 10, solver: (data: number[], ans: string) => { - let n: number = data[0]; // Number of rows - let m: number = data[1]; // Number of columns - let currentRow: number[] = []; + const n: number = data[0]; // Number of rows + const m: number = data[1]; // Number of columns + const currentRow: number[] = []; currentRow.length = n; for (let i = 0; i < n; i++) { @@ -672,7 +672,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ }, { desc: (data: number[][]) => { - let gridString: string = ""; + let gridString = ""; for (const line of data) { gridString += `${line.toString()},\n`; } @@ -715,7 +715,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ name: "Unique Paths in a Grid II", numTries: 10, solver: (data: number[][], ans: string) => { - let obstacleGrid: number[][] = []; + const obstacleGrid: number[][] = []; obstacleGrid.length = data.length; for (let i = 0; i < obstacleGrid.length; ++i) { obstacleGrid[i] = data[i].slice(); @@ -755,7 +755,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ difficulty: 10, gen: () => { const len: number = getRandomInt(6, 20); - let chars: string[] = []; + const chars: string[] = []; chars.length = len; // 80% chance of the first parenthesis being ( @@ -779,7 +779,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ solver: (data: string, ans: string) => { let left = 0; let right = 0; - let res: string[] = []; + const res: string[] = []; for (let i = 0; i < data.length; ++i) { if (data[i] === '(') { @@ -792,7 +792,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ function dfs(pair: number, index: number, left: number, right: number, s: string, solution: string, res: string[]) { if (s.length === index) { if (left === 0 && right === 0 && pair === 0) { - for(var i = 0; i < res.length; i++) { + for(let i = 0; i < res.length; i++) { if(res[i] === solution) { return; } } res.push(solution); @@ -883,7 +883,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ for (let i = pos; i < num.length; ++i) { if (i != pos && num[pos] == '0') { break; } - let cur = parseInt(num.substring(pos, i+1)); + const cur = parseInt(num.substring(pos, i+1)); if (pos === 0) { helper(res, path + cur, num, target, i + 1, cur, cur); @@ -899,7 +899,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(","); for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) { sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]) - .replace(/\s/g, "");; + .replace(/\s/g, ""); } if (num == null || num.length === 0) { @@ -908,7 +908,7 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [ return false; } - let result: string[] = []; + const result: string[] = []; helper(result, "", num, target, 0, 0, 0); for (const expr of result) { diff --git a/src/data/gangmembertasks.ts b/src/data/gangmembertasks.ts index 16732c5ab..9aefa0059 100644 --- a/src/data/gangmembertasks.ts +++ b/src/data/gangmembertasks.ts @@ -146,9 +146,9 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [ territory: { money: 1.6, respect: 1.1, - wanted: 1.5 - } - } + wanted: 1.5, + }, + }, }, { desc: "Assign this gang member to run cons

    Earns money - Increases respect - Increases wanted level", @@ -212,8 +212,8 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [ money: 1.5, respect: 1.5, wanted: 1.6, - } - } + }, + }, }, { desc: "Assign this gang member to commit acts of terrorism

    Greatly increases respect - Greatly increases wanted level - Scales heavily with territory", @@ -254,7 +254,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [ name: "Train Combat", params: { strWeight: 25, defWeight: 25, dexWeight: 25, agiWeight: 25, - difficulty: 5 + difficulty: 5, }, }, { @@ -278,7 +278,7 @@ export const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [ name: "Territory Warfare", params: { hackWeight: 15, strWeight: 20, defWeight: 20, dexWeight: 20, agiWeight: 20, chaWeight: 5, - difficulty: 5 + difficulty: 5, }, }, ]; diff --git a/src/engine.jsx b/src/engine.jsx index 06dc0b1e9..d9ae12d42 100644 --- a/src/engine.jsx +++ b/src/engine.jsx @@ -5,7 +5,7 @@ */ import { convertTimeMsToTimeElapsedString, - replaceAt + replaceAt, } from "../utils/StringHelperFunctions"; import { logBoxUpdateText, logBoxOpened } from "../utils/LogBox"; import { Augmentations } from "./Augmentation/Augmentations"; @@ -15,7 +15,7 @@ import { } from "./Augmentation/AugmentationHelpers"; import { AugmentationNames } from "./Augmentation/data/AugmentationNames"; import { - initBitNodeMultipliers + initBitNodeMultipliers, } from "./BitNode/BitNode"; import { Bladeburner } from "./Bladeburner"; import { CharacterOverviewComponent } from "./ui/React/CharacterOverview"; @@ -30,14 +30,14 @@ import { displayFactionContent, joinFaction, processPassiveFactionRepGain, - inviteToFaction + inviteToFaction, } from "./Faction/FactionHelpers"; import { FconfSettings } from "./Fconf/FconfSettings"; import { hasHacknetServers, renderHacknetNodesUI, clearHacknetNodesUI, - processHacknetEarnings + processHacknetEarnings, } from "./Hacknet/HacknetHelpers"; import { iTutorialStart } from "./InteractiveTutorial"; import { LocationName } from "./Locations/data/LocationNames"; @@ -54,14 +54,14 @@ import { prestigeAugmentation } from "./Prestige"; import { displayCreateProgramContent, getNumAvailableCreateProgram, - initCreateProgramButtons + initCreateProgramButtons, } from "./Programs/ProgramHelpers"; import { redPillFlag } from "./RedPill"; import { saveObject, loadGame } from "./SaveObject"; import { getCurrentEditor, scriptEditorInit, - updateScriptEditorContent + updateScriptEditorContent, } from "./Script/ScriptHelpers"; import { initForeignServers } from "./Server/AllServers"; import { Settings } from "./Settings/Settings"; @@ -70,7 +70,7 @@ import { initSpecialServerIps } from "./Server/SpecialServerIps"; import { initSymbolToStockMap, processStockPrices, - displayStockMarketContent + displayStockMarketContent, } from "./StockMarket/StockMarket"; import { displayMilestonesContent } from "./Milestones/MilestoneHelpers"; import { Terminal, postNetburnerText } from "./Terminal"; @@ -78,11 +78,11 @@ import { Sleeve } from "./PersonObjects/Sleeve/Sleeve"; import { clearSleevesPage, createSleevesPage, - updateSleevesPage + updateSleevesPage, } from "./PersonObjects/Sleeve/SleeveUI"; import { clearResleevesPage, - createResleevesPage + createResleevesPage, } from "./PersonObjects/Resleeving/ResleevingUI"; import { createStatusText } from "./ui/createStatusText"; @@ -270,7 +270,7 @@ const Engine = { routing.navigateTo(Page.ActiveScripts); ReactDOM.render( , - Engine.Display.activeScriptsContent + Engine.Display.activeScriptsContent, ) MainMenuLinks.ActiveScripts.classList.add("active"); }, @@ -590,10 +590,10 @@ const Engine = { // Factions Engine.Display.factionsContent.appendChild(createElement("h1", { - innerText:"Factions" + innerText:"Factions", })); Engine.Display.factionsContent.appendChild(createElement("p", { - innerText:"Lists all factions you have joined" + innerText:"Lists all factions you have joined", })); var factionsList = createElement("ul"); Engine.Display.factionsContent.appendChild(createElement("br")); @@ -610,7 +610,7 @@ const Engine = { Engine.loadFactionContent(); displayFactionContent(factionName); return false; - } + }, })); factionsList.appendChild(createElement("br")); }()); // Immediate invocation @@ -620,12 +620,12 @@ const Engine = { // Invited Factions Engine.Display.factionsContent.appendChild(createElement("h1", { - innerText:"Outstanding Faction Invitations" + innerText:"Outstanding Faction Invitations", })); Engine.Display.factionsContent.appendChild(createElement("p", { width:"70%", innerText:"Lists factions you have been invited to. You can accept " + - "these faction invitations at any time." + "these faction invitations at any time.", })); var invitationsList = createElement("ul"); @@ -636,7 +636,7 @@ const Engine = { var item = createElement("li", {padding:"6px", margin:"6px"}); item.appendChild(createElement("p", { - innerText:factionName, display:"inline", margin:"4px", padding:"4px" + innerText:factionName, display:"inline", margin:"4px", padding:"4px", })); item.appendChild(createElement("a", { innerText:"Accept Faction Invitation", @@ -652,7 +652,7 @@ const Engine = { } Engine.displayFactionsInfo(); return false; - } + }, })); invitationsList.appendChild(item); @@ -829,7 +829,7 @@ const Engine = { if (routing.isOn(Page.ActiveScripts)) { ReactDOM.render( , - Engine.Display.activeScriptsContent + Engine.Display.activeScriptsContent, ) } @@ -1229,7 +1229,7 @@ const Engine = { Engine.openMainMenuHeader( [terminal, createScript, activeScripts, stats, hacknetnodes, city, milestones, - tutorial, options] + tutorial, options], ); // Start interactive tutorial @@ -1561,7 +1561,7 @@ const Engine = { start: function() { // Run main loop Engine.idleTimer(); - } + }, }; var indexedDb, indexedDbRequest; diff --git a/src/ui/ActiveScripts/ServerAccordion.tsx b/src/ui/ActiveScripts/ServerAccordion.tsx index 9a0d1c57f..35a78e6a2 100644 --- a/src/ui/ActiveScripts/ServerAccordion.tsx +++ b/src/ui/ActiveScripts/ServerAccordion.tsx @@ -26,7 +26,7 @@ export function ServerAccordion(props: IProps): React.ReactElement { const paddedName = `${server.hostname}${" ".repeat(longestHostnameLength)}`.slice(0, Math.max(server.hostname.length, longestHostnameLength)); const barOptions = { progress: server.ramUsed / server.maxRam, - totalTicks: 30 + totalTicks: 30, }; const headerTxt = `${paddedName} ${createProgressBarText(barOptions)}`; diff --git a/src/ui/CharacterInfo.tsx b/src/ui/CharacterInfo.tsx index 03b84f3fc..28efd3110 100644 --- a/src/ui/CharacterInfo.tsx +++ b/src/ui/CharacterInfo.tsx @@ -47,20 +47,20 @@ export function CharacterInfo(p: IPlayer): React.ReactElement { } function convertMoneySourceTrackerToString(src: MoneySourceTracker): React.ReactElement { - let parts: any[][] = [[`Total:`, Money(src.total)]]; - if (src.bladeburner) { parts.push([`Bladeburner:`, Money(src.bladeburner)]) }; - if (src.codingcontract) { parts.push([`Coding Contracts:`, Money(src.codingcontract)]) }; - if (src.work) { parts.push([`Company Work:`, Money(src.work)]) }; - if (src.class) { parts.push([`Class:`, Money(src.class)]) }; - if (src.corporation) { parts.push([`Corporation:`, Money(src.corporation)]) }; - if (src.crime) { parts.push([`Crimes:`, Money(src.crime)]) }; - if (src.gang) { parts.push([`Gang:`, Money(src.gang)]) }; - if (src.hacking) { parts.push([`Hacking:`, Money(src.hacking)]) }; - if (src.hacknetnode) { parts.push([`Hacknet Nodes:`, Money(src.hacknetnode)]) }; - if (src.hospitalization) { parts.push([`Hospitalization:`, Money(src.hospitalization)]) }; - if (src.infiltration) { parts.push([`Infiltration:`, Money(src.infiltration)]) }; - if (src.stock) { parts.push([`Stock Market:`, Money(src.stock)]) }; - if (src.casino) { parts.push([`Casino:`, Money(src.casino)]) }; + const parts: any[][] = [[`Total:`, Money(src.total)]]; + if (src.bladeburner) { parts.push([`Bladeburner:`, Money(src.bladeburner)]) } + if (src.codingcontract) { parts.push([`Coding Contracts:`, Money(src.codingcontract)]) } + if (src.work) { parts.push([`Company Work:`, Money(src.work)]) } + if (src.class) { parts.push([`Class:`, Money(src.class)]) } + if (src.corporation) { parts.push([`Corporation:`, Money(src.corporation)]) } + if (src.crime) { parts.push([`Crimes:`, Money(src.crime)]) } + if (src.gang) { parts.push([`Gang:`, Money(src.gang)]) } + if (src.hacking) { parts.push([`Hacking:`, Money(src.hacking)]) } + if (src.hacknetnode) { parts.push([`Hacknet Nodes:`, Money(src.hacknetnode)]) } + if (src.hospitalization) { parts.push([`Hospitalization:`, Money(src.hospitalization)]) } + if (src.infiltration) { parts.push([`Infiltration:`, Money(src.infiltration)]) } + if (src.stock) { parts.push([`Stock Market:`, Money(src.stock)]) } + if (src.casino) { parts.push([`Casino:`, Money(src.casino)]) } return StatsTable(parts, ""); } @@ -80,7 +80,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement { function Intelligence(): React.ReactElement { if (p.intelligence > 0) { - return
    + return ; @@ -91,7 +91,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement { function MultiplierTable(props: any): React.ReactElement { function bn5Stat(r: any) { if(SourceFileFlags[5] > 0 && r.length > 2 && r[1] != r[2]) { - return + return } return <>; } @@ -99,8 +99,8 @@ export function CharacterInfo(p: IPlayer): React.ReactElement {
    Intelligence: {numeralWrapper.formatSkill(p.intelligence)}
    ({numeralWrapper.formatPercentage(r[2])}) ({numeralWrapper.formatPercentage(r[2])})
    {props.rows.map((r: any) => - - + + {bn5Stat(r)} )} @@ -146,35 +146,35 @@ export function CharacterInfo(p: IPlayer): React.ReactElement { Stats
    {`${r[0]} multiplier:`}{numeralWrapper.formatPercentage(r[1])}{`${r[0]} multiplier:`}{numeralWrapper.formatPercentage(r[1])}
    - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + @@ -184,7 +184,7 @@ export function CharacterInfo(p: IPlayer): React.ReactElement { ['Hacking Chance', p.hacking_chance_mult], ['Hacking Speed', p.hacking_speed_mult], ['Hacking Money', p.hacking_money_mult, p.hacking_money_mult*BitNodeMultipliers.ScriptHackMoney], - ['Hacking Growth', p.hacking_grow_mult, p.hacking_grow_mult*BitNodeMultipliers.ServerGrowthRate] + ['Hacking Growth', p.hacking_grow_mult, p.hacking_grow_mult*BitNodeMultipliers.ServerGrowthRate], ]} />









    Misc.

    diff --git a/src/ui/React/AccordionButton.tsx b/src/ui/React/AccordionButton.tsx index f60c6b821..c847f4aae 100644 --- a/src/ui/React/AccordionButton.tsx +++ b/src/ui/React/AccordionButton.tsx @@ -36,7 +36,7 @@ export function AccordionButton(props: IProps): React.ReactElement { let tooltipMarkup: IInnerHTMLMarkup | null; if (hasTooltip) { tooltipMarkup = { - __html: props.tooltip! + __html: props.tooltip!, } } diff --git a/src/ui/React/AugmentationAccordion.tsx b/src/ui/React/AugmentationAccordion.tsx index 98b95f8f1..87ab4ae8f 100644 --- a/src/ui/React/AugmentationAccordion.tsx +++ b/src/ui/React/AugmentationAccordion.tsx @@ -12,8 +12,8 @@ import { Augmentation } from "../../Augmentation/Augmentation"; import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; type IProps = { - aug: Augmentation, - level?: number | string | null, + aug: Augmentation; + level?: number | string | null; } export function AugmentationAccordion(props: IProps): React.ReactElement { diff --git a/src/ui/React/AutoupdatingParagraph.tsx b/src/ui/React/AutoupdatingParagraph.tsx index 28e9d47c9..30dbd7d5f 100644 --- a/src/ui/React/AutoupdatingParagraph.tsx +++ b/src/ui/React/AutoupdatingParagraph.tsx @@ -24,7 +24,7 @@ export class AutoupdatingParagraph extends React.Component { /** * Timer ID for auto-updating implementation (returned value from setInterval()) */ - interval: number = 0; + interval = 0; constructor(props: IProps) { super(props); @@ -44,7 +44,7 @@ export class AutoupdatingParagraph extends React.Component { tick() { this.setState(prevState => ({ - i: prevState.i + 1 + i: prevState.i + 1, })); } diff --git a/src/ui/React/AutoupdatingStdButton.tsx b/src/ui/React/AutoupdatingStdButton.tsx index ff3c5a608..61ea95984 100644 --- a/src/ui/React/AutoupdatingStdButton.tsx +++ b/src/ui/React/AutoupdatingStdButton.tsx @@ -27,7 +27,7 @@ export class AutoupdatingStdButton extends React.Component { /** * Timer ID for auto-updating implementation (returned value from setInterval()) */ - interval: number = 0; + interval = 0; constructor(props: IProps) { super(props); @@ -47,7 +47,7 @@ export class AutoupdatingStdButton extends React.Component { tick() { this.setState(prevState => ({ - i: prevState.i + 1 + i: prevState.i + 1, })); } @@ -63,7 +63,7 @@ export class AutoupdatingStdButton extends React.Component { let tooltipMarkup: IInnerHTMLMarkup | null; if (hasTooltip) { tooltipMarkup = { - __html: this.props.tooltip! + __html: this.props.tooltip!, } } diff --git a/src/ui/React/SourceFileAccordion.tsx b/src/ui/React/SourceFileAccordion.tsx index d72c3f3de..040258c88 100644 --- a/src/ui/React/SourceFileAccordion.tsx +++ b/src/ui/React/SourceFileAccordion.tsx @@ -11,8 +11,8 @@ import { Accordion } from "./Accordion"; import { SourceFile } from "../../SourceFile/SourceFile"; type IProps = { - level: number, - sf: SourceFile, + level: number; + sf: SourceFile; } export function SourceFileAccordion(props: IProps): React.ReactElement { diff --git a/src/ui/React/StdButton.tsx b/src/ui/React/StdButton.tsx index b51e4c3bc..56351f960 100644 --- a/src/ui/React/StdButton.tsx +++ b/src/ui/React/StdButton.tsx @@ -35,7 +35,7 @@ export function StdButton(props: IStdButtonProps): React.ReactElement { if(typeof props.tooltip === 'string') { let tooltipMarkup: IInnerHTMLMarkup | null; tooltipMarkup = { - __html: props.tooltip! + __html: props.tooltip!, } tooltip = } else { diff --git a/src/ui/React/StdButtonPurchased.tsx b/src/ui/React/StdButtonPurchased.tsx index db041af0a..3fd6d0bae 100644 --- a/src/ui/React/StdButtonPurchased.tsx +++ b/src/ui/React/StdButtonPurchased.tsx @@ -26,7 +26,7 @@ export class StdButtonPurchased extends React.Component React.Component; let gameContainer: HTMLElement; function getGameContainer() { - let container = document.getElementById("entire-game-container"); + const container = document.getElementById("entire-game-container"); if (container == null) { throw new Error(`Failed to find game container DOM element`) } @@ -51,7 +51,7 @@ export function createPopup(id: string, rootComponent: ReactComponent, props: ob * Closes a popup created with the createPopup() function above */ export function removePopup(id: string): void { - let content = document.getElementById(`${id}`); + const content = document.getElementById(`${id}`); if (content == null) { return; } ReactDOM.unmountComponentAtNode(content); diff --git a/src/ui/createStatusText.ts b/src/ui/createStatusText.ts index 161eb047e..96487816d 100644 --- a/src/ui/createStatusText.ts +++ b/src/ui/createStatusText.ts @@ -2,7 +2,7 @@ import { setTimeoutRef } from "../utils/SetTimeoutRef"; import { getElementById } from "../../utils/uiHelpers/getElementById"; import { Action } from "../types"; -const threeSeconds: number = 3000; +const threeSeconds = 3000; let x: number | undefined; /** diff --git a/src/ui/postToTerminal.tsx b/src/ui/postToTerminal.tsx index 5716e8569..18095ad8e 100644 --- a/src/ui/postToTerminal.tsx +++ b/src/ui/postToTerminal.tsx @@ -41,9 +41,9 @@ export function postElement(element: JSX.Element) { export function postContent(input: string, config: IPostContentConfig = {}) { // tslint:disable-next-line:max-line-length - const style: string = `color: ${config.color != null ? config.color : "var(--my-font-color)"}; background-color:var(--my-background-color);${config.id === undefined ? " white-space:pre-wrap;" : ""}`; + const style = `color: ${config.color != null ? config.color : "var(--my-font-color)"}; background-color:var(--my-background-color);${config.id === undefined ? " white-space:pre-wrap;" : ""}`; // tslint:disable-next-line:max-line-length - const content: string = `
    `; + const content = ``; const inputElement: HTMLElement = getElementById("terminal-input"); inputElement.insertAdjacentHTML("beforebegin", content); scrollTerminalToBottom(); diff --git a/src/utils/helpers/createRandomString.ts b/src/utils/helpers/createRandomString.ts index d963e8a41..97261a919 100644 --- a/src/utils/helpers/createRandomString.ts +++ b/src/utils/helpers/createRandomString.ts @@ -2,7 +2,7 @@ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; export function createRandomString(n: number): string { - let str: string = ""; + let str = ""; for (let i = 0; i < n; ++i) { str += chars.charAt(Math.floor(Math.random() * chars.length)); diff --git a/stylelint.config.js b/stylelint.config.js index 34255608b..6a3a7e05e 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -2,7 +2,7 @@ module.exports = { plugins: [ "stylelint-declaration-use-variable", - "stylelint-order" /*, + "stylelint-order", /*, "stylelint-scss" */ ], rules: { @@ -139,20 +139,20 @@ module.exports = { "custom-properties", { type: "at-rule", - name: "extend" + name: "extend", }, { type: "at-rule", - name: "include" + name: "include", }, "declarations", "rules", "at-rules", - "less-mixins" + "less-mixins", ], { - unspecified: "bottom" - } + unspecified: "bottom", + }, ], // "order/properties-order": [ // [] @@ -162,7 +162,7 @@ module.exports = { "grid-area", "grid-template", "grid-column", - "grid-row" + "grid-row", ], "property-case": "lower", "property-no-unknown": true, @@ -236,7 +236,7 @@ module.exports = { "selector-attribute-operator-space-after": "never", "selector-attribute-operator-space-before": "never", "selector-attribute-operator-whitelist": [ - "=" + "=", ], "selector-attribute-quotes": "always", "selector-class-pattern": ".+", @@ -264,9 +264,9 @@ module.exports = { true, { ignore: [ - "attribute", "class" - ] - } + "attribute", "class", + ], + }, ], "selector-no-vendor-prefix": true, "selector-pseudo-class-blacklist": [], @@ -284,7 +284,7 @@ module.exports = { "not", "last-child", "root", - "visited" + "visited", ], //"selector-pseudo-element-blacklist": [], "selector-pseudo-element-case": "lower", @@ -315,7 +315,7 @@ module.exports = { "ms", "s", "vw", - "%" + "%", ], // "value-keyword-case": "lower", "value-list-comma-newline-after": "always-multi-line", @@ -323,6 +323,6 @@ module.exports = { "value-list-comma-space-after": "always-single-line", "value-list-comma-space-before": "never", "value-list-max-empty-lines": 0, - "value-no-vendor-prefix": true - } + "value-no-vendor-prefix": true, + }, }; diff --git a/test/StockMarketTests.ts b/test/StockMarketTests.ts index bd933478d..3d36493b1 100644 --- a/test/StockMarketTests.ts +++ b/test/StockMarketTests.ts @@ -1089,7 +1089,7 @@ describe("Stock Market Tests", function() { shares: 1e3, price: 9e3, type: OrderTypes.LimitBuy, - pos: PositionTypes.Long + pos: PositionTypes.Long, }); expect(res).to.equal(true); expect(StockMarket["Orders"][stock.symbol]).to.have.lengthOf(0); @@ -1107,7 +1107,7 @@ describe("Stock Market Tests", function() { shares: 999, price: 9e3, type: OrderTypes.LimitBuy, - pos: PositionTypes.Long + pos: PositionTypes.Long, }); expect(res2).to.equal(false); expect(StockMarket["Orders"][stock.symbol]).to.have.lengthOf(1); diff --git a/utils/GameOptions.js b/utils/GameOptions.js index ad929a6cc..654a17bdf 100644 --- a/utils/GameOptions.js +++ b/utils/GameOptions.js @@ -23,7 +23,7 @@ function gameOptionsBoxInit() { gameOptionsBoxClose(); return false; }); -}; +} document.addEventListener("DOMContentLoaded", gameOptionsBoxInit, false); diff --git a/utils/JSONReviver.d.ts b/utils/JSONReviver.d.ts index f4405df83..0f81cc812 100644 --- a/utils/JSONReviver.d.ts +++ b/utils/JSONReviver.d.ts @@ -1,6 +1,6 @@ interface IReviverValue { ctor: string; - data: object + data: object; } export function Generic_fromJSON(ctor: new () => T, data: any): T; export function Generic_toJSON(ctorName: string, obj: object, keys?: string[]): string; diff --git a/utils/LogBox.ts b/utils/LogBox.ts index 10633e035..05f7db342 100644 --- a/utils/LogBox.ts +++ b/utils/LogBox.ts @@ -42,7 +42,7 @@ function logBoxInit(): void { logBoxClose(); document.removeEventListener("DOMContentLoaded", logBoxInit); -}; +} document.addEventListener("DOMContentLoaded", logBoxInit); diff --git a/utils/StringHelperFunctions.ts b/utils/StringHelperFunctions.ts index 01a69ce69..effe284d4 100644 --- a/utils/StringHelperFunctions.ts +++ b/utils/StringHelperFunctions.ts @@ -14,11 +14,11 @@ e.g. 10000 -> "10 seconds" 120000 -> "2 minutes and 0 seconds" */ function convertTimeMsToTimeElapsedString(time: number): string { - const millisecondsPerSecond: number = 1000; - const secondPerMinute: number = 60; - const minutesPerHours: number = 60; + const millisecondsPerSecond = 1000; + const secondPerMinute = 60; + const minutesPerHours = 60; const secondPerHours: number = secondPerMinute * minutesPerHours; - const hoursPerDays: number = 24; + const hoursPerDays = 24; const secondPerDay: number = secondPerHours * hoursPerDays; // Convert ms to seconds, since we only have second-level precision @@ -35,7 +35,7 @@ function convertTimeMsToTimeElapsedString(time: number): string { const seconds: number = secTruncMinutes; - let res: string = ""; + let res = ""; if (days > 0) {res += `${days} days `; } if (hours > 0) {res += `${hours} hours `; } if (minutes > 0) {res += `${minutes} minutes `; } @@ -54,7 +54,7 @@ function longestCommonStart(strings: string[]): string { const a1: string = A[0]; const a2: string = A[A.length - 1]; const L: number = a1.length; - let i: number = 0; + let i = 0; const areEqualCaseInsensitive: EqualityFunc = (a: string, b: string) => a.toUpperCase() === b.toUpperCase(); while (i < L && areEqualCaseInsensitive(a1.charAt(i), a2.charAt(i))) { i++; @@ -92,10 +92,10 @@ function isHTML(str: string): boolean { // Generates a random alphanumeric string with N characters function generateRandomString(n: number): string { - let str: string = ""; - const chars: string = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + let str = ""; + const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - for (let i: number = 0; i < n; i++) { + for (let i = 0; i < n; i++) { str += chars.charAt(Math.floor(Math.random() * chars.length)); } diff --git a/utils/YesNoBox.ts b/utils/YesNoBox.ts index ca1da968f..f170921ee 100644 --- a/utils/YesNoBox.ts +++ b/utils/YesNoBox.ts @@ -11,7 +11,7 @@ import { KEY } from "./helpers/keyCodes"; import * as React from "react"; import * as ReactDOM from "react-dom"; -export let yesNoBoxOpen: boolean = false; +export let yesNoBoxOpen = false; const yesNoBoxContainer: HTMLElement | null = document.getElementById("yes-no-box-container"); const yesNoBoxTextElement: HTMLElement | null = document.getElementById("yes-no-box-text"); diff --git a/utils/helpers/addOffset.ts b/utils/helpers/addOffset.ts index a45ababd4..ccc5232d9 100644 --- a/utils/helpers/addOffset.ts +++ b/utils/helpers/addOffset.ts @@ -10,7 +10,7 @@ * @param percentage The percentage (in a range of 0-100) to offset */ export function addOffset(midpoint: number, percentage: number) { - const maxPercent: number = 100; + const maxPercent = 100; if (percentage < 0 || percentage > maxPercent) { return midpoint; } diff --git a/utils/helpers/exceptionAlert.ts b/utils/helpers/exceptionAlert.ts index 2a6998c89..5130b2fb5 100644 --- a/utils/helpers/exceptionAlert.ts +++ b/utils/helpers/exceptionAlert.ts @@ -1,8 +1,8 @@ import { dialogBoxCreate } from "../DialogBox"; interface IError { - fileName?: string, - lineNumber?: number, + fileName?: string; + lineNumber?: number; } export function exceptionAlert(e: IError): void { diff --git a/utils/helpers/getRandomByte.ts b/utils/helpers/getRandomByte.ts index 5b6ddf57d..a551382f3 100644 --- a/utils/helpers/getRandomByte.ts +++ b/utils/helpers/getRandomByte.ts @@ -6,7 +6,7 @@ import { getRandomInt } from "./getRandomInt"; */ export function getRandomByte(max: number) { // Technically 2^8 is 256, but the values are 0-255, not 1-256. - const byteMaximum: number = 255; + const byteMaximum = 255; const upper: number = Math.max(Math.min(max, byteMaximum), 0); return getRandomInt(0, upper); diff --git a/utils/helpers/getTimestamp.ts b/utils/helpers/getTimestamp.ts index 6e7ee119f..18e3539c1 100644 --- a/utils/helpers/getTimestamp.ts +++ b/utils/helpers/getTimestamp.ts @@ -4,7 +4,7 @@ export function getTimestamp() { const d: Date = new Date(); // A negative slice value takes from the end of the string rather than the beginning. - const stringWidth: number = -2; + const stringWidth = -2; const formattedHours: string = `0${d.getHours()}`.slice(stringWidth); const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth); diff --git a/utils/helpers/isValidIPAddress.ts b/utils/helpers/isValidIPAddress.ts index 67b40257f..3b02b5c27 100644 --- a/utils/helpers/isValidIPAddress.ts +++ b/utils/helpers/isValidIPAddress.ts @@ -4,9 +4,9 @@ * @param ipaddress A string representing a potential IP Address */ export function isValidIPAddress(ipaddress: string) { - const byteRange: string = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; - const regexStr: string = `^${byteRange}\.${byteRange}\.${byteRange}\.${byteRange}$`; - const ipAddressRegex: RegExp = new RegExp(regexStr); + const byteRange = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"; + const regexStr = `^${byteRange}\.${byteRange}\.${byteRange}\.${byteRange}$`; + const ipAddressRegex = new RegExp(regexStr); return ipAddressRegex.test(ipaddress); } diff --git a/utils/uiHelpers/appendLineBreaks.ts b/utils/uiHelpers/appendLineBreaks.ts index f2895c536..026e7718a 100644 --- a/utils/uiHelpers/appendLineBreaks.ts +++ b/utils/uiHelpers/appendLineBreaks.ts @@ -6,7 +6,7 @@ import { createElement } from "./createElement"; * @param n The number of breaks to add. */ export function appendLineBreaks(el: HTMLElement, n: number) { - for (let i: number = 0; i < n; ++i) { + for (let i = 0; i < n; ++i) { el.appendChild(createElement("br")); } } diff --git a/utils/uiHelpers/createOptionElement.ts b/utils/uiHelpers/createOptionElement.ts index cbd09f8ba..85ef37743 100644 --- a/utils/uiHelpers/createOptionElement.ts +++ b/utils/uiHelpers/createOptionElement.ts @@ -1,6 +1,6 @@ import { createElement } from "./createElement"; -export function createOptionElement(text: string, value: string=""): HTMLOptionElement { +export function createOptionElement(text: string, value=""): HTMLOptionElement { let sanitizedValue: string = value; if (sanitizedValue === "") { sanitizedValue = text; } diff --git a/webpack.config-test.js b/webpack.config-test.js index 106bc7afa..2c59333cb 100644 --- a/webpack.config-test.js +++ b/webpack.config-test.js @@ -21,7 +21,7 @@ module.exports = (env, argv) => { return { plugins: [ new webpack.DefinePlugin({ - 'process.env.NODE_ENV': "\"development\"" + 'process.env.NODE_ENV': "\"development\"", }), new webpack.ProvidePlugin({ // Automtically detect jQuery and $ as free var in modules @@ -30,7 +30,7 @@ module.exports = (env, argv) => { // http://stackoverflow.com/questions/29080148/expose-jquery-to-real-window-object-with-webpack jquery: "jquery", jQuery: "jquery", - $: "jquery" + $: "jquery", }), ], entry: "./test/index.js", @@ -45,20 +45,20 @@ module.exports = (env, argv) => { { test: /\.tsx?$/, loader: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /\.(jsx)$/, exclude: /node_modules/, use: { - loader: "babel-loader" - } + loader: "babel-loader", + }, }, { test: /\.s?css$/, loader: 'null-loader', }, - ] + ], }, optimization: { removeAvailableModules: true, @@ -79,10 +79,10 @@ module.exports = (env, argv) => { vendor: { test: /[\\/]node_modules[\\/]/, name: `tests/vendor`, - chunks: 'all' - } - } - } + chunks: 'all', + }, + }, + }, }, resolve: { extensions: [ @@ -90,7 +90,7 @@ module.exports = (env, argv) => { ".ts", ".js", ".jsx", - ] + ], }, stats: statsConfig, }; diff --git a/webpack.config.js b/webpack.config.js index 4b95407c6..da342707b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,7 +25,7 @@ module.exports = (env, argv) => { return { plugins: [ new webpack.DefinePlugin({ - 'process.env.NODE_ENV': isDevelopment ? "\"development\"" : "\"production\"" + 'process.env.NODE_ENV': isDevelopment ? "\"development\"" : "\"production\"", }), // http://stackoverflow.com/questions/29080148/expose-jquery-to-real-window-object-with-webpack new webpack.ProvidePlugin({ @@ -34,14 +34,14 @@ module.exports = (env, argv) => { // This is required by many jquery plugins jquery: "jquery", jQuery: "jquery", - $: "jquery" + $: "jquery", }), new HtmlWebpackPlugin({ title: "Bitburner" + (isDevelopment ? ' - development' : ""), template: "src/index.html", favicon: "favicon.ico", googleAnalytics: { - trackingId: 'UA-100157497-1' + trackingId: 'UA-100157497-1', }, meta: {}, minify: isDevelopment ? false : { @@ -69,43 +69,43 @@ module.exports = (env, argv) => { removeTagWhitespace: false, sortAttributes: false, sortClassName: false, - useShortDoctype: false + useShortDoctype: false, }, }), new MiniCssExtractPlugin({ - filename: "[name].css" - }) + filename: "[name].css", + }), ], target: "web", entry: entries, devtool: "source-map", output: { path: path.resolve(__dirname, "./"), - filename: "[name].bundle.js" + filename: "[name].bundle.js", }, module: { rules: [ { test: /\.tsx?$/, loader: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /\.(jsx)$/, exclude: /node_modules/, use: { - loader: "babel-loader" - } + loader: "babel-loader", + }, }, { test: /\.s?css$/, use: [ MiniCssExtractPlugin.loader, "css-loader", - "sass-loader" - ] + "sass-loader", + ], }, - ] + ], }, optimization: { removeAvailableModules: true, @@ -126,10 +126,10 @@ module.exports = (env, argv) => { vendor: { test: /[\\/]node_modules[\\/]/, name: `${outputDirectory}/vendor`, - chunks: 'all' - } - } - } + chunks: 'all', + }, + }, + }, }, devServer: { port: 8000, @@ -142,7 +142,7 @@ module.exports = (env, argv) => { ".ts", ".js", ".jsx", - ] + ], }, stats: statsConfig, };
    Hacking:{numeralWrapper.formatSkill(p.hacking_skill)}({numeralWrapper.formatExp(p.hacking_exp)} exp)
    Hacking:{numeralWrapper.formatSkill(p.hacking_skill)}({numeralWrapper.formatExp(p.hacking_exp)} exp)
    Strength:{numeralWrapper.formatSkill(p.strength)}({numeralWrapper.formatExp(p.strength_exp)} exp)
    Strength:{numeralWrapper.formatSkill(p.strength)}({numeralWrapper.formatExp(p.strength_exp)} exp)
    Defense:{numeralWrapper.formatSkill(p.defense)}({numeralWrapper.formatExp(p.defense_exp)} exp)
    Defense:{numeralWrapper.formatSkill(p.defense)}({numeralWrapper.formatExp(p.defense_exp)} exp)
    Dexterity:{numeralWrapper.formatSkill(p.dexterity)}({numeralWrapper.formatExp(p.dexterity_exp)} exp)
    Dexterity:{numeralWrapper.formatSkill(p.dexterity)}({numeralWrapper.formatExp(p.dexterity_exp)} exp)
    Agility:{numeralWrapper.formatSkill(p.agility)}({numeralWrapper.formatExp(p.agility_exp)} exp)
    Agility:{numeralWrapper.formatSkill(p.agility)}({numeralWrapper.formatExp(p.agility_exp)} exp)
    Charisma:{numeralWrapper.formatSkill(p.charisma)}({numeralWrapper.formatExp(p.charisma_exp)} exp)
    Charisma:{numeralWrapper.formatSkill(p.charisma)}({numeralWrapper.formatExp(p.charisma_exp)} exp)
    ${input}
    ${input}