Office Size Upgrade Cost

This commit is contained in:
pigalot 2022-01-15 14:24:01 +00:00
parent 2246dd7fe6
commit d34d720ab9
4 changed files with 52 additions and 0 deletions

@ -0,0 +1,28 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [OfficeAPI](./bitburner.officeapi.md) &gt; [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);

@ -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;
}
/**