API: Update getInfiltration API (#1235)

This commit is contained in:
catloversg 2024-05-12 07:13:59 +07:00 committed by GitHub
parent e478b9a224
commit 1288d1c289
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 33 additions and 2 deletions

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

@ -17,5 +17,7 @@ interface InfiltrationLocation
| --- | --- | --- | --- |
| [difficulty](./bitburner.infiltrationlocation.difficulty.md) | | number | |
| [location](./bitburner.infiltrationlocation.location.md) | | [ILocation](./bitburner.ilocation.md) | |
| [maxClearanceLevel](./bitburner.infiltrationlocation.maxclearancelevel.md) | | number | |
| [reward](./bitburner.infiltrationlocation.reward.md) | | [InfiltrationReward](./bitburner.infiltrationreward.md) | |
| [startingSecurityLevel](./bitburner.infiltrationlocation.startingsecuritylevel.md) | | number | |

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

@ -1,5 +1,5 @@
import type { InternalAPI, NetscriptContext } from "../Netscript/APIWrapper";
import { Infiltration as NetscriptInfiltation, InfiltrationLocation, ILocation } from "@nsdefs";
import { Infiltration as NetscriptInfiltation, InfiltrationLocation } from "@nsdefs";
import { FactionName, LocationName } from "@enums";
import { Location } from "../Locations/Location";
import { Locations } from "../Locations/Locations";
@ -29,13 +29,18 @@ export function NetscriptInfiltration(): InternalAPI<NetscriptInfiltation> {
const reward = calculateReward(startingSecurityLevel);
const maxLevel = location.infiltrationData.maxClearanceLevel;
return {
location: structuredClone(location) as ILocation,
location: {
city: location.city!,
name: location.name,
},
reward: {
tradeRep: calculateTradeInformationRepReward(reward, maxLevel, startingSecurityLevel),
sellCash: calculateSellInformationCashReward(reward, maxLevel, startingSecurityLevel),
SoARep: calculateInfiltratorsRepReward(Factions[FactionName.ShadowsOfAnarchy], startingSecurityLevel),
},
difficulty: difficulty,
maxClearanceLevel: location.infiltrationData.maxClearanceLevel,
startingSecurityLevel: location.infiltrationData.startingSecurityLevel,
};
};
return {

@ -5158,6 +5158,8 @@ interface InfiltrationLocation {
location: ILocation;
reward: InfiltrationReward;
difficulty: number;
maxClearanceLevel: number;
startingSecurityLevel: number;
}
/**