create program and grafting done

This commit is contained in:
Olivier Gagnon
2022-07-10 01:37:36 -04:00
parent 647392626e
commit 606f1bf6c4
25 changed files with 375 additions and 324 deletions
+8 -2
View File
@@ -7,6 +7,7 @@ import { getGraftingAvailableAugs, calculateGraftingTimeWithBonus } from "../Per
import { IPlayer } from "../PersonObjects/IPlayer";
import { Grafting as IGrafting } from "../ScriptEditor/NetscriptDefinitions";
import { Router } from "../ui/GameRoot";
import { GraftingWork } from "../Work/GraftingWork";
export function NetscriptGrafting(player: IPlayer): InternalAPI<IGrafting> {
const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {
@@ -79,8 +80,13 @@ export function NetscriptGrafting(player: IPlayer): InternalAPI<IGrafting> {
return false;
}
player.loseMoney(craftableAug.cost, "augmentations");
player.startGraftAugmentationWork(augName, craftableAug.time);
player.startNEWWork(
new GraftingWork({
singularity: true,
augmentation: augName,
player: player,
}),
);
if (focus) {
player.startFocusing();