mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 15:12:27 +01:00
Merge branch 'dev' of https://github.com/rderfler/bitburner into dev
This commit is contained in:
commit
1239c7ad7f
@ -1,3 +1,3 @@
|
||||
last 4 versions
|
||||
last 8 versions
|
||||
not dead
|
||||
not ie <= 11
|
||||
|
@ -353,6 +353,7 @@ module.exports = {
|
||||
"no-useless-constructor": [
|
||||
"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-ignore": "off",
|
||||
"@typescript-eslint/camelcase": "off",
|
||||
|
71
.github/workflows/ci-pr.yml
vendored
Normal file
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
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -1,11 +1,9 @@
|
||||
name: CI
|
||||
|
||||
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:
|
||||
branches: [dev]
|
||||
pull_request:
|
||||
branches: [dev]
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
.DS_Store
|
||||
.history
|
||||
.vscode
|
||||
Changelog.txt
|
||||
Netburner.txt
|
||||
|
3
.npmrc
Normal file
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
181
dist/bitburner.d.ts
vendored
@ -3,7 +3,7 @@
|
||||
*/
|
||||
export declare interface ActiveFragment {
|
||||
id: number;
|
||||
avgCharge: number;
|
||||
highestCharge: number;
|
||||
numCharge: number;
|
||||
rotation: number;
|
||||
x: number;
|
||||
@ -182,7 +182,7 @@ export declare interface BitNodeMultipliers {
|
||||
/** Influences the maximum allowed RAM for a purchased server */
|
||||
PurchasedServerMaxRam: number;
|
||||
/** 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. */
|
||||
RepToDonateToFaction: number;
|
||||
/** 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[];
|
||||
/** Current health points */
|
||||
hp: number;
|
||||
/** Array of all companies at which you have jobs */
|
||||
company: string[];
|
||||
/** Array of all jobs */
|
||||
jobs: string[];
|
||||
/** Array of job positions for all companies you are employed at. Same order as 'jobs' */
|
||||
jobTitle: string[];
|
||||
jobTitles: string[];
|
||||
/** Maximum health points */
|
||||
maxHp: number;
|
||||
/** Boolean indicating whether or not you have a tor router */
|
||||
@ -737,6 +737,18 @@ export declare interface CharacterInfo {
|
||||
workRepGain: number;
|
||||
/** Money earned so far from work, if applicable */
|
||||
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 exp */
|
||||
agilityExp: number;
|
||||
/** Charisma stat */
|
||||
charisma: number;
|
||||
/** Charisma exp */
|
||||
charismaExp: number;
|
||||
/** Company reputation */
|
||||
companyRep: number;
|
||||
/** Money earned from crimes */
|
||||
@ -1177,6 +1193,8 @@ export declare type FilenameOrPID = number | string;
|
||||
* @public
|
||||
*/
|
||||
export declare interface Formulas {
|
||||
/** Reputation formulas */
|
||||
reputation: ReputationFormulas;
|
||||
/** Skills formulas */
|
||||
skills: SkillsFormulas;
|
||||
/** Hacking formulas */
|
||||
@ -1755,6 +1773,18 @@ export declare interface Grafting {
|
||||
*/
|
||||
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.
|
||||
* @remarks
|
||||
@ -2101,7 +2131,7 @@ export declare interface Hacknet {
|
||||
* // NS1:
|
||||
* var upgradeName = "Sell for Corporation Funds";
|
||||
* if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
|
||||
* hacknet.spendHashes(upgName);
|
||||
* hacknet.spendHashes(upgradeName);
|
||||
* }
|
||||
* ```
|
||||
* @example
|
||||
@ -2109,7 +2139,7 @@ export declare interface Hacknet {
|
||||
* // NS2:
|
||||
* const upgradeName = "Sell for Corporation Funds";
|
||||
* 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.
|
||||
@ -2442,6 +2472,10 @@ export declare interface Material {
|
||||
qty: number;
|
||||
/** Quality of the material */
|
||||
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 */
|
||||
prod: number;
|
||||
/** 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}
|
||||
* <hr>
|
||||
*/
|
||||
export declare interface NS extends Singularity {
|
||||
export declare interface NS {
|
||||
/**
|
||||
* Namespace for hacknet functions.
|
||||
* @remarks RAM cost: 4 GB
|
||||
@ -2635,6 +2669,12 @@ export declare interface NS extends Singularity {
|
||||
*/
|
||||
readonly ui: UserInterface;
|
||||
|
||||
/**
|
||||
* Namespace for singularity functions.
|
||||
* RAM cost: 0 GB
|
||||
*/
|
||||
readonly singularity: Singularity;
|
||||
|
||||
/**
|
||||
* Namespace for grafting functions.
|
||||
* @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.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
hackAnalyzeSecurity(threads: number): number;
|
||||
hackAnalyzeSecurity(threads: number, hostname?: string): number;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @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.
|
||||
*/
|
||||
growthAnalyzeSecurity(threads: number): number;
|
||||
growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;
|
||||
|
||||
/**
|
||||
* Suspends the script for n milliseconds.
|
||||
@ -2912,7 +2955,7 @@ export declare interface NS extends Singularity {
|
||||
* ```
|
||||
* @returns
|
||||
*/
|
||||
sleep(millis: number): Promise<void>;
|
||||
sleep(millis: number): Promise<true>;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* @returns
|
||||
*/
|
||||
asleep(millis: number): Promise<void>;
|
||||
asleep(millis: number): Promise<true>;
|
||||
|
||||
/**
|
||||
* Prints one or move values or variables to the script’s logs.
|
||||
@ -3051,6 +3094,27 @@ export declare interface NS extends Singularity {
|
||||
*/
|
||||
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.
|
||||
* @remarks
|
||||
@ -3941,7 +4005,7 @@ export declare interface NS extends Singularity {
|
||||
* @param args - Arguments to identify the script
|
||||
* @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.
|
||||
@ -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 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.
|
||||
@ -4648,6 +4712,13 @@ export declare interface NS extends Singularity {
|
||||
* RAM cost: 0.2 GB
|
||||
*/
|
||||
getSharePower(): number;
|
||||
|
||||
enums: NSEnums;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export declare interface NSEnums {
|
||||
toast: typeof ToastVariant;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4671,8 +4742,10 @@ export declare interface Office {
|
||||
maxMor: number;
|
||||
/** Name of all the employees */
|
||||
employees: string[];
|
||||
/** Positions of the employees */
|
||||
/** Production of the employees */
|
||||
employeeProd: EmployeeJobs;
|
||||
/** Positions of the employees */
|
||||
employeeJobs: EmployeeJobs;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4947,10 +5020,14 @@ export declare interface ProcessInfo {
|
||||
export declare interface Product {
|
||||
/** Name of the product */
|
||||
name: string;
|
||||
/** Demand for the product */
|
||||
dmd: number;
|
||||
/** Competition for the product */
|
||||
cmp: number;
|
||||
/** Demand for the product, only present if "Market Research - Demand" unlocked */
|
||||
dmd: number | undefined;
|
||||
/** Competition for the product, only present if "Market Research - Competition" unlocked */
|
||||
cmp: number | undefined;
|
||||
/** Product Rating */
|
||||
rat: number;
|
||||
/** Product Properties. The data is \{qlt, per, dur, rel, aes, fea\} */
|
||||
properties: { [key: string]: number };
|
||||
/** Production cost */
|
||||
pCost: number;
|
||||
/** Sell cost, can be "MP+5" */
|
||||
@ -4963,24 +5040,66 @@ export declare interface Product {
|
||||
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
|
||||
*/
|
||||
export declare interface RunningScript {
|
||||
/** Arguments the script was called with */
|
||||
args: string[];
|
||||
/** Filename of the script */
|
||||
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[];
|
||||
/** Total amount of hacking experience earned from this script when offline */
|
||||
offlineExpGained: number;
|
||||
/** Total amount of money made by this script when offline */
|
||||
offlineMoneyMade: number;
|
||||
/** Offline running time of the script, in seconds **/
|
||||
/** Number of seconds that the script has been running offline */
|
||||
offlineRunningTime: number;
|
||||
/** Total amount of hacking experience earned from this script when online */
|
||||
onlineExpGained: number;
|
||||
/** Total amount of money made by this script when online */
|
||||
onlineMoneyMade: number;
|
||||
/** Online running time of the script, in seconds **/
|
||||
/** Number of seconds that this script has been running online */
|
||||
onlineRunningTime: number;
|
||||
/** Process ID. Must be an integer */
|
||||
pid: number;
|
||||
/** How much RAM this script uses for ONE thread */
|
||||
ramUsage: number;
|
||||
/** Hostname of the server on which this script runs */
|
||||
server: string;
|
||||
/** Number of threads that this script runs with */
|
||||
threads: number;
|
||||
}
|
||||
|
||||
@ -5750,11 +5869,8 @@ export declare interface Singularity {
|
||||
* Hospitalize the player.
|
||||
* @remarks
|
||||
* RAM cost: 0.25 GB * 16/4/1
|
||||
*
|
||||
*
|
||||
* @returns The cost of the hospitalization.
|
||||
*/
|
||||
hospitalize(): number;
|
||||
hospitalize(): void;
|
||||
|
||||
/**
|
||||
* Soft reset the game.
|
||||
@ -6028,9 +6144,9 @@ export declare interface Sleeve {
|
||||
* @param sleeveNumber - Index of the sleeve to work for the faction.
|
||||
* @param factionName - Name of the faction to work for.
|
||||
* @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.
|
||||
@ -6729,6 +6845,17 @@ export declare interface TIX {
|
||||
purchaseTixApi(): boolean;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export declare enum ToastVariant {
|
||||
SUCCESS = "success",
|
||||
WARNING = "warning",
|
||||
ERROR = "error",
|
||||
INFO = "info",
|
||||
}
|
||||
|
||||
/** @public */
|
||||
export declare type ToastVariantValues = `${ToastVariant}`;
|
||||
|
||||
/**
|
||||
* User Interface API.
|
||||
* @public
|
||||
|
4
dist/main.bundle.js
vendored
4
dist/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/main.bundle.js.map
vendored
2
dist/main.bundle.js.map
vendored
File diff suppressed because one or more lines are too long
42
dist/vendor.bundle.js
vendored
42
dist/vendor.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/vendor.bundle.js.map
vendored
2
dist/vendor.bundle.js.map
vendored
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
|
||||
Augmentations, without needing to reboot your body.
|
||||
|
||||
In order to graft, you must first purchase a blueprint for and craft the Augmentation.
|
||||
This can be done at VitaLife in New Tokyo, where you'll find a shady researcher with
|
||||
questionable connections. Once you purchase a blueprint, you will start crafting the
|
||||
Augmentation, and it will be grafted to your body once complete.
|
||||
Grafting 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
|
||||
Augmentations. This will take some time. When done, the Augmentation will be applied to
|
||||
your character without needing to install.
|
||||
|
||||
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,
|
||||
|
@ -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 |
|
||||
| | | 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? |
|
||||
+------------------------------------+------------------------------------------------------------------------------------------+
|
||||
| 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 |
|
||||
| | | 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 |
|
||||
| | | 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 |
|
||||
| | | is an array with two numbers, where the first number is always less than |
|
||||
| | | the second (e.g. [1, 5]). |
|
||||
|
@ -66,7 +66,7 @@ documentation_title = '{0} Documentation'.format(project)
|
||||
# The short X.Y version.
|
||||
version = '1.6'
|
||||
# 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
|
||||
# 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,109 +22,96 @@ function error_process(err, error_callback) {
|
||||
if (err && error_callback) error_callback(err);
|
||||
}
|
||||
|
||||
greenworks.ugcGetItems = function (options, ugc_matching_type, ugc_query_type, success_callback, error_callback) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = ugc_query_type;
|
||||
ugc_query_type = ugc_matching_type;
|
||||
ugc_matching_type = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
page_num: 1,
|
||||
};
|
||||
}
|
||||
greenworks._ugcGetItems(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") {
|
||||
error_callback = success_callback;
|
||||
success_callback = ugc_query_type;
|
||||
ugc_query_type = ugc_matching_type;
|
||||
ugc_matching_type = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
page_num: 1,
|
||||
};
|
||||
}
|
||||
greenworks._ugcGetItems(options, ugc_matching_type, ugc_query_type, success_callback, error_callback);
|
||||
};
|
||||
|
||||
greenworks.ugcGetUserItems = function (
|
||||
options,
|
||||
ugc_matching_type,
|
||||
ugc_list_sort_order,
|
||||
ugc_list,
|
||||
success_callback,
|
||||
error_callback,
|
||||
) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = ugc_list;
|
||||
ugc_list = ugc_list_sort_order;
|
||||
ugc_list_sort_order = ugc_matching_type;
|
||||
ugc_matching_type = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
page_num: 1,
|
||||
};
|
||||
}
|
||||
greenworks._ugcGetUserItems(
|
||||
greenworks.ugcGetUserItems = function (
|
||||
options,
|
||||
ugc_matching_type,
|
||||
ugc_list_sort_order,
|
||||
ugc_list,
|
||||
success_callback,
|
||||
error_callback,
|
||||
);
|
||||
};
|
||||
) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = ugc_list;
|
||||
ugc_list = ugc_list_sort_order;
|
||||
ugc_list_sort_order = ugc_matching_type;
|
||||
ugc_matching_type = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
page_num: 1,
|
||||
};
|
||||
}
|
||||
greenworks._ugcGetUserItems(
|
||||
options,
|
||||
ugc_matching_type,
|
||||
ugc_list_sort_order,
|
||||
ugc_list,
|
||||
success_callback,
|
||||
error_callback,
|
||||
);
|
||||
};
|
||||
|
||||
greenworks.ugcSynchronizeItems = function (options, sync_dir, success_callback, error_callback) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = sync_dir;
|
||||
sync_dir = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
page_num: 1,
|
||||
};
|
||||
}
|
||||
greenworks._ugcSynchronizeItems(options, sync_dir, success_callback, error_callback);
|
||||
};
|
||||
greenworks.ugcSynchronizeItems = function (options, sync_dir, success_callback, error_callback) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = sync_dir;
|
||||
sync_dir = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
page_num: 1,
|
||||
};
|
||||
}
|
||||
greenworks._ugcSynchronizeItems(options, sync_dir, success_callback, error_callback);
|
||||
};
|
||||
|
||||
greenworks.publishWorkshopFile = function (
|
||||
options,
|
||||
file_path,
|
||||
image_path,
|
||||
title,
|
||||
description,
|
||||
success_callback,
|
||||
error_callback,
|
||||
) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = description;
|
||||
description = title;
|
||||
title = image_path;
|
||||
image_path = file_path;
|
||||
file_path = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
tags: [],
|
||||
};
|
||||
}
|
||||
greenworks._publishWorkshopFile(options, file_path, image_path, title, description, success_callback, error_callback);
|
||||
};
|
||||
greenworks.publishWorkshopFile = function (
|
||||
options,
|
||||
file_path,
|
||||
image_path,
|
||||
title,
|
||||
description,
|
||||
success_callback,
|
||||
error_callback,
|
||||
) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = description;
|
||||
description = title;
|
||||
title = image_path;
|
||||
image_path = file_path;
|
||||
file_path = options;
|
||||
options = {
|
||||
app_id: greenworks.getAppId(),
|
||||
tags: [],
|
||||
};
|
||||
}
|
||||
greenworks._publishWorkshopFile(
|
||||
options,
|
||||
file_path,
|
||||
image_path,
|
||||
title,
|
||||
description,
|
||||
success_callback,
|
||||
error_callback,
|
||||
);
|
||||
};
|
||||
|
||||
greenworks.updatePublishedWorkshopFile = function (
|
||||
options,
|
||||
published_file_handle,
|
||||
file_path,
|
||||
image_path,
|
||||
title,
|
||||
description,
|
||||
success_callback,
|
||||
error_callback,
|
||||
) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = description;
|
||||
description = title;
|
||||
title = image_path;
|
||||
image_path = file_path;
|
||||
file_path = published_file_handle;
|
||||
published_file_handle = options;
|
||||
options = {
|
||||
tags: [], // No tags are set
|
||||
};
|
||||
}
|
||||
greenworks._updatePublishedWorkshopFile(
|
||||
greenworks.updatePublishedWorkshopFile = function (
|
||||
options,
|
||||
published_file_handle,
|
||||
file_path,
|
||||
@ -133,161 +120,184 @@ greenworks.updatePublishedWorkshopFile = function (
|
||||
description,
|
||||
success_callback,
|
||||
error_callback,
|
||||
);
|
||||
};
|
||||
) {
|
||||
if (typeof options !== "object") {
|
||||
error_callback = success_callback;
|
||||
success_callback = description;
|
||||
description = title;
|
||||
title = image_path;
|
||||
image_path = file_path;
|
||||
file_path = published_file_handle;
|
||||
published_file_handle = options;
|
||||
options = {
|
||||
tags: [], // No tags are set
|
||||
};
|
||||
}
|
||||
greenworks._updatePublishedWorkshopFile(
|
||||
options,
|
||||
published_file_handle,
|
||||
file_path,
|
||||
image_path,
|
||||
title,
|
||||
description,
|
||||
success_callback,
|
||||
error_callback,
|
||||
);
|
||||
};
|
||||
|
||||
// An utility function for publish related APIs.
|
||||
// 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) {
|
||||
if (progress_callback) progress_callback("Completed on saving files on Steam Cloud.");
|
||||
greenworks.fileShare(
|
||||
// An utility function for publish related APIs.
|
||||
// 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) {
|
||||
if (progress_callback) progress_callback("Completed on saving files on Steam Cloud.");
|
||||
greenworks.fileShare(
|
||||
file_name,
|
||||
function () {
|
||||
greenworks.fileShare(
|
||||
image_name,
|
||||
function () {
|
||||
next_process_func();
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// Publishing user generated content(ugc) to Steam contains following steps:
|
||||
// 1. Save file and image to Steam Cloud.
|
||||
// 2. Share the file and image.
|
||||
// 3. publish the file to workshop.
|
||||
greenworks.ugcPublish = function (
|
||||
file_name,
|
||||
function () {
|
||||
greenworks.fileShare(
|
||||
title,
|
||||
description,
|
||||
image_name,
|
||||
success_callback,
|
||||
error_callback,
|
||||
progress_callback,
|
||||
) {
|
||||
var publish_file_process = function () {
|
||||
if (progress_callback) progress_callback("Completed on sharing files.");
|
||||
greenworks.publishWorkshopFile(
|
||||
file_name,
|
||||
image_name,
|
||||
function () {
|
||||
next_process_func();
|
||||
title,
|
||||
description,
|
||||
function (publish_file_id) {
|
||||
success_callback(publish_file_id);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
greenworks.saveFilesToCloud(
|
||||
[file_name, image_name],
|
||||
function () {
|
||||
file_share_process(file_name, image_name, publish_file_process, error_callback, progress_callback);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
// Update publish ugc steps:
|
||||
// 1. Save new file and image to Steam Cloud.
|
||||
// 2. Share file and images.
|
||||
// 3. Update published file.
|
||||
greenworks.ugcPublishUpdate = function (
|
||||
published_file_id,
|
||||
file_name,
|
||||
title,
|
||||
description,
|
||||
image_name,
|
||||
success_callback,
|
||||
error_callback,
|
||||
progress_callback,
|
||||
) {
|
||||
var update_published_file_process = function () {
|
||||
if (progress_callback) progress_callback("Completed on sharing files.");
|
||||
greenworks.updatePublishedWorkshopFile(
|
||||
published_file_id,
|
||||
file_name,
|
||||
image_name,
|
||||
title,
|
||||
description,
|
||||
function () {
|
||||
success_callback();
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
greenworks.saveFilesToCloud(
|
||||
[file_name, image_name],
|
||||
function () {
|
||||
file_share_process(file_name, image_name, update_published_file_process, error_callback, progress_callback);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
// Greenworks Utils APIs implmentation.
|
||||
greenworks.Utils.move = function (source_dir, target_dir, success_callback, error_callback) {
|
||||
fs.rename(source_dir, target_dir, function (err) {
|
||||
if (err) {
|
||||
if (error_callback) error_callback(err);
|
||||
return;
|
||||
}
|
||||
if (success_callback) success_callback();
|
||||
});
|
||||
};
|
||||
|
||||
greenworks.init = function () {
|
||||
if (this.initAPI()) return true;
|
||||
if (!this.isSteamRunning()) throw new Error("Steam initialization failed. Steam is not running.");
|
||||
var appId;
|
||||
try {
|
||||
appId = fs.readFileSync("steam_appid.txt", "utf8");
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
"Steam initialization failed. Steam is running," +
|
||||
"but steam_appid.txt is missing. Expected to find it in: " +
|
||||
require("path").resolve("steam_appid.txt"),
|
||||
);
|
||||
}
|
||||
if (!/^\d+ *\r?\n?$/.test(appId)) {
|
||||
throw new Error(
|
||||
"Steam initialization failed. " +
|
||||
"steam_appid.txt appears to be invalid; " +
|
||||
"it should contain a numeric ID: " +
|
||||
appId,
|
||||
);
|
||||
}
|
||||
throw new Error(
|
||||
"Steam initialization failed, but Steam is running, " +
|
||||
"and steam_appid.txt is present and valid." +
|
||||
"Maybe that's not really YOUR app ID? " +
|
||||
appId.trim(),
|
||||
);
|
||||
};
|
||||
|
||||
var EventEmitter = require("events").EventEmitter;
|
||||
greenworks.__proto__ = EventEmitter.prototype;
|
||||
EventEmitter.call(greenworks);
|
||||
|
||||
greenworks._steam_events.on = function () {
|
||||
greenworks.emit.apply(greenworks, arguments);
|
||||
};
|
||||
|
||||
process.versions["greenworks"] = greenworks._version;
|
||||
}
|
||||
|
||||
// Publishing user generated content(ugc) to Steam contains following steps:
|
||||
// 1. Save file and image to Steam Cloud.
|
||||
// 2. Share the file and image.
|
||||
// 3. publish the file to workshop.
|
||||
greenworks.ugcPublish = function (
|
||||
file_name,
|
||||
title,
|
||||
description,
|
||||
image_name,
|
||||
success_callback,
|
||||
error_callback,
|
||||
progress_callback,
|
||||
) {
|
||||
var publish_file_process = function () {
|
||||
if (progress_callback) progress_callback("Completed on sharing files.");
|
||||
greenworks.publishWorkshopFile(
|
||||
file_name,
|
||||
image_name,
|
||||
title,
|
||||
description,
|
||||
function (publish_file_id) {
|
||||
success_callback(publish_file_id);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
greenworks.saveFilesToCloud(
|
||||
[file_name, image_name],
|
||||
function () {
|
||||
file_share_process(file_name, image_name, publish_file_process, error_callback, progress_callback);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
// Update publish ugc steps:
|
||||
// 1. Save new file and image to Steam Cloud.
|
||||
// 2. Share file and images.
|
||||
// 3. Update published file.
|
||||
greenworks.ugcPublishUpdate = function (
|
||||
published_file_id,
|
||||
file_name,
|
||||
title,
|
||||
description,
|
||||
image_name,
|
||||
success_callback,
|
||||
error_callback,
|
||||
progress_callback,
|
||||
) {
|
||||
var update_published_file_process = function () {
|
||||
if (progress_callback) progress_callback("Completed on sharing files.");
|
||||
greenworks.updatePublishedWorkshopFile(
|
||||
published_file_id,
|
||||
file_name,
|
||||
image_name,
|
||||
title,
|
||||
description,
|
||||
function () {
|
||||
success_callback();
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
greenworks.saveFilesToCloud(
|
||||
[file_name, image_name],
|
||||
function () {
|
||||
file_share_process(file_name, image_name, update_published_file_process, error_callback, progress_callback);
|
||||
},
|
||||
function (err) {
|
||||
error_process(err, error_callback);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
// Greenworks Utils APIs implmentation.
|
||||
greenworks.Utils.move = function (source_dir, target_dir, success_callback, error_callback) {
|
||||
fs.rename(source_dir, target_dir, function (err) {
|
||||
if (err) {
|
||||
if (error_callback) error_callback(err);
|
||||
return;
|
||||
}
|
||||
if (success_callback) success_callback();
|
||||
});
|
||||
};
|
||||
|
||||
greenworks.init = function () {
|
||||
if (this.initAPI()) return true;
|
||||
if (!this.isSteamRunning()) throw new Error("Steam initialization failed. Steam is not running.");
|
||||
var appId;
|
||||
try {
|
||||
appId = fs.readFileSync("steam_appid.txt", "utf8");
|
||||
} catch (e) {
|
||||
throw new Error(
|
||||
"Steam initialization failed. Steam is running," +
|
||||
"but steam_appid.txt is missing. Expected to find it in: " +
|
||||
require("path").resolve("steam_appid.txt"),
|
||||
);
|
||||
}
|
||||
if (!/^\d+ *\r?\n?$/.test(appId)) {
|
||||
throw new Error(
|
||||
"Steam initialization failed. " +
|
||||
"steam_appid.txt appears to be invalid; " +
|
||||
"it should contain a numeric ID: " +
|
||||
appId,
|
||||
);
|
||||
}
|
||||
throw new Error(
|
||||
"Steam initialization failed, but Steam is running, " +
|
||||
"and steam_appid.txt is present and valid." +
|
||||
"Maybe that's not really YOUR app ID? " +
|
||||
appId.trim(),
|
||||
);
|
||||
};
|
||||
|
||||
var EventEmitter = require("events").EventEmitter;
|
||||
greenworks.__proto__ = EventEmitter.prototype;
|
||||
EventEmitter.call(greenworks);
|
||||
|
||||
greenworks._steam_events.on = function () {
|
||||
greenworks.emit.apply(greenworks, arguments);
|
||||
};
|
||||
|
||||
process.versions["greenworks"] = greenworks._version;
|
||||
|
||||
module.exports = greenworks;
|
||||
|
@ -25,7 +25,7 @@ process.on("uncaughtException", function () {
|
||||
|
||||
// We want to fail gracefully if we cannot connect to Steam
|
||||
try {
|
||||
if (greenworks.init()) {
|
||||
if (greenworks && greenworks.init()) {
|
||||
log.info("Steam API has been initialized.");
|
||||
} else {
|
||||
const error = "Steam API has failed to initialize.";
|
||||
|
@ -8,6 +8,39 @@ const storage = require("./storage");
|
||||
const config = new Config();
|
||||
|
||||
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([
|
||||
{
|
||||
label: "File",
|
||||
@ -289,45 +322,45 @@ function getMenu(window) {
|
||||
submenu: [
|
||||
{
|
||||
label: "Zoom In",
|
||||
enabled: utils.getZoomFactor() <= 2,
|
||||
enabled: canZoomIn,
|
||||
accelerator: "CommandOrControl+numadd",
|
||||
click: () => {
|
||||
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");
|
||||
}
|
||||
},
|
||||
click: zoomIn,
|
||||
},
|
||||
{
|
||||
label: "Zoom In (non numpad)",
|
||||
enabled: canZoomIn,
|
||||
visible: false,
|
||||
accelerator: "CommandOrControl+Plus",
|
||||
acceleratorWorksWhenHidden: true,
|
||||
click: zoomIn,
|
||||
},
|
||||
{
|
||||
label: "Zoom Out",
|
||||
enabled: utils.getZoomFactor() >= 0.5,
|
||||
enabled: canZoomOut,
|
||||
accelerator: "CommandOrControl+numsub",
|
||||
click: () => {
|
||||
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");
|
||||
}
|
||||
},
|
||||
click: zoomOut,
|
||||
},
|
||||
{
|
||||
label: "Zoom Out (non numpad)",
|
||||
enabled: canZoomOut,
|
||||
accelerator: "CommandOrControl+-",
|
||||
visible: false,
|
||||
acceleratorWorksWhenHidden: true,
|
||||
click: zoomOut,
|
||||
},
|
||||
{
|
||||
label: "Reset Zoom",
|
||||
enabled: utils.getZoomFactor() !== 1,
|
||||
enabled: canResetZoom,
|
||||
accelerator: "CommandOrControl+num0",
|
||||
click: () => {
|
||||
utils.setZoomFactor(window, 1);
|
||||
refreshMenu(window);
|
||||
log.log("Reset zoom");
|
||||
},
|
||||
click: resetZoom,
|
||||
},
|
||||
{
|
||||
label: "Reset Zoom (non numpad)",
|
||||
enabled: canResetZoom,
|
||||
accelerator: "CommandOrControl+0",
|
||||
visible: false,
|
||||
acceleratorWorksWhenHidden: true,
|
||||
click: resetZoom,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
4
electron/package-lock.json
generated
4
electron/package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "1.0.0",
|
||||
"version": "1.6.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bitburner",
|
||||
"version": "1.0.0",
|
||||
"version": "1.6.4",
|
||||
"dependencies": {
|
||||
"electron-config": "^2.0.0",
|
||||
"electron-log": "^4.4.4",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "1.0.0",
|
||||
"version": "1.6.4",
|
||||
"description": "A cyberpunk-themed programming incremental game",
|
||||
"main": "main.js",
|
||||
"author": "Daniel Xie & Olivier Gagnon",
|
||||
|
@ -73,5 +73,5 @@
|
||||
<link rel="shortcut icon" href="favicon.ico"></head>
|
||||
<body>
|
||||
<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>
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
6
markdown/bitburner.activefragment.avgcharge.md → markdown/bitburner.activefragment.highestcharge.md
6
markdown/bitburner.activefragment.avgcharge.md → markdown/bitburner.activefragment.highestcharge.md
@ -1,11 +1,11 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ActiveFragment](./bitburner.activefragment.md) > [avgCharge](./bitburner.activefragment.avgcharge.md)
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ActiveFragment](./bitburner.activefragment.md) > [highestCharge](./bitburner.activefragment.highestcharge.md)
|
||||
|
||||
## ActiveFragment.avgCharge property
|
||||
## ActiveFragment.highestCharge property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
avgCharge: number;
|
||||
highestCharge: number;
|
||||
```
|
@ -15,7 +15,7 @@ export interface ActiveFragment
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [avgCharge](./bitburner.activefragment.avgcharge.md) | number | |
|
||||
| [highestCharge](./bitburner.activefragment.highestcharge.md) | number | |
|
||||
| [id](./bitburner.activefragment.id.md) | number | |
|
||||
| [numCharge](./bitburner.activefragment.numcharge.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 |
|
||||
| [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 |
|
||||
| [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. |
|
||||
| [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. |
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) > [PurchasedServerSoftCap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md)
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) > [PurchasedServerSoftcap](./bitburner.bitnodemultipliers.purchasedserversoftcap.md)
|
||||
|
||||
## BitNodeMultipliers.PurchasedServerSoftCap property
|
||||
## BitNodeMultipliers.PurchasedServerSoftcap property
|
||||
|
||||
Influences cost of any purchased server at or above 128GB
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
PurchasedServerSoftCap: number;
|
||||
PurchasedServerSoftcap: number;
|
||||
```
|
||||
|
13
markdown/bitburner.characterinfo.agilityexp.md
Normal file
13
markdown/bitburner.characterinfo.agilityexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [agilityExp](./bitburner.characterinfo.agilityexp.md)
|
||||
|
||||
## CharacterInfo.agilityExp property
|
||||
|
||||
total agility exp
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
agilityExp: number;
|
||||
```
|
13
markdown/bitburner.characterinfo.charismaexp.md
Normal file
13
markdown/bitburner.characterinfo.charismaexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [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) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [company](./bitburner.characterinfo.company.md)
|
||||
|
||||
## CharacterInfo.company property
|
||||
|
||||
Array of all companies at which you have jobs
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
company: string[];
|
||||
```
|
13
markdown/bitburner.characterinfo.defenseexp.md
Normal file
13
markdown/bitburner.characterinfo.defenseexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [defenseExp](./bitburner.characterinfo.defenseexp.md)
|
||||
|
||||
## CharacterInfo.defenseExp property
|
||||
|
||||
total defense exp
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
defenseExp: number;
|
||||
```
|
13
markdown/bitburner.characterinfo.dexterityexp.md
Normal file
13
markdown/bitburner.characterinfo.dexterityexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [dexterityExp](./bitburner.characterinfo.dexterityexp.md)
|
||||
|
||||
## CharacterInfo.dexterityExp property
|
||||
|
||||
total dexterity exp
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
dexterityExp: number;
|
||||
```
|
13
markdown/bitburner.characterinfo.hackingexp.md
Normal file
13
markdown/bitburner.characterinfo.hackingexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [hackingExp](./bitburner.characterinfo.hackingexp.md)
|
||||
|
||||
## CharacterInfo.hackingExp property
|
||||
|
||||
total hacking exp
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
hackingExp: number;
|
||||
```
|
13
markdown/bitburner.characterinfo.jobs.md
Normal file
13
markdown/bitburner.characterinfo.jobs.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [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. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [jobTitle](./bitburner.characterinfo.jobtitle.md)
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [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'
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
jobTitle: string[];
|
||||
jobTitles: string[];
|
||||
```
|
@ -15,14 +15,20 @@ export interface CharacterInfo
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [agilityExp](./bitburner.characterinfo.agilityexp.md) | number | total agility exp |
|
||||
| [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 |
|
||||
| [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 |
|
||||
| [hackingExp](./bitburner.characterinfo.hackingexp.md) | number | total hacking exp |
|
||||
| [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 |
|
||||
| [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 |
|
||||
| [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 |
|
||||
|
13
markdown/bitburner.characterinfo.strengthexp.md
Normal file
13
markdown/bitburner.characterinfo.strengthexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterInfo](./bitburner.characterinfo.md) > [strengthExp](./bitburner.characterinfo.strengthexp.md)
|
||||
|
||||
## CharacterInfo.strengthExp property
|
||||
|
||||
total strength exp
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
strengthExp: number;
|
||||
```
|
13
markdown/bitburner.charactermult.charisma.md
Normal file
13
markdown/bitburner.charactermult.charisma.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterMult](./bitburner.charactermult.md) > [charisma](./bitburner.charactermult.charisma.md)
|
||||
|
||||
## CharacterMult.charisma property
|
||||
|
||||
Charisma stat
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
charisma: number;
|
||||
```
|
13
markdown/bitburner.charactermult.charismaexp.md
Normal file
13
markdown/bitburner.charactermult.charismaexp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [CharacterMult](./bitburner.charactermult.md) > [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 |
|
||||
| [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 |
|
||||
| [crimeMoney](./bitburner.charactermult.crimemoney.md) | number | Money earned from crimes |
|
||||
| [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 |
|
||||
| [hacknetNodes](./bitburner.formulas.hacknetnodes.md) | [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | Hacknet Nodes 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 |
|
||||
|
||||
|
13
markdown/bitburner.formulas.reputation.md
Normal file
13
markdown/bitburner.formulas.reputation.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Formulas](./bitburner.formulas.md) > [reputation](./bitburner.formulas.reputation.md)
|
||||
|
||||
## Formulas.reputation property
|
||||
|
||||
Reputation formulas
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
reputation: ReputationFormulas;
|
||||
```
|
25
markdown/bitburner.grafting.getgraftableaugmentations.md
Normal file
25
markdown/bitburner.grafting.getgraftableaugmentations.md
Normal file
@ -0,0 +1,25 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Grafting](./bitburner.grafting.md) > [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. |
|
||||
| [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. |
|
||||
|
||||
|
@ -39,7 +39,7 @@ Returns the number of hashes required for the specified upgrade. The name of the
|
||||
// NS1:
|
||||
var upgradeName = "Sell for Corporation Funds";
|
||||
if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
|
||||
hacknet.spendHashes(upgName);
|
||||
hacknet.spendHashes(upgradeName);
|
||||
}
|
||||
```
|
||||
|
||||
@ -50,7 +50,7 @@ if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
|
||||
// NS2:
|
||||
const upgradeName = "Sell for Corporation Funds";
|
||||
if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {
|
||||
ns.hacknet.spendHashes(upgName);
|
||||
ns.hacknet.spendHashes(upgradeName);
|
||||
}
|
||||
```
|
||||
|
||||
|
13
markdown/bitburner.material.cmp.md
Normal file
13
markdown/bitburner.material.cmp.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Material](./bitburner.material.md) > [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;
|
||||
```
|
13
markdown/bitburner.material.dmd.md
Normal file
13
markdown/bitburner.material.dmd.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Material](./bitburner.material.md) > [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 |
|
||||
| --- | --- | --- |
|
||||
| [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 |
|
||||
| [prod](./bitburner.material.prod.md) | number | Amount of material produced |
|
||||
| [qlt](./bitburner.material.qlt.md) | number | Quality of the material |
|
||||
|
@ -10,6 +10,7 @@
|
||||
| --- | --- |
|
||||
| [OrderTypes](./bitburner.ordertypes.md) | |
|
||||
| [PositionTypes](./bitburner.positiontypes.md) | |
|
||||
| [ToastVariant](./bitburner.toastvariant.md) | |
|
||||
|
||||
## Interfaces
|
||||
|
||||
@ -59,12 +60,15 @@
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [OfficeAPI](./bitburner.officeapi.md) | Corporation Office API |
|
||||
| [Player](./bitburner.player.md) | |
|
||||
| [PlayerSkills](./bitburner.playerskills.md) | Short summary of the players skills. |
|
||||
| [ProcessInfo](./bitburner.processinfo.md) | A single process on a server. |
|
||||
| [Product](./bitburner.product.md) | Product in a warehouse |
|
||||
| [RecentScript](./bitburner.recentscript.md) | |
|
||||
| [ReputationFormulas](./bitburner.reputationformulas.md) | Reputation formulas |
|
||||
| [RunningScript](./bitburner.runningscript.md) | |
|
||||
| [Server](./bitburner.server.md) | A single server. |
|
||||
| [Singularity](./bitburner.singularity.md) | Singularity API |
|
||||
@ -88,4 +92,5 @@
|
||||
| Type Alias | Description |
|
||||
| --- | --- |
|
||||
| [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>
|
||||
|
||||
```typescript
|
||||
asleep(millis: number): Promise<void>;
|
||||
asleep(millis: number): Promise<true>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -20,7 +20,7 @@ asleep(millis: number): Promise<void>;
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<void>
|
||||
Promise<true>
|
||||
|
||||
|
||||
## Remarks
|
||||
|
11
markdown/bitburner.ns.enums.md
Normal file
11
markdown/bitburner.ns.enums.md
Normal file
@ -0,0 +1,11 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [enums](./bitburner.ns.enums.md)
|
||||
|
||||
## NS.enums property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
enums: NSEnums;
|
||||
```
|
35
markdown/bitburner.ns.getrecentscripts.md
Normal file
35
markdown/bitburner.ns.getrecentscripts.md
Normal file
@ -0,0 +1,35 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [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>
|
||||
|
||||
```typescript
|
||||
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript;
|
||||
getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string | number)[]): RunningScript | null;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -22,7 +22,7 @@ getRunningScript(filename?: FilenameOrPID, hostname?: string, ...args: (string |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
[RunningScript](./bitburner.runningscript.md)
|
||||
[RunningScript](./bitburner.runningscript.md) \| null
|
||||
|
||||
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>
|
||||
|
||||
```typescript
|
||||
growthAnalyzeSecurity(threads: number): number;
|
||||
growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -17,6 +17,8 @@ growthAnalyzeSecurity(threads: number): number;
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| 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>
|
||||
|
||||
|
@ -9,7 +9,7 @@ Get the security increase for a number of thread.
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
hackAnalyzeSecurity(threads: number): number;
|
||||
hackAnalyzeSecurity(threads: number, hostname?: string): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -17,6 +17,7 @@ hackAnalyzeSecurity(threads: number): number;
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| 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>
|
||||
|
||||
|
@ -9,9 +9,8 @@ Collection of all functions passed to scripts
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export interface NS extends Singularity
|
||||
export interface NS
|
||||
```
|
||||
<b>Extends:</b> [Singularity](./bitburner.singularity.md)
|
||||
|
||||
## Remarks
|
||||
|
||||
@ -45,10 +44,12 @@ export async function main(ns) {
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
@ -88,6 +89,7 @@ export async function main(ns) {
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
@ -113,11 +115,11 @@ export async function main(ns) {
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
|
13
markdown/bitburner.ns.singularity.md
Normal file
13
markdown/bitburner.ns.singularity.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [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>
|
||||
|
||||
```typescript
|
||||
sleep(millis: number): Promise<void>;
|
||||
sleep(millis: number): Promise<true>;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -20,7 +20,7 @@ sleep(millis: number): Promise<void>;
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
Promise<void>
|
||||
Promise<true>
|
||||
|
||||
|
||||
## Remarks
|
||||
|
@ -9,7 +9,7 @@ Queue a toast (bottom-right notification).
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
toast(msg: any, variant?: string, duration?: number | null): void;
|
||||
toast(msg: any, variant?: ToastVariantValues, duration?: number | null): void;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -17,7 +17,7 @@ toast(msg: any, variant?: string, duration?: number | null): void;
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| 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 |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
19
markdown/bitburner.nsenums.md
Normal file
19
markdown/bitburner.nsenums.md
Normal file
@ -0,0 +1,19 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [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) | |
|
||||
|
11
markdown/bitburner.nsenums.toast.md
Normal file
11
markdown/bitburner.nsenums.toast.md
Normal file
@ -0,0 +1,11 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [NSEnums](./bitburner.nsenums.md) > [toast](./bitburner.nsenums.toast.md)
|
||||
|
||||
## NSEnums.toast property
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
toast: typeof ToastVariant;
|
||||
```
|
13
markdown/bitburner.office.employeejobs.md
Normal file
13
markdown/bitburner.office.employeejobs.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Office](./bitburner.office.md) > [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
|
||||
|
||||
Positions of the employees
|
||||
Production of the employees
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
@ -16,7 +16,8 @@ interface Office
|
||||
|
||||
| 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 |
|
||||
| [loc](./bitburner.office.loc.md) | string | City of the office |
|
||||
| [maxEne](./bitburner.office.maxene.md) | number | Maximum amount of energy of the employees |
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
## Product.cmp property
|
||||
|
||||
Competition for the product
|
||||
Competition for the product, only present if "Market Research - Competition" unlocked
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
cmp: number;
|
||||
cmp: number | undefined;
|
||||
```
|
||||
|
@ -4,10 +4,10 @@
|
||||
|
||||
## Product.dmd property
|
||||
|
||||
Demand for the product
|
||||
Demand for the product, only present if "Market Research - Demand" unlocked
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
dmd: number;
|
||||
dmd: number | undefined;
|
||||
```
|
||||
|
@ -17,10 +17,12 @@ interface Product
|
||||
| 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\] |
|
||||
| [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 |
|
||||
| [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 |
|
||||
| [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" |
|
||||
|
||||
|
13
markdown/bitburner.product.properties.md
Normal file
13
markdown/bitburner.product.properties.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Product](./bitburner.product.md) > [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 };
|
||||
```
|
13
markdown/bitburner.product.rat.md
Normal file
13
markdown/bitburner.product.rat.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [Product](./bitburner.product.md) > [rat](./bitburner.product.rat.md)
|
||||
|
||||
## Product.rat property
|
||||
|
||||
Product Rating
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
rat: number;
|
||||
```
|
20
markdown/bitburner.recentscript.md
Normal file
20
markdown/bitburner.recentscript.md
Normal file
@ -0,0 +1,20 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [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 |
|
||||
|
13
markdown/bitburner.recentscript.timeofdeath.md
Normal file
13
markdown/bitburner.recentscript.timeofdeath.md
Normal file
@ -0,0 +1,13 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [RecentScript](./bitburner.recentscript.md) > [timeOfDeath](./bitburner.recentscript.timeofdeath.md)
|
||||
|
||||
## RecentScript.timeOfDeath property
|
||||
|
||||
Timestamp of when the script was killed
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
timeOfDeath: Date;
|
||||
```
|
26
markdown/bitburner.reputationformulas.calculatefavortorep.md
Normal file
26
markdown/bitburner.reputationformulas.calculatefavortorep.md
Normal file
@ -0,0 +1,26 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ReputationFormulas](./bitburner.reputationformulas.md) > [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.
|
||||
|
26
markdown/bitburner.reputationformulas.calculatereptofavor.md
Normal file
26
markdown/bitburner.reputationformulas.calculatereptofavor.md
Normal file
@ -0,0 +1,26 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ReputationFormulas](./bitburner.reputationformulas.md) > [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.
|
||||
|
21
markdown/bitburner.reputationformulas.md
Normal file
21
markdown/bitburner.reputationformulas.md
Normal file
@ -0,0 +1,21 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [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
|
||||
|
||||
Arguments the script was called with
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.filename property
|
||||
|
||||
Filename of the script
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## 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>
|
||||
|
||||
```typescript
|
||||
|
@ -8,24 +8,24 @@
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
interface RunningScript
|
||||
export interface RunningScript
|
||||
```
|
||||
|
||||
## Properties
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| [args](./bitburner.runningscript.args.md) | string\[\] | |
|
||||
| [filename](./bitburner.runningscript.filename.md) | string | |
|
||||
| [logs](./bitburner.runningscript.logs.md) | string\[\] | |
|
||||
| [offlineExpGained](./bitburner.runningscript.offlineexpgained.md) | number | |
|
||||
| [offlineMoneyMade](./bitburner.runningscript.offlinemoneymade.md) | number | |
|
||||
| [offlineRunningTime](./bitburner.runningscript.offlinerunningtime.md) | number | Offline running time of the script, in seconds \* |
|
||||
| [onlineExpGained](./bitburner.runningscript.onlineexpgained.md) | number | |
|
||||
| [onlineMoneyMade](./bitburner.runningscript.onlinemoneymade.md) | number | |
|
||||
| [onlineRunningTime](./bitburner.runningscript.onlinerunningtime.md) | number | Online running time of the script, in seconds \* |
|
||||
| [pid](./bitburner.runningscript.pid.md) | number | |
|
||||
| [ramUsage](./bitburner.runningscript.ramusage.md) | number | |
|
||||
| [server](./bitburner.runningscript.server.md) | string | |
|
||||
| [threads](./bitburner.runningscript.threads.md) | number | |
|
||||
| [args](./bitburner.runningscript.args.md) | string\[\] | Arguments the script was called with |
|
||||
| [filename](./bitburner.runningscript.filename.md) | string | Filename of the script |
|
||||
| [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 | Total amount of hacking experience earned from this script when offline |
|
||||
| [offlineMoneyMade](./bitburner.runningscript.offlinemoneymade.md) | number | Total amount of money made by this script when offline |
|
||||
| [offlineRunningTime](./bitburner.runningscript.offlinerunningtime.md) | number | Number of seconds that the script has been running offline |
|
||||
| [onlineExpGained](./bitburner.runningscript.onlineexpgained.md) | number | Total amount of hacking experience earned from this script when online |
|
||||
| [onlineMoneyMade](./bitburner.runningscript.onlinemoneymade.md) | number | Total amount of money made by this script when online |
|
||||
| [onlineRunningTime](./bitburner.runningscript.onlinerunningtime.md) | number | Number of seconds that this script has been running online |
|
||||
| [pid](./bitburner.runningscript.pid.md) | number | Process ID. Must be an integer |
|
||||
| [ramUsage](./bitburner.runningscript.ramusage.md) | number | How much RAM this script uses for ONE thread |
|
||||
| [server](./bitburner.runningscript.server.md) | string | Hostname of the server on which this script runs |
|
||||
| [threads](./bitburner.runningscript.threads.md) | number | Number of threads that this script runs with |
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.offlineExpGained property
|
||||
|
||||
Total amount of hacking experience earned from this script when offline
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.offlineMoneyMade property
|
||||
|
||||
Total amount of money made by this script when offline
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## RunningScript.offlineRunningTime property
|
||||
|
||||
Offline running time of the script, in seconds \*
|
||||
Number of seconds that the script has been running offline
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.onlineExpGained property
|
||||
|
||||
Total amount of hacking experience earned from this script when online
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.onlineMoneyMade property
|
||||
|
||||
Total amount of money made by this script when online
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## RunningScript.onlineRunningTime property
|
||||
|
||||
Online running time of the script, in seconds \*
|
||||
Number of seconds that this script has been running online
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.pid property
|
||||
|
||||
Process ID. Must be an integer
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.ramUsage property
|
||||
|
||||
How much RAM this script uses for ONE thread
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.server property
|
||||
|
||||
Hostname of the server on which this script runs
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,6 +4,8 @@
|
||||
|
||||
## RunningScript.threads property
|
||||
|
||||
Number of threads that this script runs with
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -9,13 +9,11 @@ Hospitalize the player.
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
hospitalize(): number;
|
||||
hospitalize(): void;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
number
|
||||
|
||||
The cost of the hospitalization.
|
||||
void
|
||||
|
||||
## Remarks
|
||||
|
||||
|
@ -9,7 +9,7 @@ Set a sleeve to work for a faction.
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean;
|
||||
setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
@ -22,9 +22,9 @@ setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: str
|
||||
|
||||
<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
|
||||
|
||||
|
22
markdown/bitburner.toastvariant.md
Normal file
22
markdown/bitburner.toastvariant.md
Normal file
@ -0,0 +1,22 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ToastVariant](./bitburner.toastvariant.md)
|
||||
|
||||
## ToastVariant enum
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export enum ToastVariant
|
||||
```
|
||||
|
||||
## Enumeration Members
|
||||
|
||||
| Member | Value | Description |
|
||||
| --- | --- | --- |
|
||||
| ERROR | <code>"error"</code> | |
|
||||
| INFO | <code>"info"</code> | |
|
||||
| SUCCESS | <code>"success"</code> | |
|
||||
| WARNING | <code>"warning"</code> | |
|
||||
|
14
markdown/bitburner.toastvariantvalues.md
Normal file
14
markdown/bitburner.toastvariantvalues.md
Normal file
@ -0,0 +1,14 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [ToastVariantValues](./bitburner.toastvariantvalues.md)
|
||||
|
||||
## ToastVariantValues type
|
||||
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
export type ToastVariantValues = `${ToastVariant}`;
|
||||
```
|
||||
<b>References:</b> [ToastVariant](./bitburner.toastvariant.md)
|
||||
|
30
package-lock.json
generated
30
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.4",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "bitburner",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.4",
|
||||
"hasInstallScript": true,
|
||||
"license": "SEE LICENSE IN license.txt",
|
||||
"dependencies": {
|
||||
@ -5965,13 +5965,19 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001265",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz",
|
||||
"integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/browserslist"
|
||||
}
|
||||
"version": "1.0.30001328",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz",
|
||||
"integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/browserslist"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/caseless": {
|
||||
"version": "0.12.0",
|
||||
@ -26994,9 +27000,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"caniuse-lite": {
|
||||
"version": "1.0.30001265",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001265.tgz",
|
||||
"integrity": "sha512-YzBnspggWV5hep1m9Z6sZVLOt7vrju8xWooFAgN6BA5qvy98qPAPb7vNUzypFaoh2pb3vlfzbDO8tB57UPGbtw=="
|
||||
"version": "1.0.30001328",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001328.tgz",
|
||||
"integrity": "sha512-Ue55jHkR/s4r00FLNiX+hGMMuwml/QGqqzVeMQ5thUewznU2EdULFvI3JR7JJid6OrjJNfFvHY2G2dIjmRaDDQ=="
|
||||
},
|
||||
"caseless": {
|
||||
"version": "0.12.0",
|
||||
|
15
package.json
15
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bitburner",
|
||||
"license": "SEE LICENSE IN license.txt",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.4",
|
||||
"main": "electron-main.js",
|
||||
"author": {
|
||||
"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",
|
||||
"format": "prettier --write .",
|
||||
"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:dev": "webpack-dev-server --progress --env.devServer --mode development",
|
||||
"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",
|
||||
"build": "webpack --mode production",
|
||||
"build:dev": "webpack --mode development",
|
||||
"lint": "eslint --fix . --ext js,jsx,ts,tsx",
|
||||
"lint:report": "eslint --ext js,jsx,ts,tsx .",
|
||||
"lint": "eslint --fix --ext js,jsx,ts,tsx --max-warnings 0 .",
|
||||
"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",
|
||||
"postinstall": "cd electron && npm install",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"watch": "webpack --watch --mode production",
|
||||
"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-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-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",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
31
package.sh
31
package.sh
@ -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}
|
||||
<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 = "";
|
||||
|
||||
// Whether the player owns this Augmentation
|
||||
owned = false;
|
||||
|
||||
// Array of names of all prerequisites
|
||||
prereqs: string[] = [];
|
||||
|
||||
|
@ -1488,12 +1488,18 @@ export const initGeneralAugmentations = (): Augmentation[] => [
|
||||
// Grafting-exclusive Augmentation
|
||||
new Augmentation({
|
||||
name: AugmentationNames.CongruityImplant,
|
||||
repCost: 0,
|
||||
repCost: Infinity,
|
||||
moneyCost: 50e12,
|
||||
info:
|
||||
"Developed by a pioneer in Grafting research, this implant " +
|
||||
"generates pulses of stability which seem to have a nullifying " +
|
||||
"effect versus the Entropy virus.",
|
||||
info: (
|
||||
<>
|
||||
Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a
|
||||
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.</>,
|
||||
factions: [],
|
||||
}),
|
||||
|
@ -8,7 +8,6 @@ import { CONSTANTS } from "../Constants";
|
||||
import { Factions, factionExists } from "../Faction/Factions";
|
||||
import { Player } from "../Player";
|
||||
import { prestigeAugmentation } from "../Prestige";
|
||||
import { SourceFileFlags } from "../SourceFile/SourceFileFlags";
|
||||
|
||||
import { dialogBoxCreate } from "../ui/React/DialogBox";
|
||||
import { clearObject } from "../utils/helpers/clearObject";
|
||||
@ -21,6 +20,7 @@ import {
|
||||
initNeuroFluxGovernor,
|
||||
initUnstableCircadianModulator,
|
||||
} from "./AugmentationCreator";
|
||||
import { Router } from "../ui/GameRoot";
|
||||
|
||||
export function AddToAugmentations(aug: Augmentation): void {
|
||||
const name = aug.name;
|
||||
@ -72,7 +72,7 @@ function initAugmentations(): void {
|
||||
}
|
||||
|
||||
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 {
|
||||
return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length);
|
||||
@ -117,8 +117,6 @@ function resetAugmentation(aug: Augmentation): void {
|
||||
}
|
||||
|
||||
function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {
|
||||
Augmentations[aug.name].owned = true;
|
||||
|
||||
const augObj = Augmentations[aug.name];
|
||||
|
||||
// Apply multipliers
|
||||
@ -194,6 +192,7 @@ function installAugmentations(force?: boolean): boolean {
|
||||
);
|
||||
}
|
||||
prestigeAugmentation();
|
||||
Router.toTerminal();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import React, { useState, useEffect } from "react";
|
||||
import { InstalledAugmentations } from "./InstalledAugmentations";
|
||||
import { PlayerMultipliers } from "./PlayerMultipliers";
|
||||
import { PurchasedAugmentations } from "./PurchasedAugmentations";
|
||||
import { SourceFiles } from "./SourceFiles";
|
||||
import { SourceFilesElement } from "./SourceFiles";
|
||||
|
||||
import { canGetBonus } from "../../ExportBonus";
|
||||
import { use } from "../../ui/Context";
|
||||
@ -16,8 +16,55 @@ import Typography from "@mui/material/Typography";
|
||||
import Button from "@mui/material/Button";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import Box from "@mui/material/Box";
|
||||
import Paper from "@mui/material/Paper";
|
||||
import Container from "@mui/material/Container";
|
||||
import { Settings } from "../../Settings/Settings";
|
||||
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 {
|
||||
exportGameFn: () => void;
|
||||
@ -55,81 +102,113 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Container disableGutters maxWidth="lg" sx={{ mx: 0 }}>
|
||||
<Typography variant="h4">Augmentations</Typography>
|
||||
<Box mx={2}>
|
||||
<Typography>
|
||||
Below is a list of all Augmentations you have purchased but not yet installed. Click the button below to
|
||||
install them.
|
||||
</Typography>
|
||||
<Typography>WARNING: Installing your Augmentations resets most of your progress, including:</Typography>
|
||||
<br />
|
||||
<Typography>- Stats/Skill levels and Experience</Typography>
|
||||
<Typography>- Money</Typography>
|
||||
<Typography>- Scripts on every computer but your home computer</Typography>
|
||||
<Typography>- Purchased servers</Typography>
|
||||
<Typography>- Hacknet Nodes</Typography>
|
||||
<Typography>- Faction/Company reputation</Typography>
|
||||
<Typography>- Stocks</Typography>
|
||||
<br />
|
||||
<Typography>
|
||||
Installing Augmentations lets you start over with the perks and benefits granted by all of the Augmentations
|
||||
you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your home computer (but you
|
||||
will lose all programs besides NUKE.exe)
|
||||
</Typography>
|
||||
<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>
|
||||
Below is a list of all Augmentations you have purchased but not yet installed. Click the button
|
||||
below to install them.
|
||||
</Typography>
|
||||
<Typography>
|
||||
WARNING: Installing your Augmentations resets most of your progress, including:
|
||||
</Typography>
|
||||
<br />
|
||||
<Typography>- Stats/Skill levels and Experience</Typography>
|
||||
<Typography>- Money</Typography>
|
||||
<Typography>- Scripts on every computer but your home computer</Typography>
|
||||
<Typography>- Purchased servers</Typography>
|
||||
<Typography>- Hacknet Nodes</Typography>
|
||||
<Typography>- Faction/Company reputation</Typography>
|
||||
<Typography>- Stocks</Typography>
|
||||
<br />
|
||||
<Typography>
|
||||
Installing Augmentations lets you start over with the perks and benefits granted by all of the
|
||||
Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your
|
||||
home computer (but you will lose all programs besides NUKE.exe)
|
||||
</Typography>
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Info sx={{ ml: 1, mb: 0.5 }} color="info" />
|
||||
</Tooltip>
|
||||
</Typography>
|
||||
<ConfirmationModal
|
||||
open={installOpen}
|
||||
onClose={() => setInstallOpen(false)}
|
||||
onConfirm={props.installAugmentationsFn}
|
||||
confirmationText={
|
||||
<>
|
||||
Installing will reset
|
||||
<br />
|
||||
<br />- money
|
||||
<br />- skill / experience
|
||||
<br />- every server except home
|
||||
<br />- factions and reputation
|
||||
<br />
|
||||
<br />
|
||||
You will keep:
|
||||
<br />
|
||||
<br />- All scripts on home
|
||||
<br />- home ram and cores
|
||||
<br />
|
||||
<br />
|
||||
It is recommended to install several Augmentations at once. Preferably everything from any faction of
|
||||
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>}>
|
||||
<Button sx={{ width: "100%" }} onClick={doExport} color="error">
|
||||
Backup Save {exportBonusStr()}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
</Paper>
|
||||
{player.queuedAugmentations.length > 0 ? (
|
||||
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 3fr" }}>
|
||||
<PurchasedAugmentations />
|
||||
<PlayerMultipliers />
|
||||
</Box>
|
||||
) : (
|
||||
<Paper sx={{ p: 1 }}>
|
||||
<Typography>No Augmentations have been purchased yet</Typography>
|
||||
</Paper>
|
||||
)}
|
||||
</Box>
|
||||
<Typography variant="h4" color="primary">
|
||||
Purchased Augmentations
|
||||
</Typography>
|
||||
<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>
|
||||
<ConfirmationModal
|
||||
open={installOpen}
|
||||
onClose={() => setInstallOpen(false)}
|
||||
onConfirm={props.installAugmentationsFn}
|
||||
confirmationText={
|
||||
<>
|
||||
Installing will reset
|
||||
<br />
|
||||
<br />- money
|
||||
<br />- skill / experience
|
||||
<br />- every server except home
|
||||
<br />- factions and reputation
|
||||
<br />
|
||||
<br />
|
||||
You will keep:
|
||||
<br />
|
||||
<br />- All scripts on home
|
||||
<br />- home ram and cores
|
||||
<br />
|
||||
<br />
|
||||
It is recommended to install several Augmentations at once. Preferably everything from any faction of your
|
||||
choosing.
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<Tooltip title={<Typography>It's always a good idea to backup/export your save!</Typography>}>
|
||||
<Button sx={{ mx: 2 }} onClick={doExport} color="error">
|
||||
Backup Save {exportBonusStr()}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<PurchasedAugmentations />
|
||||
|
||||
<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>
|
||||
<Typography variant="h4">Installed Augmentations</Typography>
|
||||
<Box mx={2}>
|
||||
<Typography>
|
||||
List of all Augmentations that have been installed. You have gained the effects of these.
|
||||
</Typography>
|
||||
|
||||
<Box>
|
||||
<InstalledAugmentations />
|
||||
</Box>
|
||||
<PlayerMultipliers />
|
||||
<SourceFiles />
|
||||
</>
|
||||
<SourceFilesElement />
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
|
@ -5,28 +5,23 @@
|
||||
* It also contains 'configuration' buttons that allow you to change how the
|
||||
* 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 { AugmentationAccordion } from "../../ui/React/AugmentationAccordion";
|
||||
import { Augmentations } from "../Augmentations";
|
||||
import { AugmentationNames } from "../data/AugmentationNames";
|
||||
|
||||
import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums";
|
||||
import { Settings } from "../../Settings/Settings";
|
||||
import { use } from "../../ui/Context";
|
||||
import { OwnedAugmentationsOrderSetting } from "../../Settings/SettingEnums";
|
||||
import Button from "@mui/material/Button";
|
||||
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";
|
||||
import { Augmentations } from "../Augmentations";
|
||||
import { AugmentationNames } from "../data/AugmentationNames";
|
||||
|
||||
export function InstalledAugmentations(): React.ReactElement {
|
||||
const setRerender = useState(true)[1];
|
||||
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) {
|
||||
sourceAugs.sort((aug1, aug2) => {
|
||||
@ -49,59 +44,60 @@ export function InstalledAugmentations(): React.ReactElement {
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tooltip title={"Sorts the Augmentations alphabetically in numeral order"}>
|
||||
<Button onClick={sortInOrder}>Sort in Order</Button>
|
||||
</Tooltip>
|
||||
<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>
|
||||
</Tooltip>
|
||||
<List dense>
|
||||
{player.entropy > 0 &&
|
||||
(() => {
|
||||
const [open, setOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<Box component={Paper}>
|
||||
<ListItemButton onClick={() => setOpen((old) => !old)}>
|
||||
<ListItemText
|
||||
primary={
|
||||
<Typography color={Settings.theme.hp} style={{ whiteSpace: "pre-wrap" }}>
|
||||
Entropy Virus - Level {player.entropy}
|
||||
</Typography>
|
||||
}
|
||||
/>
|
||||
{open ? (
|
||||
<ExpandLess sx={{ color: Settings.theme.hp }} />
|
||||
) : (
|
||||
<ExpandMore sx={{ color: Settings.theme.hp }} />
|
||||
)}
|
||||
<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"}>
|
||||
<Button sx={{ width: "100%" }} onClick={sortInOrder}>
|
||||
Sort in Order
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip title={"Sorts the Augmentations based on when you acquired them (same as default)"}>
|
||||
<Button sx={{ width: "100%" }} onClick={sortByAcquirementTime}>
|
||||
Sort by Time of Acquirement
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Box>
|
||||
</Paper>
|
||||
{sourceAugs.length > 0 ? (
|
||||
<Paper sx={{ display: "grid", gridTemplateColumns: "1fr 3fr" }}>
|
||||
<Box>
|
||||
<List sx={{ height: 400, overflowY: "scroll", borderRight: `1px solid ${Settings.theme.welllight}` }}>
|
||||
{sourceAugs.map((k, i) => (
|
||||
<ListItemButton key={i + 1} onClick={() => setSelectedAug(k)} selected={selectedAug === k}>
|
||||
<Typography>{k.name}</Typography>
|
||||
</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>
|
||||
);
|
||||
})()}
|
||||
))}
|
||||
</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];
|
||||
|
||||
{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>
|
||||
</>
|
||||
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
Loading…
Reference in New Issue
Block a user