move ctx.log to NetscriptHelpers

This commit is contained in:
Snarling
2022-08-08 15:51:50 -04:00
parent 8f8d9a1d23
commit 01e63b10a1
11 changed files with 296 additions and 234 deletions
+4 -4
View File
@@ -61,7 +61,7 @@ export function NetscriptGrafting(player: IPlayer): InternalAPI<IGrafting> {
throw helpers.makeRuntimeErrorMsg(ctx, "You must be in New Tokyo to begin grafting an Augmentation.");
}
if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {
ctx.log(() => `Invalid aug: ${augName}`);
helpers.log(ctx, () => `Invalid aug: ${augName}`);
return false;
}
@@ -69,12 +69,12 @@ export function NetscriptGrafting(player: IPlayer): InternalAPI<IGrafting> {
const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);
if (player.money < craftableAug.cost) {
ctx.log(() => `You don't have enough money to craft ${augName}`);
helpers.log(ctx, () => `You don't have enough money to craft ${augName}`);
return false;
}
if (!hasAugmentationPrereqs(craftableAug.augmentation)) {
ctx.log(() => `You don't have the pre-requisites for ${augName}`);
helpers.log(ctx, () => `You don't have the pre-requisites for ${augName}`);
return false;
}
@@ -94,7 +94,7 @@ export function NetscriptGrafting(player: IPlayer): InternalAPI<IGrafting> {
Router.toTerminal();
}
ctx.log(() => `Began grafting Augmentation ${augName}.`);
helpers.log(ctx, () => `Began grafting Augmentation ${augName}.`);
return true;
},
};