Implement graft time calc helper function

This commit is contained in:
nickofolas 2022-04-21 21:31:43 -05:00
parent 5490d8c837
commit 304e7e69d5

@ -1,5 +1,6 @@
import { Augmentations } from "../../Augmentation/Augmentations";
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
import { GraftableAugmentation } from "./GraftableAugmentation";
import { IPlayer } from "../IPlayer";
export const getGraftingAvailableAugs = (player: IPlayer): string[] => {
@ -13,3 +14,8 @@ export const getGraftingAvailableAugs = (player: IPlayer): string[] => {
return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation));
};
export const calculateGraftingTimeWithBonus = (player: IPlayer, aug: GraftableAugmentation): number => {
const baseTime = aug.time;
return baseTime / (1 + (player.getIntelligenceBonus(3) - 1) / 3);
};