run auto fix lint

This commit is contained in:
Olivier Gagnon 2021-04-29 23:52:56 -04:00
parent 77cb63e36a
commit 3fad505096
183 changed files with 1547 additions and 1546 deletions

@ -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",
}
}
]
},
},
],
};

@ -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;
}

@ -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 {

@ -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",

@ -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;

@ -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<number> = {}
// 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;

@ -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.<br /><br />
This augmentation:<br />
Lets the player start with {Money(1e6)} after a reset.<br />
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,
);
}

@ -1,4 +1,4 @@
import { Augmentation } from "./Augmentation";
import { IMap } from "../types";
export let Augmentations: IMap<Augmentation> = {};
export const Augmentations: IMap<Augmentation> = {};

@ -1,8 +1,8 @@
export class PlayerOwnedAugmentation {
level: number = 1;
name: string = "";
level = 1;
name = "";
constructor(name: string = "") {
constructor(name = "") {
this.name = name;
}
}

@ -1,6 +1,6 @@
import { IMap } from "../../types";
export let AugmentationNames: IMap<string> = {
export const AugmentationNames: IMap<string> = {
Targeting1: "Augmented Targeting I",
Targeting2: "Augmented Targeting II",
Targeting3: "Augmented Targeting III",

@ -27,7 +27,7 @@ export function PlayerMultipliers(): React.ReactElement {
if(r) {
elems = [
<td key="2">&nbsp;{"=>"}&nbsp;</td>,
<td key="3">{numeralWrapper.formatPercentage(r)}</td>
<td key="3">{numeralWrapper.formatPercentage(r)}</td>,
];
}
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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{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],
])}<br />
{MultiplierTable([

@ -22,7 +22,7 @@ export function PurchasedAugmentations(): React.ReactElement {
augs.push(
<li key={`${ownedAug.name}${ownedAug.level}`}>
<AugmentationAccordion aug={aug} level={level} />
</li>
</li>,
)
}

@ -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 <></>

@ -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;
}

@ -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:"<br><strong>Skill Points: " + formatNumber(this.skillPoints, 0) + "</strong>"
innerHTML:"<br><strong>Skill Points: " + formatNumber(this.skillPoints, 0) + "</strong>",
});
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:"&uarr;",
@ -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:"&darr;",
@ -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:"&uarr;",
@ -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:"&darr;",
@ -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) + "<br>"
innerHTML:"Required Rank: " + formatNumber(action.reqdRank, 0) + "<br>",
}));
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;

