DOCUMENTATION: Update documentation of Corporation API (#1587)

This commit is contained in:
catloversg 2024-08-16 16:02:23 +07:00 committed by GitHub
parent d82247a404
commit a9cb46606c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
69 changed files with 841 additions and 256 deletions

@ -4,7 +4,7 @@
## Corporation.acceptInvestmentOffer() method ## Corporation.acceptInvestmentOffer() method
Accept investment based on you companies current valuation Accept the investment offer. The value of offer is based on current corporation valuation.
**Signature:** **Signature:**
@ -15,9 +15,9 @@ acceptInvestmentOffer(): boolean;
boolean boolean
An offer of investment true if you successfully accept the offer, false if not
## Remarks ## Remarks
Is based on current valuation and will not honer a specific Offer RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.bribe() method ## Corporation.bribe() method
Bribe a faction Bribe a faction.
**Signature:** **Signature:**
@ -23,5 +23,9 @@ bribe(factionName: string, amountCash: number): boolean;
boolean boolean
True if successful, false if not true if successful, false if not
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.buyBackShares() method ## Corporation.buyBackShares() method
Buyback Shares. Spend money from the player's wallet to transfer shares from public traders to the CEO. Buyback shares. Spend money from the player's wallet to transfer shares from public traders to the CEO.
**Signature:** **Signature:**
@ -22,3 +22,7 @@ buyBackShares(amount: number): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.createCorporation() method ## Corporation.createCorporation() method
Create a Corporation Create a Corporation.
**Signature:** **Signature:**
@ -17,7 +17,7 @@ createCorporation(corporationName: string, selfFund: boolean): boolean;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| corporationName | string | Name of the corporation | | corporationName | string | Name of the corporation |
| selfFund | boolean | If you should self fund, defaults to true, false will only work on BitNode 3 | | selfFund | boolean | If you want to self-fund. Defaults to true, false will only work in BitNode 3. |
**Returns:** **Returns:**
@ -25,3 +25,13 @@ boolean
true if created and false if not true if created and false if not
## Remarks
RAM cost: 20 GB
This function throws an error if:
- Try to self-fund outside BitNode 3.
- Be in a BitNode that has CorporationSoftcap (a BN modifier) less than 0.15. Use [getBitNodeMultipliers](./bitburner.ns.getbitnodemultipliers.md) to get the value of this modifier.

@ -4,7 +4,7 @@
## Corporation.expandCity() method ## Corporation.expandCity() method
Expand to a new city Expand to a new city.
**Signature:** **Signature:**
@ -23,3 +23,7 @@ expandCity(divisionName: string, city: CityName | `${CityName}`): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.expandIndustry() method ## Corporation.expandIndustry() method
Expand to a new industry Expand to a new industry.
**Signature:** **Signature:**
@ -23,3 +23,7 @@ expandIndustry(industryType: CorpIndustryName, divisionName: string): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.getBonusTime() method ## Corporation.getBonusTime() method
Get bonus time. Bonus time is accumulated when the game is offline or if the game is inactive in the browser. “Bonus time” makes the game progress faster. Get bonus time. Bonus time is accumulated when the game is offline or if the game is inactive in the browser. Bonus time makes the corporation progress faster.
**Signature:** **Signature:**
@ -17,3 +17,7 @@ number
Bonus time for the Corporation mechanic in milliseconds. Bonus time for the Corporation mechanic in milliseconds.
## Remarks
RAM cost: 0 GB

@ -4,7 +4,7 @@
## Corporation.getConstants() method ## Corporation.getConstants() method
Get corporation related constants Get corporation-related constants.
**Signature:** **Signature:**
@ -15,5 +15,9 @@ getConstants(): CorpConstants;
[CorpConstants](./bitburner.corpconstants.md) [CorpConstants](./bitburner.corpconstants.md)
corporation related constants Corporation-related constants
## Remarks
RAM cost: 0 GB

@ -4,7 +4,7 @@
## Corporation.getCorporation() method ## Corporation.getCorporation() method
Get corporation data Get corporation data.
**Signature:** **Signature:**
@ -17,3 +17,7 @@ getCorporation(): CorporationInfo;
Corporation data Corporation data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getDivision() method ## Corporation.getDivision() method
Get division data Get division data.
**Signature:** **Signature:**
@ -24,3 +24,7 @@ getDivision(divisionName: string): Division;
Division data Division data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getIndustryData() method ## Corporation.getIndustryData() method
Get constant industry definition data for a specific industry Get constant data of an industry.
**Signature:** **Signature:**
@ -16,9 +16,15 @@ getIndustryData(industryName: CorpIndustryName): CorpIndustryData;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| industryName | [CorpIndustryName](./bitburner.corpindustryname.md) | | | industryName | [CorpIndustryName](./bitburner.corpindustryname.md) | Name of the industry |
**Returns:** **Returns:**
[CorpIndustryData](./bitburner.corpindustrydata.md) [CorpIndustryData](./bitburner.corpindustrydata.md)
Industry data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getInvestmentOffer() method ## Corporation.getInvestmentOffer() method
Get an offer for investment based on you companies current valuation Get an offer for investment based on current corporation valuation.
**Signature:** **Signature:**
@ -17,3 +17,7 @@ getInvestmentOffer(): InvestmentOffer;
An offer of investment An offer of investment
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getMaterialData() method ## Corporation.getMaterialData() method
Get constant data for a specific material Get constant data of a material.
**Signature:** **Signature:**
@ -16,9 +16,15 @@ getMaterialData(materialName: CorpMaterialName): CorpMaterialConstantData;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| materialName | [CorpMaterialName](./bitburner.corpmaterialname.md) | | | materialName | [CorpMaterialName](./bitburner.corpmaterialname.md) | Name of the material |
**Returns:** **Returns:**
[CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md)
Material data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getUnlockCost() method ## Corporation.getUnlockCost() method
Gets the cost to unlock a one time unlockable upgrade Get the cost to unlock a one-time unlockable upgrade.
**Signature:** **Signature:**
@ -22,5 +22,9 @@ getUnlockCost(upgradeName: string): number;
number number
cost of the upgrade Cost of the upgrade
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getUpgradeLevel() method ## Corporation.getUpgradeLevel() method
Get the level of a levelable upgrade Get the level of a levelable upgrade.
**Signature:** **Signature:**
@ -22,5 +22,9 @@ getUpgradeLevel(upgradeName: string): number;
number number
the level of the upgrade The level of the upgrade
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.getUpgradeLevelCost() method ## Corporation.getUpgradeLevelCost() method
Gets the cost to unlock the next level of a levelable upgrade Get the cost to unlock the next level of a levelable upgrade.
**Signature:** **Signature:**
@ -22,5 +22,9 @@ getUpgradeLevelCost(upgradeName: string): number;
number number
cost of the upgrade Cost of the upgrade
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.goPublic() method ## Corporation.goPublic() method
Go public Go public.
**Signature:** **Signature:**
@ -16,7 +16,7 @@ goPublic(numShares: number): boolean;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| numShares | number | number of shares you would like to issue for your IPO | | numShares | number | Number of shares you would like to issue for your IPO |
**Returns:** **Returns:**
@ -24,3 +24,7 @@ boolean
true if you successfully go public, false if not true if you successfully go public, false if not
## Remarks
RAM cost: 20 GB

@ -15,5 +15,9 @@ hasCorporation(): boolean;
boolean boolean
whether the player has a corporation Whether the player has a corporation
## Remarks
RAM cost: 0 GB

@ -4,7 +4,7 @@
## Corporation.hasUnlock() method ## Corporation.hasUnlock() method
Check if you have a one time unlockable upgrade Check if you have a one-time unlockable upgrade.
**Signature:** **Signature:**
@ -24,3 +24,7 @@ boolean
true if unlocked and false if not true if unlocked and false if not
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## Corporation.issueDividends() method ## Corporation.issueDividends() method
Issue dividends Issue dividends.
**Signature:** **Signature:**
@ -22,3 +22,7 @@ issueDividends(rate: number): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.issueNewShares() method ## Corporation.issueNewShares() method
Issue new shares Issue new shares.
**Signature:** **Signature:**
@ -16,7 +16,7 @@ issueNewShares(amount?: number): number;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| amount | number | _(Optional)_ Number of new shares to issue, will be rounded to nearest 10m. Defaults to max amount. | | amount | number | _(Optional)_ Number of new shares to issue. It will be rounded to nearest 10 million. Defaults to max amount. |
**Returns:** **Returns:**
@ -24,3 +24,7 @@ number
Amount of funds generated for the corporation. Amount of funds generated for the corporation.
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.levelUpgrade() method ## Corporation.levelUpgrade() method
Level an upgrade. Level up an upgrade.
**Signature:** **Signature:**
@ -22,3 +22,7 @@ levelUpgrade(upgradeName: string): void;
void void
## Remarks
RAM cost: 20 GB

@ -17,30 +17,30 @@ export interface Corporation extends WarehouseAPI, OfficeAPI
| Method | Description | | Method | Description |
| --- | --- | | --- | --- |
| [acceptInvestmentOffer()](./bitburner.corporation.acceptinvestmentoffer.md) | Accept investment based on you companies current valuation | | [acceptInvestmentOffer()](./bitburner.corporation.acceptinvestmentoffer.md) | Accept the investment offer. The value of offer is based on current corporation valuation. |
| [bribe(factionName, amountCash)](./bitburner.corporation.bribe.md) | Bribe a faction | | [bribe(factionName, amountCash)](./bitburner.corporation.bribe.md) | Bribe a faction. |
| [buyBackShares(amount)](./bitburner.corporation.buybackshares.md) | Buyback Shares. Spend money from the player's wallet to transfer shares from public traders to the CEO. | | [buyBackShares(amount)](./bitburner.corporation.buybackshares.md) | Buyback shares. Spend money from the player's wallet to transfer shares from public traders to the CEO. |
| [createCorporation(corporationName, selfFund)](./bitburner.corporation.createcorporation.md) | Create a Corporation | | [createCorporation(corporationName, selfFund)](./bitburner.corporation.createcorporation.md) | Create a Corporation. |
| [expandCity(divisionName, city)](./bitburner.corporation.expandcity.md) | Expand to a new city | | [expandCity(divisionName, city)](./bitburner.corporation.expandcity.md) | Expand to a new city. |
| [expandIndustry(industryType, divisionName)](./bitburner.corporation.expandindustry.md) | Expand to a new industry | | [expandIndustry(industryType, divisionName)](./bitburner.corporation.expandindustry.md) | Expand to a new industry. |
| [getBonusTime()](./bitburner.corporation.getbonustime.md) | Get bonus time. Bonus time is accumulated when the game is offline or if the game is inactive in the browser. “Bonus time” makes the game progress faster. | | [getBonusTime()](./bitburner.corporation.getbonustime.md) | Get bonus time. Bonus time is accumulated when the game is offline or if the game is inactive in the browser. Bonus time makes the corporation progress faster. |
| [getConstants()](./bitburner.corporation.getconstants.md) | Get corporation related constants | | [getConstants()](./bitburner.corporation.getconstants.md) | Get corporation-related constants. |
| [getCorporation()](./bitburner.corporation.getcorporation.md) | Get corporation data | | [getCorporation()](./bitburner.corporation.getcorporation.md) | Get corporation data. |
| [getDivision(divisionName)](./bitburner.corporation.getdivision.md) | Get division data | | [getDivision(divisionName)](./bitburner.corporation.getdivision.md) | Get division data. |
| [getIndustryData(industryName)](./bitburner.corporation.getindustrydata.md) | Get constant industry definition data for a specific industry | | [getIndustryData(industryName)](./bitburner.corporation.getindustrydata.md) | Get constant data of an industry. |
| [getInvestmentOffer()](./bitburner.corporation.getinvestmentoffer.md) | Get an offer for investment based on you companies current valuation | | [getInvestmentOffer()](./bitburner.corporation.getinvestmentoffer.md) | Get an offer for investment based on current corporation valuation. |
| [getMaterialData(materialName)](./bitburner.corporation.getmaterialdata.md) | Get constant data for a specific material | | [getMaterialData(materialName)](./bitburner.corporation.getmaterialdata.md) | Get constant data of a material. |
| [getUnlockCost(upgradeName)](./bitburner.corporation.getunlockcost.md) | Gets the cost to unlock a one time unlockable upgrade | | [getUnlockCost(upgradeName)](./bitburner.corporation.getunlockcost.md) | Get the cost to unlock a one-time unlockable upgrade. |
| [getUpgradeLevel(upgradeName)](./bitburner.corporation.getupgradelevel.md) | Get the level of a levelable upgrade | | [getUpgradeLevel(upgradeName)](./bitburner.corporation.getupgradelevel.md) | Get the level of a levelable upgrade. |
| [getUpgradeLevelCost(upgradeName)](./bitburner.corporation.getupgradelevelcost.md) | Gets the cost to unlock the next level of a levelable upgrade | | [getUpgradeLevelCost(upgradeName)](./bitburner.corporation.getupgradelevelcost.md) | Get the cost to unlock the next level of a levelable upgrade. |
| [goPublic(numShares)](./bitburner.corporation.gopublic.md) | Go public | | [goPublic(numShares)](./bitburner.corporation.gopublic.md) | Go public. |
| [hasCorporation()](./bitburner.corporation.hascorporation.md) | Returns whether the player has a corporation. Does not require API access. | | [hasCorporation()](./bitburner.corporation.hascorporation.md) | Returns whether the player has a corporation. Does not require API access. |
| [hasUnlock(upgradeName)](./bitburner.corporation.hasunlock.md) | Check if you have a one time unlockable upgrade | | [hasUnlock(upgradeName)](./bitburner.corporation.hasunlock.md) | Check if you have a one-time unlockable upgrade. |
| [issueDividends(rate)](./bitburner.corporation.issuedividends.md) | Issue dividends | | [issueDividends(rate)](./bitburner.corporation.issuedividends.md) | Issue dividends. |
| [issueNewShares(amount)](./bitburner.corporation.issuenewshares.md) | Issue new shares | | [issueNewShares(amount)](./bitburner.corporation.issuenewshares.md) | Issue new shares. |
| [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level an upgrade. | | [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level up an upgrade. |
| [nextUpdate()](./bitburner.corporation.nextupdate.md) | Sleep until the next Corporation update has happened. | | [nextUpdate()](./bitburner.corporation.nextupdate.md) | Sleep until the next Corporation update happens. |
| [purchaseUnlock(upgradeName)](./bitburner.corporation.purchaseunlock.md) | Unlock an upgrade | | [purchaseUnlock(upgradeName)](./bitburner.corporation.purchaseunlock.md) | Unlock an upgrade. |
| [sellDivision(divisionName)](./bitburner.corporation.selldivision.md) | Sell a division | | [sellDivision(divisionName)](./bitburner.corporation.selldivision.md) | Sell a division. |
| [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares. Transfer shares from the CEO to public traders to receive money in the player's wallet. | | [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell shares. Transfer shares from the CEO to public traders to receive money in the player's wallet. |

@ -4,7 +4,7 @@
## Corporation.nextUpdate() method ## Corporation.nextUpdate() method
Sleep until the next Corporation update has happened. Sleep until the next Corporation update happens.
**Signature:** **Signature:**
@ -17,16 +17,16 @@ Promise&lt;[CorpStateName](./bitburner.corpstatename.md)<!-- -->&gt;
Promise that resolves to the name of the state that was just processed. Promise that resolves to the name of the state that was just processed.
I.e. when the state is PURCHASE, it means purchasing has just happened. Note that this is the state just before `getCorporation().state`<!-- -->.
Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
## Remarks ## Remarks
RAM cost: 1 GB RAM cost: 1 GB
The amount of real time spent asleep between updates can vary due to "bonus time" (usually 200 milliseconds - 2 seconds). The amount of real time spent asleep between updates can vary due to "bonus time" (usually 200 milliseconds - 2 seconds).
If the returned state is X, it means X just happened.
Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
## Example ## Example

@ -4,7 +4,7 @@
## Corporation.purchaseUnlock() method ## Corporation.purchaseUnlock() method
Unlock an upgrade Unlock an upgrade.
**Signature:** **Signature:**
@ -22,3 +22,7 @@ purchaseUnlock(upgradeName: string): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## Corporation.sellDivision() method ## Corporation.sellDivision() method
Sell a division Sell a division.
**Signature:** **Signature:**

@ -4,7 +4,7 @@
## Corporation.sellShares() method ## Corporation.sellShares() method
Sell Shares. Transfer shares from the CEO to public traders to receive money in the player's wallet. Sell shares. Transfer shares from the CEO to public traders to receive money in the player's wallet.
**Signature:** **Signature:**
@ -22,3 +22,7 @@ sellShares(amount: number): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## OfficeAPI.buyTea() method ## OfficeAPI.buyTea() method
Buy tea for your employees Buy tea for your employees.
**Signature:** **Signature:**
@ -25,3 +25,7 @@ boolean
true if buying tea was successful, false otherwise true if buying tea was successful, false otherwise
## Remarks
RAM cost: 20 GB

@ -24,3 +24,7 @@ number
The cost to hire AdVert. The cost to hire AdVert.
## Remarks
RAM cost: 10 GB

@ -24,3 +24,7 @@ number
Number of times you have hired AdVert. Number of times you have hired AdVert.
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## OfficeAPI.getOffice() method ## OfficeAPI.getOffice() method
Get data about an office Get data about an office.
**Signature:** **Signature:**
@ -25,3 +25,7 @@ getOffice(divisionName: string, city: CityName | `${CityName}`): Office;
Office data Office data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## OfficeAPI.getOfficeSizeUpgradeCost() method ## OfficeAPI.getOfficeSizeUpgradeCost() method
Cost to Upgrade office size. Get the cost to upgrade an office.
**Signature:** **Signature:**
@ -26,3 +26,7 @@ number
Cost of upgrading the office Cost of upgrading the office
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## OfficeAPI.getResearchCost() method ## OfficeAPI.getResearchCost() method
Get the cost to unlock research Get the cost to unlock a research.
**Signature:** **Signature:**
@ -23,5 +23,9 @@ getResearchCost(divisionName: string, researchName: string): number;
number number
cost Cost
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## OfficeAPI.hasResearched() method ## OfficeAPI.hasResearched() method
Gets if you have unlocked a research Check if you unlocked a research.
**Signature:** **Signature:**
@ -25,3 +25,7 @@ boolean
true is unlocked, false if not true is unlocked, false if not
## Remarks
RAM cost: 10 GB

@ -22,3 +22,7 @@ hireAdVert(divisionName: string): void;
void void
## Remarks
RAM cost: 20 GB

@ -26,3 +26,7 @@ boolean
True if an employee was hired, false otherwise True if an employee was hired, false otherwise
## Remarks
RAM cost: 20 GB

@ -14,23 +14,23 @@ export interface OfficeAPI
## Remarks ## Remarks
requires the Office API upgrade from your corporation. Requires the Office API upgrade from your corporation.
## Methods ## Methods
| Method | Description | | Method | Description |
| --- | --- | | --- | --- |
| [buyTea(divisionName, city)](./bitburner.officeapi.buytea.md) | Buy tea for your employees | | [buyTea(divisionName, city)](./bitburner.officeapi.buytea.md) | Buy tea for your employees. |
| [getHireAdVertCost(divisionName)](./bitburner.officeapi.gethireadvertcost.md) | Get the cost to hire AdVert. | | [getHireAdVertCost(divisionName)](./bitburner.officeapi.gethireadvertcost.md) | Get the cost to hire AdVert. |
| [getHireAdVertCount(divisionName)](./bitburner.officeapi.gethireadvertcount.md) | Get the number of times you have hired AdVert. | | [getHireAdVertCount(divisionName)](./bitburner.officeapi.gethireadvertcount.md) | Get the number of times you have hired AdVert. |
| [getOffice(divisionName, city)](./bitburner.officeapi.getoffice.md) | Get data about an office | | [getOffice(divisionName, city)](./bitburner.officeapi.getoffice.md) | Get data about an office. |
| [getOfficeSizeUpgradeCost(divisionName, city, size)](./bitburner.officeapi.getofficesizeupgradecost.md) | Cost to Upgrade office size. | | [getOfficeSizeUpgradeCost(divisionName, city, size)](./bitburner.officeapi.getofficesizeupgradecost.md) | Get the cost to upgrade an office. |
| [getResearchCost(divisionName, researchName)](./bitburner.officeapi.getresearchcost.md) | Get the cost to unlock research | | [getResearchCost(divisionName, researchName)](./bitburner.officeapi.getresearchcost.md) | Get the cost to unlock a research. |
| [hasResearched(divisionName, researchName)](./bitburner.officeapi.hasresearched.md) | Gets if you have unlocked a research | | [hasResearched(divisionName, researchName)](./bitburner.officeapi.hasresearched.md) | Check if you unlocked a research. |
| [hireAdVert(divisionName)](./bitburner.officeapi.hireadvert.md) | Hire AdVert. | | [hireAdVert(divisionName)](./bitburner.officeapi.hireadvert.md) | Hire AdVert. |
| [hireEmployee(divisionName, city, employeePosition)](./bitburner.officeapi.hireemployee.md) | Hire an employee. | | [hireEmployee(divisionName, city, employeePosition)](./bitburner.officeapi.hireemployee.md) | Hire an employee. |
| [research(divisionName, researchName)](./bitburner.officeapi.research.md) | Purchase a research | | [research(divisionName, researchName)](./bitburner.officeapi.research.md) | Purchase a research. |
| [setAutoJobAssignment(divisionName, city, job, amount)](./bitburner.officeapi.setautojobassignment.md) | Set the auto job assignment for a job | | [setAutoJobAssignment(divisionName, city, job, amount)](./bitburner.officeapi.setautojobassignment.md) | Set the job assignment for a job. |
| [throwParty(divisionName, city, costPerEmployee)](./bitburner.officeapi.throwparty.md) | Throw a party for your employees | | [throwParty(divisionName, city, costPerEmployee)](./bitburner.officeapi.throwparty.md) | Throw a party for your employees. |
| [upgradeOfficeSize(divisionName, city, size)](./bitburner.officeapi.upgradeofficesize.md) | Upgrade office size. | | [upgradeOfficeSize(divisionName, city, size)](./bitburner.officeapi.upgradeofficesize.md) | Upgrade office size. |

@ -4,7 +4,7 @@
## OfficeAPI.research() method ## OfficeAPI.research() method
Purchase a research Purchase a research.
**Signature:** **Signature:**
@ -23,3 +23,7 @@ research(divisionName: string, researchName: string): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## OfficeAPI.setAutoJobAssignment() method ## OfficeAPI.setAutoJobAssignment() method
Set the auto job assignment for a job Set the job assignment for a job.
**Signature:** **Signature:**
@ -27,3 +27,7 @@ boolean
true if the employee count reached the target amount, false if not true if the employee count reached the target amount, false if not
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## OfficeAPI.throwParty() method ## OfficeAPI.throwParty() method
Throw a party for your employees Throw a party for your employees.
**Signature:** **Signature:**
@ -26,3 +26,7 @@ number
Multiplier for morale, or zero on failure Multiplier for morale, or zero on failure
## Remarks
RAM cost: 20 GB

@ -24,3 +24,7 @@ upgradeOfficeSize(divisionName: string, city: CityName | `${CityName}`, size: nu
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.bulkPurchase() method ## WarehouseAPI.bulkPurchase() method
Set material to bulk buy Set material to bulk-buy.
**Signature:** **Signature:**
@ -25,3 +25,7 @@ bulkPurchase(divisionName: string, city: CityName | `${CityName}`, materialName:
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.buyMaterial() method ## WarehouseAPI.buyMaterial() method
Set material buy data Set material buy data.
**Signature:** **Signature:**
@ -25,3 +25,7 @@ buyMaterial(divisionName: string, city: CityName | `${CityName}`, materialName:
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.cancelExportMaterial() method ## WarehouseAPI.cancelExportMaterial() method
Cancel material export Cancel material export.
**Signature:** **Signature:**
@ -32,3 +32,7 @@ cancelExportMaterial(
void void
## Remarks
RAM cost: 20 GB

@ -23,3 +23,7 @@ discontinueProduct(divisionName: string, productName: string): void;
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.exportMaterial() method ## WarehouseAPI.exportMaterial() method
Set material export data Set material export data.
**Signature:** **Signature:**
@ -34,3 +34,7 @@ exportMaterial(
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.getMaterial() method ## WarehouseAPI.getMaterial() method
Get material data Get material data.
**Signature:** **Signature:**
@ -24,5 +24,9 @@ getMaterial(divisionName: string, city: CityName | `${CityName}`, materialName:
[Material](./bitburner.material.md) [Material](./bitburner.material.md)
material data Material data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## WarehouseAPI.getProduct() method ## WarehouseAPI.getProduct() method
Get product data Get product data.
**Signature:** **Signature:**
@ -24,5 +24,9 @@ getProduct(divisionName: string, cityName: CityName | `${CityName}`, productName
[Product](./bitburner.product.md) [Product](./bitburner.product.md)
product data Product data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## WarehouseAPI.getUpgradeWarehouseCost() method ## WarehouseAPI.getUpgradeWarehouseCost() method
Gets the cost to upgrade a warehouse to the next level Get the cost to upgrade a warehouse to the next level.
**Signature:** **Signature:**
@ -18,11 +18,15 @@ getUpgradeWarehouseCost(divisionName: string, city: CityName | `${CityName}`, am
| --- | --- | --- | | --- | --- | --- |
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city | | city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city |
| amt | number | _(Optional)_ amount of upgrades. Optional, defaults to 1 | | amt | number | _(Optional)_ Amount of upgrades. Optional. Defaults to 1. |
**Returns:** **Returns:**
number number
cost to upgrade Cost to upgrade
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## WarehouseAPI.getWarehouse() method ## WarehouseAPI.getWarehouse() method
Get warehouse data Get warehouse data.
**Signature:** **Signature:**
@ -23,5 +23,9 @@ getWarehouse(divisionName: string, city: CityName | `${CityName}`): Warehouse;
[Warehouse](./bitburner.warehouse.md) [Warehouse](./bitburner.warehouse.md)
warehouse data Warehouse data
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## WarehouseAPI.hasWarehouse() method ## WarehouseAPI.hasWarehouse() method
Check if you have a warehouse in city Check if you have a warehouse in city.
**Signature:** **Signature:**
@ -23,5 +23,9 @@ hasWarehouse(divisionName: string, city: CityName | `${CityName}`): boolean;
boolean boolean
true if warehouse is present, false if not true if warehouse is present, false if not.
## Remarks
RAM cost: 10 GB

@ -4,7 +4,7 @@
## WarehouseAPI.limitMaterialProduction() method ## WarehouseAPI.limitMaterialProduction() method
Limit Material Production. Limit material production.
**Signature:** **Signature:**
@ -30,3 +30,7 @@ limitMaterialProduction(
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.limitProductProduction() method ## WarehouseAPI.limitProductProduction() method
Limit Product Production. Limit product production.
**Signature:** **Signature:**
@ -25,3 +25,7 @@ limitProductProduction(divisionName: string, city: CityName | `${CityName}`, pro
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.makeProduct() method ## WarehouseAPI.makeProduct() method
Create a new product Create a new product.
**Signature:** **Signature:**
@ -32,3 +32,7 @@ makeProduct(
void void
## Remarks
RAM cost: 20 GB

@ -20,27 +20,27 @@ Requires the Warehouse API upgrade from your corporation.
| Method | Description | | Method | Description |
| --- | --- | | --- | --- |
| [bulkPurchase(divisionName, city, materialName, amt)](./bitburner.warehouseapi.bulkpurchase.md) | Set material to bulk buy | | [bulkPurchase(divisionName, city, materialName, amt)](./bitburner.warehouseapi.bulkpurchase.md) | Set material to bulk-buy. |
| [buyMaterial(divisionName, city, materialName, amt)](./bitburner.warehouseapi.buymaterial.md) | Set material buy data | | [buyMaterial(divisionName, city, materialName, amt)](./bitburner.warehouseapi.buymaterial.md) | Set material buy data. |
| [cancelExportMaterial(sourceDivision, sourceCity, targetDivision, targetCity, materialName)](./bitburner.warehouseapi.cancelexportmaterial.md) | Cancel material export | | [cancelExportMaterial(sourceDivision, sourceCity, targetDivision, targetCity, materialName)](./bitburner.warehouseapi.cancelexportmaterial.md) | Cancel material export. |
| [discontinueProduct(divisionName, productName)](./bitburner.warehouseapi.discontinueproduct.md) | Discontinue a product. | | [discontinueProduct(divisionName, productName)](./bitburner.warehouseapi.discontinueproduct.md) | Discontinue a product. |
| [exportMaterial(sourceDivision, sourceCity, targetDivision, targetCity, materialName, amt)](./bitburner.warehouseapi.exportmaterial.md) | Set material export data | | [exportMaterial(sourceDivision, sourceCity, targetDivision, targetCity, materialName, amt)](./bitburner.warehouseapi.exportmaterial.md) | Set material export data. |
| [getMaterial(divisionName, city, materialName)](./bitburner.warehouseapi.getmaterial.md) | Get material data | | [getMaterial(divisionName, city, materialName)](./bitburner.warehouseapi.getmaterial.md) | Get material data. |
| [getProduct(divisionName, cityName, productName)](./bitburner.warehouseapi.getproduct.md) | Get product data | | [getProduct(divisionName, cityName, productName)](./bitburner.warehouseapi.getproduct.md) | Get product data. |
| [getUpgradeWarehouseCost(divisionName, city, amt)](./bitburner.warehouseapi.getupgradewarehousecost.md) | Gets the cost to upgrade a warehouse to the next level | | [getUpgradeWarehouseCost(divisionName, city, amt)](./bitburner.warehouseapi.getupgradewarehousecost.md) | Get the cost to upgrade a warehouse to the next level. |
| [getWarehouse(divisionName, city)](./bitburner.warehouseapi.getwarehouse.md) | Get warehouse data | | [getWarehouse(divisionName, city)](./bitburner.warehouseapi.getwarehouse.md) | Get warehouse data. |
| [hasWarehouse(divisionName, city)](./bitburner.warehouseapi.haswarehouse.md) | Check if you have a warehouse in city | | [hasWarehouse(divisionName, city)](./bitburner.warehouseapi.haswarehouse.md) | Check if you have a warehouse in city. |
| [limitMaterialProduction(divisionName, city, materialName, qty)](./bitburner.warehouseapi.limitmaterialproduction.md) | Limit Material Production. | | [limitMaterialProduction(divisionName, city, materialName, qty)](./bitburner.warehouseapi.limitmaterialproduction.md) | Limit material production. |
| [limitProductProduction(divisionName, city, productName, qty)](./bitburner.warehouseapi.limitproductproduction.md) | Limit Product Production. | | [limitProductProduction(divisionName, city, productName, qty)](./bitburner.warehouseapi.limitproductproduction.md) | Limit product production. |
| [makeProduct(divisionName, city, productName, designInvest, marketingInvest)](./bitburner.warehouseapi.makeproduct.md) | Create a new product | | [makeProduct(divisionName, city, productName, designInvest, marketingInvest)](./bitburner.warehouseapi.makeproduct.md) | Create a new product. |
| [purchaseWarehouse(divisionName, city)](./bitburner.warehouseapi.purchasewarehouse.md) | Purchase warehouse for a new city | | [purchaseWarehouse(divisionName, city)](./bitburner.warehouseapi.purchasewarehouse.md) | Purchase warehouse for a new city. |
| [sellMaterial(divisionName, city, materialName, amt, price)](./bitburner.warehouseapi.sellmaterial.md) | Set material sell data. | | [sellMaterial(divisionName, city, materialName, amt, price)](./bitburner.warehouseapi.sellmaterial.md) | Set material sell data. |
| [sellProduct(divisionName, city, productName, amt, price, all)](./bitburner.warehouseapi.sellproduct.md) | Set product sell data. | | [sellProduct(divisionName, city, productName, amt, price, all)](./bitburner.warehouseapi.sellproduct.md) | Set product sell data. |
| [setMaterialMarketTA1(divisionName, city, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta1.md) | Set market TA 1 for a material. | | [setMaterialMarketTA1(divisionName, city, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta1.md) | Set Market-TA1 for a material. |
| [setMaterialMarketTA2(divisionName, city, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta2.md) | Set market TA 2 for a material. | | [setMaterialMarketTA2(divisionName, city, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta2.md) | Set Market-TA2 for a material. |
| [setProductMarketTA1(divisionName, productName, on)](./bitburner.warehouseapi.setproductmarketta1.md) | \* Set market TA 1 for a product. | | [setProductMarketTA1(divisionName, productName, on)](./bitburner.warehouseapi.setproductmarketta1.md) | Set Market-TA1 for a product. |
| [setProductMarketTA2(divisionName, productName, on)](./bitburner.warehouseapi.setproductmarketta2.md) | Set market TA 2 for a product. | | [setProductMarketTA2(divisionName, productName, on)](./bitburner.warehouseapi.setproductmarketta2.md) | Set Market-TA2 for a product. |
| [setSmartSupply(divisionName, city, enabled)](./bitburner.warehouseapi.setsmartsupply.md) | Set smart supply | | [setSmartSupply(divisionName, city, enabled)](./bitburner.warehouseapi.setsmartsupply.md) | Set smart supply. |
| [setSmartSupplyOption(divisionName, city, materialName, option)](./bitburner.warehouseapi.setsmartsupplyoption.md) | Set whether smart supply uses leftovers before buying | | [setSmartSupplyOption(divisionName, city, materialName, option)](./bitburner.warehouseapi.setsmartsupplyoption.md) | Set whether smart supply uses leftovers before buying. |
| [upgradeWarehouse(divisionName, city, amt)](./bitburner.warehouseapi.upgradewarehouse.md) | Upgrade warehouse | | [upgradeWarehouse(divisionName, city, amt)](./bitburner.warehouseapi.upgradewarehouse.md) | Upgrade warehouse. |

@ -4,7 +4,7 @@
## WarehouseAPI.purchaseWarehouse() method ## WarehouseAPI.purchaseWarehouse() method
Purchase warehouse for a new city Purchase warehouse for a new city.
**Signature:** **Signature:**
@ -23,3 +23,7 @@ purchaseWarehouse(divisionName: string, city: CityName | `${CityName}`): void;
void void
## Remarks
RAM cost: 20 GB

@ -32,3 +32,7 @@ sellMaterial(
void void
## Remarks
RAM cost: 20 GB

@ -34,3 +34,7 @@ sellProduct(
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.setMaterialMarketTA1() method ## WarehouseAPI.setMaterialMarketTA1() method
Set market TA 1 for a material. Set Market-TA1 for a material.
**Signature:** **Signature:**
@ -19,9 +19,13 @@ setMaterialMarketTA1(divisionName: string, city: CityName | `${CityName}`, mater
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city | | city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city |
| materialName | string | Name of the material | | materialName | string | Name of the material |
| on | boolean | market ta enabled | | on | boolean | Use true to enable, false otherwise. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.setMaterialMarketTA2() method ## WarehouseAPI.setMaterialMarketTA2() method
Set market TA 2 for a material. Set Market-TA2 for a material.
**Signature:** **Signature:**
@ -19,9 +19,13 @@ setMaterialMarketTA2(divisionName: string, city: CityName | `${CityName}`, mater
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city | | city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city |
| materialName | string | Name of the material | | materialName | string | Name of the material |
| on | boolean | market ta enabled | | on | boolean | Use true to enable, false otherwise. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.setProductMarketTA1() method ## WarehouseAPI.setProductMarketTA1() method
\* Set market TA 1 for a product. Set Market-TA1 for a product.
**Signature:** **Signature:**
@ -18,9 +18,13 @@ setProductMarketTA1(divisionName: string, productName: string, on: boolean): voi
| --- | --- | --- | | --- | --- | --- |
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| productName | string | Name of the product | | productName | string | Name of the product |
| on | boolean | market ta enabled | | on | boolean | Use true to enable, false otherwise. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.setProductMarketTA2() method ## WarehouseAPI.setProductMarketTA2() method
Set market TA 2 for a product. Set Market-TA2 for a product.
**Signature:** **Signature:**
@ -18,9 +18,13 @@ setProductMarketTA2(divisionName: string, productName: string, on: boolean): voi
| --- | --- | --- | | --- | --- | --- |
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| productName | string | Name of the product | | productName | string | Name of the product |
| on | boolean | market ta enabled | | on | boolean | Use true to enable, false otherwise. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.setSmartSupply() method ## WarehouseAPI.setSmartSupply() method
Set smart supply Set smart supply.
**Signature:** **Signature:**
@ -18,9 +18,13 @@ setSmartSupply(divisionName: string, city: CityName | `${CityName}`, enabled: bo
| --- | --- | --- | | --- | --- | --- |
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city | | city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city |
| enabled | boolean | smart supply enabled | | enabled | boolean | Use true to enable, false otherwise. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.setSmartSupplyOption() method ## WarehouseAPI.setSmartSupplyOption() method
Set whether smart supply uses leftovers before buying Set whether smart supply uses leftovers before buying.
**Signature:** **Signature:**
@ -24,9 +24,13 @@ setSmartSupplyOption(
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city | | city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city |
| materialName | string | Name of the material | | materialName | string | Name of the material |
| option | [CorpSmartSupplyOption](./bitburner.corpsmartsupplyoption.md) | smart supply option, "leftovers" to use leftovers, "imports" to use only imported materials, "none" to not use materials from store | | option | [CorpSmartSupplyOption](./bitburner.corpsmartsupplyoption.md) | Smart supply option. Set "leftovers" to use leftovers, "imports" to use only imported materials, and "none" to not use stored materials. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -4,7 +4,7 @@
## WarehouseAPI.upgradeWarehouse() method ## WarehouseAPI.upgradeWarehouse() method
Upgrade warehouse Upgrade warehouse.
**Signature:** **Signature:**
@ -18,9 +18,13 @@ upgradeWarehouse(divisionName: string, city: CityName | `${CityName}`, amt?: num
| --- | --- | --- | | --- | --- | --- |
| divisionName | string | Name of the division | | divisionName | string | Name of the division |
| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city | | city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)<!-- -->}\` | Name of the city |
| amt | number | _(Optional)_ amount of upgrades defaults to 1 | | amt | number | _(Optional)_ Amount of upgrades. Defaults to 1. |
**Returns:** **Returns:**
void void
## Remarks
RAM cost: 20 GB

@ -82,7 +82,7 @@ export const RamCostConstants = {
StanekAcceptGift: 2, StanekAcceptGift: 2,
CycleTiming: 1, CycleTiming: 1,
}; } as const;
function SF4Cost(cost: number): () => number { function SF4Cost(cost: number): () => number {
return () => { return () => {
@ -398,19 +398,16 @@ const grafting = {
} as const; } as const;
const corporation = { const corporation = {
hasCorporation: 0, // This one is free hasCorporation: 0,
getConstants: 0,
getBonusTime: 0,
nextUpdate: RamCostConstants.CycleTiming,
getIndustryData: RamCostConstants.CorporationInfo,
getMaterialData: RamCostConstants.CorporationInfo,
issueNewShares: RamCostConstants.CorporationAction,
createCorporation: RamCostConstants.CorporationAction, createCorporation: RamCostConstants.CorporationAction,
hasUnlock: RamCostConstants.CorporationInfo, hasUnlock: RamCostConstants.CorporationInfo,
getUnlockCost: RamCostConstants.CorporationInfo, getUnlockCost: RamCostConstants.CorporationInfo,
getUpgradeLevel: RamCostConstants.CorporationInfo, getUpgradeLevel: RamCostConstants.CorporationInfo,
getUpgradeLevelCost: RamCostConstants.CorporationInfo, getUpgradeLevelCost: RamCostConstants.CorporationInfo,
getInvestmentOffer: RamCostConstants.CorporationInfo, getInvestmentOffer: RamCostConstants.CorporationInfo,
getConstants: 0,
getIndustryData: RamCostConstants.CorporationInfo,
getMaterialData: RamCostConstants.CorporationInfo,
acceptInvestmentOffer: RamCostConstants.CorporationAction, acceptInvestmentOffer: RamCostConstants.CorporationAction,
goPublic: RamCostConstants.CorporationAction, goPublic: RamCostConstants.CorporationAction,
bribe: RamCostConstants.CorporationAction, bribe: RamCostConstants.CorporationAction,
@ -421,8 +418,13 @@ const corporation = {
purchaseUnlock: RamCostConstants.CorporationAction, purchaseUnlock: RamCostConstants.CorporationAction,
levelUpgrade: RamCostConstants.CorporationAction, levelUpgrade: RamCostConstants.CorporationAction,
issueDividends: RamCostConstants.CorporationAction, issueDividends: RamCostConstants.CorporationAction,
issueNewShares: RamCostConstants.CorporationAction,
buyBackShares: RamCostConstants.CorporationAction, buyBackShares: RamCostConstants.CorporationAction,
sellShares: RamCostConstants.CorporationAction, sellShares: RamCostConstants.CorporationAction,
getBonusTime: 0,
nextUpdate: RamCostConstants.CycleTiming,
sellDivision: RamCostConstants.CorporationAction,
// Warehouse API
sellMaterial: RamCostConstants.CorporationAction, sellMaterial: RamCostConstants.CorporationAction,
sellProduct: RamCostConstants.CorporationAction, sellProduct: RamCostConstants.CorporationAction,
discontinueProduct: RamCostConstants.CorporationAction, discontinueProduct: RamCostConstants.CorporationAction,
@ -446,6 +448,7 @@ const corporation = {
limitProductProduction: RamCostConstants.CorporationAction, limitProductProduction: RamCostConstants.CorporationAction,
getUpgradeWarehouseCost: RamCostConstants.CorporationInfo, getUpgradeWarehouseCost: RamCostConstants.CorporationInfo,
hasWarehouse: RamCostConstants.CorporationInfo, hasWarehouse: RamCostConstants.CorporationInfo,
// Warehouse API
hireEmployee: RamCostConstants.CorporationAction, hireEmployee: RamCostConstants.CorporationAction,
upgradeOfficeSize: RamCostConstants.CorporationAction, upgradeOfficeSize: RamCostConstants.CorporationAction,
throwParty: RamCostConstants.CorporationAction, throwParty: RamCostConstants.CorporationAction,
@ -459,7 +462,6 @@ const corporation = {
hasResearched: RamCostConstants.CorporationInfo, hasResearched: RamCostConstants.CorporationInfo,
setAutoJobAssignment: RamCostConstants.CorporationAction, setAutoJobAssignment: RamCostConstants.CorporationAction,
getOfficeSizeUpgradeCost: RamCostConstants.CorporationInfo, getOfficeSizeUpgradeCost: RamCostConstants.CorporationInfo,
sellDivision: RamCostConstants.CorporationAction,
} as const; } as const;
/** RamCosts guaranteed to match ns structure 1:1 (aside from args and enums). /** RamCosts guaranteed to match ns structure 1:1 (aside from args and enums).

@ -161,7 +161,7 @@ function parseOnlyRamCalculate(
// Finally, walk the reference map and generate a ram cost. The initial set of keys to scan // Finally, walk the reference map and generate a ram cost. The initial set of keys to scan
// are those that start with the name of the main script. // are those that start with the name of the main script.
let ram = RamCostConstants.Base; let ram: number = RamCostConstants.Base;
const detailedCosts: RamUsageEntry[] = [{ type: "misc", name: "baseCost", cost: RamCostConstants.Base }]; const detailedCosts: RamUsageEntry[] = [{ type: "misc", name: "baseCost", cost: RamCostConstants.Base }];
const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule)); const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule));
const resolvedRefs = new Set(); const resolvedRefs = new Set();

@ -59,7 +59,7 @@ export class RunningScript {
pid = -1; pid = -1;
// How much RAM this script uses for ONE thread // How much RAM this script uses for ONE thread
ramUsage = RamCostConstants.Base; ramUsage: number = RamCostConstants.Base;
// hostname of the server on which this script is running // hostname of the server on which this script is running
server = ""; server = "";

@ -7579,7 +7579,7 @@ export interface NS {
* ns.tprint(`The last augmentation reset was: ${new Date(lastAugReset)}`); * ns.tprint(`The last augmentation reset was: ${new Date(lastAugReset)}`);
* ns.tprint(`It has been ${Date.now() - lastAugReset} ms since the last augmentation reset.`); * ns.tprint(`It has been ${Date.now() - lastAugReset} ms since the last augmentation reset.`);
* ``` * ```
* */ */
getResetInfo(): ResetInfo; getResetInfo(): ResetInfo;
/** /**
@ -7934,88 +7934,148 @@ export type NSEnums = {
/** /**
* Corporation Office API * Corporation Office API
*
* @remarks * @remarks
* requires the Office API upgrade from your corporation. * Requires the Office API upgrade from your corporation.
*
* @public * @public
*/ */
export interface OfficeAPI { export interface OfficeAPI {
/** /**
* Hire an employee. * Hire an employee.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param employeePosition - Position to place into. Defaults to "Unassigned". * @param employeePosition - Position to place into. Defaults to "Unassigned".
* @returns True if an employee was hired, false otherwise * @returns True if an employee was hired, false otherwise
*/ */
hireEmployee(divisionName: string, city: CityName | `${CityName}`, employeePosition?: CorpEmployeePosition): boolean; hireEmployee(divisionName: string, city: CityName | `${CityName}`, employeePosition?: CorpEmployeePosition): boolean;
/** /**
* Upgrade office size. * Upgrade office size.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param size - Amount of positions to open * @param size - Amount of positions to open
*/ */
upgradeOfficeSize(divisionName: string, city: CityName | `${CityName}`, size: number): void; upgradeOfficeSize(divisionName: string, city: CityName | `${CityName}`, size: number): void;
/** /**
* Throw a party for your employees * Throw a party for your employees.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param costPerEmployee - Amount to spend per employee. * @param costPerEmployee - Amount to spend per employee.
* @returns Multiplier for morale, or zero on failure * @returns Multiplier for morale, or zero on failure
*/ */
throwParty(divisionName: string, city: CityName | `${CityName}`, costPerEmployee: number): number; throwParty(divisionName: string, city: CityName | `${CityName}`, costPerEmployee: number): number;
/** /**
* Buy tea for your employees * Buy tea for your employees.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @returns true if buying tea was successful, false otherwise * @returns true if buying tea was successful, false otherwise
*/ */
buyTea(divisionName: string, city: CityName | `${CityName}`): boolean; buyTea(divisionName: string, city: CityName | `${CityName}`): boolean;
/** /**
* Hire AdVert. * Hire AdVert.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
*/ */
hireAdVert(divisionName: string): void; hireAdVert(divisionName: string): void;
/** /**
* Purchase a research * Purchase a research.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param researchName - Name of the research * @param researchName - Name of the research
*/ */
research(divisionName: string, researchName: string): void; research(divisionName: string, researchName: string): void;
/** /**
* Get data about an office * Get data about an office.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @returns Office data * @returns Office data
*/ */
getOffice(divisionName: string, city: CityName | `${CityName}`): Office; getOffice(divisionName: string, city: CityName | `${CityName}`): Office;
/** /**
* Get the cost to hire AdVert. * Get the cost to hire AdVert.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division. * @param divisionName - Name of the division.
* @returns The cost to hire AdVert. * @returns The cost to hire AdVert.
*/ */
getHireAdVertCost(divisionName: string): number; getHireAdVertCost(divisionName: string): number;
/** /**
* Get the number of times you have hired AdVert. * Get the number of times you have hired AdVert.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division. * @param divisionName - Name of the division.
* @returns Number of times you have hired AdVert. * @returns Number of times you have hired AdVert.
*/ */
getHireAdVertCount(divisionName: string): number; getHireAdVertCount(divisionName: string): number;
/** /**
* Get the cost to unlock research * Get the cost to unlock a research.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param researchName - Name of the research * @param researchName - Name of the research
* @returns cost * @returns Cost
*/ */
getResearchCost(divisionName: string, researchName: string): number; getResearchCost(divisionName: string, researchName: string): number;
/** /**
* Gets if you have unlocked a research * Check if you unlocked a research.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param researchName - Name of the research * @param researchName - Name of the research
* @returns true is unlocked, false if not * @returns true is unlocked, false if not
*/ */
hasResearched(divisionName: string, researchName: string): boolean; hasResearched(divisionName: string, researchName: string): boolean;
/** /**
* Set the auto job assignment for a job * Set the job assignment for a job.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param job - Name of the job * @param job - Name of the job
@ -8023,8 +8083,13 @@ export interface OfficeAPI {
* @returns true if the employee count reached the target amount, false if not * @returns true if the employee count reached the target amount, false if not
*/ */
setAutoJobAssignment(divisionName: string, city: CityName | `${CityName}`, job: string, amount: number): boolean; setAutoJobAssignment(divisionName: string, city: CityName | `${CityName}`, job: string, amount: number): boolean;
/** /**
* Cost to Upgrade office size. * Get the cost to upgrade an office.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param size - Amount of positions to open * @param size - Amount of positions to open
@ -8035,13 +8100,19 @@ export interface OfficeAPI {
/** /**
* Corporation Warehouse API * Corporation Warehouse API
*
* @remarks * @remarks
* Requires the Warehouse API upgrade from your corporation. * Requires the Warehouse API upgrade from your corporation.
*
* @public * @public
*/ */
export interface WarehouseAPI { export interface WarehouseAPI {
/** /**
* Set material sell data. * Set material sell data.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
@ -8055,8 +8126,13 @@ export interface WarehouseAPI {
amt: string, amt: string,
price: string, price: string,
): void; ): void;
/** /**
* Set product sell data. * Set product sell data.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param productName - Name of the product * @param productName - Name of the product
@ -8072,25 +8148,40 @@ export interface WarehouseAPI {
price: string, price: string,
all: boolean, all: boolean,
): void; ): void;
/** /**
* Discontinue a product. * Discontinue a product.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param productName - Name of the product * @param productName - Name of the product
*/ */
discontinueProduct(divisionName: string, productName: string): void; discontinueProduct(divisionName: string, productName: string): void;
/** /**
* Set smart supply * Set smart supply.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param enabled - smart supply enabled * @param enabled - Use true to enable, false otherwise.
*/ */
setSmartSupply(divisionName: string, city: CityName | `${CityName}`, enabled: boolean): void; setSmartSupply(divisionName: string, city: CityName | `${CityName}`, enabled: boolean): void;
/** /**
* Set whether smart supply uses leftovers before buying * Set whether smart supply uses leftovers before buying.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
* @param option - smart supply option, "leftovers" to use leftovers, "imports" to use only imported materials, "none" to not use materials from store * @param option - Smart supply option. Set "leftovers" to use leftovers, "imports" to use only imported materials, and "none" to not use stored materials.
*/ */
setSmartSupplyOption( setSmartSupplyOption(
divisionName: string, divisionName: string,
@ -8098,16 +8189,26 @@ export interface WarehouseAPI {
materialName: string, materialName: string,
option: CorpSmartSupplyOption, option: CorpSmartSupplyOption,
): void; ): void;
/** /**
* Set material buy data * Set material buy data.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
* @param amt - Amount of material to buy * @param amt - Amount of material to buy
*/ */
buyMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void; buyMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void;
/** /**
* Set material to bulk buy * Set material to bulk-buy.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
@ -8115,56 +8216,100 @@ export interface WarehouseAPI {
*/ */
bulkPurchase(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void; bulkPurchase(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void;
/** Get warehouse data /**
* Get warehouse data.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @returns warehouse data */ * @returns Warehouse data
*/
getWarehouse(divisionName: string, city: CityName | `${CityName}`): Warehouse; getWarehouse(divisionName: string, city: CityName | `${CityName}`): Warehouse;
/** Get product data /**
* Get product data.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param cityName - Name of the city * @param cityName - Name of the city
* @param productName - Name of the product * @param productName - Name of the product
* @returns product data */ * @returns Product data
*/
getProduct(divisionName: string, cityName: CityName | `${CityName}`, productName: string): Product; getProduct(divisionName: string, cityName: CityName | `${CityName}`, productName: string): Product;
/** /**
* Get material data * Get material data.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
* @returns material data * @returns Material data
*/ */
getMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string): Material; getMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string): Material;
/** /**
* Set market TA 1 for a material. * Set Market-TA1 for a material.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
* @param on - market ta enabled * @param on - Use true to enable, false otherwise.
*/ */
setMaterialMarketTA1(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void; setMaterialMarketTA1(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void;
/** /**
* Set market TA 2 for a material. * Set Market-TA2 for a material.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param materialName - Name of the material * @param materialName - Name of the material
* @param on - market ta enabled * @param on - Use true to enable, false otherwise.
*/ */
setMaterialMarketTA2(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void; setMaterialMarketTA2(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void;
/** * Set market TA 1 for a product. /**
* Set Market-TA1 for a product.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param productName - Name of the product * @param productName - Name of the product
* @param on - market ta enabled */ * @param on - Use true to enable, false otherwise.
*/
setProductMarketTA1(divisionName: string, productName: string, on: boolean): void; setProductMarketTA1(divisionName: string, productName: string, on: boolean): void;
/** Set market TA 2 for a product. /**
* Set Market-TA2 for a product.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param productName - Name of the product * @param productName - Name of the product
* @param on - market ta enabled */ * @param on - Use true to enable, false otherwise.
*/
setProductMarketTA2(divisionName: string, productName: string, on: boolean): void; setProductMarketTA2(divisionName: string, productName: string, on: boolean): void;
/** /**
* Set material export data * Set material export data.
*
* @remarks
* RAM cost: 20 GB
*
* @param sourceDivision - Source division * @param sourceDivision - Source division
* @param sourceCity - Source city * @param sourceCity - Source city
* @param targetDivision - Target division * @param targetDivision - Target division
@ -8180,8 +8325,13 @@ export interface WarehouseAPI {
materialName: string, materialName: string,
amt: number | string, amt: number | string,
): void; ): void;
/** /**
* Cancel material export * Cancel material export.
*
* @remarks
* RAM cost: 20 GB
*
* @param sourceDivision - Source division * @param sourceDivision - Source division
* @param sourceCity - Source city * @param sourceCity - Source city
* @param targetDivision - Target division * @param targetDivision - Target division
@ -8195,21 +8345,36 @@ export interface WarehouseAPI {
targetCity: CityName | `${CityName}`, targetCity: CityName | `${CityName}`,
materialName: string, materialName: string,
): void; ): void;
/** /**
* Purchase warehouse for a new city * Purchase warehouse for a new city.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
*/ */
purchaseWarehouse(divisionName: string, city: CityName | `${CityName}`): void; purchaseWarehouse(divisionName: string, city: CityName | `${CityName}`): void;
/** /**
* Upgrade warehouse * Upgrade warehouse.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param amt - amount of upgrades defaults to 1 * @param amt - Amount of upgrades. Defaults to 1.
*/ */
upgradeWarehouse(divisionName: string, city: CityName | `${CityName}`, amt?: number): void; upgradeWarehouse(divisionName: string, city: CityName | `${CityName}`, amt?: number): void;
/** /**
* Create a new product * Create a new product.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param productName - Name of the product * @param productName - Name of the product
@ -8223,8 +8388,13 @@ export interface WarehouseAPI {
designInvest: number, designInvest: number,
marketingInvest: number, marketingInvest: number,
): void; ): void;
/** /**
* Limit Material Production. * Limit material production.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division. * @param divisionName - Name of the division.
* @param city - Name of the city. * @param city - Name of the city.
* @param materialName - Name of the material. * @param materialName - Name of the material.
@ -8236,25 +8406,40 @@ export interface WarehouseAPI {
materialName: string, materialName: string,
qty: number, qty: number,
): void; ): void;
/** /**
* Limit Product Production. * Limit product production.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division. * @param divisionName - Name of the division.
* @param city - Name of the city. * @param city - Name of the city.
* @param productName - Name of the product. * @param productName - Name of the product.
* @param qty - Amount to limit to. Pass a negative value to remove the limit instead. * @param qty - Amount to limit to. Pass a negative value to remove the limit instead.
*/ */
limitProductProduction(divisionName: string, city: CityName | `${CityName}`, productName: string, qty: number): void; limitProductProduction(divisionName: string, city: CityName | `${CityName}`, productName: string, qty: number): void;
/** /**
* Gets the cost to upgrade a warehouse to the next level * Get the cost to upgrade a warehouse to the next level.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city * @param city - Name of the city
* @param amt - amount of upgrades. Optional, defaults to 1 * @param amt - Amount of upgrades. Optional. Defaults to 1.
* @returns cost to upgrade * @returns Cost to upgrade
*/ */
getUpgradeWarehouseCost(divisionName: string, city: CityName | `${CityName}`, amt?: number): number; getUpgradeWarehouseCost(divisionName: string, city: CityName | `${CityName}`, amt?: number): number;
/** /**
* Check if you have a warehouse in city * Check if you have a warehouse in city.
* @returns true if warehouse is present, false if not *
* @remarks
* RAM cost: 10 GB
*
* @returns true if warehouse is present, false if not.
*/ */
hasWarehouse(divisionName: string, city: CityName | `${CityName}`): boolean; hasWarehouse(divisionName: string, city: CityName | `${CityName}`): boolean;
} }
@ -8264,133 +8449,281 @@ export interface WarehouseAPI {
* @public * @public
*/ */
export interface Corporation extends WarehouseAPI, OfficeAPI { export interface Corporation extends WarehouseAPI, OfficeAPI {
/** Returns whether the player has a corporation. Does not require API access. /**
* @returns whether the player has a corporation */ * Returns whether the player has a corporation. Does not require API access.
*
* @remarks
* RAM cost: 0 GB
*
* @returns Whether the player has a corporation
*/
hasCorporation(): boolean; hasCorporation(): boolean;
/** Create a Corporation /**
* Create a Corporation.
*
* @remarks
* RAM cost: 20 GB
*
* This function throws an error if:
*
* - Try to self-fund outside BitNode 3.
*
* - Be in a BitNode that has CorporationSoftcap (a BN modifier) less than 0.15. Use
* {@link NS.getBitNodeMultipliers | getBitNodeMultipliers} to get the value of this modifier.
*
* @param corporationName - Name of the corporation * @param corporationName - Name of the corporation
* @param selfFund - If you should self fund, defaults to true, false will only work on BitNode 3 * @param selfFund - If you want to self-fund. Defaults to true, false will only work in BitNode 3.
* @returns true if created and false if not */ * @returns true if created and false if not
*/
createCorporation(corporationName: string, selfFund: boolean): boolean; createCorporation(corporationName: string, selfFund: boolean): boolean;
/** Check if you have a one time unlockable upgrade /**
* Check if you have a one-time unlockable upgrade.
*
* @remarks
* RAM cost: 10 GB
*
* @param upgradeName - Name of the upgrade * @param upgradeName - Name of the upgrade
* @returns true if unlocked and false if not */ * @returns true if unlocked and false if not
*/
hasUnlock(upgradeName: string): boolean; hasUnlock(upgradeName: string): boolean;
/** Gets the cost to unlock a one time unlockable upgrade /**
* Get the cost to unlock a one-time unlockable upgrade.
*
* @remarks
* RAM cost: 10 GB
*
* @param upgradeName - Name of the upgrade * @param upgradeName - Name of the upgrade
* @returns cost of the upgrade */ * @returns Cost of the upgrade
*/
getUnlockCost(upgradeName: string): number; getUnlockCost(upgradeName: string): number;
/** Get the level of a levelable upgrade /**
* Get the level of a levelable upgrade.
*
* @remarks
* RAM cost: 10 GB
*
* @param upgradeName - Name of the upgrade * @param upgradeName - Name of the upgrade
* @returns the level of the upgrade */ * @returns The level of the upgrade
*/
getUpgradeLevel(upgradeName: string): number; getUpgradeLevel(upgradeName: string): number;
/** Gets the cost to unlock the next level of a levelable upgrade /**
* Get the cost to unlock the next level of a levelable upgrade.
*
* @remarks
* RAM cost: 10 GB
*
* @param upgradeName - Name of the upgrade * @param upgradeName - Name of the upgrade
* @returns cost of the upgrade */ * @returns Cost of the upgrade
*/
getUpgradeLevelCost(upgradeName: string): number; getUpgradeLevelCost(upgradeName: string): number;
/** Get an offer for investment based on you companies current valuation /**
* @returns An offer of investment */ * Get an offer for investment based on current corporation valuation.
*
* @remarks
* RAM cost: 10 GB
*
* @returns An offer of investment
*/
getInvestmentOffer(): InvestmentOffer; getInvestmentOffer(): InvestmentOffer;
/** Get corporation related constants /**
* @returns corporation related constants */ * Get corporation-related constants.
*
* @remarks
* RAM cost: 0 GB
*
* @returns Corporation-related constants
*/
getConstants(): CorpConstants; getConstants(): CorpConstants;
/** Get constant industry definition data for a specific industry */ /**
* Get constant data of an industry.
*
* @remarks
* RAM cost: 10 GB
*
* @param industryName - Name of the industry
* @returns Industry data
*/
getIndustryData(industryName: CorpIndustryName): CorpIndustryData; getIndustryData(industryName: CorpIndustryName): CorpIndustryData;
/** Get constant data for a specific material */ /**
* Get constant data of a material.
*
* @remarks
* RAM cost: 10 GB
*
* @param materialName - Name of the material
* @returns Material data
*/
getMaterialData(materialName: CorpMaterialName): CorpMaterialConstantData; getMaterialData(materialName: CorpMaterialName): CorpMaterialConstantData;
/** Accept investment based on you companies current valuation /**
* Accept the investment offer. The value of offer is based on current corporation valuation.
*
* @remarks * @remarks
* Is based on current valuation and will not honer a specific Offer * RAM cost: 20 GB
* @returns An offer of investment */ *
* @returns true if you successfully accept the offer, false if not
*/
acceptInvestmentOffer(): boolean; acceptInvestmentOffer(): boolean;
/** Go public /**
* @param numShares - number of shares you would like to issue for your IPO * Go public.
* @returns true if you successfully go public, false if not */ *
* @remarks
* RAM cost: 20 GB
*
* @param numShares - Number of shares you would like to issue for your IPO
* @returns true if you successfully go public, false if not
*/
goPublic(numShares: number): boolean; goPublic(numShares: number): boolean;
/** Bribe a faction /**
* Bribe a faction.
*
* @remarks
* RAM cost: 20 GB
*
* @param factionName - Faction name * @param factionName - Faction name
* @param amountCash - Amount of money to bribe * @param amountCash - Amount of money to bribe
* @returns True if successful, false if not */ * @returns true if successful, false if not
*/
bribe(factionName: string, amountCash: number): boolean; bribe(factionName: string, amountCash: number): boolean;
/** Get corporation data /**
* @returns Corporation data */ * Get corporation data.
*
* @remarks
* RAM cost: 10 GB
*
* @returns Corporation data
*/
getCorporation(): CorporationInfo; getCorporation(): CorporationInfo;
/** Get division data /**
* Get division data.
*
* @remarks
* RAM cost: 10 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @returns Division data */ * @returns Division data
*/
getDivision(divisionName: string): Division; getDivision(divisionName: string): Division;
/** Expand to a new industry /**
* Expand to a new industry.
*
* @remarks
* RAM cost: 20 GB
*
* @param industryType - Name of the industry * @param industryType - Name of the industry
* @param divisionName - Name of the division */ * @param divisionName - Name of the division
*/
expandIndustry(industryType: CorpIndustryName, divisionName: string): void; expandIndustry(industryType: CorpIndustryName, divisionName: string): void;
/** Expand to a new city /**
* Expand to a new city.
*
* @remarks
* RAM cost: 20 GB
*
* @param divisionName - Name of the division * @param divisionName - Name of the division
* @param city - Name of the city */ * @param city - Name of the city
*/
expandCity(divisionName: string, city: CityName | `${CityName}`): void; expandCity(divisionName: string, city: CityName | `${CityName}`): void;
/** Unlock an upgrade /**
* @param upgradeName - Name of the upgrade */ * Unlock an upgrade.
*
* @remarks
* RAM cost: 20 GB
*
* @param upgradeName - Name of the upgrade
*/
purchaseUnlock(upgradeName: string): void; purchaseUnlock(upgradeName: string): void;
/** Level an upgrade. /**
* @param upgradeName - Name of the upgrade */ * Level up an upgrade.
*
* @remarks
* RAM cost: 20 GB
*
* @param upgradeName - Name of the upgrade
*/
levelUpgrade(upgradeName: string): void; levelUpgrade(upgradeName: string): void;
/** Issue dividends /**
* @param rate - Fraction of profit to issue as dividends. */ * Issue dividends.
*
* @remarks
* RAM cost: 20 GB
*
* @param rate - Fraction of profit to issue as dividends.
*/
issueDividends(rate: number): void; issueDividends(rate: number): void;
/** Issue new shares /**
* @param amount - Number of new shares to issue, will be rounded to nearest 10m. Defaults to max amount. * Issue new shares.
* @returns Amount of funds generated for the corporation. */ *
* @remarks
* RAM cost: 20 GB
*
* @param amount - Number of new shares to issue. It will be rounded to nearest 10 million. Defaults to max amount.
* @returns Amount of funds generated for the corporation.
*/
issueNewShares(amount?: number): number; issueNewShares(amount?: number): number;
/** Buyback Shares. /**
* Spend money from the player's wallet to transfer shares from public traders to the CEO. * Buyback shares. Spend money from the player's wallet to transfer shares from public traders to the CEO.
* @param amount - Amount of shares to buy back, must be integer and larger than 0 */ *
* @remarks
* RAM cost: 20 GB
*
* @param amount - Amount of shares to buy back, must be integer and larger than 0
*/
buyBackShares(amount: number): void; buyBackShares(amount: number): void;
/** Sell Shares. /**
* Transfer shares from the CEO to public traders to receive money in the player's wallet. * Sell shares. Transfer shares from the CEO to public traders to receive money in the player's wallet.
* @param amount - Amount of shares to sell, must be integer between 1 and 100t */ *
* @remarks
* RAM cost: 20 GB
*
* @param amount - Amount of shares to sell, must be integer between 1 and 100t
*/
sellShares(amount: number): void; sellShares(amount: number): void;
/** Get bonus time. /**
* Bonus time is accumulated when the game is offline or if the game is inactive in the browser. * Get bonus time. Bonus time is accumulated when the game is offline or if the game is inactive in the browser. Bonus
* Bonus time makes the game progress faster. * time makes the corporation progress faster.
* @returns Bonus time for the Corporation mechanic in milliseconds. */ *
* @remarks
* RAM cost: 0 GB
*
* @returns Bonus time for the Corporation mechanic in milliseconds.
*/
getBonusTime(): number; getBonusTime(): number;
/** /**
* Sleep until the next Corporation update has happened. * Sleep until the next Corporation update happens.
*
* @remarks * @remarks
* RAM cost: 1 GB * RAM cost: 1 GB
* *
* The amount of real time spent asleep between updates can vary due to "bonus time" * The amount of real time spent asleep between updates can vary due to "bonus time"
* (usually 200 milliseconds - 2 seconds). * (usually 200 milliseconds - 2 seconds).
* *
* @returns Promise that resolves to the name of the state that was just processed. * If the returned state is X, it means X just happened.
* *
* I.e. when the state is PURCHASE, it means purchasing has just happened. * Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
* Note that this is the state just before `getCorporation().state`.
*
* Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
* *
* @example * @example
* ```js * ```js
@ -8401,15 +8734,19 @@ export interface Corporation extends WarehouseAPI, OfficeAPI {
* // Manage the Corporation * // Manage the Corporation
* } * }
* ``` * ```
*
* @returns Promise that resolves to the name of the state that was just processed.
*/ */
nextUpdate(): Promise<CorpStateName>; nextUpdate(): Promise<CorpStateName>;
/** /**
* Sell a division * Sell a division.
*
* @remarks * @remarks
* RAM cost: 20 GB * RAM cost: 20 GB
* *
* @param divisionName - Name of the division */ * @param divisionName - Name of the division
*/
sellDivision(divisionName: string): void; sellDivision(divisionName: string): void;
} }