add sleeve aug price and rep function

This commit is contained in:
Olivier Gagnon
2022-07-21 02:42:48 -04:00
parent dd7b5c4316
commit 693baf26df
3 changed files with 41 additions and 0 deletions
+17
View File
@@ -4,6 +4,7 @@ import { findSleevePurchasableAugs } from "../PersonObjects/Sleeve/SleeveHelpers
import { StaticAugmentations } from "../Augmentation/StaticAugmentations";
import { CityName } from "../Locations/data/CityNames";
import { findCrime } from "../Crime/CrimeHelpers";
import { Augmentation } from "../Augmentation/Augmentation";
import {
AugmentPair,
@@ -311,6 +312,22 @@ export function NetscriptSleeve(player: IPlayer): InternalAPI<ISleeve> {
return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);
},
getSleeveAugmentationPrice:
(ctx: NetscriptContext) =>
(_augName: unknown): number => {
checkSleeveAPIAccess(ctx);
const augName = ctx.helper.string("augName", _augName);
const aug: Augmentation = StaticAugmentations[augName];
return aug.baseCost;
},
getSleeveAugmentationRepReq:
(ctx: NetscriptContext) =>
(_augName: unknown, _basePrice = false): number => {
checkSleeveAPIAccess(ctx);
const augName = ctx.helper.string("augName", _augName);
const aug: Augmentation = StaticAugmentations[augName];
return aug.getCost(player).repCost;
},
setToBladeburnerAction:
(ctx: NetscriptContext) =>
(_sleeveNumber: unknown, _action: unknown, _contract?: unknown): boolean => {