Remove some any and add getAugmentationBasePrice

This commit is contained in:
Olivier Gagnon 2022-07-20 01:20:11 -04:00
parent ceb9fa1249
commit 4518eabc29
7 changed files with 30 additions and 11 deletions

4
dist/main.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

14
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -195,6 +195,7 @@ const singularity = {
getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost), getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost), getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2), getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
getAugmentationBasePrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2), getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),
getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost), getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),
purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost), purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),

@ -137,6 +137,13 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
const aug = getAugmentation(_ctx, augName); const aug = getAugmentation(_ctx, augName);
return aug.prereqs.slice(); return aug.prereqs.slice();
}, },
getAugmentationBasePrice: (_ctx: NetscriptContext) =>
function (_augName: unknown): number {
_ctx.helper.checkSingularityAccess();
const augName = _ctx.helper.string("augName", _augName);
const aug = getAugmentation(_ctx, augName);
return aug.baseCost * BitNodeMultipliers.AugmentationMoneyCost;
},
getAugmentationPrice: (_ctx: NetscriptContext) => getAugmentationPrice: (_ctx: NetscriptContext) =>
function (_augName: unknown): number { function (_augName: unknown): number {
_ctx.helper.checkSingularityAccess(); _ctx.helper.checkSingularityAccess();

@ -2140,6 +2140,17 @@ export interface Singularity {
*/ */
getAugmentationPrice(augName: string): number; getAugmentationPrice(augName: string): number;
/**
* Get base price of an augmentation.
* @remarks
* RAM cost: 2.5 GB * 16/4/1
*
*
* @param augName - Name of Augmentation.
* @returns Base price of the augmentation, before price multiplier.
*/
getAugmentationBasePrice(augName: string): number;
/** /**
* Get reputation requirement of an augmentation. * Get reputation requirement of an augmentation.
* @remarks * @remarks