Compare commits

..

41 Commits

Author SHA1 Message Date
Snarling
c6141f2adf RELEASE: 2.5.2 (#990) 2023-12-26 10:59:33 -05:00
Snarling
2b7f6381eb Changelog update 2023-12-22 06:54:53 -05:00
Kelenius
5789003d46 Gave bit fluming its own message (#974) 2023-12-19 05:28:34 -05:00
Snarling
3a7ff7880d COMPANY: Show unqualified direct promotion (followup) (#983) 2023-12-19 05:27:26 -05:00
Snarling
09b74a3868 BLADEBURNER: Different solution for Enter key support in team member modal (#984) 2023-12-19 05:21:25 -05:00
Shockwave
28d1610bac Update Prestige.ts (#985) 2023-12-19 05:21:05 -05:00
Tibo De Peuter
1ce22e9788 MISC: Fix various typos (#982) 2023-12-18 08:21:47 -05:00
Jesse Clark
28ef5df880 COMPANY: Much better job location interface (#927) 2023-12-18 07:23:47 -05:00
Snarling
97d679bdac MISC: Protect against reassigning certain globals (#972) 2023-12-16 05:03:52 -05:00
Kelenius
da1b8533e0 Added "prev" and "next" buttons to job screen (#932) 2023-12-16 05:00:19 -05:00
Jesse Clark
417671ecb8 CORPORATION: Account for CapEx and Cap Gains differently (#977) 2023-12-16 04:56:57 -05:00
DJMatch3000
a6436ca4b3 MISC: Revert default HGW threads from 1 to number of script threads (#978) 2023-12-16 04:38:39 -05:00
Jesse Clark
473217ef31 API: Programming-friendly interface to getFactionInviteRequirements (#953) 2023-12-16 04:27:22 -05:00
TheAimMan
e957864c4b Fix missing check on singularity.getCurrentWork (#971) 2023-12-09 06:11:46 -05:00
Snarling
c6434e2297 Quick changelog update 2023-12-09 06:06:14 -05:00
Snarling
a3c26caf2c npm run doc 2023-12-07 21:26:28 -05:00
TheAimMan
5482848eeb SLEEVE: Add task counter to Crimes and BladeBurner (#930) 2023-12-07 21:24:50 -05:00
Jesse Clark
902306530c CORPORATION: Use accounting methods for all funds transactions (#949) 2023-12-07 21:22:21 -05:00
Snarling
b114fb9eed Changelog update 2023-12-07 21:20:58 -05:00
Jesse Clark
ecc63eb07e FACTIONS: Fix for faction names staying scrambled after joining (#968) 2023-12-07 20:53:28 -05:00
Kelenius
107b4e90e9 Changed message when buying tor router (#948) 2023-12-07 20:51:29 -05:00
David Walker
61ffed9b3a BUGFIX: Fix additionalMsec overflow issue (#941) 2023-12-07 20:34:49 -05:00
Sphyxis
21c7f56d23 TERMINAL: Updated Alias/Unalias (#914) 2023-12-07 20:15:55 -05:00
TheAimMan
89fc22f28f IMPROVEMENT: Apply core bonus for share and stanek (#913) 2023-12-07 20:10:21 -05:00
Jesse Clark
544c38065e DOC: Create factions-list documentation page (#904) 2023-12-07 20:07:01 -05:00
LJ
1ce0584b25 MISC: Switch port.nextWrite() from LIFO to FIFO (#965) 2023-12-07 18:00:01 -05:00
TheAimMan
375cf453b3 BUGFIX: Properly apply entropy to hacknet multiplers (#969) 2023-12-07 17:57:54 -05:00
catloversg
4dd4f920c3 Remove unused code in OfficeSpace (#961) 2023-12-07 07:55:30 -05:00
David Walker
019f2d6a11 DOCS: Add type of return for 3 formulas functions. (#967) 2023-12-07 07:33:15 -05:00
draughtnyan
b46b6e62bc Fix script autocompletion bug w/ subdirectories (#947) 2023-12-04 14:39:08 -05:00
Sphyxis
79b0f83b5f DEVMENU: Easier to add/remove sleeves (#908) 2023-12-04 14:36:00 -05:00
Kelenius
76f0f3d6d3 Remove inter-fragment borders in Stanek's gift (#929) 2023-12-03 04:55:13 -05:00
Sphyxis
3b4cac5584 BITVERSE: Updated BN 3 from easy to hard (#909) 2023-12-03 04:21:24 -05:00
Kelenius
aee353a54e Fix warehouse not updating after product sale (#925) 2023-12-03 04:13:06 -05:00
Shockwave
1dc4d01d64 Fix bug in SF9.3 reward server cpuCores (#938) 2023-12-03 04:12:20 -05:00
Jesse Clark
99383eb1c7 Only show "joining this faction will prevent you from joining enemies" for factions that have enemies (#921) 2023-12-03 04:07:59 -05:00
Jesse Clark
7fc46649f9 FACTIONS: fix unstable display order (#920) 2023-12-03 04:06:30 -05:00
Jesse Clark
34cc0441c2 Remove cooldown from "Sell corporation and start over" (#919) 2023-12-03 04:03:30 -05:00
Trambelus
f2baa04f45 CCT: Fewer money coding contracts if the reward would be $0 (#918) 2023-12-03 04:00:15 -05:00
Caldwell
8b6caeb68b STOCKMARKET: Added slight randomization to when stock forecasts can flip (#911) 2023-12-03 03:45:42 -05:00
Snarling
997ae8c176 Changelog reset for 2.5.2 dev cycle 2023-11-30 17:21:31 -05:00
177 changed files with 2986 additions and 1531 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "bitburner",
"version": "2.5.1",
"version": "2.5.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bitburner",
"version": "2.5.1",
"version": "2.5.2",
"dependencies": {
"electron-log": "^4.4.8",
"electron-store": "^8.1.0",

View File

@@ -1,6 +1,6 @@
{
"name": "bitburner",
"version": "2.5.1",
"version": "2.5.2",
"description": "A cyberpunk-themed programming incremental game",
"main": "main.js",
"author": "Daniel Xie, Olivier Gagnon, et al.",

View File

@@ -10,12 +10,13 @@ module.exports = {
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/test/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/test/__mocks__/styleMock.js",
"\\!!raw-loader!.*$": "<rootDir>/test/__mocks__/rawLoader.js",
"\\.(css|less)$": "<rootDir>/test/__mocks__/NullMock.js",
"\\!!raw-loader!.*$": "<rootDir>/test/__mocks__/NullMock.js",
"@player": "<rootDir>/src/Player",
"@enums": "<rootDir>/src/Enums",
"@nsdefs": "<rootDir>/src/ScriptEditor/NetscriptDefinitions",
"^monaco-editor$": "<rootDir>/test/__mocks__/monacoMock.js",
"^monaco-vim$": "<rootDir>/test/__mocks__/monacoMock.js",
"^monaco-editor$": "<rootDir>/test/__mocks__/NullMock.js",
"^monaco-vim$": "<rootDir>/test/__mocks__/NullMock.js",
"/utils/Protections$": "<rootDir>/test/__mocks__/NullMock.js",
},
};

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BackdoorRequirement](./bitburner.backdoorrequirement.md)
## BackdoorRequirement interface
Player must have installed a backdoor on this server.
**Signature:**
```typescript
interface BackdoorRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [server](./bitburner.backdoorrequirement.server.md) | | string | |
| [type](./bitburner.backdoorrequirement.type.md) | | "backdoorInstalled" | |

View File

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

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BackdoorRequirement](./bitburner.backdoorrequirement.md) &gt; [type](./bitburner.backdoorrequirement.type.md)
## BackdoorRequirement.type property
**Signature:**
```typescript
type: "backdoorInstalled";
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeRequirement](./bitburner.bitnoderequirement.md) &gt; [bitNodeN](./bitburner.bitnoderequirement.bitnoden.md)
## BitNodeRequirement.bitNodeN property
**Signature:**
```typescript
bitNodeN: number;
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeRequirement](./bitburner.bitnoderequirement.md)
## BitNodeRequirement interface
Player must be located in this BitNode.
**Signature:**
```typescript
interface BitNodeRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [bitNodeN](./bitburner.bitnoderequirement.bitnoden.md) | | number | |
| [type](./bitburner.bitnoderequirement.type.md) | | "bitNodeN" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BitNodeRequirement](./bitburner.bitnoderequirement.md) &gt; [type](./bitburner.bitnoderequirement.type.md)
## BitNodeRequirement.type property
**Signature:**
```typescript
type: "bitNodeN";
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BladeburnerRankRequirement](./bitburner.bladeburnerrankrequirement.md) &gt; [bladeburnerRank](./bitburner.bladeburnerrankrequirement.bladeburnerrank.md)
## BladeburnerRankRequirement.bladeburnerRank property
**Signature:**
```typescript
bladeburnerRank: number;
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BladeburnerRankRequirement](./bitburner.bladeburnerrankrequirement.md)
## BladeburnerRankRequirement interface
Player must have at least this rank in the Bladeburner Division.
**Signature:**
```typescript
interface BladeburnerRankRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [bladeburnerRank](./bitburner.bladeburnerrankrequirement.bladeburnerrank.md) | | number | |
| [type](./bitburner.bladeburnerrankrequirement.type.md) | | "bladeburnerRank" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [BladeburnerRankRequirement](./bitburner.bladeburnerrankrequirement.md) &gt; [type](./bitburner.bladeburnerrankrequirement.type.md)
## BladeburnerRankRequirement.type property
**Signature:**
```typescript
type: "bladeburnerRank";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CityRequirement](./bitburner.cityrequirement.md)
## CityRequirement interface
Player must be located in this city.
**Signature:**
```typescript
interface CityRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [city](./bitburner.cityrequirement.city.md) | | [CityName](./bitburner.cityname.md) | |
| [type](./bitburner.cityrequirement.type.md) | | "city" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CityRequirement](./bitburner.cityrequirement.md) &gt; [type](./bitburner.cityrequirement.type.md)
## CityRequirement.type property
**Signature:**
```typescript
type: "city";
```

View File

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

View File

@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyReputationRequirement](./bitburner.companyreputationrequirement.md)
## CompanyReputationRequirement interface
Player must have at least this much reputation with this company.
**Signature:**
```typescript
interface CompanyReputationRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [company](./bitburner.companyreputationrequirement.company.md) | | [CompanyName](./bitburner.companyname.md) | |
| [reputation](./bitburner.companyreputationrequirement.reputation.md) | | number | |
| [type](./bitburner.companyreputationrequirement.type.md) | | "companyReputation" | |

View File

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

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [CompanyReputationRequirement](./bitburner.companyreputationrequirement.md) &gt; [type](./bitburner.companyreputationrequirement.type.md)
## CompanyReputationRequirement.type property
**Signature:**
```typescript
type: "companyReputation";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [EmployedByRequirement](./bitburner.employedbyrequirement.md)
## EmployedByRequirement interface
Player must be working for this company.
**Signature:**
```typescript
interface EmployedByRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [company](./bitburner.employedbyrequirement.company.md) | | [CompanyName](./bitburner.companyname.md) | |
| [type](./bitburner.employedbyrequirement.type.md) | | "employedBy" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [EmployedByRequirement](./bitburner.employedbyrequirement.md) &gt; [type](./bitburner.employedbyrequirement.type.md)
## EmployedByRequirement.type property
**Signature:**
```typescript
type: "employedBy";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [EveryRequirement](./bitburner.everyrequirement.md)
## EveryRequirement interface
All sub-conditions must be satisfied.
**Signature:**
```typescript
interface EveryRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [conditions](./bitburner.everyrequirement.conditions.md) | | [PlayerRequirement](./bitburner.playerrequirement.md)<!-- -->\[\] | |
| [type](./bitburner.everyrequirement.type.md) | | "everyCondition" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [EveryRequirement](./bitburner.everyrequirement.md) &gt; [type](./bitburner.everyrequirement.type.md)
## EveryRequirement.type property
**Signature:**
```typescript
type: "everyCondition";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [FileRequirement](./bitburner.filerequirement.md)
## FileRequirement interface
Player must have a specific Literature or Message file on their home computer.
**Signature:**
```typescript
interface FileRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [file](./bitburner.filerequirement.file.md) | | string | |
| [type](./bitburner.filerequirement.type.md) | | "file" | |

View File

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

View File

@@ -23,5 +23,5 @@ growTime(server: Server, player: Person): number;
number
The calculated grow time.
The calculated grow time, in milliseconds.

View File

@@ -23,5 +23,5 @@ hackTime(server: Server, player: Person): number;
number
The calculated hack time.
The calculated hack time, in milliseconds.

View File

@@ -23,5 +23,5 @@ weakenTime(server: Server, player: Person): number;
number
The calculated weaken time.
The calculated weaken time, in milliseconds.

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetCoresRequirement](./bitburner.hacknetcoresrequirement.md) &gt; [hacknetCores](./bitburner.hacknetcoresrequirement.hacknetcores.md)
## HacknetCoresRequirement.hacknetCores property
**Signature:**
```typescript
hacknetCores: number;
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetCoresRequirement](./bitburner.hacknetcoresrequirement.md)
## HacknetCoresRequirement interface
Player's Hacknet devices must have at least this many total cores.
**Signature:**
```typescript
interface HacknetCoresRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [hacknetCores](./bitburner.hacknetcoresrequirement.hacknetcores.md) | | number | |
| [type](./bitburner.hacknetcoresrequirement.type.md) | | "hacknetCores" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetCoresRequirement](./bitburner.hacknetcoresrequirement.md) &gt; [type](./bitburner.hacknetcoresrequirement.type.md)
## HacknetCoresRequirement.type property
**Signature:**
```typescript
type: "hacknetCores";
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetLevelsRequirement](./bitburner.hacknetlevelsrequirement.md) &gt; [hacknetLevels](./bitburner.hacknetlevelsrequirement.hacknetlevels.md)
## HacknetLevelsRequirement.hacknetLevels property
**Signature:**
```typescript
hacknetLevels: number;
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetLevelsRequirement](./bitburner.hacknetlevelsrequirement.md)
## HacknetLevelsRequirement interface
Player's Hacknet devices must have at least this many total levels.
**Signature:**
```typescript
interface HacknetLevelsRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [hacknetLevels](./bitburner.hacknetlevelsrequirement.hacknetlevels.md) | | number | |
| [type](./bitburner.hacknetlevelsrequirement.type.md) | | "hacknetLevels" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetLevelsRequirement](./bitburner.hacknetlevelsrequirement.md) &gt; [type](./bitburner.hacknetlevelsrequirement.type.md)
## HacknetLevelsRequirement.type property
**Signature:**
```typescript
type: "hacknetLevels";
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetRAMRequirement](./bitburner.hacknetramrequirement.md) &gt; [hacknetRAM](./bitburner.hacknetramrequirement.hacknetram.md)
## HacknetRAMRequirement.hacknetRAM property
**Signature:**
```typescript
hacknetRAM: number;
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetRAMRequirement](./bitburner.hacknetramrequirement.md)
## HacknetRAMRequirement interface
Player's Hacknet devices must have at least this much total RAM.
**Signature:**
```typescript
interface HacknetRAMRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [hacknetRAM](./bitburner.hacknetramrequirement.hacknetram.md) | | number | |
| [type](./bitburner.hacknetramrequirement.type.md) | | "hacknetRAM" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetRAMRequirement](./bitburner.hacknetramrequirement.md) &gt; [type](./bitburner.hacknetramrequirement.type.md)
## HacknetRAMRequirement.type property
**Signature:**
```typescript
type: "hacknetRAM";
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [JobTitleRequirement](./bitburner.jobtitlerequirement.md) &gt; [jobTitle](./bitburner.jobtitlerequirement.jobtitle.md)
## JobTitleRequirement.jobTitle property
**Signature:**
```typescript
jobTitle: JobName;
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [JobTitleRequirement](./bitburner.jobtitlerequirement.md)
## JobTitleRequirement interface
Player must have this job title at some company.
**Signature:**
```typescript
interface JobTitleRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [jobTitle](./bitburner.jobtitlerequirement.jobtitle.md) | | [JobName](./bitburner.jobname.md) | |
| [type](./bitburner.jobtitlerequirement.type.md) | | "jobTitle" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [JobTitleRequirement](./bitburner.jobtitlerequirement.md) &gt; [type](./bitburner.jobtitlerequirement.type.md)
## JobTitleRequirement.type property
**Signature:**
```typescript
type: "jobTitle";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [KarmaRequiremennt](./bitburner.karmarequiremennt.md)
## KarmaRequiremennt interface
Player must have less than this much karma.
**Signature:**
```typescript
interface KarmaRequiremennt
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [karma](./bitburner.karmarequiremennt.karma.md) | | number | |
| [type](./bitburner.karmarequiremennt.type.md) | | "karma" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [KarmaRequiremennt](./bitburner.karmarequiremennt.md) &gt; [type](./bitburner.karmarequiremennt.type.md)
## KarmaRequiremennt.type property
**Signature:**
```typescript
type: "karma";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [LocationRequirement](./bitburner.locationrequirement.md)
## LocationRequirement interface
Player must be at this location within a city.
**Signature:**
```typescript
interface LocationRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [location](./bitburner.locationrequirement.location.md) | | [LocationName](./bitburner.locationname.md) | |
| [type](./bitburner.locationrequirement.type.md) | | "location" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [LocationRequirement](./bitburner.locationrequirement.md) &gt; [type](./bitburner.locationrequirement.type.md)
## LocationRequirement.type property
**Signature:**
```typescript
type: "location";
```

View File

@@ -28,12 +28,17 @@
| [ActiveFragment](./bitburner.activefragment.md) | |
| [AugmentPair](./bitburner.augmentpair.md) | Return value of [getSleevePurchasableAugs](./bitburner.sleeve.getsleevepurchasableaugs.md) |
| [AutocompleteData](./bitburner.autocompletedata.md) | Used for autocompletion |
| [BackdoorRequirement](./bitburner.backdoorrequirement.md) | Player must have installed a backdoor on this server. |
| [BasicHGWOptions](./bitburner.basichgwoptions.md) | Options to affect the behavior of [hack](./bitburner.ns.hack.md)<!-- -->, [grow](./bitburner.ns.grow.md)<!-- -->, and [weaken](./bitburner.ns.weaken.md)<!-- -->. |
| [BitNodeMultipliers](./bitburner.bitnodemultipliers.md) | All multipliers affecting the difficulty of the current challenge. |
| [BitNodeRequirement](./bitburner.bitnoderequirement.md) | Player must be located in this BitNode. |
| [Bladeburner](./bitburner.bladeburner.md) | Bladeburner API |
| [BladeburnerCurAction](./bitburner.bladeburnercuraction.md) | Bladeburner current action. |
| [BladeburnerRankRequirement](./bitburner.bladeburnerrankrequirement.md) | Player must have at least this rank in the Bladeburner Division. |
| [CityRequirement](./bitburner.cityrequirement.md) | Player must be located in this city. |
| [CodingContract](./bitburner.codingcontract.md) | Coding Contract API |
| [CompanyPositionInfo](./bitburner.companypositioninfo.md) | Company position requirements and salary. |
| [CompanyReputationRequirement](./bitburner.companyreputationrequirement.md) | Player must have at least this much reputation with this company. |
| [CorpConstants](./bitburner.corpconstants.md) | Corporation related constants |
| [CorpIndustryData](./bitburner.corpindustrydata.md) | Data for an individual industry |
| [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) | Corporation material information |
@@ -42,8 +47,11 @@
| [CorpProductData](./bitburner.corpproductdata.md) | Product rating information |
| [CrimeStats](./bitburner.crimestats.md) | Data representing the internal values of a crime. |
| [Division](./bitburner.division.md) | Corporation division |
| [EmployedByRequirement](./bitburner.employedbyrequirement.md) | Player must be working for this company. |
| [EquipmentStats](./bitburner.equipmentstats.md) | Object representing data representing a gang member equipment. |
| [EveryRequirement](./bitburner.everyrequirement.md) | All sub-conditions must be satisfied. |
| [Export](./bitburner.export.md) | Export order for a material |
| [FileRequirement](./bitburner.filerequirement.md) | Player must have a specific Literature or Message file on their home computer. |
| [Formulas](./bitburner.formulas.md) | Formulas API |
| [Fragment](./bitburner.fragment.md) | |
| [GameInfo](./bitburner.gameinfo.md) | Game Information |
@@ -60,9 +68,12 @@
| [HackingFormulas](./bitburner.hackingformulas.md) | Hacking formulas |
| [HackingMultipliers](./bitburner.hackingmultipliers.md) | Hack related multipliers. |
| [Hacknet](./bitburner.hacknet.md) | Hacknet API |
| [HacknetCoresRequirement](./bitburner.hacknetcoresrequirement.md) | Player's Hacknet devices must have at least this many total cores. |
| [HacknetLevelsRequirement](./bitburner.hacknetlevelsrequirement.md) | Player's Hacknet devices must have at least this many total levels. |
| [HacknetMultipliers](./bitburner.hacknetmultipliers.md) | Hacknet related multipliers. |
| [HacknetNodeConstants](./bitburner.hacknetnodeconstants.md) | Hacknet node related constants |
| [HacknetNodesFormulas](./bitburner.hacknetnodesformulas.md) | Hacknet Node formulas |
| [HacknetRAMRequirement](./bitburner.hacknetramrequirement.md) | Player's Hacknet devices must have at least this much total RAM. |
| [HacknetServerConstants](./bitburner.hacknetserverconstants.md) | Hacknet server related constants |
| [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | Hacknet Server formulas |
| [HP](./bitburner.hp.md) | |
@@ -73,15 +84,23 @@
| [InfiltrationReward](./bitburner.infiltrationreward.md) | |
| [InvestmentOffer](./bitburner.investmentoffer.md) | Corporation investment offer |
| [IStyleSettings](./bitburner.istylesettings.md) | Interface Styles |
| [JobTitleRequirement](./bitburner.jobtitlerequirement.md) | Player must have this job title at some company. |
| [KarmaRequiremennt](./bitburner.karmarequiremennt.md) | Player must have less than this much karma. |
| [LocationRequirement](./bitburner.locationrequirement.md) | Player must be at this location within a city. |
| [Material](./bitburner.material.md) | Material in a warehouse |
| [MoneyRequirement](./bitburner.moneyrequirement.md) | Player must have at least this much money. |
| [MoneySource](./bitburner.moneysource.md) | |
| [MoneySources](./bitburner.moneysources.md) | |
| [Multipliers](./bitburner.multipliers.md) | |
| [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. |
| [NotRequirement](./bitburner.notrequirement.md) | The sub-condition must not be satisfied. |
| [NS](./bitburner.ns.md) | Collection of all functions passed to scripts |
| [NumAugmentationsRequirement](./bitburner.numaugmentationsrequirement.md) | Player must have at least this many augmentations installed (if positive). Player must have no augmentations installed (if zero). |
| [NumInfiltrationsRequirement](./bitburner.numinfiltrationsrequirement.md) | Player must have completed this many infiltrations. |
| [Office](./bitburner.office.md) | Office for a division in a city. |
| [OfficeAPI](./bitburner.officeapi.md) | Corporation Office API |
| [PeopleKilledRequirement](./bitburner.peoplekilledrequirement.md) | Player must have killed at least this many people. |
| [Person](./bitburner.person.md) | |
| [Player](./bitburner.player.md) | |
| [ProcessInfo](./bitburner.processinfo.md) | A single process on a server. |
@@ -94,11 +113,14 @@
| [RunOptions](./bitburner.runoptions.md) | |
| [Server](./bitburner.server.md) | A server. Not all servers have all of these properties - optional properties are missing on certain servers. |
| [Singularity](./bitburner.singularity.md) | Singularity API |
| [SkillRequirement](./bitburner.skillrequirement.md) | Player must have each listed skill at least this level. |
| [Skills](./bitburner.skills.md) | |
| [SkillsFormulas](./bitburner.skillsformulas.md) | Skills formulas |
| [Sleeve](./bitburner.sleeve.md) | Sleeve API |
| [SleevePerson](./bitburner.sleeveperson.md) | |
| [SomeRequirement](./bitburner.somerequirement.md) | At least one sub-condition must be satisfied. |
| [SourceFileLvl](./bitburner.sourcefilelvl.md) | |
| [SourceFileRequirement](./bitburner.sourcefilerequirement.md) | Player must have this Source File. |
| [SpawnOptions](./bitburner.spawnoptions.md) | |
| [Stanek](./bitburner.stanek.md) | Stanek's Gift API. |
| [StockMarketConstants](./bitburner.stockmarketconstants.md) | Constants used for the stockmarket game mechanic. |
@@ -128,6 +150,7 @@
| [CorpUpgradeName](./bitburner.corpupgradename.md) | |
| [FilenameOrPID](./bitburner.filenameorpid.md) | |
| [NSEnums](./bitburner.nsenums.md) | |
| [PlayerRequirement](./bitburner.playerrequirement.md) | Structured interface to requirements for joining a faction or company. For fields with numerical value &gt; 0, the player must have at least this value. For fields with numerical value &lt;<!-- -->= 0, the player must have at most this value. For "not", the sub-condition must be failed instead of passed. For "someCondition", at least one sub-condition must be passed. |
| [PortData](./bitburner.portdata.md) | |
| [ReactNode](./bitburner.reactnode.md) | <p>A stand-in for the real React.ReactNode. A [ReactElement](./bitburner.reactelement.md) is rendered dynamically with React. number and string are displayed directly. boolean, null, and undefined are ignored and not rendered. An array of ReactNodes will display all members of that array sequentially.</p><p>Use React.createElement to make the ReactElement type, see [creating an element without jsx](https://react.dev/reference/react/createElement#creating-an-element-without-jsx) from the official React documentation.</p> |
| [ScriptArg](./bitburner.scriptarg.md) | |

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [MoneyRequirement](./bitburner.moneyrequirement.md)
## MoneyRequirement interface
Player must have at least this much money.
**Signature:**
```typescript
interface MoneyRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [money](./bitburner.moneyrequirement.money.md) | | number | |
| [type](./bitburner.moneyrequirement.type.md) | | "money" | |

View File

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

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [MoneyRequirement](./bitburner.moneyrequirement.md) &gt; [type](./bitburner.moneyrequirement.type.md)
## MoneyRequirement.type property
**Signature:**
```typescript
type: "money";
```

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NotRequirement](./bitburner.notrequirement.md)
## NotRequirement interface
The sub-condition must not be satisfied.
**Signature:**
```typescript
interface NotRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [condition](./bitburner.notrequirement.condition.md) | | [PlayerRequirement](./bitburner.playerrequirement.md) | |
| [type](./bitburner.notrequirement.type.md) | | "not" | |

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NumAugmentationsRequirement](./bitburner.numaugmentationsrequirement.md)
## NumAugmentationsRequirement interface
Player must have at least this many augmentations installed (if positive). Player must have no augmentations installed (if zero).
**Signature:**
```typescript
interface NumAugmentationsRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [numAugmentations](./bitburner.numaugmentationsrequirement.numaugmentations.md) | | number | |
| [type](./bitburner.numaugmentationsrequirement.type.md) | | "numAugmentations" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NumAugmentationsRequirement](./bitburner.numaugmentationsrequirement.md) &gt; [numAugmentations](./bitburner.numaugmentationsrequirement.numaugmentations.md)
## NumAugmentationsRequirement.numAugmentations property
**Signature:**
```typescript
numAugmentations: number;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NumAugmentationsRequirement](./bitburner.numaugmentationsrequirement.md) &gt; [type](./bitburner.numaugmentationsrequirement.type.md)
## NumAugmentationsRequirement.type property
**Signature:**
```typescript
type: "numAugmentations";
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NumInfiltrationsRequirement](./bitburner.numinfiltrationsrequirement.md)
## NumInfiltrationsRequirement interface
Player must have completed this many infiltrations.
**Signature:**
```typescript
interface NumInfiltrationsRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [numInfiltrations](./bitburner.numinfiltrationsrequirement.numinfiltrations.md) | | number | |
| [type](./bitburner.numinfiltrationsrequirement.type.md) | | "numInfiltrations" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NumInfiltrationsRequirement](./bitburner.numinfiltrationsrequirement.md) &gt; [numInfiltrations](./bitburner.numinfiltrationsrequirement.numinfiltrations.md)
## NumInfiltrationsRequirement.numInfiltrations property
**Signature:**
```typescript
numInfiltrations: number;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NumInfiltrationsRequirement](./bitburner.numinfiltrationsrequirement.md) &gt; [type](./bitburner.numinfiltrationsrequirement.type.md)
## NumInfiltrationsRequirement.type property
**Signature:**
```typescript
type: "numInfiltrations";
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [PeopleKilledRequirement](./bitburner.peoplekilledrequirement.md)
## PeopleKilledRequirement interface
Player must have killed at least this many people.
**Signature:**
```typescript
interface PeopleKilledRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [numPeopleKilled](./bitburner.peoplekilledrequirement.numpeoplekilled.md) | | number | |
| [type](./bitburner.peoplekilledrequirement.type.md) | | "numPeopleKilled" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [PeopleKilledRequirement](./bitburner.peoplekilledrequirement.md) &gt; [numPeopleKilled](./bitburner.peoplekilledrequirement.numpeoplekilled.md)
## PeopleKilledRequirement.numPeopleKilled property
**Signature:**
```typescript
numPeopleKilled: number;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [PeopleKilledRequirement](./bitburner.peoplekilledrequirement.md) &gt; [type](./bitburner.peoplekilledrequirement.type.md)
## PeopleKilledRequirement.type property
**Signature:**
```typescript
type: "numPeopleKilled";
```

View File

@@ -0,0 +1,37 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [PlayerRequirement](./bitburner.playerrequirement.md)
## PlayerRequirement type
Structured interface to requirements for joining a faction or company. For fields with numerical value &gt; 0, the player must have at least this value. For fields with numerical value &lt;<!-- -->= 0, the player must have at most this value. For "not", the sub-condition must be failed instead of passed. For "someCondition", at least one sub-condition must be passed.
**Signature:**
```typescript
export type PlayerRequirement =
| MoneyRequirement
| SkillRequirement
| KarmaRequiremennt
| PeopleKilledRequirement
| FileRequirement
| NumAugmentationsRequirement
| EmployedByRequirement
| CompanyReputationRequirement
| JobTitleRequirement
| CityRequirement
| LocationRequirement
| BackdoorRequirement
| HacknetRAMRequirement
| HacknetCoresRequirement
| HacknetLevelsRequirement
| BitNodeRequirement
| SourceFileRequirement
| BladeburnerRankRequirement
| NumInfiltrationsRequirement
| NotRequirement
| SomeRequirement
| EveryRequirement;
```
**References:** [MoneyRequirement](./bitburner.moneyrequirement.md)<!-- -->, [SkillRequirement](./bitburner.skillrequirement.md)<!-- -->, [KarmaRequiremennt](./bitburner.karmarequiremennt.md)<!-- -->, [PeopleKilledRequirement](./bitburner.peoplekilledrequirement.md)<!-- -->, [FileRequirement](./bitburner.filerequirement.md)<!-- -->, [NumAugmentationsRequirement](./bitburner.numaugmentationsrequirement.md)<!-- -->, [EmployedByRequirement](./bitburner.employedbyrequirement.md)<!-- -->, [CompanyReputationRequirement](./bitburner.companyreputationrequirement.md)<!-- -->, [JobTitleRequirement](./bitburner.jobtitlerequirement.md)<!-- -->, [CityRequirement](./bitburner.cityrequirement.md)<!-- -->, [LocationRequirement](./bitburner.locationrequirement.md)<!-- -->, [BackdoorRequirement](./bitburner.backdoorrequirement.md)<!-- -->, [HacknetRAMRequirement](./bitburner.hacknetramrequirement.md)<!-- -->, [HacknetCoresRequirement](./bitburner.hacknetcoresrequirement.md)<!-- -->, [HacknetLevelsRequirement](./bitburner.hacknetlevelsrequirement.md)<!-- -->, [BitNodeRequirement](./bitburner.bitnoderequirement.md)<!-- -->, [SourceFileRequirement](./bitburner.sourcefilerequirement.md)<!-- -->, [BladeburnerRankRequirement](./bitburner.bladeburnerrankrequirement.md)<!-- -->, [NumInfiltrationsRequirement](./bitburner.numinfiltrationsrequirement.md)<!-- -->, [NotRequirement](./bitburner.notrequirement.md)<!-- -->, [SomeRequirement](./bitburner.somerequirement.md)<!-- -->, [EveryRequirement](./bitburner.everyrequirement.md)

View File

@@ -9,7 +9,7 @@ Apply for a job at a company.
**Signature:**
```typescript
applyToCompany(companyName: CompanyName | `${CompanyName}`, field: JobField | `${JobField}`): boolean;
applyToCompany(companyName: CompanyName | `${CompanyName}`, field: JobField | `${JobField}`): JobName | null;
```
## Parameters
@@ -21,7 +21,7 @@ applyToCompany(companyName: CompanyName | `${CompanyName}`, field: JobField | `$
**Returns:**
boolean
[JobName](./bitburner.jobname.md) \| null
True if the player successfully get a job/promotion, and false otherwise.

View File

@@ -0,0 +1,56 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [getFactionInviteRequirements](./bitburner.singularity.getfactioninviterequirements.md)
## Singularity.getFactionInviteRequirements() method
List conditions for being invited to a faction.
**Signature:**
```typescript
getFactionInviteRequirements(faction: string): PlayerRequirement[];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| faction | string | Name of the faction |
**Returns:**
[PlayerRequirement](./bitburner.playerrequirement.md)<!-- -->\[\]
Array of PlayerRequirement objects which must all be fulfilled to receive an invitation.
## Remarks
RAM cost: 3 GB \* 16/4/1
## Example
```js
ns.singularity.getFactionInviteRequirements("The Syndicate")
[
{ "type": "someCondition", "conditions": [
{ "type": "city", "city": "Aevum" },
{ "type": "city", "city": "Sector-12" }
]
},
{ "type": "not", "condition": {
"type": "employedBy", "company": "Central Intelligence Agency"
}
},
{ "type": "not", "condition": {
"type": "employedBy", "company": "National Security Agency"
}
},
{ "type": "money", "money": 10000000 },
{ "type": "skills", "skills": { "hacking": 200 } },
{ "type": "skills", "skills": { "strength": 200, "defense": 200, "dexterity": 200, "agility": 200 } },
{ "type": "karma", "karma": -90 }
]
```

View File

@@ -50,6 +50,7 @@ This API requires Source-File 4 to use. The RAM cost of all these functions is m
| [getDarkwebPrograms()](./bitburner.singularity.getdarkwebprograms.md) | Get a list of programs offered on the dark web. |
| [getFactionFavor(faction)](./bitburner.singularity.getfactionfavor.md) | Get faction favor. |
| [getFactionFavorGain(faction)](./bitburner.singularity.getfactionfavorgain.md) | Get faction favor gain. |
| [getFactionInviteRequirements(faction)](./bitburner.singularity.getfactioninviterequirements.md) | List conditions for being invited to a faction. |
| [getFactionRep(faction)](./bitburner.singularity.getfactionrep.md) | Get faction reputation. |
| [getOwnedAugmentations(purchased)](./bitburner.singularity.getownedaugmentations.md) | Get a list of owned augmentation. |
| [getOwnedSourceFiles()](./bitburner.singularity.getownedsourcefiles.md) | Get a list of acquired Source-Files. |

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SkillRequirement](./bitburner.skillrequirement.md)
## SkillRequirement interface
Player must have each listed skill at least this level.
**Signature:**
```typescript
interface SkillRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [skills](./bitburner.skillrequirement.skills.md) | | Partial&lt;[Skills](./bitburner.skills.md)<!-- -->&gt; | |
| [type](./bitburner.skillrequirement.type.md) | | "skills" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SkillRequirement](./bitburner.skillrequirement.md) &gt; [skills](./bitburner.skillrequirement.skills.md)
## SkillRequirement.skills property
**Signature:**
```typescript
skills: Partial<Skills>;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SkillRequirement](./bitburner.skillrequirement.md) &gt; [type](./bitburner.skillrequirement.type.md)
## SkillRequirement.type property
**Signature:**
```typescript
type: "skills";
```

View File

@@ -15,5 +15,6 @@ type SleeveBladeburnerTask = {
cyclesWorked: number;
cyclesNeeded: number;
nextCompletion: Promise<void>;
tasksCompleted: number;
};
```

View File

@@ -13,6 +13,7 @@ type SleeveCrimeTask = {
crimeType: CrimeType | `${CrimeType}`;
cyclesWorked: number;
cyclesNeeded: number;
tasksCompleted: number;
};
```
**References:** [CrimeType](./bitburner.crimetype.md)

View File

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

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SomeRequirement](./bitburner.somerequirement.md)
## SomeRequirement interface
At least one sub-condition must be satisfied.
**Signature:**
```typescript
interface SomeRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [conditions](./bitburner.somerequirement.conditions.md) | | [PlayerRequirement](./bitburner.playerrequirement.md)<!-- -->\[\] | |
| [type](./bitburner.somerequirement.type.md) | | "someCondition" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SomeRequirement](./bitburner.somerequirement.md) &gt; [type](./bitburner.somerequirement.type.md)
## SomeRequirement.type property
**Signature:**
```typescript
type: "someCondition";
```

View File

@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SourceFileRequirement](./bitburner.sourcefilerequirement.md)
## SourceFileRequirement interface
Player must have this Source File.
**Signature:**
```typescript
interface SourceFileRequirement
```
## Properties
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [sourceFile](./bitburner.sourcefilerequirement.sourcefile.md) | | number | |
| [type](./bitburner.sourcefilerequirement.type.md) | | "sourceFile" | |

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SourceFileRequirement](./bitburner.sourcefilerequirement.md) &gt; [sourceFile](./bitburner.sourcefilerequirement.sourcefile.md)
## SourceFileRequirement.sourceFile property
**Signature:**
```typescript
sourceFile: number;
```

View File

@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [SourceFileRequirement](./bitburner.sourcefilerequirement.md) &gt; [type](./bitburner.sourcefilerequirement.type.md)
## SourceFileRequirement.type property
**Signature:**
```typescript
type: "sourceFile";
```

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "bitburner",
"version": "2.5.1",
"version": "2.5.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bitburner",
"version": "2.5.1",
"version": "2.5.2",
"hasInstallScript": true,
"license": "SEE LICENSE IN license.txt",
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "bitburner",
"license": "SEE LICENSE IN license.txt",
"version": "2.5.1",
"version": "2.5.2",
"main": "electron-main.js",
"author": {
"name": "Daniel Xie, Olivier Gagnon, et al."

View File

@@ -95,7 +95,7 @@ export function initBitNodes() {
);
BitNodes.BitNode3 = new BitNode(
3,
0,
2,
"Corporatocracy",
"The Price of Civilization",
(

View File

@@ -10,6 +10,7 @@ import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip";
import { Settings } from "../../Settings/Settings";
import Button from "@mui/material/Button";
import { CompletedProgramName } from "@enums";
const useStyles = makeStyles(() =>
createStyles({
@@ -121,33 +122,52 @@ export function BitverseRoot(props: IProps): React.ReactElement {
const [destroySequence, setDestroySequence] = useState(!props.quick);
if (destroySequence) {
return (
<CinematicText
lines={[
"[ERROR] SEMPOOL INVALID",
"[ERROR] Segmentation Fault",
"[ERROR] SIGKILL RECVD",
"Dumping core...",
"0000 000016FA 174FEE40 29AC8239 384FEA88",
"0010 745F696E 2BBBE394 390E3940 248BEC23",
"0020 7124696B 0000FF69 74652E6F FFFF1111",
"----------------------------------------",
"Failsafe initiated...",
`Restarting BitNode-${destroyed}...`,
"...........",
"...........",
"[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE",
"..............................................",
"..............................................",
"..............................................",
"..............................................",
"..............................................",
"..............................................",
]}
onDone={() => setDestroySequence(false)}
auto={true}
/>
);
let cinematicLines;
if (props.flume) {
cinematicLines = [
`Running ${CompletedProgramName.bitFlume}...`,
"...........",
"...........",
"counter dq 0x0",
"mov [counter], EXC",
"dec [counter]",
"mov EXC, [counter]",
"...........",
"...........",
`[WARN] BitNode-${destroyed} assertion error:`,
"Expected inputs to be strictly equal:",
"<Number of incoming connections>, <Number of outgoing connections>",
"Running full scan...",
"..............................................",
"..............................................",
"Hanging connection located, disconnecting...",
"..............................................",
"..............................................",
];
} else {
cinematicLines = [
"[ERROR] SEMPOOL INVALID",
"[ERROR] Segmentation Fault",
"[ERROR] SIGKILL RECVD",
"Dumping core...",
"0000 000016FA 174FEE40 29AC8239 384FEA88",
"0010 745F696E 2BBBE394 390E3940 248BEC23",
"0020 7124696B 0000FF69 74652E6F FFFF1111",
"----------------------------------------",
"Failsafe initiated...",
`Restarting BitNode-${destroyed}...`,
"...........",
"...........",
"[ERROR] FAILED TO AUTOMATICALLY REBOOT BITNODE",
"..............................................",
"..............................................",
"..............................................",
"..............................................",
"..............................................",
"..............................................",
];
}
return <CinematicText lines={cinematicLines} onDone={() => setDestroySequence(false)} auto={true} />;
}
const nextSourceFileLvl = (n: number): number => {

View File

@@ -1,49 +1,52 @@
import type { Action } from "../Action";
import type { Bladeburner } from "../Bladeburner";
import React, { useState } from "react";
import { dialogBoxCreate } from "../../ui/React/DialogBox";
import { Modal } from "../../ui/React/Modal";
import { Action } from "../Action";
import { Bladeburner } from "../Bladeburner";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import TextField from "@mui/material/TextField";
import { Button, TextField, Typography } from "@mui/material";
interface IProps {
interface TeamSizeModalProps {
bladeburner: Bladeburner;
action: Action;
open: boolean;
onClose: () => void;
}
export function TeamSizeModal(props: IProps): React.ReactElement {
export function TeamSizeModal({ bladeburner, action, open, onClose }: TeamSizeModalProps): React.ReactElement {
const [teamSize, setTeamSize] = useState<number | undefined>();
function confirmTeamSize(): void {
function confirmTeamSize(event: React.FormEvent): void {
// Prevent reloading page when submitting form
event.preventDefault();
if (teamSize === undefined) return;
const num = Math.round(teamSize);
if (isNaN(num) || num < 0) {
dialogBoxCreate("Invalid value entered for number of Team Members (must be numeric, positive)");
dialogBoxCreate("Invalid value entered for number of Team Members (must be numeric and non-negative)");
} else {
props.action.teamCount = num;
action.teamCount = num;
}
props.onClose();
onClose();
}
function onTeamSize(event: React.ChangeEvent<HTMLInputElement>): void {
const x = parseFloat(event.target.value);
if (x > props.bladeburner.teamSize) setTeamSize(props.bladeburner.teamSize);
if (x > bladeburner.teamSize) setTeamSize(bladeburner.teamSize);
else setTeamSize(x);
}
return (
<Modal open={props.open} onClose={props.onClose}>
<Typography>
Enter the amount of team members you would like to take on this Op. If you do not have the specified number of
team members, then as many as possible will be used. Note that team members may be lost during operations.
</Typography>
<TextField autoFocus type="number" placeholder="Team size" value={teamSize} onChange={onTeamSize} />
<Button sx={{ mx: 2 }} onClick={confirmTeamSize}>
Confirm
</Button>
<Modal open={open} onClose={onClose}>
<form onSubmit={confirmTeamSize}>
<Typography>
Enter the amount of team members you would like to take on this Op. If you do not have the specified number of
team members, then as many as possible will be used. Note that team members may be lost during operations.
</Typography>
<TextField autoFocus type="number" placeholder="Team size" value={teamSize} onChange={onTeamSize} />
<Button sx={{ mx: 2 }} type={"submit"}>
Confirm
</Button>
</form>
</Modal>
);
}

View File

@@ -4,6 +4,7 @@ import {
CodingContractTypes,
ICodingContractReward,
} from "./CodingContracts";
import { currentNodeMults } from "./BitNode/BitNodeMultipliers";
import { Factions } from "./Faction/Factions";
import { Player } from "@player";
import { GetServer, GetAllServers } from "./Server/AllServers";
@@ -124,7 +125,10 @@ function getRandomProblemType(): string {
}
function getRandomReward(): ICodingContractReward {
const rewardType = sanitizeRewardType(getRandomInt(0, CodingContractRewardType.Money));
// Don't offer money reward by default if BN multiplier is 0 (e.g. BN8)
const rewardTypeUpperBound =
currentNodeMults.CodingContractMoney === 0 ? CodingContractRewardType.Money - 1 : CodingContractRewardType.Money;
const rewardType = sanitizeRewardType(getRandomInt(0, rewardTypeUpperBound));
// Add additional information based on the reward type
const factionsThatAllowHacking = Player.factions.filter((fac) => Factions[fac].getInfo().offerHackingWork);

View File

@@ -56,42 +56,6 @@ export class Company {
return this.companyPositions.has(typeof pos === "string" ? pos : pos.name);
}
hasAgentPositions(): boolean {
return this.companyPositions.has(JobName.agent0);
}
hasBusinessConsultantPositions(): boolean {
return this.companyPositions.has(JobName.businessConsult0);
}
hasBusinessPositions(): boolean {
return this.companyPositions.has(JobName.business0);
}
hasEmployeePositions(): boolean {
return this.companyPositions.has(JobName.employee);
}
hasITPositions(): boolean {
return this.companyPositions.has(JobName.IT0);
}
hasSecurityPositions(): boolean {
return this.companyPositions.has(JobName.security0);
}
hasSoftwareConsultantPositions(): boolean {
return this.companyPositions.has(JobName.softwareConsult0);
}
hasSoftwarePositions(): boolean {
return this.companyPositions.has(JobName.software0);
}
hasWaiterPositions(): boolean {
return this.companyPositions.has(JobName.waiter);
}
prestigeAugmentation(): void {
if (this.favor == null) this.favor = 0;
this.favor += this.getFavorGain();
@@ -121,7 +85,7 @@ export class Company {
return Generic_fromJSON(Company, value.data, Company.includedKeys);
}
// Only these 3 keys are relevant to the save file
// Only these 2 keys are relevant to the save file
static includedKeys = ["favor", "playerReputation"] as const;
}

View File

@@ -1,22 +1,16 @@
import { Person as IPerson } from "@nsdefs";
import { CONSTANTS } from "../Constants";
import { JobName, JobField } from "@enums";
import {
agentJobs,
businessConsultJobs,
businessJobs,
itJobs,
netEngJobs,
securityJobs,
softwareConsultJobs,
softwareJobs,
} from "./data/JobTracks";
import type { Skills } from "../PersonObjects/Skills";
export interface CompanyPositionCtorParams {
nextPosition: JobName | null;
field: JobField;
baseSalary: number;
repMultiplier: number;
applyText?: string;
hiredText?: string;
isPartTime?: boolean;
reqdHacking?: number;
reqdStrength?: number;
@@ -60,6 +54,15 @@ export class CompanyPosition {
/** Reputation multiplier */
repMultiplier: number;
/** Text to display when applying for this job */
applyText: string;
/** Text to display when receiving this job */
hiredText: string;
/** Whether this position is part-time */
isPartTime: boolean;
/** Required stats to earn this position */
requiredAgility: number;
requiredCharisma: number;
@@ -93,6 +96,9 @@ export class CompanyPosition {
this.nextPosition = p.nextPosition;
this.baseSalary = p.baseSalary;
this.repMultiplier = p.repMultiplier;
this.isPartTime = p.isPartTime ?? false;
this.applyText = p.applyText ?? `Apply for ${this.name} Job`;
this.hiredText = p.hiredText ?? `Congratulations, you are now employed as a ${this.name}`;
this.requiredHacking = p.reqdHacking != null ? p.reqdHacking : 0;
this.requiredStrength = p.reqdStrength != null ? p.reqdStrength : 0;
@@ -130,6 +136,18 @@ export class CompanyPosition {
this.charismaExpGain = p.charismaExpGain != null ? p.charismaExpGain : 0;
}
requiredSkills(jobStatReqOffset: number): Skills {
return {
hacking: this.requiredHacking > 0 ? this.requiredHacking + jobStatReqOffset : 0,
strength: this.requiredStrength > 0 ? this.requiredStrength + jobStatReqOffset : 0,
defense: this.requiredDefense > 0 ? this.requiredDefense + jobStatReqOffset : 0,
dexterity: this.requiredDexterity > 0 ? this.requiredDexterity + jobStatReqOffset : 0,
agility: this.requiredAgility > 0 ? this.requiredAgility + jobStatReqOffset : 0,
charisma: this.requiredCharisma > 0 ? this.requiredCharisma + jobStatReqOffset : 0,
intelligence: 0,
};
}
calculateJobPerformance(worker: IPerson): number {
const hackRatio: number = (this.hackingEffectiveness * worker.skills.hacking) / CONSTANTS.MaxSkillLevel;
const strRatio: number = (this.strengthEffectiveness * worker.skills.strength) / CONSTANTS.MaxSkillLevel;
@@ -147,44 +165,4 @@ export class CompanyPosition {
reputationGain += worker.skills.intelligence / CONSTANTS.MaxSkillLevel;
return reputationGain;
}
isSoftwareJob(): boolean {
return softwareJobs.includes(this.name);
}
isITJob(): boolean {
return itJobs.includes(this.name);
}
isSecurityEngineerJob(): boolean {
return this.name === JobName.securityEng;
}
isNetworkEngineerJob(): boolean {
return netEngJobs.includes(this.name);
}
isBusinessJob(): boolean {
return businessJobs.includes(this.name);
}
isSecurityJob(): boolean {
return securityJobs.includes(this.name);
}
isAgentJob(): boolean {
return agentJobs.includes(this.name);
}
isSoftwareConsultantJob(): boolean {
return softwareConsultJobs.includes(this.name);
}
isBusinessConsultantJob(): boolean {
return businessConsultJobs.includes(this.name);
}
isPartTimeJob(): boolean {
return [JobName.employeePT, JobName.waiterPT].includes(this.name);
}
}

View File

@@ -1,51 +0,0 @@
import { Company } from "./Company";
import { CompanyPosition } from "./CompanyPosition";
/** Returns a string with the given CompanyPosition's stat requirements */
export function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext = false): string {
let reqText = "";
const offset: number = company.jobStatReqOffset;
const reqHacking: number = pos.requiredHacking > 0 ? pos.requiredHacking + offset : 0;
const reqStrength: number = pos.requiredStrength > 0 ? pos.requiredStrength + offset : 0;
const reqDefense: number = pos.requiredDefense > 0 ? pos.requiredDefense + offset : 0;
const reqDexterity: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;
const reqAgility: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;
const reqCharisma: number = pos.requiredCharisma > 0 ? pos.requiredCharisma + offset : 0;
const reqRep: number = pos.requiredReputation;
if (tooltiptext) {
reqText = "Requires:<br>";
reqText += reqHacking.toString() + " hacking<br>";
reqText += reqStrength.toString() + " strength<br>";
reqText += reqDefense.toString() + " defense<br>";
reqText += reqDexterity.toString() + " dexterity<br>";
reqText += reqAgility.toString() + " agility<br>";
reqText += reqCharisma.toString() + " charisma<br>";
reqText += reqRep.toString() + " reputation";
} else {
reqText = "(Requires ";
if (reqHacking > 0) {
reqText += reqHacking + " hacking, ";
}
if (reqStrength > 0) {
reqText += reqStrength + " strength, ";
}
if (reqDefense > 0) {
reqText += reqDefense + " defense, ";
}
if (reqDexterity > 0) {
reqText += reqDexterity + " dexterity, ";
}
if (reqAgility > 0) {
reqText += reqAgility + " agility, ";
}
if (reqCharisma > 0) {
reqText += reqCharisma + " charisma, ";
}
if (reqRep > 1) {
reqText += reqRep + " reputation, ";
}
reqText = reqText.substring(0, reqText.length - 2);
reqText += ")";
}
return reqText;
}

View File

@@ -0,0 +1,23 @@
import { Company } from "./Company";
import { CompanyPosition } from "./CompanyPosition";
import { PlayerCondition, haveSkill, haveCompanyRep } from "../Faction/FactionJoinCondition";
import type { Skills } from "../PersonObjects/Skills";
export function getJobRequirements(company: Company, pos: CompanyPosition): PlayerCondition[] {
const reqSkills = pos.requiredSkills(company.jobStatReqOffset);
const reqs = [];
for (const [skillName, value] of Object.entries(reqSkills)) {
if (value > 0) reqs.push(haveSkill(skillName as keyof Skills, value));
}
if (pos.requiredReputation > 0) {
reqs.push(haveCompanyRep(company.name, pos.requiredReputation));
}
return reqs;
}
/** Returns a string with the given CompanyPosition's stat requirements */
export function getJobRequirementText(company: Company, pos: CompanyPosition): string {
const reqs = getJobRequirements(company, pos);
return `(${pos.name} requires: ${reqs.map((s) => s.toString()).join(", ")})`;
}

View File

@@ -1,14 +1,15 @@
import { CompanyCtorParams } from "../Company";
import { CompanyName, JobName, FactionName } from "@enums";
import { CompanyName, FactionName, JobName } from "@enums";
import {
agentJobs,
softwareJobs,
businessJobs,
itJobs,
netEngJobs,
securityJobs,
softwareConsultJobs,
softwareJobs,
netEngJobs,
itJobs,
agentJobs,
businessConsultJobs,
} from "./JobTracks";
export function getCompaniesMetadata(): Record<CompanyName, CompanyCtorParams> {
@@ -107,14 +108,14 @@ export function getCompaniesMetadata(): Record<CompanyName, CompanyCtorParams> {
},
[CompanyName.DefComm]: {
name: CompanyName.DefComm,
companyPositions: [JobName.business5, ...allTechJobs, ...softwareConsultJobs],
companyPositions: [JobName.business5, ...allTechJobs, ...softwareConsultJobs, ...businessConsultJobs],
expMultiplier: 1.75,
salaryMultiplier: 1.75,
jobStatReqOffset: 199,
},
[CompanyName.HeliosLabs]: {
name: CompanyName.HeliosLabs,
companyPositions: [JobName.business5, ...allTechJobs, ...softwareConsultJobs],
companyPositions: [JobName.business5, ...allTechJobs, ...softwareConsultJobs, ...businessConsultJobs],
expMultiplier: 1.8,
salaryMultiplier: 1.8,
jobStatReqOffset: 199,
@@ -149,28 +150,28 @@ export function getCompaniesMetadata(): Record<CompanyName, CompanyCtorParams> {
},
[CompanyName.AeroCorp]: {
name: CompanyName.AeroCorp,
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs],
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs, ...businessConsultJobs],
expMultiplier: 1.7,
salaryMultiplier: 1.7,
jobStatReqOffset: 199,
},
[CompanyName.OmniaCybersystems]: {
name: CompanyName.OmniaCybersystems,
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs],
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs, ...businessConsultJobs],
expMultiplier: 1.7,
salaryMultiplier: 1.7,
jobStatReqOffset: 199,
},
[CompanyName.SolarisSpaceSystems]: {
name: CompanyName.SolarisSpaceSystems,
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs],
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs, ...businessConsultJobs],
expMultiplier: 1.7,
salaryMultiplier: 1.7,
jobStatReqOffset: 199,
},
[CompanyName.DeltaOne]: {
name: CompanyName.DeltaOne,
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs],
companyPositions: [JobName.business3, JobName.business5, ...allTechJobs, ...securityJobs, ...businessConsultJobs],
expMultiplier: 1.6,
salaryMultiplier: 1.6,
jobStatReqOffset: 199,

View File

@@ -65,6 +65,7 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 501,
reqdReputation: 400e3,
repMultiplier: 1.6,
hiredText: `Congratulations, you are now ${JobName.software4}`,
},
[JobName.software5]: {
nextPosition: JobName.software6, // Vice President of Technology
@@ -78,6 +79,7 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 501,
reqdReputation: 800e3,
repMultiplier: 1.6,
hiredText: `Congratulations, you are now ${JobName.software5}`,
},
[JobName.software6]: {
nextPosition: JobName.software7, // Chief Technology Officer
@@ -91,6 +93,7 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 601,
reqdReputation: 1.6e6,
repMultiplier: 1.75,
hiredText: `Congratulations, you are now ${JobName.software6}`,
},
[JobName.software7]: {
nextPosition: null,
@@ -104,6 +107,7 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 751,
reqdReputation: 3.2e6,
repMultiplier: 2,
hiredText: `Congratulations, you are now ${JobName.software7}`,
},
[JobName.IT0]: {
nextPosition: JobName.IT1, // IT Analyst
@@ -256,6 +260,7 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 76,
reqdReputation: 800e3,
repMultiplier: 1.6,
hiredText: `Congratulations, you are now ${JobName.business4}`,
},
[JobName.business5]: {
nextPosition: null,
@@ -269,6 +274,7 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 101,
reqdReputation: 3.2e6,
repMultiplier: 1.75,
hiredText: `Congratulations, you are now ${JobName.business5}`,
},
[JobName.security0]: {
nextPosition: JobName.security1, // Security Officer
@@ -457,6 +463,8 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
agilityExpGain: 0.02,
charismaExpGain: 0.05,
repMultiplier: 1,
applyText: `Apply to be a ${JobName.waiter}`,
hiredText: `Congratulations, you are now employed as a ${JobName.waiter}`,
},
[JobName.employee]: {
nextPosition: null,
@@ -472,6 +480,8 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
agilityExpGain: 0.02,
charismaExpGain: 0.04,
repMultiplier: 1,
applyText: `Apply to be an ${JobName.employee}`,
hiredText: "Congratulations, you are now employed",
},
[JobName.softwareConsult0]: {
nextPosition: JobName.softwareConsult1, // Senior Software Consultant
@@ -483,6 +493,8 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
charismaExpGain: 0.03,
reqdHacking: 51,
repMultiplier: 1,
applyText: `Pitch a Software Consulting contract`,
hiredText: `Congratulations, you got a contract as a ${JobName.softwareConsult0}`,
},
[JobName.softwareConsult1]: {
nextPosition: null,
@@ -495,6 +507,8 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 251,
reqdCharisma: 51,
repMultiplier: 1.2,
applyText: `Pitch a Software Consulting contract`,
hiredText: `Congratulations, you got a contract as a ${JobName.softwareConsult1}`,
},
[JobName.businessConsult0]: {
nextPosition: JobName.businessConsult1, // Senior Business Consultant
@@ -507,6 +521,8 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 6,
reqdCharisma: 51,
repMultiplier: 1,
applyText: `Pitch a Business Consulting contract`,
hiredText: `Congratulations, you got a contract as a ${JobName.businessConsult0}`,
},
[JobName.businessConsult1]: {
nextPosition: null,
@@ -519,10 +535,12 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
reqdHacking: 51,
reqdCharisma: 226,
repMultiplier: 1.2,
applyText: `Pitch a Business Consulting contract`,
hiredText: `Congratulations, you got a contract as a ${JobName.businessConsult1}`,
},
[JobName.waiterPT]: {
nextPosition: null,
field: JobField.partTimeWaiter,
field: JobField.waiter,
baseSalary: 20,
strengthEffectiveness: 10,
dexterityEffectiveness: 10,
@@ -534,10 +552,13 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
agilityExpGain: 0.0075,
charismaExpGain: 0.04,
repMultiplier: 1,
isPartTime: true,
applyText: `Apply to be a ${JobName.waiterPT}`,
hiredText: `Congratulations, you are now employed as a ${JobName.waiterPT}`,
},
[JobName.employeePT]: {
nextPosition: null,
field: JobField.partTimeEmployee,
field: JobField.employee,
baseSalary: 20,
strengthEffectiveness: 10,
dexterityEffectiveness: 10,
@@ -549,6 +570,9 @@ export function getCompanyPositionMetadata(): Record<JobName, CompanyPositionCto
agilityExpGain: 0.0075,
charismaExpGain: 0.03,
repMultiplier: 1,
isPartTime: true,
applyText: `Apply to be a ${JobName.employeePT}`,
hiredText: "Congratulations, you are now employed part-time",
},
};
}

View File

@@ -1,25 +1,42 @@
import { JobName } from "@enums";
export const softwareJobs = [
JobName.software0,
JobName.software1,
JobName.software2,
JobName.software3,
JobName.software4,
JobName.software5,
JobName.software6,
JobName.software7,
];
export const itJobs = [JobName.IT0, JobName.IT1, JobName.IT2, JobName.IT3];
export const netEngJobs = [JobName.networkEng0, JobName.networkEng1];
export const businessJobs = [
JobName.business0,
JobName.business1,
JobName.business2,
JobName.business3,
JobName.business4,
JobName.business5,
];
export const securityJobs = [JobName.security0, JobName.security1, JobName.security2, JobName.security3];
export const agentJobs = [JobName.agent0, JobName.agent1, JobName.agent2];
export const softwareConsultJobs = [JobName.softwareConsult0, JobName.softwareConsult1];
export const businessConsultJobs = [JobName.businessConsult0, JobName.businessConsult1];
import { JobName, JobField } from "@enums";
export const JobTracks: Record<JobField, readonly JobName[]> = {
[JobField.software]: [
JobName.software0,
JobName.software1,
JobName.software2,
JobName.software3,
JobName.software4,
JobName.software5,
JobName.software6,
JobName.software7,
],
[JobField.softwareConsultant]: [JobName.softwareConsult0, JobName.softwareConsult1],
[JobField.it]: [JobName.IT0, JobName.IT1, JobName.IT2, JobName.IT3],
[JobField.securityEngineer]: [JobName.securityEng],
[JobField.networkEngineer]: [JobName.networkEng0, JobName.networkEng1],
[JobField.business]: [
JobName.business0,
JobName.business1,
JobName.business2,
JobName.business3,
JobName.business4,
JobName.business5,
],
[JobField.businessConsultant]: [JobName.businessConsult0, JobName.businessConsult1],
[JobField.security]: [JobName.security0, JobName.security1, JobName.security2, JobName.security3],
[JobField.agent]: [JobName.agent0, JobName.agent1, JobName.agent2],
[JobField.employee]: [JobName.employee],
[JobField.partTimeEmployee]: [JobName.employeePT],
[JobField.waiter]: [JobName.waiter],
[JobField.partTimeWaiter]: [JobName.waiterPT],
} as const;
export const softwareJobs = JobTracks[JobField.software];
export const itJobs = JobTracks[JobField.it];
export const netEngJobs = JobTracks[JobField.networkEngineer];
export const businessJobs = JobTracks[JobField.business];
export const securityJobs = JobTracks[JobField.security];
export const agentJobs = JobTracks[JobField.agent];
export const softwareConsultJobs = JobTracks[JobField.softwareConsultant];
export const businessConsultJobs = JobTracks[JobField.businessConsultant];

View File

@@ -0,0 +1,63 @@
import type { CompanyPosition } from "../CompanyPosition";
import type { Company } from "../Company";
import * as React from "react";
import { Player } from "@player";
import { Typography } from "@mui/material";
import { ButtonWithTooltip } from "../../ui/Components/ButtonWithTooltip";
import { JobSummary } from "./JobSummary";
import { Requirement } from "../../ui/Components/Requirement";
import { getJobRequirements } from "../GetJobRequirements";
interface ApplyToJobProps {
company: Company;
position: CompanyPosition;
qualified: boolean;
}
/** React Component for a button that's used to apply for a job */
export function ApplyToJobButton({ company, position, qualified }: ApplyToJobProps): React.ReactElement {
const reqs = getJobRequirements(company, position);
const positionRequirements =
reqs.length == 0 ? (
<Typography>Accepting all applicants</Typography>
) : (
<>
<Typography>Requirements:</Typography>
{reqs.map((req, i) => (
<Requirement key={i} fulfilled={req.isSatisfied(Player)} value={req.toString()} />
))}
</>
);
const positionDetails = (
<>
<JobSummary company={company} position={position} />
{position.isPartTime && (
<Typography>
<br />
Part-time jobs have no penalty for
<br /> doing something else simultaneously.
</Typography>
)}
<br />
{positionRequirements}
</>
);
function applyForJob(): void {
Player.applyForJob(company, position);
}
return (
<ButtonWithTooltip
disabledTooltip={!qualified && positionDetails}
normalTooltip={positionDetails}
onClick={applyForJob}
tooltipProps={{ style: { display: "grid" } }}
>
{position.applyText}
</ButtonWithTooltip>
);
}

View File

@@ -0,0 +1,39 @@
import type { Company } from "../Company";
import type { CompanyPosition } from "../CompanyPosition";
import React from "react";
import { CompanyPositions } from "../CompanyPositions";
import { ApplyToJobButton } from "./ApplyToJobButton";
import { Player } from "@player";
interface JobListingsProps {
company: Company;
currentPosition: CompanyPosition | null;
}
export function JobListings({ company, currentPosition }: JobListingsProps): React.ReactElement {
const jobNames = [...company.companyPositions];
const qualifiedJobs = new Set(jobNames.filter((jobName) => Player.isQualified(company, CompanyPositions[jobName])));
const jobsToShow = [];
for (const jobName of jobNames) {
if (jobName === currentPosition?.name) continue;
const job = CompanyPositions[jobName];
const nextJobName = job.nextPosition;
// Don't show a job if we already qualify for a later job offered by this company
if (nextJobName && qualifiedJobs.has(nextJobName)) continue;
// Don't show a job if we don't qualify for it, unless it's a starting job or a promotion from current job
if (!qualifiedJobs.has(jobName) && job.requiredReputation > 0 && jobName !== currentPosition?.nextPosition) {
continue;
}
jobsToShow.push(job);
}
return (
<>
{jobsToShow.map((job) => (
<ApplyToJobButton key={job.name} company={company} position={job} qualified={qualifiedJobs.has(job.name)} />
))}
</>
);
}

View File

@@ -0,0 +1,35 @@
import type { Company } from "../Company";
import type { CompanyPosition } from "../CompanyPosition";
import { Typography } from "@mui/material";
import { Player } from "@player";
import * as React from "react";
import { CONSTANTS } from "../../Constants";
import { calculateCompanyWorkStats } from "../../Work/Formulas";
import { MoneyRate } from "../../ui/React/MoneyRate";
import { ReputationRate } from "../../ui/React/ReputationRate";
import { StatsTable } from "../../ui/React/StatsTable";
const CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;
interface JobSummaryProps {
company: Company;
position: CompanyPosition;
}
export function JobSummary({ company, position }: JobSummaryProps): React.ReactElement {
const workStats = calculateCompanyWorkStats(Player, company, position, company.favor);
return (
<>
<Typography>
<u>{position.name}</u>
</Typography>
<StatsTable
wide
rows={[
["Wages:", <MoneyRate key="money" money={workStats.money * CYCLES_PER_SEC} />],
["Reputation:", <ReputationRate key="rep" reputation={workStats.reputation * CYCLES_PER_SEC} />],
]}
/>
</>
);
}

View File

@@ -84,9 +84,9 @@ export const CONSTANTS: {
Donations: number; // number of blood/plasma/palette donation the dev have verified., boosts NFG
LatestUpdate: string;
} = {
VersionString: "2.5.1",
VersionString: "2.5.2",
isDevBranch: false,
VersionNumber: 36,
VersionNumber: 37,
/** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience
* and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then
@@ -223,65 +223,53 @@ export const CONSTANTS: {
// Also update doc/source/changelog.rst
LatestUpdate: `
## v2.5.1 - 30 November 2023 Update
### NOTES
For the Steam version, any special options you have enabled in the File menu may need to be reselected after this update, due to a change in how these settings are stored.
### MAJOR ADDITIONS
- Added a faction rumors system, to learn the requirements for joining factions ingame (@jjclark1982)
## v2.5.2 - 26 December 2023
### API
- (Bladeburner) Added ns.bladeburner.nextUpdate, which allows waiting for the next update of the bladeburner mechanic (@jjclark1982)
- (Bladeburner) Added ns.bladeburner.getNextBlackOp, which provides name and rank info for the next Black Operation that can be completed (@myCatsName)
- (Corporation) Added ns.corporation.nextUpdate, which allows waiting for the next update of the corporation mechanic (@jjclark1982)
- (Corporation) Added a size property to the return value of getProduct (@Caldwell-74)
- (Corporation) ns.corporation.getCorporation return value: 'state' property is deprecated. Added 'prevState' and 'nextState' properties. (@Caldwell-74)
- (Gang) Added ns.gang.nextUpdate, which allows waiting for the next update of the gang mechanic (@jjclark1982)
- (Singularity) Added a JobField enum, and used this for the ns.singularity.applyToCompany function (@alutman)
- (Singularity) ns.singularity.purchaseProgram now returns true for programs that are already owned even if the player doesn't have enough money to re-buy the program (@ncharris93)
- (Sleeve) Added nextCompletion promise as a property of sleeve bladeburner work tasks (@Snarling)
- (Stanek) Added an effect property to getFragment (@TheAimMan)
- (Stock) Added ns.stock.nextUpdate, which allows waiting for the next update of the stock mechanic (@jjclark1982)
- Added limit of 1e9 for additionalMsec property of HGWOptions (@d0sboots)
- ns.share effect is now boosted by host server core count (@TheAimMan)
- Fix a bug with HGWOptions that caused the default value to be 1 thread even for scripts running multiple threads (@DJMatch3000)
- (Singularity) ns.singularity.applyToCompany now returns the JobName if a job was obtained, or null otherwise - previously was boolean (@jjclark1982)
- (Singularity) ns.singularity.getCurrentWork now requires access to the singularity API (@TheAimMan)
- (Singularity) Added ns.singularity.getFactionInviteRequirements (@jjclark1982)
- (Stanek) ns.stanek.chargeFragment is now boosted by host server core count (@TheAimMan)
### BUGFIX
- (Bladeburner) Fixed a bug that could allow reaching -1 contracts available (@TheAimMan)
- (Corporation) Fix an incorrect calculation when adding more employees to an office (@Caldwell-74)
- (Corporation) Bulk purchase can no longer be used to exceed maximum warehouse capacity (@TheAimMan)
- (Corporation) Fixed a bug that allowed out-of-order research (@TheAimMan)
- (Corporation) Product production cost is stored separately for each city (@Caldwell-74)
- (Sleeve) Sleeve crime work can no longer cause an overflow of %completion when performing quick crimes during bonus time (@TheAimMan)
- (Stanek) Multipliers from Stanek are now calculated correctly even if the player has Entropy (@yichizhng)
- (Stanek) Fix a bug where Stanek bonuses were not being removed correctly after a reset (@TheAimMan)
- Fix an error that would occur in some cases when using gymGains or universityGains (@cigarmemr)
- Fix tab autocompletion when running a sceript without the run command (@mytskine)
- Fix a bug that could cause the wrong coding contract to be deleted when using rm (@TheAimMan)
- Scripts no longer show $0 for offline money income (@alutman)
- Faction invitations are now cleared properly when performing a reset (@alutman)
- API functions that work on a hostname no longer work on servers that have not been added to the network. (@TheAimMan)
- Fix an issue where the "True Recursion" achievement could be granted incorrectly (@jjclark1982)
- (Bladeburner) Operation team size modal now handles keyboard submission correctly (@Snarling)
- (Corporation) Fixed an issue with Warehouse size being out of sync following prduct sale (@Kelenius)
- (Factions) Fixed some display order issues, and possible multiple entries for a faction (@jjclark1982)
- (Factions) Fixed an issue with certain factions not becoming "known" when joining them (@jjclark1982)
- (Grafting) Entropy now has the correct negative effect on hacknet multipliers (@TheAimMan)
- (Hashnet) Fixed an issue where the SF9.3 reward server had an incorrect number of cores (@cigarmemr)
- (Terminal) Fixed a bug with script autocompletion when the script is inside a subdirectory (@draughtnyan)
### MISC
- (Sleeve) Added ability to set a sleeve to idle through the UI (@Sphyxis)
- Updated lots of dependencies (@Caldwell-74)
- Updated electron to the latest version (Steam version only) (@Snarling)
- Various spelling / grammar / wording fixes (@ficocelliguy, @Squirlll, @Warrobot10)
- Minor reorganization and streamlining in Script Editor code (@Snarling)
- Tweaked the .lit file referencing Illuminati to give a better idea about joining requirements (@d0sboots)
- (Steam version) Replaced outdated electron-config with electron-store (@tiziodcaio)
- Added basic protection for certain global values that could cause a recovery screen if reassigned (@Snarling)
- Fixed conditions for an easter egg message (@cigarmemr)
- (Bitverse) Changed listed difficulty for BN3 to "hard"
- (CodingContract) Reduce incidence of $0 coding contract rewards in circumstances where the reward would be $0 (@trambelus)
- (Corporation) Added better accounting of funds transactions (@jjclark1982)
- (Corporation) Remove cooldown on starting over corporation, but maintain remaining cooldown for selling shares (@jjclark1982)
- (Corporation) Removed some legacy code that was not doing anything (@catloversg)
- (DevMenu) Added the ability to add/remove sleeves from the dev menu (@Sphyxis, @Snarling)
- (Docs) Fixed various typos in documentation (@tdpeuter)
- (Factions) Added a documentation page for faction join requirements (@jjclark1982)
- (Formulas) Added clarification for the unit of time returned by hackTime, growTime, and weakenTime functions (@d0sboots)
- (Ports) Promises from port.nextWrite resolve in the same order they were created, instead of reverse order (@LJNeon)
- (Sleeve) Add task counters for Crime and Bladeburner tasks (@TheAimMan)
- (Stock) Add some randomization to timing for stockmarket forecast change events (@Caldwell-74)
- (Terminal) Added the --all option for unalias, to allow removing all aliases (@Sphyxis)
- Nerf noodle bar (various contributors)
### UI
- (Corporation) Improved the display of corporation state. (@Caldwell-74)
- (Corporation) Improved various Corporation UIs (@jjclark1982)
- (Gang) Removed the territory warfare toggle from the main Gang screen (@Tyasuh)
- Added number of exploits to import savegame comparison (@myCatsName)
- Dev menu improvements (@myCatsName, @Snarling)
- Added a credits button on the options page (@myCatsName)
- Message for buying TOR router no longer implies the need to connect to darkweb (@Kelenius)
- (Company) Rework of the job location details (@jjclark1982)
- (Company) Added previous/next buttons for job location if the player has multiple jobs (@Kelenius)
- (Factions) Only show warning about enemy factions for factions with enemies (@jjclark1982)
- (Stanek) Improved the display of the Stanek grid (@Kelenius)
`,
};

View File

@@ -34,7 +34,7 @@ export function NewDivision(corporation: Corporation, industry: IndustryType, na
} else if (name === "") {
throw new Error("New division must have a name!");
} else {
corporation.funds = corporation.funds - cost;
corporation.loseFunds(cost, "division");
corporation.divisions.set(
name,
new Division({
@@ -46,9 +46,12 @@ export function NewDivision(corporation: Corporation, industry: IndustryType, na
}
}
export function removeDivision(corporation: Corporation, name: string) {
if (!corporation.divisions.has(name)) throw new Error("There is no division called " + name);
export function removeDivision(corporation: Corporation, name: string): number {
const division = corporation.divisions.get(name);
if (!division) throw new Error("There is no division called " + name);
const price = division.calculateRecoupableValue();
corporation.divisions.delete(name);
// We also need to remove any exports that were pointing to the old division
for (const otherDivision of corporation.divisions.values()) {
for (const warehouse of getRecordValues(otherDivision.warehouses)) {
@@ -60,6 +63,8 @@ export function removeDivision(corporation: Corporation, name: string) {
}
}
}
corporation.gainFunds(price, "division");
return price;
}
export function purchaseOffice(corporation: Corporation, division: Division, city: CityName): void {
@@ -69,7 +74,7 @@ export function purchaseOffice(corporation: Corporation, division: Division, cit
if (division.offices[city]) {
throw new Error(`You have already expanded into ${city} for ${division.name}`);
}
corporation.addNonIncomeFunds(-corpConstants.officeInitialCost);
corporation.loseFunds(corpConstants.officeInitialCost, "division");
division.offices[city] = new OfficeSpace({
city: city,
size: corpConstants.officeInitialSize,
@@ -98,7 +103,7 @@ export function GoPublic(corporation: Corporation, numShares: number): void {
corporation.sharePrice = initialSharePrice;
corporation.issuedShares += numShares;
corporation.numShares -= numShares;
corporation.addNonIncomeFunds(numShares * initialSharePrice);
corporation.gainFunds(numShares * initialSharePrice, "public equity");
}
export function IssueNewShares(
@@ -123,7 +128,7 @@ export function IssueNewShares(
corporation.issuedShares += amount - privateShares;
corporation.investorShares += privateShares;
corporation.totalShares += amount;
corporation.addNonIncomeFunds(profit);
corporation.gainFunds(profit, "public equity");
// Set sharePrice directly because all formulas will be based on stale cycleValuation data
corporation.sharePrice = newSharePrice;
@@ -144,7 +149,7 @@ export function AcceptInvestmentOffer(corporation: Corporation): void {
const funding = val * percShares * roundMultiplier;
const investShares = Math.floor(corpConstants.initialShares * percShares);
corporation.fundingRound++;
corporation.addNonIncomeFunds(funding);
corporation.gainFunds(funding, "private equity");
corporation.numShares -= investShares;
corporation.investorShares += investShares;
@@ -310,7 +315,7 @@ export function BulkPurchase(
}
const cost = amt * material.marketPrice;
if (corp.funds >= cost) {
corp.funds = corp.funds - cost;
corp.loseFunds(cost, "materials");
material.stored += amt;
warehouse.sizeUsed = warehouse.sizeUsed + amt * matSize;
} else {
@@ -358,13 +363,13 @@ export function UpgradeOfficeSize(corp: Corporation, office: OfficeSpace, size:
const cost = corpConstants.officeInitialCost * mult;
if (corp.funds < cost) return;
office.size += size;
corp.addNonIncomeFunds(-cost);
corp.loseFunds(cost, "office");
}
export function BuyTea(corp: Corporation, office: OfficeSpace): boolean {
const cost = office.getTeaCost();
if (corp.funds < cost || !office.setTea()) return false;
corp.funds -= cost;
corp.loseFunds(cost, "tea");
return true;
}
@@ -378,7 +383,7 @@ export function ThrowParty(corp: Corporation, office: OfficeSpace, costPerEmploy
if (!office.setParty(mult)) {
return 0;
}
corp.funds -= cost;
corp.loseFunds(cost, "parties");
return mult;
}
@@ -386,7 +391,7 @@ export function ThrowParty(corp: Corporation, office: OfficeSpace, costPerEmploy
export function purchaseWarehouse(corp: Corporation, division: Division, city: CityName): void {
if (corp.funds < corpConstants.warehouseInitialCost) return;
if (division.warehouses[city]) return;
corp.addNonIncomeFunds(-corpConstants.warehouseInitialCost);
corp.loseFunds(corpConstants.warehouseInitialCost, "division");
division.warehouses[city] = new Warehouse({
division: division,
loc: city,
@@ -406,13 +411,13 @@ export function UpgradeWarehouse(corp: Corporation, division: Division, warehous
if (corp.funds < sizeUpgradeCost) return;
warehouse.level += amt;
warehouse.updateSize(corp, division);
corp.addNonIncomeFunds(-sizeUpgradeCost);
corp.loseFunds(sizeUpgradeCost, "warehouse");
}
export function HireAdVert(corp: Corporation, division: Division): void {
const cost = division.getAdVertCost();
if (corp.funds < cost) return;
corp.funds = corp.funds - cost;
corp.loseFunds(cost, "advert");
division.applyAdVert(corp);
}
@@ -454,7 +459,7 @@ export function MakeProduct(
throw new Error(`You already have a product with this name!`);
}
corp.funds = corp.funds - (designInvest + marketingInvest);
corp.loseFunds(designInvest + marketingInvest, "product development");
division.products.set(product.name, product);
}

View File

@@ -1,19 +1,19 @@
import { Player } from "@player";
import { CorpStateName, InvestmentOffer } from "@nsdefs";
import { CorpUnlockName, CorpUpgradeName, LiteratureName } from "@enums";
import { CorporationState } from "./CorporationState";
import { CorpUnlocks } from "./data/CorporationUnlocks";
import { CorpUpgrades } from "./data/CorporationUpgrades";
import * as corpConstants from "./data/Constants";
import { IndustriesData } from "./data/IndustryData";
import { FundsSource, LongTermFundsSources } from "./data/FundsSource";
import { Division } from "./Division";
import { calculateUpgradeCost } from "./helpers";
import { currentNodeMults } from "../BitNode/BitNodeMultipliers";
import { showLiterature } from "../Literature/LiteratureHelpers";
import { dialogBoxCreate } from "../ui/React/DialogBox";
import { constructorsForReviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver";
import { CorpStateName, InvestmentOffer } from "@nsdefs";
import { calculateUpgradeCost } from "./helpers";
import { JSONMap, JSONSet } from "../Types/Jsonable";
import { formatMoney } from "../ui/formatNumber";
import { isPositiveInteger } from "../types";
@@ -21,9 +21,10 @@ import { createEnumKeyedRecord, getRecordValues } from "../Types/Record";
export const CorporationResolvers: ((prevState: CorpStateName) => void)[] = [];
interface IParams {
interface ICorporationParams {
name?: string;
seedFunded?: boolean;
shareSaleCooldown?: number;
}
export class Corporation {
@@ -70,28 +71,29 @@ export class Corporation {
state = new CorporationState();
constructor(params: IParams = {}) {
constructor(params: ICorporationParams = {}) {
this.name = params.name || "The Corporation";
this.seedFunded = params.seedFunded ?? false;
this.shareSaleCooldown = params.shareSaleCooldown ?? 0;
}
addFunds(amt: number): void {
gainFunds(amt: number, source: FundsSource): void {
if (!isFinite(amt)) {
console.error("Trying to add invalid amount of funds. Report to a developer.");
console.error("Trying to add invalid amount of funds. Please report to game developer.");
return;
}
if (LongTermFundsSources.has(source)) {
// This cycle's assets include the purchase price of a capital expenditure.
// (It will likely depreciate in the following cycle.)
// Or the value of some non-accounted item (equity, hashes) that was sold for a capital gain.
// (It will remain as funds, with no effect on assetDelta.)
this.totalAssets += Math.abs(amt);
}
this.funds += amt;
}
// Add or subtract funds which should not be counted for valuation; e.g. investments,
// upgrades, stock issuance
addNonIncomeFunds(amt: number): void {
if (!isFinite(amt)) {
console.error("Trying to add invalid amount of funds. Report to a developer.");
return;
}
this.totalAssets += amt;
this.funds += amt;
loseFunds(amt: number, source: FundsSource): void {
return this.gainFunds(-amt, source);
}
getNextState(): CorpStateName {
@@ -142,8 +144,6 @@ export class Corporation {
this.revenue = this.revenue + ind.lastCycleRevenue;
this.expenses = this.expenses + ind.lastCycleExpenses;
});
const profit = this.revenue - this.expenses;
const cycleProfit = profit * (marketCycles * corpConstants.secondsPerMarketCycle);
if (isNaN(this.funds) || this.funds === Infinity || this.funds === -Infinity) {
dialogBoxCreate(
"There was an error calculating your Corporations funds and they got reset to 0. " +
@@ -152,18 +152,20 @@ export class Corporation {
);
this.funds = 150e9;
}
const cycleRevenue = this.revenue * (marketCycles * corpConstants.secondsPerMarketCycle);
const cycleExpenses = this.expenses * (marketCycles * corpConstants.secondsPerMarketCycle);
const cycleProfit = cycleRevenue - cycleExpenses;
this.gainFunds(cycleRevenue, "operating revenue");
this.loseFunds(cycleExpenses, "operating expenses");
if (this.dividendRate > 0 && cycleProfit > 0) {
// Validate input again, just to be safe
if (isNaN(this.dividendRate) || this.dividendRate < 0 || this.dividendRate > corpConstants.dividendMaxRate) {
console.error(`Invalid Corporation dividend rate: ${this.dividendRate}`);
} else {
const totalDividends = this.dividendRate * cycleProfit;
const retainedEarnings = cycleProfit - totalDividends;
Player.gainMoney(this.getCycleDividends(), "corporation");
this.addFunds(retainedEarnings);
this.loseFunds(totalDividends, "dividends");
}
} else {
this.addFunds(cycleProfit);
}
this.updateTotalAssets();
this.cycleValuation = this.determineCycleValuation();
@@ -209,7 +211,7 @@ export class Corporation {
val += assetDelta * 315e3;
}
val *= Math.pow(1.1, this.divisions.size);
val -= val % 1e6; //Round down to nearest millionth
val -= val % 1e6; //Round down to nearest million
}
if (val < 10e9) val = 10e9; // Base valuation
return val * currentNodeMults.CorporationValuation;
@@ -226,7 +228,7 @@ export class Corporation {
updateTotalAssets(): void {
let assets = this.funds;
this.divisions.forEach((ind) => {
assets += IndustriesData[ind.type].startingCost;
assets += ind.calculateRecoupableValue();
for (const warehouse of getRecordValues(ind.warehouses)) {
for (const mat of getRecordValues(warehouse.materials)) {
assets += mat.stored * mat.averagePrice;
@@ -367,7 +369,7 @@ export class Corporation {
if (this.unlocks.has(unlockName)) return `The corporation has already unlocked ${unlockName}`;
const price = CorpUnlocks[unlockName].price;
if (this.funds < price) return `Insufficient funds to purchase ${unlockName}, requires ${formatMoney(price)}`;
this.addNonIncomeFunds(-price);
this.loseFunds(price, "upgrades");
this.unlocks.add(unlockName);
// Apply effects for one-time unlocks
@@ -384,7 +386,7 @@ export class Corporation {
const upgrade = CorpUpgrades[upgradeName];
const totalCost = calculateUpgradeCost(this, upgrade, amount);
if (this.funds < totalCost) return `Not enough funds to purchase ${amount} of upgrade ${upgradeName}.`;
this.addNonIncomeFunds(-totalCost);
this.loseFunds(totalCost, "upgrades");
this.upgrades[upgradeName].level += amount;
this.upgrades[upgradeName].value += upgrade.benefit * amount;

View File

@@ -133,6 +133,17 @@ export class Division {
multSum < 1 ? (this.productionMult = 1) : (this.productionMult = multSum);
}
calculateRecoupableValue(): number {
let price = this.startingCost;
for (const city of getRecordKeys(this.offices)) {
if (city === CityName.Sector12) continue;
price += corpConstants.officeInitialCost;
if (this.warehouses[city]) price += corpConstants.warehouseInitialCost;
}
price /= 2;
return price;
}
updateWarehouseSizeUsed(warehouse: Warehouse): void {
warehouse.updateMaterialSizeUsed();
@@ -946,6 +957,7 @@ export class Division {
console.error(`Invalid State: ${state}`);
break;
} //End switch(this.state)
this.updateWarehouseSizeUsed(warehouse);
}
return totalProfit;
}

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