mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Infiltration as IInfiltration, InfiltrationLocation } from "../ScriptEditor/NetscriptDefinitions";
|
||||
import { Infiltration as IInfiltration, InfiltrationLocation } from "@nsdefs";
|
||||
import { Location } from "../Locations/Location";
|
||||
import { Locations } from "../Locations/Locations";
|
||||
import { calculateDifficulty, calculateReward } from "../Infiltration/formulas/game";
|
||||
@@ -11,7 +11,7 @@ import { FactionNames } from "../Faction/data/FactionNames";
|
||||
import { Factions } from "../Faction/Factions";
|
||||
import { InternalAPI, NetscriptContext } from "../Netscript/APIWrapper";
|
||||
import { checkEnum } from "../utils/helpers/enum";
|
||||
import { LocationName } from "../utils/enums";
|
||||
import { CityName, LocationName } from "../Enums";
|
||||
import { helpers } from "../Netscript/NetscriptHelpers";
|
||||
|
||||
export function NetscriptInfiltration(): InternalAPI<IInfiltration> {
|
||||
@@ -41,10 +41,12 @@ export function NetscriptInfiltration(): InternalAPI<IInfiltration> {
|
||||
};
|
||||
return {
|
||||
getPossibleLocations: () => () => {
|
||||
return getLocationsWithInfiltrations.map((l) => ({
|
||||
city: l.city ?? "",
|
||||
name: String(l.name),
|
||||
}));
|
||||
return getLocationsWithInfiltrations
|
||||
.filter((l) => l.city) //Guarantees no locations with a "null" entry, which should not be infiltratable anyway.
|
||||
.map((l) => ({
|
||||
city: l.city as CityName,
|
||||
name: l.name,
|
||||
}));
|
||||
},
|
||||
getInfiltration: (ctx) => (_location) => {
|
||||
const location = helpers.string(ctx, "location", _location);
|
||||
|
||||
Reference in New Issue
Block a user