mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 12:15:44 +01:00
Office Size Upgrade Cost
This commit is contained in:
parent
2246dd7fe6
commit
d34d720ab9
28
markdown/bitburner.officeapi.getofficesizeupgradecost.md
Normal file
28
markdown/bitburner.officeapi.getofficesizeupgradecost.md
Normal file
@ -0,0 +1,28 @@
|
||||
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||
|
||||
[Home](./index.md) > [bitburner](./bitburner.md) > [OfficeAPI](./bitburner.officeapi.md) > [getOfficeSizeUpgradeCost](./bitburner.officeapi.getofficesizeupgradecost.md)
|
||||
|
||||
## OfficeAPI.getOfficeSizeUpgradeCost() method
|
||||
|
||||
Cost to Upgrade office size.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number;
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| divisionName | string | Name of the division |
|
||||
| cityName | string | Name of the city |
|
||||
| asize | number | |
|
||||
|
||||
<b>Returns:</b>
|
||||
|
||||
number
|
||||
|
||||
Cost of upgrading the office
|
||||
|
@ -26,6 +26,7 @@ Requires the Office API upgrade from your corporation.
|
||||
| [getHireAdVertCost(divisionName)](./bitburner.officeapi.gethireadvertcost.md) | Get the cost to Hire AdVert |
|
||||
| [getHireAdVertCount(adivisionName)](./bitburner.officeapi.gethireadvertcount.md) | Get the number of times you have Hired AdVert |
|
||||
| [getOffice(divisionName, cityName)](./bitburner.officeapi.getoffice.md) | Get data about an office |
|
||||
| [getOfficeSizeUpgradeCost(divisionName, cityName, asize)](./bitburner.officeapi.getofficesizeupgradecost.md) | Cost to Upgrade office size. |
|
||||
| [getResearchCost(divisionName, researchName)](./bitburner.officeapi.getresearchcost.md) | Get the cost to unlock research |
|
||||
| [hasResearched(divisionName, researchName)](./bitburner.officeapi.hasresearched.md) | Gets if you have unlocked a research |
|
||||
| [hireAdVert(divisionName)](./bitburner.officeapi.hireadvert.md) | Hire AdVert. |
|
||||
|
@ -543,6 +543,21 @@ export function NetscriptCorporation(
|
||||
return Promise.resolve(office.setEmployeeToJob(job, amount));
|
||||
});
|
||||
},
|
||||
getOfficeSizeUpgradeCost: function (adivisionName: any, acityName: any, asize: any): number {
|
||||
checkAccess("getOfficeSizeUpgradeCost", 8);
|
||||
const divisionName = helper.string("getOfficeSizeUpgradeCost", "divisionName", adivisionName);
|
||||
const cityName = helper.string("getOfficeSizeUpgradeCost", "cityName", acityName);
|
||||
const size = helper.number("getOfficeSizeUpgradeCost", "size", asize);
|
||||
if (size < 0) throw new Error("Invalid value for size field! Must be numeric and grater than 0");
|
||||
const office = getOffice(divisionName, cityName);
|
||||
const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);
|
||||
const costMultiplier = 1.09;
|
||||
let mult = 0;
|
||||
for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {
|
||||
mult += Math.pow(costMultiplier, initialPriceMult + i);
|
||||
}
|
||||
return CorporationConstants.OfficeInitialCost * mult;
|
||||
},
|
||||
assignJob: function (adivisionName: any, acityName: any, aemployeeName: any, ajob: any): Promise<void> {
|
||||
checkAccess("assignJob", 8);
|
||||
const divisionName = helper.string("assignJob", "divisionName", adivisionName);
|
||||
|
8
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
8
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -6175,6 +6175,14 @@ export interface OfficeAPI {
|
||||
* @returns A promise that is fulfilled when the assignment is complete.
|
||||
*/
|
||||
setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): Promise<boolean>;
|
||||
/**
|
||||
* Cost to Upgrade office size.
|
||||
* @param divisionName - Name of the division
|
||||
* @param cityName - Name of the city
|
||||
* @param size - Amount of positions to open
|
||||
* @returns Cost of upgrading the office
|
||||
*/
|
||||
getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user