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
5 changed files with 33 additions and 2 deletions

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; [InfiltrationLocation](./bitburner.infiltrationlocation.md) &gt; [maxClearanceLevel](./bitburner.infiltrationlocation.maxclearancelevel.md)
## InfiltrationLocation.maxClearanceLevel property
**Signature:**
```typescript
maxClearanceLevel: number;
```

View File

@ -17,5 +17,7 @@ interface InfiltrationLocation
| --- | --- | --- | --- | | --- | --- | --- | --- |
| [difficulty](./bitburner.infiltrationlocation.difficulty.md) | | number | | | [difficulty](./bitburner.infiltrationlocation.difficulty.md) | | number | |
| [location](./bitburner.infiltrationlocation.location.md) | | [ILocation](./bitburner.ilocation.md) | | | [location](./bitburner.infiltrationlocation.location.md) | | [ILocation](./bitburner.ilocation.md) | |
| [maxClearanceLevel](./bitburner.infiltrationlocation.maxclearancelevel.md) | | number | |
| [reward](./bitburner.infiltrationlocation.reward.md) | | [InfiltrationReward](./bitburner.infiltrationreward.md) | | | [reward](./bitburner.infiltrationlocation.reward.md) | | [InfiltrationReward](./bitburner.infiltrationreward.md) | |
| [startingSecurityLevel](./bitburner.infiltrationlocation.startingsecuritylevel.md) | | 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; [InfiltrationLocation](./bitburner.infiltrationlocation.md) &gt; [startingSecurityLevel](./bitburner.infiltrationlocation.startingsecuritylevel.md)
## InfiltrationLocation.startingSecurityLevel property
**Signature:**
```typescript
startingSecurityLevel: number;
```

View File

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

View File

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