@ -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}`);

@ -16,7 +16,7 @@ export const BlackOperations: IMap<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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<BlackOperation> = {};
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",

@ -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;

@ -11,7 +11,7 @@ export const GeneralActions: IMap<Action> = {};
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<Action> = {};
"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.<br><br>" +
"Does NOT require stamina."
"Does NOT require stamina.",
});
actionName = "Recruitment";
@ -29,7 +29,7 @@ export const GeneralActions: IMap<Action> = {};
name:actionName,
desc:"Attempt to recruit members for your Bladeburner team. These members " +
"can help you conduct operations.<br><br>" +
"Does NOT require stamina."
"Does NOT require stamina.",
});
actionName = "Diplomacy";
@ -37,7 +37,7 @@ export const GeneralActions: IMap<Action> = {};
name: actionName,
desc: "Improve diplomatic relations with the Synthoid population. " +
"Completing this action will reduce the Chaos level in your current city.<br><br>" +
"Does NOT require stamina."
"Does NOT require stamina.",
});
actionName = "Hyperbolic Regeneration Chamber";

@ -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;
}

@ -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) {

@ -10,55 +10,55 @@ export const Skills: IMap<Skill> = {};
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<Skill> = {};
"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,

@ -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.",
],
}

@ -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.<br /><br />
<b>Your ultimate goal to climb through the ranks of Bladeburners is to complete all of the Black Ops.</b><br /><br />
Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank losses.</p>
{blackops.map( op =>
<div className="bladeburner-action">
</div>
{blackops.map( op => <div className="bladeburner-action">
</div>,
)}
</div>)
}

@ -89,7 +89,7 @@ export class CoinFlip extends Game<IProps, IState> {
| | | |<br />
++<br />
</pre>
<span className="text">Play for: </span><input type="number" className='text-input' onChange={this.updateInvestment} value={this.state.investment} /><br />
<span className="text">Play for: </span><input type="number" className="text-input" onChange={this.updateInvestment} value={this.state.investment} /><br />
<StdButton onClick={trusted(() => this.play('H'))} text={"Head!"} disabled={this.state.playLock} />
<StdButton onClick={trusted(() => this.play('T'))} text={"Tail!"} disabled={this.state.playLock} />
<h1>{this.state.status}</h1>

@ -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.

@ -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<IProps, IState> {
interval: number = -1;
interval = -1;
rng: WHRNG;
constructor(props: IProps) {
@ -226,7 +226,7 @@ export class Roulette extends Game<IProps, IState> {
render() {
return <>
<h1>{this.currentNumber()}</h1>
<input type="number" className='text-input' onChange={this.updateInvestment} placeholder={"Amount to play"} value={this.state.investment} disabled={!this.state.canPlay} />
<input type="number" className="text-input" onChange={this.updateInvestment} placeholder={"Amount to play"} value={this.state.investment} disabled={!this.state.canPlay} />
<h1>{this.state.status}</h1>
<table>
<tbody>

@ -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<IProps, IState> {
rng: WHRNG;
interval: number = -1;
interval = -1;
constructor(props: IProps) {
super(props);
@ -142,7 +142,7 @@ export class SlotMachine extends Game<IProps, IState> {
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<IProps, IState> {
| | {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]} | |<br />
++<br />
</pre>
<input type="number" className='text-input' onChange={this.updateInvestment} placeholder={"Amount to play"} value={this.state.investment} disabled={!this.state.canPlay} />
<input type="number" className="text-input" onChange={this.updateInvestment} placeholder={"Amount to play"} value={this.state.investment} disabled={!this.state.canPlay} />
<StdButton onClick={trusted(this.play)} text={"Spin!"} disabled={!this.state.canPlay} />
<h1>{this.state.status}</h1>
<h2>Pay lines</h2>

@ -99,7 +99,7 @@ function cinematicTextEnd() {
mainMenu.style.visibility = "visible";
cinematicTextFlag = false;
resolve();
}
},
}));
});
}

@ -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;
}

@ -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<CodingContractResult>((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,
});

@ -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;

@ -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;

@ -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,

@ -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",
];

@ -5,7 +5,7 @@
*/
import { IMap } from "./types";
export let CONSTANTS: IMap<any> = {
export const CONSTANTS: IMap<any> = {
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<any> = {
* so many documentation and typos fixes (@Pimgd)
* A corruption visual effect has been added to location with servers that
have backdoor installed. (@dewint)
`
`,
}

@ -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);

@ -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() {}

@ -107,7 +107,7 @@ export const IndustryDescriptions: IIndustryMap<string> = {
// Map of available Research for each Industry. This data is held in a
// ResearchTree object
export let IndustryResearchTrees: IIndustryMap<ResearchTree> = {
export const IndustryResearchTrees: IIndustryMap<ResearchTree> = {
Energy: getBaseResearchTreeCopy(),
Utilities: getBaseResearchTreeCopy(),
Agriculture: getBaseResearchTreeCopy(),

@ -11,5 +11,5 @@ export const IndustryUpgrades: IMap<any[]> = {
"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."],
}

@ -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);

@ -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<any[]> = createCityMap<any[]>([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<number> = createCityMap<number>(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);

@ -73,5 +73,5 @@ export const ProductRatingWeights: IMap<object> = {
Reliability: 0.1,
Aesthetics: 0.35,
Features: 0.1,
}
},
}

@ -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;

@ -5,7 +5,7 @@ import { Research,
import { researchMetadata } from "./data/ResearchMetadata";
import { IMap } from "../types";
export let ResearchMap: IMap<Research> = {};
export const ResearchMap: IMap<Research> = {};
function addResearch(p: IConstructorParams) {
if (ResearchMap[p.name] != null) {

@ -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[] = [];

@ -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) {

@ -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",

@ -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";

@ -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",
})
}
</div>

@ -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 (

@ -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<IOfficeSpace>
offices: IMap<IOfficeSpace>;
}
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

@ -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;

@ -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;

@ -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 {
<button className="std-button touch-sides" onClick={this.setSF(i, 2)}>2</button>
<button className="std-button touch-left" onClick={this.setSF(i, 3)}>3</button>
</td>
</tr>
</tr>,
));

@ -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) {

@ -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,
)
}

@ -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));
}

@ -77,7 +77,7 @@ export class AugmentationsPage extends React.Component<IProps, IState> {
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<IProps, IState> {
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<IProps, IState> {
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;

@ -91,7 +91,7 @@ export class DonateOption extends React.Component<IProps, IState> {
return (
<div className={"faction-work-div"}>
<div className={"faction-work-div-wrapper"}>
<input className='text-input' onChange={this.handleChange} placeholder={"Donation amount"} style={inputStyleMarkup} />
<input className="text-input" onChange={this.handleChange} placeholder={"Donation amount"} style={inputStyleMarkup} />
<StdButton
onClick={this.donate}
text={"Donate Money"}

@ -108,9 +108,9 @@ export class PurchaseableAugmentation extends React.Component<IProps, any> {
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)</>;

@ -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<IProps, IState> {

@ -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.<br><br>" +
"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.<br><br>" +
"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.<br><br>"
"money, respect, and wanted level. It is very beneficial to have high territory control.<br><br>",
});
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",

@ -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,

@ -20,7 +20,7 @@ import { generateRandomContract } from "../CodingContractGenerator";
import {
iTutorialSteps,
iTutorialNextStep,
ITutorial
ITutorial,
} from "../InteractiveTutorial";
import { Player } from "../Player";
import { AllServers } from "../Server/AllServers";

@ -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
}

@ -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;

@ -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<number> = {};

@ -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; }

@ -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;
}

@ -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;

@ -36,7 +36,7 @@ class HashUpgrade extends React.Component {
changeTargetServer(e) {
this.setState({
selectedServer: e.target.value
selectedServer: e.target.value,
});
}

@ -42,7 +42,7 @@ const orderedITutorialSteps = [
"HacknetNodesGoToWorldPage",
"WorldDescription",
"TutorialPageInfo",
"End"
"End",
]
// Create an 'enum' for the Steps
@ -500,13 +500,13 @@ function iTutorialEnd() {
"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/guidesandtips/gettingstartedguideforbeginnerprogrammers.html' target='_blank'>Getting Started Guide</a>" +
"<a class='a-link-button' href='https://bitburner.readthedocs.io/en/latest/' target='_blank'>Documentation</a><br><br>" +
"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<br><br>cat " + LiteratureNames.HackersStartingHandbook
"To read it, go to Terminal and enter<br><br>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]);

@ -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 {

@ -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;

@ -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; }

@ -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!<br>" +
"You now have access to the dark web from your home computer<br>" +
"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.",
);
}

@ -78,4 +78,4 @@ export enum LocationName {
// Default name for Location objects
Void = "The Void",
};
}

@ -28,7 +28,7 @@ export class ApplyToJobButton extends React.Component<IProps, any> {
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 ""; }

@ -23,7 +23,7 @@ export class LocationCity extends React.Component<IProps, any> {
function LocationLetter(location: LocationName) {
if (location)
return <span key={location} className='tooltip' style={{color: 'blue', whiteSpace: 'nowrap', margin: '0px', padding: '0px', cursor: 'pointer'}} onClick={topprop.enterLocation.bind(thiscity, location)}>
return <span key={location} className="tooltip" style={{color: 'blue', whiteSpace: 'nowrap', margin: '0px', padding: '0px', cursor: 'pointer'}} onClick={topprop.enterLocation.bind(thiscity, location)}>
X
</span>
return <span>*</span>
@ -37,8 +37,8 @@ export class LocationCity extends React.Component<IProps, any> {
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<IProps, any> {
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<IProps, any> {
return elems;
}
let elems: any[] = [];
const elems: any[] = [];
const lines = this.props.city.asciiArt.split('\n');
for(const i in lines) {
elems.push(<pre key={i}>{lineElems(lines[i])}</pre>)

@ -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<IProps, IState> {
if (updateState) {
this.setState({
employedHere: this.jobTitle != null
employedHere: this.jobTitle != null,
});
}
}
@ -218,8 +218,8 @@ export class CompanyLocation extends React.Component<IProps, IState> {
quit(e: React.MouseEvent<HTMLElement>) {
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";

@ -64,7 +64,7 @@ export class GenericLocation extends React.Component<IProps, any> {
key={"companylocation"}
locName={this.props.loc.name}
p={this.props.p}
/>
/>,
)
}
@ -74,7 +74,7 @@ export class GenericLocation extends React.Component<IProps, any> {
key={"gymlocation"}
loc={this.props.loc}
p={this.props.p}
/>
/>,
)
}
@ -83,7 +83,7 @@ export class GenericLocation extends React.Component<IProps, any> {
<HospitalLocation
key={"hospitallocation"}
p={this.props.p}
/>
/>,
)
}
@ -92,7 +92,7 @@ export class GenericLocation extends React.Component<IProps, any> {
<SlumsLocation
key={"slumslocation"}
p={this.props.p}
/>
/>,
)
}
@ -103,7 +103,7 @@ export class GenericLocation extends React.Component<IProps, any> {
key={"speciallocation"}
loc={this.props.loc}
p={this.props.p}
/>
/>,
)
}
@ -113,7 +113,7 @@ export class GenericLocation extends React.Component<IProps, any> {
key={"techvendorlocation"}
loc={this.props.loc}
p={this.props.p}
/>
/>,
)
}
@ -123,7 +123,7 @@ export class GenericLocation extends React.Component<IProps, any> {
key={"travelagencylocation"}
p={this.props.p}
travel={this.props.travel}
/>
/>,
)
}
@ -133,7 +133,7 @@ export class GenericLocation extends React.Component<IProps, any> {
key={"universitylocation"}
loc={this.props.loc}
p={this.props.p}
/>
/>,
)
}
@ -142,7 +142,7 @@ export class GenericLocation extends React.Component<IProps, any> {
<CasinoLocation
key={"casinoLocation"}
p={this.props.p}
/>
/>,
)
}

@ -136,7 +136,7 @@ export class LocationRoot extends React.Component<IProps, IState> {
if (this.props.p.travel(to)) {
this.setState({
inCity: true,
city: to
city: to,
});
}
}

@ -72,7 +72,7 @@ export class TechVendorLocation extends React.Component<IProps, any> {
onClick={() => createPurchaseServerPopup(i, this.props.p)}
style={this.btnStyle}
text={<>Purchase {i}GB Server - {Money(cost)}</>}
/>
/>,
)
}

@ -38,8 +38,8 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
function LocationLetter(props: any) {
if(props.city !== thisTravelAgencyLocation.props.p.city) {
return <span className='tooltip' style={{color: 'blue', whiteSpace: 'nowrap', margin: '0px', padding: '0px'}} onClick={createTravelPopup.bind(null, props.city, thisTravelAgencyLocation.props.travel)}>
<span className='tooltiptext'>{props.city}</span>
return <span className="tooltip" style={{color: 'blue', whiteSpace: 'nowrap', margin: '0px', padding: '0px'}} onClick={createTravelPopup.bind(null, props.city, thisTravelAgencyLocation.props.travel)}>
<span className="tooltiptext">{props.city}</span>
{props.city[0]}
</span>
}
@ -55,20 +55,20 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
<pre> ,_ . ._. _. .</pre>
<pre> , _-\','|~\~ ~/ ;-'_ _-' ,;_;_, ~~-</pre>
<pre> /~~-\_/-'~'--' \~~| ', ,' / / ~|-_\_/~/~ ~~--~~~~'--_</pre>
<pre> / ,/'-/~ '\ ,' _ , '<LocationLetter city='Volhaven' />,'|~ ._/-, /~</pre>
<pre> / ,/'-/~ '\ ,' _ , '<LocationLetter city="Volhaven" />,'|~ ._/-, /~</pre>
<pre> ~/-'~\_, '-,| '|. ' ~ ,\ /'~ / /_ /~</pre>
<pre>.-~ '| '',\~|\ _\~ ,_ , <LocationLetter city='Chongqing' /> /,</pre>
<pre> '\ <LocationLetter city='Sector-12' /> /'~ |_/~\\,-,~ \ " ,_,/ |</pre>
<pre> | / ._-~'\_ _~| \ ) <LocationLetter city='New Tokyo' /></pre>
<pre>.-~ '| '',\~|\ _\~ ,_ , <LocationLetter city="Chongqing" /> /,</pre>
<pre> '\ <LocationLetter city="Sector-12" /> /'~ |_/~\\,-,~ \ " ,_,/ |</pre>
<pre> | / ._-~'\_ _~| \ ) <LocationLetter city="New Tokyo" /></pre>
<pre> \ __-\ '/ ~ |\ \_ / ~</pre>
<pre> ., '\ |, ~-_ - | \\_' ~| /\ \~ ,</pre>
<pre> ~-_' _; '\ '-, \,' /\/ |</pre>
<pre> '\_,~'\_ \_ _, /' ' |, /|'</pre>
<pre> / \_ ~ | / \ ~'; -,_.</pre>
<pre> | ~\ | | , '-_, ,; ~ ~\</pre>
<pre> \, <LocationLetter city='Aevum' /> / \ / /| ,-, , -,</pre>
<pre> \, <LocationLetter city="Aevum" /> / \ / /| ,-, , -,</pre>
<pre> | ,/ | |' |/ ,- ~ \ '.</pre>
<pre> ,| ,/ \ ,/ \ <LocationLetter city='Ishima' /> |</pre>
<pre> ,| ,/ \ ,/ \ <LocationLetter city="Ishima" /> |</pre>
<pre> / | ~ -~~-, / _</pre>
<pre> | ,-' ~ /</pre>
<pre> / ,' ~</pre>
@ -93,7 +93,7 @@ export class TravelAgencyLocation extends React.Component<IProps, any> {
onClick={createTravelPopup.bind(null, city, this.props.travel)}
style={this.btnStyle}
text={`Travel to ${city}`}
/>
/>,
)
}

@ -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;

@ -23,7 +23,7 @@ export function displayMilestonesContent() {
if (milestonesContainer instanceof HTMLElement) {
ReactDOM.render(
<Root player={Player}/>,
milestonesContainer
milestonesContainer,
);
}
}

@ -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;
}

@ -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;
}

@ -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

@ -307,7 +307,7 @@ export const RamCosts: IMap<any> = {
heart: {
// Easter egg function
break : () => 0,
}
},
}
export function getRamCost(...args: string[]): number {

@ -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];

@ -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;

@ -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()

@ -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

@ -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];
}
}

@ -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.`,
);
}

@ -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);
}

@ -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() {

@ -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;

Some files were not shown because too many files have changed in this diff Show More