Merge branch 'danielyxie:dev' into dev

This commit is contained in:
rderfler 2022-04-14 11:48:44 -04:00 committed by GitHub
commit 7c468663d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
234 changed files with 7143 additions and 4783 deletions

@ -1,3 +1,3 @@
last 4 versions last 8 versions
not dead not dead
not ie <= 11 not ie <= 11

@ -353,6 +353,7 @@ module.exports = {
"no-useless-constructor": [ "no-useless-constructor": [
"off", // Valid for typescript due to property ctor shorthand "off", // Valid for typescript due to property ctor shorthand
], ],
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-ts-ignore": "off", "@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/camelcase": "off", "@typescript-eslint/camelcase": "off",

71
.github/workflows/ci-pr.yml vendored Normal file

@ -0,0 +1,71 @@
name: CI Pull Request
on:
# Triggers the workflow on pull request events but only for the dev branch, checking only diffs
pull_request:
branches: [dev]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.13.1
uses: actions/setup-node@v2
with:
node-version: 16.13.1
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Build the production app
run: npm run build
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 16.13.1
uses: actions/setup-node@v2
with:
node-version: 16.13.1
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Run linter
run: npm run lint:report-diff
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 16.13.1
uses: actions/setup-node@v2
with:
node-version: 16.13.1
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Run prettier check
run: npm run format:report-diff
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.13.1
uses: actions/setup-node@v2
with:
node-version: 16.13.1
cache: "npm"
- name: Install npm dependencies
run: npm ci
- name: Run tests
run: npm run test

@ -1,11 +1,9 @@
name: CI name: CI
on: on:
# Triggers the workflow on push or pull request events but only for the dev branch # Triggers the workflow on push events but only for the dev branch
push: push:
branches: [dev] branches: [dev]
pull_request:
branches: [dev]
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:

1
.gitignore vendored

@ -1,4 +1,5 @@
.DS_Store .DS_Store
.history
.vscode .vscode
Changelog.txt Changelog.txt
Netburner.txt Netburner.txt

3
.npmrc Normal file

@ -0,0 +1,3 @@
# Default "npm version" commit message
# See: https://stackoverflow.com/a/34606092
message=":bookmark: Build v%s"

181
dist/bitburner.d.ts vendored

@ -3,7 +3,7 @@
*/ */
export declare interface ActiveFragment { export declare interface ActiveFragment {
id: number; id: number;
avgCharge: number; highestCharge: number;
numCharge: number; numCharge: number;
rotation: number; rotation: number;
x: number; x: number;
@ -182,7 +182,7 @@ export declare interface BitNodeMultipliers {
/** Influences the maximum allowed RAM for a purchased server */ /** Influences the maximum allowed RAM for a purchased server */
PurchasedServerMaxRam: number; PurchasedServerMaxRam: number;
/** Influences cost of any purchased server at or above 128GB */ /** Influences cost of any purchased server at or above 128GB */
PurchasedServerSoftCap: number; PurchasedServerSoftcap: number;
/** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */ /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */
RepToDonateToFaction: number; RepToDonateToFaction: number;
/** Influences how much the money on a server can be reduced when a script performs a hack against it. */ /** Influences how much the money on a server can be reduced when a script performs a hack against it. */
@ -709,10 +709,10 @@ export declare interface CharacterInfo {
factions: string[]; factions: string[];
/** Current health points */ /** Current health points */
hp: number; hp: number;
/** Array of all companies at which you have jobs */ /** Array of all jobs */
company: string[]; jobs: string[];
/** Array of job positions for all companies you are employed at. Same order as 'jobs' */ /** Array of job positions for all companies you are employed at. Same order as 'jobs' */
jobTitle: string[]; jobTitles: string[];
/** Maximum health points */ /** Maximum health points */
maxHp: number; maxHp: number;
/** Boolean indicating whether or not you have a tor router */ /** Boolean indicating whether or not you have a tor router */
@ -737,6 +737,18 @@ export declare interface CharacterInfo {
workRepGain: number; workRepGain: number;
/** Money earned so far from work, if applicable */ /** Money earned so far from work, if applicable */
workMoneyGain: number; workMoneyGain: number;
/** total hacking exp */
hackingExp: number;
/** total strength exp */
strengthExp: number;
/** total defense exp */
defenseExp: number;
/** total dexterity exp */
dexterityExp: number;
/** total agility exp */
agilityExp: number;
/** total charisma exp */
charismaExp: number;
} }
/** /**
@ -747,6 +759,10 @@ export declare interface CharacterMult {
agility: number; agility: number;
/** Agility exp */ /** Agility exp */
agilityExp: number; agilityExp: number;
/** Charisma stat */
charisma: number;
/** Charisma exp */
charismaExp: number;
/** Company reputation */ /** Company reputation */
companyRep: number; companyRep: number;
/** Money earned from crimes */ /** Money earned from crimes */
@ -1177,6 +1193,8 @@ export declare type FilenameOrPID = number | string;
* @public * @public
*/ */
export declare interface Formulas { export declare interface Formulas {
/** Reputation formulas */
reputation: ReputationFormulas;
/** Skills formulas */ /** Skills formulas */
skills: SkillsFormulas; skills: SkillsFormulas;
/** Hacking formulas */ /** Hacking formulas */
@ -1755,6 +1773,18 @@ export declare interface Grafting {
*/ */
getAugmentationGraftTime(augName: string): number; getAugmentationGraftTime(augName: string): number;
/**
* Retrieves a list of Augmentations that can be grafted.
* @remarks
* RAM cost: 5 GB
*
* Note that this function returns a list of currently graftable Augmentations,
* based off of the Augmentations that you already own.
*
* @returns An array of graftable Augmentations.
*/
getGraftableAugmentations(): string[];
/** /**
* Begins grafting the named aug. You must be in New Tokyo to use this. * Begins grafting the named aug. You must be in New Tokyo to use this.
* @remarks * @remarks
@ -2101,7 +2131,7 @@ export declare interface Hacknet {
* // NS1: * // NS1:
* var upgradeName = "Sell for Corporation Funds"; * var upgradeName = "Sell for Corporation Funds";
* if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) { * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
* hacknet.spendHashes(upgName); * hacknet.spendHashes(upgradeName);
* } * }
* ``` * ```
* @example * @example
@ -2109,7 +2139,7 @@ export declare interface Hacknet {
* // NS2: * // NS2:
* const upgradeName = "Sell for Corporation Funds"; * const upgradeName = "Sell for Corporation Funds";
* if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) { * if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {
* ns.hacknet.spendHashes(upgName); * ns.hacknet.spendHashes(upgradeName);
* } * }
* ``` * ```
* @param upgName - Name of the upgrade of Hacknet Node. * @param upgName - Name of the upgrade of Hacknet Node.
@ -2442,6 +2472,10 @@ export declare interface Material {
qty: number; qty: number;
/** Quality of the material */ /** Quality of the material */
qlt: number; qlt: number;
/** Demand for the material, only present if "Market Research - Demand" unlocked */
dmd: number | undefined;
/** Competition for the material, only present if "Market Research - Competition" unlocked */
cmp: number | undefined;
/** Amount of material produced */ /** Amount of material produced */
prod: number; prod: number;
/** Amount of material sold */ /** Amount of material sold */
@ -2574,7 +2608,7 @@ export declare interface NodeStats {
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs} * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}
* <hr> * <hr>
*/ */
export declare interface NS extends Singularity { export declare interface NS {
/** /**
* Namespace for hacknet functions. * Namespace for hacknet functions.
* @remarks RAM cost: 4 GB * @remarks RAM cost: 4 GB
@ -2635,6 +2669,12 @@ export declare interface NS extends Singularity {
*/ */
readonly ui: UserInterface; readonly ui: UserInterface;
/**
* Namespace for singularity functions.
* RAM cost: 0 GB
*/
readonly singularity: Singularity;
/** /**
* Namespace for grafting functions. * Namespace for grafting functions.
* @remarks * @remarks
@ -2825,9 +2865,10 @@ export declare interface NS extends Singularity {
* Returns the security increase that would occur if a hack with this many threads happened. * Returns the security increase that would occur if a hack with this many threads happened.
* *
* @param threads - Amount of threads that will be used. * @param threads - Amount of threads that will be used.
* @param hostname - Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.
* @returns The security increase. * @returns The security increase.
*/ */
hackAnalyzeSecurity(threads: number): number; hackAnalyzeSecurity(threads: number, hostname?: string): number;
/** /**
* Get the chance of successfully hacking a server. * Get the chance of successfully hacking a server.
@ -2882,9 +2923,11 @@ export declare interface NS extends Singularity {
* Returns the security increase that would occur if a grow with this many threads happened. * Returns the security increase that would occur if a grow with this many threads happened.
* *
* @param threads - Amount of threads that will be used. * @param threads - Amount of threads that will be used.
* @param hostname - Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.
* @param cores - Optional. The number of cores of the server that would run grow.
* @returns The security increase. * @returns The security increase.
*/ */
growthAnalyzeSecurity(threads: number): number; growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;
/** /**
* Suspends the script for n milliseconds. * Suspends the script for n milliseconds.
@ -2912,7 +2955,7 @@ export declare interface NS extends Singularity {
* ``` * ```
* @returns * @returns
*/ */
sleep(millis: number): Promise<void>; sleep(millis: number): Promise<true>;
/** /**
* Suspends the script for n milliseconds. Doesn't block with concurrent calls. * Suspends the script for n milliseconds. Doesn't block with concurrent calls.
@ -2922,7 +2965,7 @@ export declare interface NS extends Singularity {
* @param millis - Number of milliseconds to sleep. * @param millis - Number of milliseconds to sleep.
* @returns * @returns
*/ */
asleep(millis: number): Promise<void>; asleep(millis: number): Promise<true>;
/** /**
* Prints one or move values or variables to the scripts logs. * Prints one or move values or variables to the scripts logs.
@ -3051,6 +3094,27 @@ export declare interface NS extends Singularity {
*/ */
getScriptLogs(fn?: string, host?: string, ...args: any[]): string[]; getScriptLogs(fn?: string, host?: string, ...args: any[]): string[];
/**
* Get an array of recently killed scripts across all servers.
* @remarks
* RAM cost: 0.2 GB
*
* The most recently killed script is the first element in the array.
* Note that there is a maximum number of recently killed scripts which are tracked.
* This is configurable in the game's options as `Recently killed scripts size`.
*
* @example
* ```ts
* let recentScripts = ns.getRecentScripts();
* let mostRecent = recentScripts.shift()
* if (mostRecent)
* ns.tprint(mostRecent.logs.join('\n'))
* ```
*
* @returns Array with information about previously killed scripts.
*/
getRecentScripts(): RecentScript[];
/** /**
* Open the tail window of a script. * Open the tail window of a script.
* @remarks * @remarks
@ -3941,7 +4005,7 @@ export declare interface NS extends Singularity {
* @param args - Arguments to identify the script * @param args - Arguments to identify the script
* @returns The info about the running script if found, and null otherwise. * @returns The info about the running script if found, and null otherwise.
*/ */
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript; getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript | null;
/** /**
* Get cost of purchasing a server. * Get cost of purchasing a server.
@ -4453,7 +4517,7 @@ export declare interface NS extends Singularity {
* @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success. * @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success.
* @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000 * @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000
*/ */
toast(msg: any, variant?: string, duration?: number | null): void; toast(msg: any, variant?: ToastVariantValues, duration?: number | null): void;
/** /**
* Download a file from the internet. * Download a file from the internet.
@ -4648,6 +4712,13 @@ export declare interface NS extends Singularity {
* RAM cost: 0.2 GB * RAM cost: 0.2 GB
*/ */
getSharePower(): number; getSharePower(): number;
enums: NSEnums;
}
/** @public */
export declare interface NSEnums {
toast: typeof ToastVariant;
} }
/** /**
@ -4671,8 +4742,10 @@ export declare interface Office {
maxMor: number; maxMor: number;
/** Name of all the employees */ /** Name of all the employees */
employees: string[]; employees: string[];
/** Positions of the employees */ /** Production of the employees */
employeeProd: EmployeeJobs; employeeProd: EmployeeJobs;
/** Positions of the employees */
employeeJobs: EmployeeJobs;
} }
/** /**
@ -4947,10 +5020,14 @@ export declare interface ProcessInfo {
export declare interface Product { export declare interface Product {
/** Name of the product */ /** Name of the product */
name: string; name: string;
/** Demand for the product */ /** Demand for the product, only present if "Market Research - Demand" unlocked */
dmd: number; dmd: number | undefined;
/** Competition for the product */ /** Competition for the product, only present if "Market Research - Competition" unlocked */
cmp: number; cmp: number | undefined;
/** Product Rating */
rat: number;
/** Product Properties. The data is \{qlt, per, dur, rel, aes, fea\} */
properties: { [key: string]: number };
/** Production cost */ /** Production cost */
pCost: number; pCost: number;
/** Sell cost, can be "MP+5" */ /** Sell cost, can be "MP+5" */
@ -4963,24 +5040,66 @@ export declare interface Product {
developmentProgress: number; developmentProgress: number;
} }
/**
* @public
*/
export declare interface RecentScript extends RunningScript {
/** Timestamp of when the script was killed */
timeOfDeath: Date;
}
/**
* Reputation formulas
* @public
*/
export declare interface ReputationFormulas {
/**
* Calculate the total required amount of faction reputation to reach a target favor.
* @param favor - target faction favor.
* @returns The calculated faction reputation required.
*/
calculateFavorToRep(favor: number): number;
/**
* Calculate the resulting faction favor of a total amount of reputation.
* (Faction favor is gained whenever you install an Augmentation.)
* @param rep - amount of reputation.
* @returns The calculated faction favor.
*/
calculateRepToFavor(rep: number): number;
}
/** /**
* @public * @public
*/ */
export declare interface RunningScript { export declare interface RunningScript {
/** Arguments the script was called with */
args: string[]; args: string[];
/** Filename of the script */
filename: string; filename: string;
/**
* Script logs as an array. The newest log entries are at the bottom.
* Timestamps, if enabled, are placed inside `[brackets]` at the start of each line.
**/
logs: string[]; logs: string[];
/** Total amount of hacking experience earned from this script when offline */
offlineExpGained: number; offlineExpGained: number;
/** Total amount of money made by this script when offline */
offlineMoneyMade: number; offlineMoneyMade: number;
/** Offline running time of the script, in seconds **/ /** Number of seconds that the script has been running offline */
offlineRunningTime: number; offlineRunningTime: number;
/** Total amount of hacking experience earned from this script when online */
onlineExpGained: number; onlineExpGained: number;
/** Total amount of money made by this script when online */
onlineMoneyMade: number; onlineMoneyMade: number;
/** Online running time of the script, in seconds **/ /** Number of seconds that this script has been running online */
onlineRunningTime: number; onlineRunningTime: number;
/** Process ID. Must be an integer */
pid: number; pid: number;
/** How much RAM this script uses for ONE thread */
ramUsage: number; ramUsage: number;
/** Hostname of the server on which this script runs */
server: string; server: string;
/** Number of threads that this script runs with */
threads: number; threads: number;
} }
@ -5750,11 +5869,8 @@ export declare interface Singularity {
* Hospitalize the player. * Hospitalize the player.
* @remarks * @remarks
* RAM cost: 0.25 GB * 16/4/1 * RAM cost: 0.25 GB * 16/4/1
*
*
* @returns The cost of the hospitalization.
*/ */
hospitalize(): number; hospitalize(): void;
/** /**
* Soft reset the game. * Soft reset the game.
@ -6028,9 +6144,9 @@ export declare interface Sleeve {
* @param sleeveNumber - Index of the sleeve to work for the faction. * @param sleeveNumber - Index of the sleeve to work for the faction.
* @param factionName - Name of the faction to work for. * @param factionName - Name of the faction to work for.
* @param factionWorkType - Name of the action to perform for this faction. * @param factionWorkType - Name of the action to perform for this faction.
* @returns True if the sleeve started working on this faction, false otherwise. * @returns True if the sleeve started working on this faction, false otherwise, can also throw on errors
*/ */
setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean; setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;
/** /**
* Set a sleeve to work for a company. * Set a sleeve to work for a company.
@ -6729,6 +6845,17 @@ export declare interface TIX {
purchaseTixApi(): boolean; purchaseTixApi(): boolean;
} }
/** @public */
export declare enum ToastVariant {
SUCCESS = "success",
WARNING = "warning",
ERROR = "error",
INFO = "info",
}
/** @public */
export declare type ToastVariantValues = `${ToastVariant}`;
/** /**
* User Interface API. * User Interface API.
* @public * @public

4
dist/main.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

42
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -5,10 +5,10 @@ Grafting
Grafting is an experimental process through which you can obtain the benefits of Grafting is an experimental process through which you can obtain the benefits of
Augmentations, without needing to reboot your body. Augmentations, without needing to reboot your body.
In order to graft, you must first purchase a blueprint for and craft the Augmentation. Grafting can be done at VitaLife in New Tokyo, where you'll find a shady researcher with
This can be done at VitaLife in New Tokyo, where you'll find a shady researcher with questionable connections. From there, you can spend a sum of money to begin grafting
questionable connections. Once you purchase a blueprint, you will start crafting the Augmentations. This will take some time. When done, the Augmentation will be applied to
Augmentation, and it will be grafted to your body once complete. your character without needing to install.
Be warned, some who have tested grafting have reported an unidentified malware. Dubbed Be warned, some who have tested grafting have reported an unidentified malware. Dubbed
"Entropy", this virus seems to grow in potency as more Augmentations are grafted, "Entropy", this virus seems to grow in potency as more Augmentations are grafted,

@ -93,9 +93,15 @@ The list contains the name of (i.e. the value returned by
| Subarray with Maximum Sum | | Given an array of integers, find the contiguous subarray (containing | | Subarray with Maximum Sum | | Given an array of integers, find the contiguous subarray (containing |
| | | at least one number) which has the largest sum and return that sum. | | | | at least one number) which has the largest sum and return that sum. |
+------------------------------------+------------------------------------------------------------------------------------------+ +------------------------------------+------------------------------------------------------------------------------------------+
| Total Ways to Sum | | Given a number, how many different ways can that number be written as | | Total Ways to Sum | | Given a number, how many different distinct ways can that number be written as |
| | | a sum of at least two positive integers? | | | | a sum of at least two positive integers? |
+------------------------------------+------------------------------------------------------------------------------------------+ +------------------------------------+------------------------------------------------------------------------------------------+
| Total Ways to Sum II | | You are given an array with two elements. The first element is an integer n. |
| | | The second element is an array of numbers representing the set of available integers. |
| | | How many different distinct ways can that number n be written as |
| | | a sum of integers contained in the given set? |
| | | You may use each integer in the set zero or more times. |
+------------------------------------+------------------------------------------------------------------------------------------+
| Spiralize Matrix | | Given an array of array of numbers representing a 2D matrix, return the | | Spiralize Matrix | | Given an array of array of numbers representing a 2D matrix, return the |
| | | elements of that matrix in clockwise spiral order. | | | | elements of that matrix in clockwise spiral order. |
| | | | | | | |
@ -115,6 +121,16 @@ The list contains the name of (i.e. the value returned by
| | | Assuming you are initially positioned at the start of the array, determine | | | | Assuming you are initially positioned at the start of the array, determine |
| | | whether you are able to reach the last index of the array. | | | | whether you are able to reach the last index of the array. |
+------------------------------------+------------------------------------------------------------------------------------------+ +------------------------------------+------------------------------------------------------------------------------------------+
| Array Jumping Game II | | You are given an array of integers where each element represents the |
| | | maximum possible jump distance from that position. For example, if you |
| | | are at position i and your maximum jump length is n, then you can jump |
| | | to any position from i to i+n. |
| | | |
| | | Assuming you are initially positioned at the start of the array, determine |
| | | the minimum number of jumps to reach the end of the array. |
| | | |
| | | If it's impossible to reach the end, then the answer should be 0. |
+------------------------------------+------------------------------------------------------------------------------------------+
| Merge Overlapping Intervals | | Given an array of intervals, merge all overlapping intervals. An interval | | Merge Overlapping Intervals | | Given an array of intervals, merge all overlapping intervals. An interval |
| | | is an array with two numbers, where the first number is always less than | | | | is an array with two numbers, where the first number is always less than |
| | | the second (e.g. [1, 5]). | | | | the second (e.g. [1, 5]). |

@ -66,7 +66,7 @@ documentation_title = '{0} Documentation'.format(project)
# The short X.Y version. # The short X.Y version.
version = '1.6' version = '1.6'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '1.6.3' release = '1.6.4'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

@ -1,453 +0,0 @@
:root {
--dark-text-color: #0c0;
--dark-link-color: #090;
}
body {
color: #000;
}
.wy-nav-content-wrap {
background-color: #000;
}
.wy-nav-content {
background-color: #000;
}
.section {
color: var(--dark-text-color);
}
.rst-content .highlighted {
background: #333;
box-shadow: none;
}
.highlight {
background-color: #17181c;
}
.highlight .nn {
color: var(--dark-text-color);
}
.highlight .nb {
color: #8bb8df;
}
.highlight .kn,
.highlight .kc,
.highlight .k {
color: #41c2ea;
}
.highlight .s1,
.highlight .s2 {
color: #b3e87f;
}
.highlight .nt {
color: #ccb350;
}
.highlight .c1 {
color: #686868;
}
.rst-content div[class^="highlight"] {
border-color: #1a1a1a;
}
.icon,
.icon-home {
color: var(--dark-link-color);
}
.wy-nav-content a,
.wy-nav-content a:visited {
color: var(--dark-link-color) !important;
text-decoration: underline;
}
.btn-neutral {
background-color: #17181c !important;
}
.btn-neutral:hover {
background-color: #101114 !important;
}
.btn-neutral:visited {
color: #c1c1c1 !important;
}
.btn {
box-shadow: none;
}
footer {
color: #bdbdbd;
}
.wy-nav-side {
background-color: #000;
border: 1px solid #333;
}
.wy-menu-vertical > a {
color: var(--dark-text-color);
}
.wy-menu-vertical li.current {
background-color: #000;
}
.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a {
background-color: #000;
color: var(--dark-text-color);
}
.wy-menu-vertical li.toctree-l1.current > a,
.wy-menu-vertical li.current a {
border-color: #000;
}
.wy-menu-vertical header,
.wy-menu-vertical p.caption {
color: var(--dark-text-color);
}
html.writer-html4 .rst-content dl:not(.docutils) > dt,
html.writer-html5
.rst-content
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)
> dt {
background-color: #333;
}
.wy-menu-vertical li.current a {
color: #090;
}
.wy-menu-vertical a {
color: var(--dark-text-color);
}
.wy-menu-vertical li.current a:hover {
background-color: #222;
}
.wy-menu-vertical a:hover,
.wy-menu-vertical li.current > a:hover,
.wy-menu-vertical li.on a:hover {
background-color: #000;
color: var(--dark-text-color);
}
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a {
background-color: #000;
}
.wy-side-nav-search {
background-color: #000;
color: var(--dark-text-color);
}
.wy-side-nav-search .wy-dropdown > a,
.wy-side-nav-search > a {
color: var(--dark-text-color);
}
.wy-side-nav-search input[type="text"] {
border-left: 0px;
border-right: 0px;
border-top: 0px;
border-radius: 0px;
box-shadow: none;
border-bottom-color: #0c0;
background-color: #333;
color: var(--dark-text-color);
}
.theme-switcher {
background-color: #0b0c0d;
color: var(--dark-text-color);
}
writer-html4 .rst-content dl:not(.docutils) > dt,
writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) > dt {
background-color: #0b0b0b;
color: #007dce;
border-color: #282828;
}
.rst-content code,
.rst-content tt {
color: var(--dark-text-color);
}
writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list) > dt,
writer-html5
.rst-content
dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)
dl:not(.field-list)
> dt {
background-color: #0f0f0f;
color: #959595;
border-color: #2b2b2b;
}
.rst-content code,
.rst-content tt,
code {
background-color: #2d2d2d;
border-color: #1c1c1c;
}
.rst-content code.xref,
.rst-content tt.xref,
a .rst-content code,
a .rst-content tt {
color: #cecece;
}
.rst-content .hint,
.rst-content .important,
.rst-content .tip,
.rst-content .wy-alert-success.admonition,
.rst-content .wy-alert-success.admonition-todo,
.rst-content .wy-alert-success.attention,
.rst-content .wy-alert-success.caution,
.rst-content .wy-alert-success.danger,
.rst-content .wy-alert-success.error,
.rst-content .wy-alert-success.note,
.rst-content .wy-alert-success.seealso,
.rst-content .wy-alert-success.warning,
.wy-alert.wy-alert-success {
background-color: #00392e;
}
.rst-content .hint .admonition-title,
.rst-content .hint .wy-alert-title,
.rst-content .important .admonition-title,
.rst-content .important .wy-alert-title,
.rst-content .tip .admonition-title,
.rst-content .tip .wy-alert-title,
.rst-content .wy-alert-success.admonition-todo .admonition-title,
.rst-content .wy-alert-success.admonition-todo .wy-alert-title,
.rst-content .wy-alert-success.admonition .admonition-title,
.rst-content .wy-alert-success.admonition .wy-alert-title,
.rst-content .wy-alert-success.attention .admonition-title,
.rst-content .wy-alert-success.attention .wy-alert-title,
.rst-content .wy-alert-success.caution .admonition-title,
.rst-content .wy-alert-success.caution .wy-alert-title,
.rst-content .wy-alert-success.danger .admonition-title,
.rst-content .wy-alert-success.danger .wy-alert-title,
.rst-content .wy-alert-success.error .admonition-title,
.rst-content .wy-alert-success.error .wy-alert-title,
.rst-content .wy-alert-success.note .admonition-title,
.rst-content .wy-alert-success.note .wy-alert-title,
.rst-content .wy-alert-success.seealso .admonition-title,
.rst-content .wy-alert-success.seealso .wy-alert-title,
.rst-content .wy-alert-success.warning .admonition-title,
.rst-content .wy-alert-success.warning .wy-alert-title,
.rst-content .wy-alert.wy-alert-success .admonition-title,
.wy-alert.wy-alert-success .rst-content .admonition-title,
.wy-alert.wy-alert-success .wy-alert-title {
background-color: #006a56;
}
.rst-content .note,
.rst-content .seealso,
.rst-content .wy-alert-info.admonition,
.rst-content .wy-alert-info.admonition-todo,
.rst-content .wy-alert-info.attention,
.rst-content .wy-alert-info.caution,
.rst-content .wy-alert-info.danger,
.rst-content .wy-alert-info.error,
.rst-content .wy-alert-info.hint,
.rst-content .wy-alert-info.important,
.rst-content .wy-alert-info.tip,
.rst-content .wy-alert-info.warning,
.wy-alert.wy-alert-info {
background-color: #002c4d;
}
.rst-content .note .admonition-title,
.rst-content .note .wy-alert-title,
.rst-content .seealso .admonition-title,
.rst-content .seealso .wy-alert-title,
.rst-content .wy-alert-info.admonition-todo .admonition-title,
.rst-content .wy-alert-info.admonition-todo .wy-alert-title,
.rst-content .wy-alert-info.admonition .admonition-title,
.rst-content .wy-alert-info.admonition .wy-alert-title,
.rst-content .wy-alert-info.attention .admonition-title,
.rst-content .wy-alert-info.attention .wy-alert-title,
.rst-content .wy-alert-info.caution .admonition-title,
.rst-content .wy-alert-info.caution .wy-alert-title,
.rst-content .wy-alert-info.danger .admonition-title,
.rst-content .wy-alert-info.danger .wy-alert-title,
.rst-content .wy-alert-info.error .admonition-title,
.rst-content .wy-alert-info.error .wy-alert-title,
.rst-content .wy-alert-info.hint .admonition-title,
.rst-content .wy-alert-info.hint .wy-alert-title,
.rst-content .wy-alert-info.important .admonition-title,
.rst-content .wy-alert-info.important .wy-alert-title,
.rst-content .wy-alert-info.tip .admonition-title,
.rst-content .wy-alert-info.tip .wy-alert-title,
.rst-content .wy-alert-info.warning .admonition-title,
.rst-content .wy-alert-info.warning .wy-alert-title,
.rst-content .wy-alert.wy-alert-info .admonition-title,
.wy-alert.wy-alert-info .rst-content .admonition-title,
.wy-alert.wy-alert-info .wy-alert-title {
background-color: #004a7b;
}
.rst-content dl:not(.docutils) dt {
background-color: #333;
}
.rst-content {
color: var(--dark-text-color);
}
.rst-content .admonition-todo,
.rst-content .attention,
.rst-content .caution,
.rst-content .warning,
.rst-content .wy-alert-warning.admonition,
.rst-content .wy-alert-warning.danger,
.rst-content .wy-alert-warning.error,
.rst-content .wy-alert-warning.hint,
.rst-content .wy-alert-warning.important,
.rst-content .wy-alert-warning.note,
.rst-content .wy-alert-warning.seealso,
.rst-content .wy-alert-warning.tip,
.wy-alert.wy-alert-warning {
background-color: #533500;
}
.rst-content .admonition-todo .admonition-title,
.rst-content .admonition-todo .wy-alert-title,
.rst-content .attention .admonition-title,
.rst-content .attention .wy-alert-title,
.rst-content .caution .admonition-title,
.rst-content .caution .wy-alert-title,
.rst-content .warning .admonition-title,
.rst-content .warning .wy-alert-title,
.rst-content .wy-alert-warning.admonition .admonition-title,
.rst-content .wy-alert-warning.admonition .wy-alert-title,
.rst-content .wy-alert-warning.danger .admonition-title,
.rst-content .wy-alert-warning.danger .wy-alert-title,
.rst-content .wy-alert-warning.error .admonition-title,
.rst-content .wy-alert-warning.error .wy-alert-title,
.rst-content .wy-alert-warning.hint .admonition-title,
.rst-content .wy-alert-warning.hint .wy-alert-title,
.rst-content .wy-alert-warning.important .admonition-title,
.rst-content .wy-alert-warning.important .wy-alert-title,
.rst-content .wy-alert-warning.note .admonition-title,
.rst-content .wy-alert-warning.note .wy-alert-title,
.rst-content .wy-alert-warning.seealso .admonition-title,
.rst-content .wy-alert-warning.seealso .wy-alert-title,
.rst-content .wy-alert-warning.tip .admonition-title,
.rst-content .wy-alert-warning.tip .wy-alert-title,
.rst-content .wy-alert.wy-alert-warning .admonition-title,
.wy-alert.wy-alert-warning .rst-content .admonition-title,
.wy-alert.wy-alert-warning .wy-alert-title {
background-color: #803b00;
}
.rst-content .danger,
.rst-content .error,
.rst-content .wy-alert-danger.admonition,
.rst-content .wy-alert-danger.admonition-todo,
.rst-content .wy-alert-danger.attention,
.rst-content .wy-alert-danger.caution,
.rst-content .wy-alert-danger.hint,
.rst-content .wy-alert-danger.important,
.rst-content .wy-alert-danger.note,
.rst-content .wy-alert-danger.seealso,
.rst-content .wy-alert-danger.tip,
.rst-content .wy-alert-danger.warning,
.wy-alert.wy-alert-danger {
background-color: #82231a;
}
.rst-content .danger .admonition-title,
.rst-content .danger .wy-alert-title,
.rst-content .error .admonition-title,
.rst-content .error .wy-alert-title,
.rst-content .wy-alert-danger.admonition-todo .admonition-title,
.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,
.rst-content .wy-alert-danger.admonition .admonition-title,
.rst-content .wy-alert-danger.admonition .wy-alert-title,
.rst-content .wy-alert-danger.attention .admonition-title,
.rst-content .wy-alert-danger.attention .wy-alert-title,
.rst-content .wy-alert-danger.caution .admonition-title,
.rst-content .wy-alert-danger.caution .wy-alert-title,
.rst-content .wy-alert-danger.hint .admonition-title,
.rst-content .wy-alert-danger.hint .wy-alert-title,
.rst-content .wy-alert-danger.important .admonition-title,
.rst-content .wy-alert-danger.important .wy-alert-title,
.rst-content .wy-alert-danger.note .admonition-title,
.rst-content .wy-alert-danger.note .wy-alert-title,
.rst-content .wy-alert-danger.seealso .admonition-title,
.rst-content .wy-alert-danger.seealso .wy-alert-title,
.rst-content .wy-alert-danger.tip .admonition-title,
.rst-content .wy-alert-danger.tip .wy-alert-title,
.rst-content .wy-alert-danger.warning .admonition-title,
.rst-content .wy-alert-danger.warning .wy-alert-title,
.rst-content .wy-alert.wy-alert-danger .admonition-title,
.wy-alert.wy-alert-danger .rst-content .admonition-title,
.wy-alert.wy-alert-danger .wy-alert-title {
background-color: #b9372b;
}
.wy-nav-top {
background-color: #0b152d;
}
.rst-content table.docutils thead,
.rst-content table.field-list thead,
.wy-table thead {
color: var(--dark-text-color);
}
.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,
.wy-table-backed,
.wy-table-odd td,
.wy-table-striped tr:nth-child(2n-1) td {
background-color: #333;
}
.rst-content table.docutils:not(.field-list) tr:nth-child(2n) td,
.wy-table-backed,
.wy-table-odd td,
.wy-table-striped tr:nth-child(2n) td {
background-color: #444;
}
.rst-content table.docutils td,
.wy-table-bordered-all td,
writer-html5 .rst-content table.docutils th,
.rst-content table.docutils,
.wy-table-bordered-all {
border-color: #262626;
}
.rst-content table.docutils caption,
.rst-content table.field-list caption,
.wy-table caption {
color: var(--dark-text-color);
}
.wy-menu-vertical li.toctree-l3.current > a,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a {
background-color: #000;
}
.wy-side-nav-search > div.version {
color: var(--dark-text-color);
}

@ -22,7 +22,8 @@ function error_process(err, error_callback) {
if (err && error_callback) error_callback(err); if (err && error_callback) error_callback(err);
} }
greenworks.ugcGetItems = function (options, ugc_matching_type, ugc_query_type, success_callback, error_callback) { if (greenworks) {
greenworks.ugcGetItems = function (options, ugc_matching_type, ugc_query_type, success_callback, error_callback) {
if (typeof options !== "object") { if (typeof options !== "object") {
error_callback = success_callback; error_callback = success_callback;
success_callback = ugc_query_type; success_callback = ugc_query_type;
@ -34,16 +35,16 @@ greenworks.ugcGetItems = function (options, ugc_matching_type, ugc_query_type, s
}; };
} }
greenworks._ugcGetItems(options, ugc_matching_type, ugc_query_type, success_callback, error_callback); greenworks._ugcGetItems(options, ugc_matching_type, ugc_query_type, success_callback, error_callback);
}; };
greenworks.ugcGetUserItems = function ( greenworks.ugcGetUserItems = function (
options, options,
ugc_matching_type, ugc_matching_type,
ugc_list_sort_order, ugc_list_sort_order,
ugc_list, ugc_list,
success_callback, success_callback,
error_callback, error_callback,
) { ) {
if (typeof options !== "object") { if (typeof options !== "object") {
error_callback = success_callback; error_callback = success_callback;
success_callback = ugc_list; success_callback = ugc_list;
@ -63,9 +64,9 @@ greenworks.ugcGetUserItems = function (
success_callback, success_callback,
error_callback, error_callback,
); );
}; };
greenworks.ugcSynchronizeItems = function (options, sync_dir, success_callback, error_callback) { greenworks.ugcSynchronizeItems = function (options, sync_dir, success_callback, error_callback) {
if (typeof options !== "object") { if (typeof options !== "object") {
error_callback = success_callback; error_callback = success_callback;
success_callback = sync_dir; success_callback = sync_dir;
@ -76,9 +77,9 @@ greenworks.ugcSynchronizeItems = function (options, sync_dir, success_callback,
}; };
} }
greenworks._ugcSynchronizeItems(options, sync_dir, success_callback, error_callback); greenworks._ugcSynchronizeItems(options, sync_dir, success_callback, error_callback);
}; };
greenworks.publishWorkshopFile = function ( greenworks.publishWorkshopFile = function (
options, options,
file_path, file_path,
image_path, image_path,
@ -86,7 +87,7 @@ greenworks.publishWorkshopFile = function (
description, description,
success_callback, success_callback,
error_callback, error_callback,
) { ) {
if (typeof options !== "object") { if (typeof options !== "object") {
error_callback = success_callback; error_callback = success_callback;
success_callback = description; success_callback = description;
@ -99,10 +100,18 @@ greenworks.publishWorkshopFile = function (
tags: [], tags: [],
}; };
} }
greenworks._publishWorkshopFile(options, file_path, image_path, title, description, success_callback, error_callback); greenworks._publishWorkshopFile(
}; options,
file_path,
image_path,
title,
description,
success_callback,
error_callback,
);
};
greenworks.updatePublishedWorkshopFile = function ( greenworks.updatePublishedWorkshopFile = function (
options, options,
published_file_handle, published_file_handle,
file_path, file_path,
@ -111,7 +120,7 @@ greenworks.updatePublishedWorkshopFile = function (
description, description,
success_callback, success_callback,
error_callback, error_callback,
) { ) {
if (typeof options !== "object") { if (typeof options !== "object") {
error_callback = success_callback; error_callback = success_callback;
success_callback = description; success_callback = description;
@ -134,11 +143,11 @@ greenworks.updatePublishedWorkshopFile = function (
success_callback, success_callback,
error_callback, error_callback,
); );
}; };
// An utility function for publish related APIs. // An utility function for publish related APIs.
// It processes remains steps after saving files to Steam Cloud. // It processes remains steps after saving files to Steam Cloud.
function file_share_process(file_name, image_name, next_process_func, error_callback, progress_callback) { function file_share_process(file_name, image_name, next_process_func, error_callback, progress_callback) {
if (progress_callback) progress_callback("Completed on saving files on Steam Cloud."); if (progress_callback) progress_callback("Completed on saving files on Steam Cloud.");
greenworks.fileShare( greenworks.fileShare(
file_name, file_name,
@ -157,13 +166,13 @@ function file_share_process(file_name, image_name, next_process_func, error_call
error_process(err, error_callback); error_process(err, error_callback);
}, },
); );
} }
// Publishing user generated content(ugc) to Steam contains following steps: // Publishing user generated content(ugc) to Steam contains following steps:
// 1. Save file and image to Steam Cloud. // 1. Save file and image to Steam Cloud.
// 2. Share the file and image. // 2. Share the file and image.
// 3. publish the file to workshop. // 3. publish the file to workshop.
greenworks.ugcPublish = function ( greenworks.ugcPublish = function (
file_name, file_name,
title, title,
description, description,
@ -171,7 +180,7 @@ greenworks.ugcPublish = function (
success_callback, success_callback,
error_callback, error_callback,
progress_callback, progress_callback,
) { ) {
var publish_file_process = function () { var publish_file_process = function () {
if (progress_callback) progress_callback("Completed on sharing files."); if (progress_callback) progress_callback("Completed on sharing files.");
greenworks.publishWorkshopFile( greenworks.publishWorkshopFile(
@ -196,13 +205,13 @@ greenworks.ugcPublish = function (
error_process(err, error_callback); error_process(err, error_callback);
}, },
); );
}; };
// Update publish ugc steps: // Update publish ugc steps:
// 1. Save new file and image to Steam Cloud. // 1. Save new file and image to Steam Cloud.
// 2. Share file and images. // 2. Share file and images.
// 3. Update published file. // 3. Update published file.
greenworks.ugcPublishUpdate = function ( greenworks.ugcPublishUpdate = function (
published_file_id, published_file_id,
file_name, file_name,
title, title,
@ -211,7 +220,7 @@ greenworks.ugcPublishUpdate = function (
success_callback, success_callback,
error_callback, error_callback,
progress_callback, progress_callback,
) { ) {
var update_published_file_process = function () { var update_published_file_process = function () {
if (progress_callback) progress_callback("Completed on sharing files."); if (progress_callback) progress_callback("Completed on sharing files.");
greenworks.updatePublishedWorkshopFile( greenworks.updatePublishedWorkshopFile(
@ -238,10 +247,10 @@ greenworks.ugcPublishUpdate = function (
error_process(err, error_callback); error_process(err, error_callback);
}, },
); );
}; };
// Greenworks Utils APIs implmentation. // Greenworks Utils APIs implmentation.
greenworks.Utils.move = function (source_dir, target_dir, success_callback, error_callback) { greenworks.Utils.move = function (source_dir, target_dir, success_callback, error_callback) {
fs.rename(source_dir, target_dir, function (err) { fs.rename(source_dir, target_dir, function (err) {
if (err) { if (err) {
if (error_callback) error_callback(err); if (error_callback) error_callback(err);
@ -249,9 +258,9 @@ greenworks.Utils.move = function (source_dir, target_dir, success_callback, erro
} }
if (success_callback) success_callback(); if (success_callback) success_callback();
}); });
}; };
greenworks.init = function () { greenworks.init = function () {
if (this.initAPI()) return true; if (this.initAPI()) return true;
if (!this.isSteamRunning()) throw new Error("Steam initialization failed. Steam is not running."); if (!this.isSteamRunning()) throw new Error("Steam initialization failed. Steam is not running.");
var appId; var appId;
@ -278,16 +287,17 @@ greenworks.init = function () {
"Maybe that's not really YOUR app ID? " + "Maybe that's not really YOUR app ID? " +
appId.trim(), appId.trim(),
); );
}; };
var EventEmitter = require("events").EventEmitter; var EventEmitter = require("events").EventEmitter;
greenworks.__proto__ = EventEmitter.prototype; greenworks.__proto__ = EventEmitter.prototype;
EventEmitter.call(greenworks); EventEmitter.call(greenworks);
greenworks._steam_events.on = function () { greenworks._steam_events.on = function () {
greenworks.emit.apply(greenworks, arguments); greenworks.emit.apply(greenworks, arguments);
}; };
process.versions["greenworks"] = greenworks._version; process.versions["greenworks"] = greenworks._version;
}
module.exports = greenworks; module.exports = greenworks;

@ -25,7 +25,7 @@ process.on("uncaughtException", function () {
// We want to fail gracefully if we cannot connect to Steam // We want to fail gracefully if we cannot connect to Steam
try { try {
if (greenworks.init()) { if (greenworks && greenworks.init()) {
log.info("Steam API has been initialized."); log.info("Steam API has been initialized.");
} else { } else {
const error = "Steam API has failed to initialize."; const error = "Steam API has failed to initialize.";

@ -8,6 +8,39 @@ const storage = require("./storage");
const config = new Config(); const config = new Config();
function getMenu(window) { function getMenu(window) {
const canZoomIn = utils.getZoomFactor() <= 2;
const zoomIn = () => {
const currentZoom = utils.getZoomFactor();
const newZoom = currentZoom + 0.1;
if (newZoom <= 2.0) {
utils.setZoomFactor(window, newZoom);
refreshMenu(window);
} else {
log.log("Max zoom out");
utils.writeToast(window, "Cannot zoom in anymore", "warning");
}
};
const canZoomOut = utils.getZoomFactor() >= 0.5;
const zoomOut = () => {
const currentZoom = utils.getZoomFactor();
const newZoom = currentZoom - 0.1;
if (newZoom >= 0.5) {
utils.setZoomFactor(window, newZoom);
refreshMenu(window);
} else {
log.log("Max zoom in");
utils.writeToast(window, "Cannot zoom out anymore", "warning");
}
};
const canResetZoom = utils.getZoomFactor() !== 1;
const resetZoom = () => {
utils.setZoomFactor(window, 1);
refreshMenu(window);
log.log("Reset zoom");
};
return Menu.buildFromTemplate([ return Menu.buildFromTemplate([
{ {
label: "File", label: "File",
@ -289,45 +322,45 @@ function getMenu(window) {
submenu: [ submenu: [
{ {
label: "Zoom In", label: "Zoom In",
enabled: utils.getZoomFactor() <= 2, enabled: canZoomIn,
accelerator: "CommandOrControl+numadd", accelerator: "CommandOrControl+numadd",
click: () => { click: zoomIn,
const currentZoom = utils.getZoomFactor();
const newZoom = currentZoom + 0.1;
if (newZoom <= 2.0) {
utils.setZoomFactor(window, newZoom);
refreshMenu(window);
} else {
log.log("Max zoom out");
utils.writeToast(window, "Cannot zoom in anymore", "warning");
}
}, },
{
label: "Zoom In (non numpad)",
enabled: canZoomIn,
visible: false,
accelerator: "CommandOrControl+Plus",
acceleratorWorksWhenHidden: true,
click: zoomIn,
}, },
{ {
label: "Zoom Out", label: "Zoom Out",
enabled: utils.getZoomFactor() >= 0.5, enabled: canZoomOut,
accelerator: "CommandOrControl+numsub", accelerator: "CommandOrControl+numsub",
click: () => { click: zoomOut,
const currentZoom = utils.getZoomFactor();
const newZoom = currentZoom - 0.1;
if (newZoom >= 0.5) {
utils.setZoomFactor(window, newZoom);
refreshMenu(window);
} else {
log.log("Max zoom in");
utils.writeToast(window, "Cannot zoom out anymore", "warning");
}
}, },
{
label: "Zoom Out (non numpad)",
enabled: canZoomOut,
accelerator: "CommandOrControl+-",
visible: false,
acceleratorWorksWhenHidden: true,
click: zoomOut,
}, },
{ {
label: "Reset Zoom", label: "Reset Zoom",
enabled: utils.getZoomFactor() !== 1, enabled: canResetZoom,
accelerator: "CommandOrControl+num0", accelerator: "CommandOrControl+num0",
click: () => { click: resetZoom,
utils.setZoomFactor(window, 1);
refreshMenu(window);
log.log("Reset zoom");
}, },
{
label: "Reset Zoom (non numpad)",
enabled: canResetZoom,
accelerator: "CommandOrControl+0",
visible: false,
acceleratorWorksWhenHidden: true,
click: resetZoom,
}, },
], ],
}, },

@ -1,12 +1,12 @@
{ {
"name": "bitburner", "name": "bitburner",
"version": "1.0.0", "version": "1.6.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "bitburner", "name": "bitburner",
"version": "1.0.0", "version": "1.6.4",
"dependencies": { "dependencies": {
"electron-config": "^2.0.0", "electron-config": "^2.0.0",
"electron-log": "^4.4.4", "electron-log": "^4.4.4",

@ -1,6 +1,6 @@
{ {
"name": "bitburner", "name": "bitburner",
"version": "1.0.0", "version": "1.6.4",
"description": "A cyberpunk-themed programming incremental game", "description": "A cyberpunk-themed programming incremental game",
"main": "main.js", "main": "main.js",
"author": "Daniel Xie & Olivier Gagnon", "author": "Daniel Xie & Olivier Gagnon",

@ -73,5 +73,5 @@
<link rel="shortcut icon" href="favicon.ico"></head> <link rel="shortcut icon" href="favicon.ico"></head>
<body> <body>
<div id="root"/> <div id="root"/>
<script type="text/javascript" src="dist/vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body> <script type="text/javascript" src="dist/vendor.bundle.js"></script><script type="text/javascript" src="dist/main.bundle.js"></script></body>
</html> </html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,11 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. --> <!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ActiveFragment](./bitburner.activefragment.md) &gt; [avgCharge](./bitburner.activefragment.avgcharge.md) [Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ActiveFragment](./bitburner.activefragment.md) &gt; [highestCharge](./bitburner.activefragment.highestcharge.md)
## ActiveFragment.avgCharge property ## ActiveFragment.highestCharge property
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
avgCharge: number; highestCharge: number;
``` ```

@ -15,7 +15,7 @@ export interface ActiveFragment
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [avgCharge](./bitburner.activefragment.avgcharge.md) | number | | | [highestCharge](./bitburner.activefragment.highestcharge.md) | number | |
| [id](./bitburner.activefragment.id.md) | number | | | [id](./bitburner.activefragment.id.md) | number | |
| [numCharge](./bitburner.activefragment.numcharge.md) | number | | | [numCharge](./bitburner.activefragment.numcharge.md) | number | |
| [rotation](./bitburner.activefragment.rotation.md) | number | | | [rotation](./bitburner.activefragment.rotation.md) | number | |

@ -49,7 +49,7 @@ export interface BitNodeMultipliers
| [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | number | Influence how much it costs to purchase a server | | [PurchasedServerCost](./bitburner.bitnodemultipliers.purchasedservercost.md) | number | Influence how much it costs to purchase a server |
| [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | number | Influences the maximum number of purchased servers you can have | | [PurchasedServerLimit](./bitburner.bitnodemultipliers.purchasedserverlimit.md) | number | Influences the maximum number of purchased servers you can have |
| [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | number | Influences the maximum allowed RAM for a purchased server | | [PurchasedServerMaxRam](./bitburner.bitnodemultipliers.purchasedservermaxram.md) | number | Influences the maximum allowed RAM for a purchased server |
| [PurchasedServerSoftCap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) | number | Influences cost of any purchased server at or above 128GB | | [PurchasedServerSoftcap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) | number | Influences cost of any purchased server at or above 128GB |
| [RepToDonateToFaction](./bitburner.bitnodemultipliers.reptodonatetofaction.md) | number | Influences the minimum favor the player must have with a faction before they can donate to gain rep. | | [RepToDonateToFaction](./bitburner.bitnodemultipliers.reptodonatetofaction.md) | number | Influences the minimum favor the player must have with a faction before they can donate to gain rep. |
| [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | number | Influences how much the money on a server can be reduced when a script performs a hack against it. | | [ScriptHackMoney](./bitburner.bitnodemultipliers.scripthackmoney.md) | number | Influences how much the money on a server can be reduced when a script performs a hack against it. |
| [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | number | Influences how much of the money stolen by a scripted hack will be added to the player's money. | | [ScriptHackMoneyGain](./bitburner.bitnodemultipliers.scripthackmoneygain.md) | number | Influences how much of the money stolen by a scripted hack will be added to the player's money. |

@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. --> <!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [PurchasedServerSoftCap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md) [Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) &gt; [PurchasedServerSoftcap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md)
## BitNodeMultipliers.PurchasedServerSoftCap property ## BitNodeMultipliers.PurchasedServerSoftcap property
Influences cost of any purchased server at or above 128GB Influences cost of any purchased server at or above 128GB
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
PurchasedServerSoftCap: number; PurchasedServerSoftcap: number;
``` ```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [agilityExp](./bitburner.characterinfo.agilityexp.md)
## CharacterInfo.agilityExp property
total agility exp
<b>Signature:</b>
```typescript
agilityExp: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [charismaExp](./bitburner.characterinfo.charismaexp.md)
## CharacterInfo.charismaExp property
total charisma exp
<b>Signature:</b>
```typescript
charismaExp: number;
```

@ -1,13 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [company](./bitburner.characterinfo.company.md)
## CharacterInfo.company property
Array of all companies at which you have jobs
<b>Signature:</b>
```typescript
company: string[];
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [defenseExp](./bitburner.characterinfo.defenseexp.md)
## CharacterInfo.defenseExp property
total defense exp
<b>Signature:</b>
```typescript
defenseExp: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [dexterityExp](./bitburner.characterinfo.dexterityexp.md)
## CharacterInfo.dexterityExp property
total dexterity exp
<b>Signature:</b>
```typescript
dexterityExp: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [hackingExp](./bitburner.characterinfo.hackingexp.md)
## CharacterInfo.hackingExp property
total hacking exp
<b>Signature:</b>
```typescript
hackingExp: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [jobs](./bitburner.characterinfo.jobs.md)
## CharacterInfo.jobs property
Array of all jobs
<b>Signature:</b>
```typescript
jobs: string[];
```

@ -1,13 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. --> <!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [jobTitle](./bitburner.characterinfo.jobtitle.md) [Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [jobTitles](./bitburner.characterinfo.jobtitles.md)
## CharacterInfo.jobTitle property ## CharacterInfo.jobTitles property
Array of job positions for all companies you are employed at. Same order as 'jobs' Array of job positions for all companies you are employed at. Same order as 'jobs'
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
jobTitle: string[]; jobTitles: string[];
``` ```

@ -15,14 +15,20 @@ export interface CharacterInfo
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [agilityExp](./bitburner.characterinfo.agilityexp.md) | number | total agility exp |
| [bitnode](./bitburner.characterinfo.bitnode.md) | number | Current BitNode number | | [bitnode](./bitburner.characterinfo.bitnode.md) | number | Current BitNode number |
| [charismaExp](./bitburner.characterinfo.charismaexp.md) | number | total charisma exp |
| [city](./bitburner.characterinfo.city.md) | string | Name of city you are currently in | | [city](./bitburner.characterinfo.city.md) | string | Name of city you are currently in |
| [company](./bitburner.characterinfo.company.md) | string\[\] | Array of all companies at which you have jobs | | [defenseExp](./bitburner.characterinfo.defenseexp.md) | number | total defense exp |
| [dexterityExp](./bitburner.characterinfo.dexterityexp.md) | number | total dexterity exp |
| [factions](./bitburner.characterinfo.factions.md) | string\[\] | Array of factions you are currently a member of | | [factions](./bitburner.characterinfo.factions.md) | string\[\] | Array of factions you are currently a member of |
| [hackingExp](./bitburner.characterinfo.hackingexp.md) | number | total hacking exp |
| [hp](./bitburner.characterinfo.hp.md) | number | Current health points | | [hp](./bitburner.characterinfo.hp.md) | number | Current health points |
| [jobTitle](./bitburner.characterinfo.jobtitle.md) | string\[\] | Array of job positions for all companies you are employed at. Same order as 'jobs' | | [jobs](./bitburner.characterinfo.jobs.md) | string\[\] | Array of all jobs |
| [jobTitles](./bitburner.characterinfo.jobtitles.md) | string\[\] | Array of job positions for all companies you are employed at. Same order as 'jobs' |
| [maxHp](./bitburner.characterinfo.maxhp.md) | number | Maximum health points | | [maxHp](./bitburner.characterinfo.maxhp.md) | number | Maximum health points |
| [mult](./bitburner.characterinfo.mult.md) | [CharacterMult](./bitburner.charactermult.md) | Object with many of the player's multipliers from Augmentations/Source Files | | [mult](./bitburner.characterinfo.mult.md) | [CharacterMult](./bitburner.charactermult.md) | Object with many of the player's multipliers from Augmentations/Source Files |
| [strengthExp](./bitburner.characterinfo.strengthexp.md) | number | total strength exp |
| [timeWorked](./bitburner.characterinfo.timeworked.md) | number | Timed worked in ms | | [timeWorked](./bitburner.characterinfo.timeworked.md) | number | Timed worked in ms |
| [tor](./bitburner.characterinfo.tor.md) | boolean | Boolean indicating whether or not you have a tor router | | [tor](./bitburner.characterinfo.tor.md) | boolean | Boolean indicating whether or not you have a tor router |
| [workAgiExpGain](./bitburner.characterinfo.workagiexpgain.md) | number | Agi experience earned so far from work | | [workAgiExpGain](./bitburner.characterinfo.workagiexpgain.md) | number | Agi experience earned so far from work |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterInfo](./bitburner.characterinfo.md) &gt; [strengthExp](./bitburner.characterinfo.strengthexp.md)
## CharacterInfo.strengthExp property
total strength exp
<b>Signature:</b>
```typescript
strengthExp: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterMult](./bitburner.charactermult.md) &gt; [charisma](./bitburner.charactermult.charisma.md)
## CharacterMult.charisma property
Charisma stat
<b>Signature:</b>
```typescript
charisma: number;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CharacterMult](./bitburner.charactermult.md) &gt; [charismaExp](./bitburner.charactermult.charismaexp.md)
## CharacterMult.charismaExp property
Charisma exp
<b>Signature:</b>
```typescript
charismaExp: number;
```

@ -17,6 +17,8 @@ export interface CharacterMult
| --- | --- | --- | | --- | --- | --- |
| [agility](./bitburner.charactermult.agility.md) | number | Agility stat | | [agility](./bitburner.charactermult.agility.md) | number | Agility stat |
| [agilityExp](./bitburner.charactermult.agilityexp.md) | number | Agility exp | | [agilityExp](./bitburner.charactermult.agilityexp.md) | number | Agility exp |
| [charisma](./bitburner.charactermult.charisma.md) | number | Charisma stat |
| [charismaExp](./bitburner.charactermult.charismaexp.md) | number | Charisma exp |
| [companyRep](./bitburner.charactermult.companyrep.md) | number | Company reputation | | [companyRep](./bitburner.charactermult.companyrep.md) | number | Company reputation |
| [crimeMoney](./bitburner.charactermult.crimemoney.md) | number | Money earned from crimes | | [crimeMoney](./bitburner.charactermult.crimemoney.md) | number | Money earned from crimes |
| [crimeSuccess](./bitburner.charactermult.crimesuccess.md) | number | Crime success chance | | [crimeSuccess](./bitburner.charactermult.crimesuccess.md) | number | Crime success chance |

@ -24,5 +24,6 @@ You need Formulas.exe on your home computer to use this API.
| [hacking](./bitburner.formulas.hacking.md) | [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas | | [hacking](./bitburner.formulas.hacking.md) | [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas |
| [hacknetNodes](./bitburner.formulas.hacknetnodes.md) | [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | Hacknet Nodes formulas | | [hacknetNodes](./bitburner.formulas.hacknetnodes.md) | [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | Hacknet Nodes formulas |
| [hacknetServers](./bitburner.formulas.hacknetservers.md) | [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | Hacknet Servers formulas | | [hacknetServers](./bitburner.formulas.hacknetservers.md) | [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | Hacknet Servers formulas |
| [reputation](./bitburner.formulas.reputation.md) | [ReputationFormulas](./bitburner.reputationformulas.md) | Reputation formulas |
| [skills](./bitburner.formulas.skills.md) | [SkillsFormulas](./bitburner.skillsformulas.md) | Skills formulas | | [skills](./bitburner.formulas.skills.md) | [SkillsFormulas](./bitburner.skillsformulas.md) | Skills formulas |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Formulas](./bitburner.formulas.md) &gt; [reputation](./bitburner.formulas.reputation.md)
## Formulas.reputation property
Reputation formulas
<b>Signature:</b>
```typescript
reputation: ReputationFormulas;
```

@ -0,0 +1,25 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Grafting](./bitburner.grafting.md) &gt; [getGraftableAugmentations](./bitburner.grafting.getgraftableaugmentations.md)
## Grafting.getGraftableAugmentations() method
Retrieves a list of Augmentations that can be grafted.
<b>Signature:</b>
```typescript
getGraftableAugmentations(): string[];
```
<b>Returns:</b>
string\[\]
An array of graftable Augmentations.
## Remarks
RAM cost: 5 GB
Note that this function returns a list of currently graftable Augmentations, based off of the Augmentations that you already own.

@ -22,5 +22,6 @@ This API requires Source-File 10 to use.
| --- | --- | | --- | --- |
| [getAugmentationGraftPrice(augName)](./bitburner.grafting.getaugmentationgraftprice.md) | Retrieve the grafting cost of an aug. | | [getAugmentationGraftPrice(augName)](./bitburner.grafting.getaugmentationgraftprice.md) | Retrieve the grafting cost of an aug. |
| [getAugmentationGraftTime(augName)](./bitburner.grafting.getaugmentationgrafttime.md) | Retrieves the time required to graft an aug. | | [getAugmentationGraftTime(augName)](./bitburner.grafting.getaugmentationgrafttime.md) | Retrieves the time required to graft an aug. |
| [getGraftableAugmentations()](./bitburner.grafting.getgraftableaugmentations.md) | Retrieves a list of Augmentations that can be grafted. |
| [graftAugmentation(augName, focus)](./bitburner.grafting.graftaugmentation.md) | Begins grafting the named aug. You must be in New Tokyo to use this. | | [graftAugmentation(augName, focus)](./bitburner.grafting.graftaugmentation.md) | Begins grafting the named aug. You must be in New Tokyo to use this. |

@ -39,7 +39,7 @@ Returns the number of hashes required for the specified upgrade. The name of the
// NS1: // NS1:
var upgradeName = "Sell for Corporation Funds"; var upgradeName = "Sell for Corporation Funds";
if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) { if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
hacknet.spendHashes(upgName); hacknet.spendHashes(upgradeName);
} }
``` ```
@ -50,7 +50,7 @@ if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
// NS2: // NS2:
const upgradeName = "Sell for Corporation Funds"; const upgradeName = "Sell for Corporation Funds";
if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) { if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {
ns.hacknet.spendHashes(upgName); ns.hacknet.spendHashes(upgradeName);
} }
``` ```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Material](./bitburner.material.md) &gt; [cmp](./bitburner.material.cmp.md)
## Material.cmp property
Competition for the material, only present if "Market Research - Competition" unlocked
<b>Signature:</b>
```typescript
cmp: number | undefined;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Material](./bitburner.material.md) &gt; [dmd](./bitburner.material.dmd.md)
## Material.dmd property
Demand for the material, only present if "Market Research - Demand" unlocked
<b>Signature:</b>
```typescript
dmd: number | undefined;
```

@ -16,6 +16,8 @@ interface Material
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [cmp](./bitburner.material.cmp.md) | number \| undefined | Competition for the material, only present if "Market Research - Competition" unlocked |
| [dmd](./bitburner.material.dmd.md) | number \| undefined | Demand for the material, only present if "Market Research - Demand" unlocked |
| [name](./bitburner.material.name.md) | string | Name of the material | | [name](./bitburner.material.name.md) | string | Name of the material |
| [prod](./bitburner.material.prod.md) | number | Amount of material produced | | [prod](./bitburner.material.prod.md) | number | Amount of material produced |
| [qlt](./bitburner.material.qlt.md) | number | Quality of the material | | [qlt](./bitburner.material.qlt.md) | number | Quality of the material |

@ -10,6 +10,7 @@
| --- | --- | | --- | --- |
| [OrderTypes](./bitburner.ordertypes.md) | | | [OrderTypes](./bitburner.ordertypes.md) | |
| [PositionTypes](./bitburner.positiontypes.md) | | | [PositionTypes](./bitburner.positiontypes.md) | |
| [ToastVariant](./bitburner.toastvariant.md) | |
## Interfaces ## Interfaces
@ -59,12 +60,15 @@
| [NetscriptPort](./bitburner.netscriptport.md) | Object representing a port. A port is a serialized queue. | | [NetscriptPort](./bitburner.netscriptport.md) | Object representing a port. A port is a serialized queue. |
| [NodeStats](./bitburner.nodestats.md) | Object representing all the values related to a hacknet node. | | [NodeStats](./bitburner.nodestats.md) | Object representing all the values related to a hacknet node. |
| [NS](./bitburner.ns.md) | Collection of all functions passed to scripts | | [NS](./bitburner.ns.md) | Collection of all functions passed to scripts |
| [NSEnums](./bitburner.nsenums.md) | |
| [Office](./bitburner.office.md) | Office for a division in a city. | | [Office](./bitburner.office.md) | Office for a division in a city. |
| [OfficeAPI](./bitburner.officeapi.md) | Corporation Office API | | [OfficeAPI](./bitburner.officeapi.md) | Corporation Office API |
| [Player](./bitburner.player.md) | | | [Player](./bitburner.player.md) | |
| [PlayerSkills](./bitburner.playerskills.md) | Short summary of the players skills. | | [PlayerSkills](./bitburner.playerskills.md) | Short summary of the players skills. |
| [ProcessInfo](./bitburner.processinfo.md) | A single process on a server. | | [ProcessInfo](./bitburner.processinfo.md) | A single process on a server. |
| [Product](./bitburner.product.md) | Product in a warehouse | | [Product](./bitburner.product.md) | Product in a warehouse |
| [RecentScript](./bitburner.recentscript.md) | |
| [ReputationFormulas](./bitburner.reputationformulas.md) | Reputation formulas |
| [RunningScript](./bitburner.runningscript.md) | | | [RunningScript](./bitburner.runningscript.md) | |
| [Server](./bitburner.server.md) | A single server. | | [Server](./bitburner.server.md) | A single server. |
| [Singularity](./bitburner.singularity.md) | Singularity API | | [Singularity](./bitburner.singularity.md) | Singularity API |
@ -88,4 +92,5 @@
| Type Alias | Description | | Type Alias | Description |
| --- | --- | | --- | --- |
| [FilenameOrPID](./bitburner.filenameorpid.md) | | | [FilenameOrPID](./bitburner.filenameorpid.md) | |
| [ToastVariantValues](./bitburner.toastvariantvalues.md) | |

@ -9,7 +9,7 @@ Suspends the script for n milliseconds. Doesn't block with concurrent calls.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
asleep(millis: number): Promise<void>; asleep(millis: number): Promise<true>;
``` ```
## Parameters ## Parameters
@ -20,7 +20,7 @@ asleep(millis: number): Promise<void>;
<b>Returns:</b> <b>Returns:</b>
Promise&lt;void&gt; Promise&lt;true&gt;
## Remarks ## Remarks

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [enums](./bitburner.ns.enums.md)
## NS.enums property
<b>Signature:</b>
```typescript
enums: NSEnums;
```

@ -0,0 +1,35 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getRecentScripts](./bitburner.ns.getrecentscripts.md)
## NS.getRecentScripts() method
Get an array of recently killed scripts across all servers.
<b>Signature:</b>
```typescript
getRecentScripts(): RecentScript[];
```
<b>Returns:</b>
[RecentScript](./bitburner.recentscript.md)<!-- -->\[\]
Array with information about previously killed scripts.
## Remarks
RAM cost: 0.2 GB
The most recently killed script is the first element in the array. Note that there is a maximum number of recently killed scripts which are tracked. This is configurable in the game's options as `Recently killed scripts size`<!-- -->.
## Example
```ts
let recentScripts = ns.getRecentScripts();
let mostRecent = recentScripts.shift()
if (mostRecent)
ns.tprint(mostRecent.logs.join('\n'))
```

@ -9,7 +9,7 @@ Get general info about a running script.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript; getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript | null;
``` ```
## Parameters ## Parameters
@ -22,7 +22,7 @@ getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string |
<b>Returns:</b> <b>Returns:</b>
[RunningScript](./bitburner.runningscript.md) [RunningScript](./bitburner.runningscript.md) \| null
The info about the running script if found, and null otherwise. The info about the running script if found, and null otherwise.

@ -9,7 +9,7 @@ Calculate the security increase for a number of thread.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
growthAnalyzeSecurity(threads: number): number; growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;
``` ```
## Parameters ## Parameters
@ -17,6 +17,8 @@ growthAnalyzeSecurity(threads: number): number;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| threads | number | Amount of threads that will be used. | | threads | number | Amount of threads that will be used. |
| hostname | string | Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money. |
| cores | number | Optional. The number of cores of the server that would run grow. |
<b>Returns:</b> <b>Returns:</b>

@ -9,7 +9,7 @@ Get the security increase for a number of thread.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
hackAnalyzeSecurity(threads: number): number; hackAnalyzeSecurity(threads: number, hostname?: string): number;
``` ```
## Parameters ## Parameters
@ -17,6 +17,7 @@ hackAnalyzeSecurity(threads: number): number;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| threads | number | Amount of threads that will be used. | | threads | number | Amount of threads that will be used. |
| hostname | string | Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money. |
<b>Returns:</b> <b>Returns:</b>

@ -9,9 +9,8 @@ Collection of all functions passed to scripts
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
export interface NS extends Singularity export interface NS
``` ```
<b>Extends:</b> [Singularity](./bitburner.singularity.md)
## Remarks ## Remarks
@ -45,10 +44,12 @@ export async function main(ns) {
| [bladeburner](./bitburner.ns.bladeburner.md) | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. | | [bladeburner](./bitburner.ns.bladeburner.md) | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. |
| [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. | | [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. |
| [corporation](./bitburner.ns.corporation.md) | [Corporation](./bitburner.corporation.md) | Namespace for corporation functions. RAM cost: 0 GB | | [corporation](./bitburner.ns.corporation.md) | [Corporation](./bitburner.corporation.md) | Namespace for corporation functions. RAM cost: 0 GB |
| [enums](./bitburner.ns.enums.md) | [NSEnums](./bitburner.nsenums.md) | |
| [formulas](./bitburner.ns.formulas.md) | [Formulas](./bitburner.formulas.md) | Namespace for formulas functions. | | [formulas](./bitburner.ns.formulas.md) | [Formulas](./bitburner.formulas.md) | Namespace for formulas functions. |
| [gang](./bitburner.ns.gang.md) | [Gang](./bitburner.gang.md) | Namespace for gang functions. | | [gang](./bitburner.ns.gang.md) | [Gang](./bitburner.gang.md) | Namespace for gang functions. |
| [grafting](./bitburner.ns.grafting.md) | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. | | [grafting](./bitburner.ns.grafting.md) | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. |
| [hacknet](./bitburner.ns.hacknet.md) | [Hacknet](./bitburner.hacknet.md) | Namespace for hacknet functions. | | [hacknet](./bitburner.ns.hacknet.md) | [Hacknet](./bitburner.hacknet.md) | Namespace for hacknet functions. |
| [singularity](./bitburner.ns.singularity.md) | [Singularity](./bitburner.singularity.md) | Namespace for singularity functions. RAM cost: 0 GB |
| [sleeve](./bitburner.ns.sleeve.md) | [Sleeve](./bitburner.sleeve.md) | Namespace for sleeve functions. | | [sleeve](./bitburner.ns.sleeve.md) | [Sleeve](./bitburner.sleeve.md) | Namespace for sleeve functions. |
| [stanek](./bitburner.ns.stanek.md) | [Stanek](./bitburner.stanek.md) | Namespace for stanek functions. RAM cost: 0 GB | | [stanek](./bitburner.ns.stanek.md) | [Stanek](./bitburner.stanek.md) | Namespace for stanek functions. RAM cost: 0 GB |
| [stock](./bitburner.ns.stock.md) | [TIX](./bitburner.tix.md) | Namespace for stock functions. | | [stock](./bitburner.ns.stock.md) | [TIX](./bitburner.tix.md) | Namespace for stock functions. |
@ -88,6 +89,7 @@ export async function main(ns) {
| [getPurchasedServerLimit()](./bitburner.ns.getpurchasedserverlimit.md) | Returns the maximum number of servers you can purchase. | | [getPurchasedServerLimit()](./bitburner.ns.getpurchasedserverlimit.md) | Returns the maximum number of servers you can purchase. |
| [getPurchasedServerMaxRam()](./bitburner.ns.getpurchasedservermaxram.md) | Returns the maximum RAM that a purchased server can have. | | [getPurchasedServerMaxRam()](./bitburner.ns.getpurchasedservermaxram.md) | Returns the maximum RAM that a purchased server can have. |
| [getPurchasedServers()](./bitburner.ns.getpurchasedservers.md) | Returns an array with the hostnames of all of the servers you have purchased. | | [getPurchasedServers()](./bitburner.ns.getpurchasedservers.md) | Returns an array with the hostnames of all of the servers you have purchased. |
| [getRecentScripts()](./bitburner.ns.getrecentscripts.md) | Get an array of recently killed scripts across all servers. |
| [getRunningScript(filename, hostname, args)](./bitburner.ns.getrunningscript.md) | Get general info about a running script. | | [getRunningScript(filename, hostname, args)](./bitburner.ns.getrunningscript.md) | Get general info about a running script. |
| [getScriptExpGain()](./bitburner.ns.getscriptexpgain.md) | Get the exp gain of a script. | | [getScriptExpGain()](./bitburner.ns.getscriptexpgain.md) | Get the exp gain of a script. |
| [getScriptExpGain(script, host, args)](./bitburner.ns.getscriptexpgain_1.md) | Get the exp gain of a script. | | [getScriptExpGain(script, host, args)](./bitburner.ns.getscriptexpgain_1.md) | Get the exp gain of a script. |
@ -113,11 +115,11 @@ export async function main(ns) {
| [getWeakenTime(host)](./bitburner.ns.getweakentime.md) | Get the execution time of a weaken() call. | | [getWeakenTime(host)](./bitburner.ns.getweakentime.md) | Get the execution time of a weaken() call. |
| [grow(host, opts)](./bitburner.ns.grow.md) | Spoof money in a servers bank account, increasing the amount available. | | [grow(host, opts)](./bitburner.ns.grow.md) | Spoof money in a servers bank account, increasing the amount available. |
| [growthAnalyze(host, growthAmount, cores)](./bitburner.ns.growthanalyze.md) | Calculate the number of grow thread needed to grow a server by a certain multiplier. | | [growthAnalyze(host, growthAmount, cores)](./bitburner.ns.growthanalyze.md) | Calculate the number of grow thread needed to grow a server by a certain multiplier. |
| [growthAnalyzeSecurity(threads)](./bitburner.ns.growthanalyzesecurity.md) | Calculate the security increase for a number of thread. | | [growthAnalyzeSecurity(threads, hostname, cores)](./bitburner.ns.growthanalyzesecurity.md) | Calculate the security increase for a number of thread. |
| [hack(host, opts)](./bitburner.ns.hack.md) | Steal a servers money. | | [hack(host, opts)](./bitburner.ns.hack.md) | Steal a servers money. |
| [hackAnalyze(host)](./bitburner.ns.hackanalyze.md) | Get the part of money stolen with a single thread. | | [hackAnalyze(host)](./bitburner.ns.hackanalyze.md) | Get the part of money stolen with a single thread. |
| [hackAnalyzeChance(host)](./bitburner.ns.hackanalyzechance.md) | Get the chance of successfully hacking a server. | | [hackAnalyzeChance(host)](./bitburner.ns.hackanalyzechance.md) | Get the chance of successfully hacking a server. |
| [hackAnalyzeSecurity(threads)](./bitburner.ns.hackanalyzesecurity.md) | Get the security increase for a number of thread. | | [hackAnalyzeSecurity(threads, hostname)](./bitburner.ns.hackanalyzesecurity.md) | Get the security increase for a number of thread. |
| [hackAnalyzeThreads(host, hackAmount)](./bitburner.ns.hackanalyzethreads.md) | Predict the effect of hack. | | [hackAnalyzeThreads(host, hackAmount)](./bitburner.ns.hackanalyzethreads.md) | Predict the effect of hack. |
| [hasRootAccess(host)](./bitburner.ns.hasrootaccess.md) | Check if your have root access on a server. | | [hasRootAccess(host)](./bitburner.ns.hasrootaccess.md) | Check if your have root access on a server. |
| [httpworm(host)](./bitburner.ns.httpworm.md) | Runs HTTPWorm.exe on a server. | | [httpworm(host)](./bitburner.ns.httpworm.md) | Runs HTTPWorm.exe on a server. |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [singularity](./bitburner.ns.singularity.md)
## NS.singularity property
Namespace for singularity functions. RAM cost: 0 GB
<b>Signature:</b>
```typescript
readonly singularity: Singularity;
```

@ -9,7 +9,7 @@ Suspends the script for n milliseconds.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
sleep(millis: number): Promise<void>; sleep(millis: number): Promise<true>;
``` ```
## Parameters ## Parameters
@ -20,7 +20,7 @@ sleep(millis: number): Promise<void>;
<b>Returns:</b> <b>Returns:</b>
Promise&lt;void&gt; Promise&lt;true&gt;
## Remarks ## Remarks

@ -9,7 +9,7 @@ Queue a toast (bottom-right notification).
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
toast(msg: any, variant?: string, duration?: number | null): void; toast(msg: any, variant?: ToastVariantValues, duration?: number | null): void;
``` ```
## Parameters ## Parameters
@ -17,7 +17,7 @@ toast(msg: any, variant?: string, duration?: number | null): void;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| msg | any | Message in the toast. | | msg | any | Message in the toast. |
| variant | string | Type of toast, must be one of success, info, warning, error. Defaults to success. | | variant | [ToastVariantValues](./bitburner.toastvariantvalues.md) | Type of toast, must be one of success, info, warning, error. Defaults to success. |
| duration | number \| null | Duration of toast in ms. Can also be <code>null</code> to create a persistent toast. Defaults to 2000 | | duration | number \| null | Duration of toast in ms. Can also be <code>null</code> to create a persistent toast. Defaults to 2000 |
<b>Returns:</b> <b>Returns:</b>

@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NSEnums](./bitburner.nsenums.md)
## NSEnums interface
<b>Signature:</b>
```typescript
export interface NSEnums
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [toast](./bitburner.nsenums.toast.md) | typeof [ToastVariant](./bitburner.toastvariant.md) | |

@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NSEnums](./bitburner.nsenums.md) &gt; [toast](./bitburner.nsenums.toast.md)
## NSEnums.toast property
<b>Signature:</b>
```typescript
toast: typeof ToastVariant;
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Office](./bitburner.office.md) &gt; [employeeJobs](./bitburner.office.employeejobs.md)
## Office.employeeJobs property
Positions of the employees
<b>Signature:</b>
```typescript
employeeJobs: EmployeeJobs;
```

@ -4,7 +4,7 @@
## Office.employeeProd property ## Office.employeeProd property
Positions of the employees Production of the employees
<b>Signature:</b> <b>Signature:</b>

@ -16,7 +16,8 @@ interface Office
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [employeeProd](./bitburner.office.employeeprod.md) | [EmployeeJobs](./bitburner.employeejobs.md) | Positions of the employees | | [employeeJobs](./bitburner.office.employeejobs.md) | [EmployeeJobs](./bitburner.employeejobs.md) | Positions of the employees |
| [employeeProd](./bitburner.office.employeeprod.md) | [EmployeeJobs](./bitburner.employeejobs.md) | Production of the employees |
| [employees](./bitburner.office.employees.md) | string\[\] | Name of all the employees | | [employees](./bitburner.office.employees.md) | string\[\] | Name of all the employees |
| [loc](./bitburner.office.loc.md) | string | City of the office | | [loc](./bitburner.office.loc.md) | string | City of the office |
| [maxEne](./bitburner.office.maxene.md) | number | Maximum amount of energy of the employees | | [maxEne](./bitburner.office.maxene.md) | number | Maximum amount of energy of the employees |

@ -4,10 +4,10 @@
## Product.cmp property ## Product.cmp property
Competition for the product Competition for the product, only present if "Market Research - Competition" unlocked
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
cmp: number; cmp: number | undefined;
``` ```

@ -4,10 +4,10 @@
## Product.dmd property ## Product.dmd property
Demand for the product Demand for the product, only present if "Market Research - Demand" unlocked
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
dmd: number; dmd: number | undefined;
``` ```

@ -17,10 +17,12 @@ interface Product
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [cityData](./bitburner.product.citydata.md) | { \[key: string\]: number\[\] } | Data refers to the production, sale, and quantity of the products These values are specific to a city For each city, the data is \[qty, prod, sell\] | | [cityData](./bitburner.product.citydata.md) | { \[key: string\]: number\[\] } | Data refers to the production, sale, and quantity of the products These values are specific to a city For each city, the data is \[qty, prod, sell\] |
| [cmp](./bitburner.product.cmp.md) | number | Competition for the product | | [cmp](./bitburner.product.cmp.md) | number \| undefined | Competition for the product, only present if "Market Research - Competition" unlocked |
| [developmentProgress](./bitburner.product.developmentprogress.md) | number | Creation progress - A number between 0-100 representing percentage | | [developmentProgress](./bitburner.product.developmentprogress.md) | number | Creation progress - A number between 0-100 representing percentage |
| [dmd](./bitburner.product.dmd.md) | number | Demand for the product | | [dmd](./bitburner.product.dmd.md) | number \| undefined | Demand for the product, only present if "Market Research - Demand" unlocked |
| [name](./bitburner.product.name.md) | string | Name of the product | | [name](./bitburner.product.name.md) | string | Name of the product |
| [pCost](./bitburner.product.pcost.md) | number | Production cost | | [pCost](./bitburner.product.pcost.md) | number | Production cost |
| [properties](./bitburner.product.properties.md) | { \[key: string\]: number } | Product Properties. The data is {<!-- -->qlt, per, dur, rel, aes, fea<!-- -->} |
| [rat](./bitburner.product.rat.md) | number | Product Rating |
| [sCost](./bitburner.product.scost.md) | string \| number | Sell cost, can be "MP+5" | | [sCost](./bitburner.product.scost.md) | string \| number | Sell cost, can be "MP+5" |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Product](./bitburner.product.md) &gt; [properties](./bitburner.product.properties.md)
## Product.properties property
Product Properties. The data is {<!-- -->qlt, per, dur, rel, aes, fea<!-- -->}
<b>Signature:</b>
```typescript
properties: { [key: string]: number };
```

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Product](./bitburner.product.md) &gt; [rat](./bitburner.product.rat.md)
## Product.rat property
Product Rating
<b>Signature:</b>
```typescript
rat: number;
```

@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [RecentScript](./bitburner.recentscript.md)
## RecentScript interface
<b>Signature:</b>
```typescript
export interface RecentScript extends RunningScript
```
<b>Extends:</b> [RunningScript](./bitburner.runningscript.md)
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [timeOfDeath](./bitburner.recentscript.timeofdeath.md) | Date | Timestamp of when the script was killed |

@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [RecentScript](./bitburner.recentscript.md) &gt; [timeOfDeath](./bitburner.recentscript.timeofdeath.md)
## RecentScript.timeOfDeath property
Timestamp of when the script was killed
<b>Signature:</b>
```typescript
timeOfDeath: Date;
```

@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ReputationFormulas](./bitburner.reputationformulas.md) &gt; [calculateFavorToRep](./bitburner.reputationformulas.calculatefavortorep.md)
## ReputationFormulas.calculateFavorToRep() method
Calculate the total required amount of faction reputation to reach a target favor.
<b>Signature:</b>
```typescript
calculateFavorToRep(favor: number): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| favor | number | target faction favor. |
<b>Returns:</b>
number
The calculated faction reputation required.

@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ReputationFormulas](./bitburner.reputationformulas.md) &gt; [calculateRepToFavor](./bitburner.reputationformulas.calculatereptofavor.md)
## ReputationFormulas.calculateRepToFavor() method
Calculate the resulting faction favor of a total amount of reputation. (Faction favor is gained whenever you install an Augmentation.)
<b>Signature:</b>
```typescript
calculateRepToFavor(rep: number): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| rep | number | amount of reputation. |
<b>Returns:</b>
number
The calculated faction favor.

@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ReputationFormulas](./bitburner.reputationformulas.md)
## ReputationFormulas interface
Reputation formulas
<b>Signature:</b>
```typescript
interface ReputationFormulas
```
## Methods
| Method | Description |
| --- | --- |
| [calculateFavorToRep(favor)](./bitburner.reputationformulas.calculatefavortorep.md) | Calculate the total required amount of faction reputation to reach a target favor. |
| [calculateRepToFavor(rep)](./bitburner.reputationformulas.calculatereptofavor.md) | Calculate the resulting faction favor of a total amount of reputation. (Faction favor is gained whenever you install an Augmentation.) |

@ -4,6 +4,8 @@
## RunningScript.args property ## RunningScript.args property
Arguments the script was called with
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.filename property ## RunningScript.filename property
Filename of the script
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.logs property ## RunningScript.logs property
Script logs as an array. The newest log entries are at the bottom. Timestamps, if enabled, are placed inside `[brackets]` at the start of each line.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -8,24 +8,24 @@
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
interface RunningScript export interface RunningScript
``` ```
## Properties ## Properties
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [args](./bitburner.runningscript.args.md) | string\[\] | | | [args](./bitburner.runningscript.args.md) | string\[\] | Arguments the script was called with |
| [filename](./bitburner.runningscript.filename.md) | string | | | [filename](./bitburner.runningscript.filename.md) | string | Filename of the script |
| [logs](./bitburner.runningscript.logs.md) | string\[\] | | | [logs](./bitburner.runningscript.logs.md) | string\[\] | Script logs as an array. The newest log entries are at the bottom. Timestamps, if enabled, are placed inside <code>[brackets]</code> at the start of each line. |
| [offlineExpGained](./bitburner.runningscript.offlineexpgained.md) | number | | | [offlineExpGained](./bitburner.runningscript.offlineexpgained.md) | number | Total amount of hacking experience earned from this script when offline |
| [offlineMoneyMade](./bitburner.runningscript.offlinemoneymade.md) | number | | | [offlineMoneyMade](./bitburner.runningscript.offlinemoneymade.md) | number | Total amount of money made by this script when offline |
| [offlineRunningTime](./bitburner.runningscript.offlinerunningtime.md) | number | Offline running time of the script, in seconds \* | | [offlineRunningTime](./bitburner.runningscript.offlinerunningtime.md) | number | Number of seconds that the script has been running offline |
| [onlineExpGained](./bitburner.runningscript.onlineexpgained.md) | number | | | [onlineExpGained](./bitburner.runningscript.onlineexpgained.md) | number | Total amount of hacking experience earned from this script when online |
| [onlineMoneyMade](./bitburner.runningscript.onlinemoneymade.md) | number | | | [onlineMoneyMade](./bitburner.runningscript.onlinemoneymade.md) | number | Total amount of money made by this script when online |
| [onlineRunningTime](./bitburner.runningscript.onlinerunningtime.md) | number | Online running time of the script, in seconds \* | | [onlineRunningTime](./bitburner.runningscript.onlinerunningtime.md) | number | Number of seconds that this script has been running online |
| [pid](./bitburner.runningscript.pid.md) | number | | | [pid](./bitburner.runningscript.pid.md) | number | Process ID. Must be an integer |
| [ramUsage](./bitburner.runningscript.ramusage.md) | number | | | [ramUsage](./bitburner.runningscript.ramusage.md) | number | How much RAM this script uses for ONE thread |
| [server](./bitburner.runningscript.server.md) | string | | | [server](./bitburner.runningscript.server.md) | string | Hostname of the server on which this script runs |
| [threads](./bitburner.runningscript.threads.md) | number | | | [threads](./bitburner.runningscript.threads.md) | number | Number of threads that this script runs with |

@ -4,6 +4,8 @@
## RunningScript.offlineExpGained property ## RunningScript.offlineExpGained property
Total amount of hacking experience earned from this script when offline
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.offlineMoneyMade property ## RunningScript.offlineMoneyMade property
Total amount of money made by this script when offline
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,7 +4,7 @@
## RunningScript.offlineRunningTime property ## RunningScript.offlineRunningTime property
Offline running time of the script, in seconds \* Number of seconds that the script has been running offline
<b>Signature:</b> <b>Signature:</b>

@ -4,6 +4,8 @@
## RunningScript.onlineExpGained property ## RunningScript.onlineExpGained property
Total amount of hacking experience earned from this script when online
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.onlineMoneyMade property ## RunningScript.onlineMoneyMade property
Total amount of money made by this script when online
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,7 +4,7 @@
## RunningScript.onlineRunningTime property ## RunningScript.onlineRunningTime property
Online running time of the script, in seconds \* Number of seconds that this script has been running online
<b>Signature:</b> <b>Signature:</b>

@ -4,6 +4,8 @@
## RunningScript.pid property ## RunningScript.pid property
Process ID. Must be an integer
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.ramUsage property ## RunningScript.ramUsage property
How much RAM this script uses for ONE thread
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.server property ## RunningScript.server property
Hostname of the server on which this script runs
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -4,6 +4,8 @@
## RunningScript.threads property ## RunningScript.threads property
Number of threads that this script runs with
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript

@ -9,13 +9,11 @@ Hospitalize the player.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
hospitalize(): number; hospitalize(): void;
``` ```
<b>Returns:</b> <b>Returns:</b>
number void
The cost of the hospitalization.
## Remarks ## Remarks

@ -9,7 +9,7 @@ Set a sleeve to work for a faction.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean; setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;
``` ```
## Parameters ## Parameters
@ -22,9 +22,9 @@ setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: str
<b>Returns:</b> <b>Returns:</b>
boolean boolean \| undefined
True if the sleeve started working on this faction, false otherwise. True if the sleeve started working on this faction, false otherwise, can also throw on errors
## Remarks ## Remarks

@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ToastVariant](./bitburner.toastvariant.md)
## ToastVariant enum
<b>Signature:</b>
```typescript
export enum ToastVariant
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| ERROR | <code>&quot;error&quot;</code> | |
| INFO | <code>&quot;info&quot;</code> | |
| SUCCESS | <code>&quot;success&quot;</code> | |
| WARNING | <code>&quot;warning&quot;</code> | |

@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [ToastVariantValues](./bitburner.toastvariantvalues.md)
## ToastVariantValues type
<b>Signature:</b>
```typescript
export type ToastVariantValues = `${ToastVariant}`;
```
<b>References:</b> [ToastVariant](./bitburner.toastvariant.md)

24
package-lock.json generated

@ -1,12 +1,12 @@
{ {
"name": "bitburner", "name": "bitburner",
"version": "1.6.0", "version": "1.6.4",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "bitburner", "name": "bitburner",
"version": "1.6.0", "version": "1.6.4",
"hasInstallScript": true, "hasInstallScript": true,
"license": "SEE LICENSE IN license.txt", "license": "SEE LICENSE IN license.txt",
"dependencies": { "dependencies": {
@ -5965,13 +5965,19 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001265", "version": "1.0.30001328",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz",
"integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==", "integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ==",
"funding": { "funding": [
{
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/browserslist" "url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
} }
]
}, },
"node_modules/caseless": { "node_modules/caseless": {
"version": "0.12.0", "version": "0.12.0",
@ -26994,9 +27000,9 @@
"dev": true "dev": true
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001265", "version": "1.0.30001328",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz",
"integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==" "integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ=="
}, },
"caseless": { "caseless": {
"version": "0.12.0", "version": "0.12.0",

@ -1,7 +1,7 @@
{ {
"name": "bitburner", "name": "bitburner",
"license": "SEE LICENSE IN license.txt", "license": "SEE LICENSE IN license.txt",
"version": "1.6.0", "version": "1.6.4",
"main": "electron-main.js", "main": "electron-main.js",
"author": { "author": {
"name": "Daniel Xie & Olivier Gagnon" "name": "Daniel Xie & Olivier Gagnon"
@ -109,26 +109,31 @@
"doc": "npx api-extractor run && npx api-documenter markdown && rm input/bitburner.api.json && rm -r input", "doc": "npx api-extractor run && npx api-documenter markdown && rm input/bitburner.api.json && rm -r input",
"format": "prettier --write .", "format": "prettier --write .",
"format:report": "prettier -c .", "format:report": "prettier -c .",
"format:report-diff": "bash -c 'if [[ $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | wc -c) -ne 0 ]]; then prettier -c $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | xargs); fi'",
"start": "http-server -p 8000", "start": "http-server -p 8000",
"start:dev": "webpack-dev-server --progress --env.devServer --mode development", "start:dev": "webpack-dev-server --progress --env.devServer --mode development",
"start:dev-fast": "webpack-dev-server --progress --env.devServer --mode development --fast true", "start:dev-fast": "webpack-dev-server --progress --env.devServer --mode development --fast true",
"start:container": "webpack-dev-server --progress --env.devServer --mode development --env.runInContainer", "start:container": "webpack-dev-server --progress --env.devServer --mode development --env.runInContainer",
"build": "webpack --mode production", "build": "webpack --mode production",
"build:dev": "webpack --mode development", "build:dev": "webpack --mode development",
"lint": "eslint --fix . --ext js,jsx,ts,tsx", "lint": "eslint --fix --ext js,jsx,ts,tsx --max-warnings 0 .",
"lint:report": "eslint --ext js,jsx,ts,tsx .", "lint:report": "eslint --ext js,jsx,ts,tsx --max-warnings 0 .",
"lint:report-diff": "eslint --max-warnings 0 $(git diff --name-only --diff-filter=ACMRTUXB origin/dev | grep -E \"(.js$|.jsx$|.ts$|.tsx$)\" | xargs)",
"preinstall": "node ./tools/engines-check/engines-check.js", "preinstall": "node ./tools/engines-check/engines-check.js",
"postinstall": "cd electron && npm install", "postinstall": "cd electron && npm install",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"watch": "webpack --watch --mode production", "watch": "webpack --watch --mode production",
"watch:dev": "webpack --watch --mode development", "watch:dev": "webpack --watch --mode development",
"electron": "sh ./package.sh", "electron": "sh ./tools/package-electron.sh",
"electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune", "electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune",
"electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png", "electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
"electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png", "electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png",
"electron:packager-mac": "electron-packager .package bitburner --platform darwin --arch x64 --out .build --overwrite --icon .package/icon.png", "electron:packager-mac": "electron-packager .package bitburner --platform darwin --arch x64 --out .build --overwrite --icon .package/icon.png",
"electron:packager-linux": "electron-packager .package bitburner --platform linux --arch x64 --out .build --overwrite --icon .package/icon.png", "electron:packager-linux": "electron-packager .package bitburner --platform linux --arch x64 --out .build --overwrite --icon .package/icon.png",
"allbuild": "npm run build && npm run electron && git add --all && git commit -m \"allbuild commit $(git rev-parse --short HEAD)\" && git push -f -u origin dev" "allbuild": "npm run build && npm run electron && git add --all && git commit -m \"allbuild commit $(git rev-parse --short HEAD)\" && git push -f -u origin dev",
"preversion": "npm install && npm run test",
"version": "sh ./tools/build-release.sh && git add --all",
"postversion": "git push -u origin dev && git push --tags"
} }
} }

@ -1,31 +0,0 @@
#!/bin/sh
# Clear out any files remaining from old builds
rm -rf .package
mkdir -p .package/dist/src/ThirdParty || true
mkdir -p .package/src/ThirdParty || true
mkdir -p .package/node_modules || true
cp index.html .package
cp -r electron/* .package
cp -r dist/ext .package/dist
cp -r dist/icons .package/dist
cp -r dist/images .package/dist
# The js files.
cp dist/vendor.bundle.js .package/dist/vendor.bundle.js
cp main.bundle.js .package/main.bundle.js
# Source maps
cp dist/vendor.bundle.js.map .package/dist/vendor.bundle.js.map
cp main.bundle.js.map .package/main.bundle.js.map
# Install electron sub-dependencies
cd electron
npm install
cd ..
BUILD_PLATFORM="${1:-"all"}"
# And finally build the app.
npm run electron:packager-$BUILD_PLATFORM

@ -133,7 +133,7 @@ function generateStatsDescription(mults: IMap<number>, programs?: string[], star
desc = ( desc = (
<> <>
{desc} {desc}
<br />+{f(mults.charisma_mult - 1)} Charisma skill <br />+{f(mults.charisma_mult - 1)} charisma skill
</> </>
); );
} }
@ -380,9 +380,6 @@ export class Augmentation {
// Name of Augmentation // Name of Augmentation
name = ""; name = "";
// Whether the player owns this Augmentation
owned = false;
// Array of names of all prerequisites // Array of names of all prerequisites
prereqs: string[] = []; prereqs: string[] = [];

@ -1488,12 +1488,18 @@ export const initGeneralAugmentations = (): Augmentation[] => [
// Grafting-exclusive Augmentation // Grafting-exclusive Augmentation
new Augmentation({ new Augmentation({
name: AugmentationNames.CongruityImplant, name: AugmentationNames.CongruityImplant,
repCost: 0, repCost: Infinity,
moneyCost: 50e12, moneyCost: 50e12,
info: info: (
"Developed by a pioneer in Grafting research, this implant " + <>
"generates pulses of stability which seem to have a nullifying " + Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a
"effect versus the Entropy virus.", nullifying effect versus the Entropy virus.
<br />
<br />
<b>Note:</b> For unknown reasons, the lowercase <code>n</code> appears to be an integral component to its
functionality.
</>
),
stats: <>This Augmentation removes the Entropy virus, and prevents it from affecting you again.</>, stats: <>This Augmentation removes the Entropy virus, and prevents it from affecting you again.</>,
factions: [], factions: [],
}), }),

@ -8,7 +8,6 @@ import { CONSTANTS } from "../Constants";
import { Factions, factionExists } from "../Faction/Factions"; import { Factions, factionExists } from "../Faction/Factions";
import { Player } from "../Player"; import { Player } from "../Player";
import { prestigeAugmentation } from "../Prestige"; import { prestigeAugmentation } from "../Prestige";
import { SourceFileFlags } from "../SourceFile/SourceFileFlags";
import { dialogBoxCreate } from "../ui/React/DialogBox"; import { dialogBoxCreate } from "../ui/React/DialogBox";
import { clearObject } from "../utils/helpers/clearObject"; import { clearObject } from "../utils/helpers/clearObject";
@ -21,6 +20,7 @@ import {
initNeuroFluxGovernor, initNeuroFluxGovernor,
initUnstableCircadianModulator, initUnstableCircadianModulator,
} from "./AugmentationCreator"; } from "./AugmentationCreator";
import { Router } from "../ui/GameRoot";
export function AddToAugmentations(aug: Augmentation): void { export function AddToAugmentations(aug: Augmentation): void {
const name = aug.name; const name = aug.name;
@ -72,7 +72,7 @@ function initAugmentations(): void {
} }
function getBaseAugmentationPriceMultiplier(): number { function getBaseAugmentationPriceMultiplier(): number {
return CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][SourceFileFlags[11]]; return CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][Player.sourceFileLvl(11)];
} }
export function getGenericAugmentationPriceMultiplier(): number { export function getGenericAugmentationPriceMultiplier(): number {
return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length); return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length);
@ -117,8 +117,6 @@ function resetAugmentation(aug: Augmentation): void {
} }
function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void { function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {
Augmentations[aug.name].owned = true;
const augObj = Augmentations[aug.name]; const augObj = Augmentations[aug.name];
// Apply multipliers // Apply multipliers
@ -194,6 +192,7 @@ function installAugmentations(force?: boolean): boolean {
); );
} }
prestigeAugmentation(); prestigeAugmentation();
Router.toTerminal();
return true; return true;
} }

@ -7,7 +7,7 @@ import React, { useState, useEffect } from "react";
import { InstalledAugmentations } from "./InstalledAugmentations"; import { InstalledAugmentations } from "./InstalledAugmentations";
import { PlayerMultipliers } from "./PlayerMultipliers"; import { PlayerMultipliers } from "./PlayerMultipliers";
import { PurchasedAugmentations } from "./PurchasedAugmentations"; import { PurchasedAugmentations } from "./PurchasedAugmentations";
import { SourceFiles } from "./SourceFiles"; import { SourceFilesElement } from "./SourceFiles";
import { canGetBonus } from "../../ExportBonus"; import { canGetBonus } from "../../ExportBonus";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
@ -16,8 +16,55 @@ import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Tooltip from "@mui/material/Tooltip"; import Tooltip from "@mui/material/Tooltip";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Paper from "@mui/material/Paper";
import Container from "@mui/material/Container";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { ConfirmationModal } from "../../ui/React/ConfirmationModal"; import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { AugmentationNames } from "../data/AugmentationNames";
import { Augmentations } from "../Augmentations";
import { CONSTANTS } from "../../Constants";
import { formatNumber } from "../../utils/StringHelperFunctions";
import { Info } from "@mui/icons-material";
interface NFGDisplayProps {
player: IPlayer;
}
const NeuroFluxDisplay = ({ player }: NFGDisplayProps): React.ReactElement => {
const level = player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0;
return level > 0 ? (
<Paper sx={{ p: 1 }}>
<Typography variant="h5" color={Settings.theme.info}>
NeuroFlux Governor - Level {level}
</Typography>
<Typography color={Settings.theme.info}>{Augmentations[AugmentationNames.NeuroFluxGovernor].stats}</Typography>
</Paper>
) : (
<></>
);
};
interface EntropyDisplayProps {
player: IPlayer;
}
const EntropyDisplay = ({ player }: EntropyDisplayProps): React.ReactElement => {
return player.entropy > 0 ? (
<Paper sx={{ p: 1 }}>
<Typography variant="h5" color={Settings.theme.error}>
Entropy Virus - Level {player.entropy}
</Typography>
<Typography color={Settings.theme.error}>
<b>All multipliers decreased by:</b> {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}%
(multiplicative)
</Typography>
</Paper>
) : (
<></>
);
};
interface IProps { interface IProps {
exportGameFn: () => void; exportGameFn: () => void;
@ -55,14 +102,22 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
} }
return ( return (
<> <Container disableGutters maxWidth="lg" sx={{ mx: 0 }}>
<Typography variant="h4">Augmentations</Typography> <Typography variant="h4">Augmentations</Typography>
<Box mx={2}> <Box sx={{ mb: 1 }}>
<Paper sx={{ p: 1 }}>
<Typography variant="h5" color="primary" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}>
Purchased Augmentations
<Tooltip
title={
<>
<Typography> <Typography>
Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to Below is a list of all Augmentations you have purchased but not yet installed. Click the button
install them. below to install them.
</Typography>
<Typography>
WARNING: Installing your Augmentations resets most of your progress, including:
</Typography> </Typography>
<Typography>WARNING: Installing your Augmentations resets most of your progress, including:</Typography>
<br /> <br />
<Typography>- Stats/Skill levels and Experience</Typography> <Typography>- Stats/Skill levels and Experience</Typography>
<Typography>- Money</Typography> <Typography>- Money</Typography>
@ -73,22 +128,16 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
<Typography>- Stocks</Typography> <Typography>- Stocks</Typography>
<br /> <br />
<Typography> <Typography>
Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations Installing Augmentations lets you start over with the perks and benefits granted by all of the
you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your
will lose all programs besides NUKE.exe) home computer (but you will lose all programs besides NUKE.exe)
</Typography> </Typography>
</Box> </>
<Typography variant="h4" color="primary"> }
Purchased Augmentations >
</Typography> <Info sx={{ ml: 1, mb: 0.5 }} color="info" />
<Box mx={2}>
<Tooltip title={<Typography>'I never asked for this'</Typography>}>
<span>
<Button disabled={player.queuedAugmentations.length === 0} onClick={doInstall}>
Install Augmentations
</Button>
</span>
</Tooltip> </Tooltip>
</Typography>
<ConfirmationModal <ConfirmationModal
open={installOpen} open={installOpen}
onClose={() => setInstallOpen(false)} onClose={() => setInstallOpen(false)}
@ -109,27 +158,57 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
<br />- home ram and cores <br />- home ram and cores
<br /> <br />
<br /> <br />
It is recommended to install several Augmentations at once. Preferably everything from any faction of your It is recommended to install several Augmentations at once. Preferably everything from any faction of
choosing. your choosing.
</> </>
} }
/> />
<Box sx={{ display: "grid", width: "100%", gridTemplateColumns: "1fr 1fr" }}>
<Tooltip title={<Typography>'I never asked for this'</Typography>}>
<span>
<Button sx={{ width: "100%" }} disabled={player.queuedAugmentations.length === 0} onClick={doInstall}>
Install Augmentations
</Button>
</span>
</Tooltip>
<Tooltip title={<Typography>It's always a good idea to backup/export your save!</Typography>}> <Tooltip title={<Typography>It's always a good idea to backup/export your save!</Typography>}>
<Button sx={{ mx: 2 }} onClick={doExport} color="error"> <Button sx={{ width: "100%" }} onClick={doExport} color="error">
Backup Save {exportBonusStr()} Backup Save {exportBonusStr()}
</Button> </Button>
</Tooltip> </Tooltip>
<PurchasedAugmentations />
</Box> </Box>
<Typography variant="h4">Installed Augmentations</Typography> </Paper>
<Box mx={2}> {player.queuedAugmentations.length > 0 ? (
<Typography> <Box sx={{ display: "grid", gridTemplateColumns: "1fr 3fr" }}>
List of all Augmentations that have been installed. You have gained the effects of these. <PurchasedAugmentations />
</Typography> <PlayerMultipliers />
</Box>
) : (
<Paper sx={{ p: 1 }}>
<Typography>No Augmentations have been purchased yet</Typography>
</Paper>
)}
</Box>
<Box
sx={{
my: 1,
display: "grid",
gridTemplateColumns: `repeat(${
+!!((player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0) > 0) +
+!!(player.entropy > 0)
}, 1fr)`,
gap: 1,
}}
>
<NeuroFluxDisplay player={player} />
<EntropyDisplay player={player} />
</Box>
<Box>
<InstalledAugmentations /> <InstalledAugmentations />
</Box> </Box>
<PlayerMultipliers /> <SourceFilesElement />
<SourceFiles /> </Container>
</>
); );
} }

@ -5,28 +5,23 @@
* It also contains 'configuration' buttons that allow you to change how the * It also contains 'configuration' buttons that allow you to change how the
* Augs/SF's are displayed * Augs/SF's are displayed
*/ */
import { Box, ListItemButton, Paper, Typography } from "@mui/material";
import Button from "@mui/material/Button";
import List from "@mui/material/List";
import Tooltip from "@mui/material/Tooltip";
import React, { useState } from "react"; import React, { useState } from "react";
import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums";
import { AugmentationAccordion } from "../../ui/React/AugmentationAccordion";
import { Augmentations } from "../Augmentations";
import { AugmentationNames } from "../data/AugmentationNames";
import { Settings } from "../../Settings/Settings"; import { Settings } from "../../Settings/Settings";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums"; import { Augmentations } from "../Augmentations";
import Button from "@mui/material/Button"; import { AugmentationNames } from "../data/AugmentationNames";
import Tooltip from "@mui/material/Tooltip";
import List from "@mui/material/List";
import { ExpandLess, ExpandMore } from "@mui/icons-material";
import { Box, Paper, ListItemButton, ListItemText, Typography, Collapse } from "@mui/material";
import { CONSTANTS } from "../../Constants";
import { formatNumber } from "../../utils/StringHelperFunctions";
export function InstalledAugmentations(): React.ReactElement { export function InstalledAugmentations(): React.ReactElement {
const setRerender = useState(true)[1]; const setRerender = useState(true)[1];
const player = use.Player(); const player = use.Player();
const sourceAugs = player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor);
const sourceAugs = player.augmentations.slice(); const [selectedAug, setSelectedAug] = useState(sourceAugs[0]);
if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) { if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {
sourceAugs.sort((aug1, aug2) => { sourceAugs.sort((aug1, aug2) => {
@ -49,59 +44,60 @@ export function InstalledAugmentations(): React.ReactElement {
} }
return ( return (
<> <Box sx={{ width: "100%" }}>
<Paper sx={{ p: 1 }}>
<Typography variant="h5">Installed Augmentations</Typography>
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 1fr" }}>
<Tooltip title={"Sorts the Augmentations alphabetically in numeral order"}> <Tooltip title={"Sorts the Augmentations alphabetically in numeral order"}>
<Button onClick={sortInOrder}>Sort in Order</Button> <Button sx={{ width: "100%" }} onClick={sortInOrder}>
</Tooltip> Sort in Order
<Tooltip title={"Sorts the Augmentations based on when you acquired them (same as default)"}>
<Button sx={{ mx: 2 }} onClick={sortByAcquirementTime}>
Sort by Acquirement Time
</Button> </Button>
</Tooltip> </Tooltip>
<List dense> <Tooltip title={"Sorts the Augmentations based on when you acquired them (same as default)"}>
{player.entropy > 0 && <Button sx={{ width: "100%" }} onClick={sortByAcquirementTime}>
(() => { Sort by Time of Acquirement
const [open, setOpen] = useState(false); </Button>
</Tooltip>
return ( </Box>
<Box component={Paper}> </Paper>
<ListItemButton onClick={() => setOpen((old) => !old)}> {sourceAugs.length > 0 ? (
<ListItemText <Paper sx={{ display: "grid", gridTemplateColumns: "1fr 3fr" }}>
primary={ <Box>
<Typography color={Settings.theme.hp} style={{ whiteSpace: "pre-wrap" }}> <List sx={{ height: 400, overflowY: "scroll", borderRight: `1px solid ${Settings.theme.welllight}` }}>
Entropy Virus - Level {player.entropy} {sourceAugs.map((k, i) => (
</Typography> <ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>
} <Typography>{k.name}</Typography>
/>
{open ? (
<ExpandLess sx={{ color: Settings.theme.hp }} />
) : (
<ExpandMore sx={{ color: Settings.theme.hp }} />
)}
</ListItemButton> </ListItemButton>
<Collapse in={open} unmountOnExit> ))}
<Box m={4}>
<Typography color={Settings.theme.hp}>
<b>All multipliers decreased by:</b>{" "}
{formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}% (multiplicative)
</Typography>
</Box>
</Collapse>
</Box>
);
})()}
{sourceAugs.map((e) => {
const aug = Augmentations[e.name];
let level = null;
if (e.name === AugmentationNames.NeuroFluxGovernor) {
level = e.level;
}
return <AugmentationAccordion key={aug.name} aug={aug} level={level} />;
})}
</List> </List>
</Box>
<Box sx={{ m: 1 }}>
<Typography variant="h6" sx={{ display: "flex", alignItems: "center", flexWrap: "wrap" }}>
{selectedAug.name}
</Typography>
<Typography sx={{ maxHeight: 350, overflowY: "scroll" }}>
{(() => {
const aug = Augmentations[selectedAug.name];
const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info;
const tooltip = (
<>
{info}
<br />
<br />
{aug.stats}
</> </>
); );
return tooltip;
})()}
</Typography>
</Box>
</Paper>
) : (
<Paper sx={{ p: 1 }}>
<Typography>No Augmentations have been installed yet</Typography>
</Paper>
)}
</Box>
);
} }

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