diff --git a/src/Augmentation/data/AugmentationCreator.tsx b/src/Augmentation/data/AugmentationCreator.tsx index 02ce0bdd2..33c125fc8 100644 --- a/src/Augmentation/data/AugmentationCreator.tsx +++ b/src/Augmentation/data/AugmentationCreator.tsx @@ -242,7 +242,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [ moneyCost: 1.15e8, repCost: 2.75e4, info: "The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.", - prereqs: [AugmentationNames.Targeting2], + prereqs: [AugmentationNames.Targeting2, AugmentationNames.Targeting1], dexterity_mult: 1.3, factions: [ FactionNames.TheDarkArmy, @@ -339,7 +339,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [ info: "The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that " + "improve muscle mass and physical performance while being safe and free of side effects.", - prereqs: [AugmentationNames.CombatRib2], + prereqs: [AugmentationNames.CombatRib2, AugmentationNames.CombatRib1], strength_mult: 1.18, defense_mult: 1.18, factions: [ @@ -673,7 +673,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [ "This upgraded firmware allows the Embedded Netburner Module to control information on " + "a network by re-routing traffic, spoofing IP addresses, and altering the data inside network " + "packets.", - prereqs: [AugmentationNames.ENMCore], + prereqs: [AugmentationNames.ENMCore, AugmentationNames.ENM], hacking_speed_mult: 1.05, hacking_money_mult: 1.3, hacking_chance_mult: 1.05, @@ -698,7 +698,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [ "The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. " + "This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into " + "any device on a network.", - prereqs: [AugmentationNames.ENMCoreV2], + prereqs: [AugmentationNames.ENMCoreV2, AugmentationNames.ENMCore, AugmentationNames.ENM], hacking_speed_mult: 1.05, hacking_money_mult: 1.4, hacking_chance_mult: 1.1, @@ -826,7 +826,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [ "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + "so that the brain doesn't have to.", - prereqs: [AugmentationNames.CranialSignalProcessorsG2], + prereqs: [AugmentationNames.CranialSignalProcessorsG2, AugmentationNames.CranialSignalProcessorsG1], hacking_speed_mult: 1.02, hacking_money_mult: 1.15, hacking_mult: 1.09, @@ -841,7 +841,11 @@ export const initGeneralAugmentations = (): Augmentation[] => [ "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + "so that the brain doesn't have to.", - prereqs: [AugmentationNames.CranialSignalProcessorsG3], + prereqs: [ + AugmentationNames.CranialSignalProcessorsG3, + AugmentationNames.CranialSignalProcessorsG2, + AugmentationNames.CranialSignalProcessorsG1, + ], hacking_speed_mult: 1.02, hacking_money_mult: 1.2, hacking_grow_mult: 1.25, @@ -856,7 +860,12 @@ export const initGeneralAugmentations = (): Augmentation[] => [ "are a set of specialized microprocessors that are attached to " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " + "so that the brain doesn't have to.", - prereqs: [AugmentationNames.CranialSignalProcessorsG4], + prereqs: [ + AugmentationNames.CranialSignalProcessorsG4, + AugmentationNames.CranialSignalProcessorsG3, + AugmentationNames.CranialSignalProcessorsG2, + AugmentationNames.CranialSignalProcessorsG1, + ], hacking_mult: 1.3, hacking_money_mult: 1.25, hacking_grow_mult: 1.75, @@ -1952,7 +1961,7 @@ export const initChurchOfTheMachineGodAugmentations = (): Augmentation[] => [ "You will become greater than the sum of our parts. As One. Embrace your gift " + "fully and wholly free of it's accursed toll. Serenity brings tranquility the form " + "of no longer suffering a stat penalty. ", - prereqs: [AugmentationNames.StaneksGift2], + prereqs: [AugmentationNames.StaneksGift2, AugmentationNames.StaneksGift1], isSpecial: true, hacking_chance_mult: 1 / 0.95, hacking_speed_mult: 1 / 0.95, diff --git a/src/Augmentation/ui/PurchaseableAugmentations.tsx b/src/Augmentation/ui/PurchaseableAugmentations.tsx index 346aaaacc..9c29a8ae7 100644 --- a/src/Augmentation/ui/PurchaseableAugmentations.tsx +++ b/src/Augmentation/ui/PurchaseableAugmentations.tsx @@ -236,7 +236,7 @@ export function PurchaseableAugmentation(props: IPurchaseableAugProps): React.Re {props.parent.rep !== undefined && ( = aug.baseRepRequirement} - value={`${numeralWrapper.formatReputation(aug.baseRepRequirement)} reputation`} + value={`${numeralWrapper.formatReputation(aug.baseRepRequirement)} rep`} color={Settings.theme.rep} /> )} diff --git a/src/Faction/FactionHelpers.tsx b/src/Faction/FactionHelpers.tsx index 84519d5af..ee027fcf6 100644 --- a/src/Faction/FactionHelpers.tsx +++ b/src/Faction/FactionHelpers.tsx @@ -54,36 +54,15 @@ export function joinFaction(faction: Faction): void { //Returns a boolean indicating whether the player has the prerequisites for the //specified Augmentation export function hasAugmentationPrereqs(aug: Augmentation): boolean { - let hasPrereqs = true; - if (aug.prereqs && aug.prereqs.length > 0) { - for (let i = 0; i < aug.prereqs.length; ++i) { - const prereqAug = Augmentations[aug.prereqs[i]]; - if (prereqAug == null) { - console.error(`Invalid prereq Augmentation ${aug.prereqs[i]}`); - continue; - } - - if (Player.hasAugmentation(prereqAug, true) === false) { - hasPrereqs = false; - - // Check if the aug is purchased - for (let j = 0; j < Player.queuedAugmentations.length; ++j) { - if (Player.queuedAugmentations[j].name === prereqAug.name) { - hasPrereqs = true; - break; - } - } - } - } - } - - return hasPrereqs; + return aug.prereqs.every((aug) => Player.hasAugmentation(aug)); } export function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string { const hasPrereqs = hasAugmentationPrereqs(aug); if (!hasPrereqs) { - const txt = `You must first purchase or install ${aug.prereqs.join(",")} before you can purchase this one.`; + const txt = `You must first purchase or install ${aug.prereqs + .filter((req) => !Player.hasAugmentation(req)) + .join(",")} before you can purchase this one.`; if (sing) { return txt; } else { diff --git a/src/PersonObjects/Grafting/ui/GraftingRoot.tsx b/src/PersonObjects/Grafting/ui/GraftingRoot.tsx index 34e3a1a61..02d8d265c 100644 --- a/src/PersonObjects/Grafting/ui/GraftingRoot.tsx +++ b/src/PersonObjects/Grafting/ui/GraftingRoot.tsx @@ -129,34 +129,36 @@ export const GraftingRoot = (): React.ReactElement => { } /> - - Time to Graft:{" "} - {convertTimeMsToTimeElapsedString( - GraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3), + + + Time to Graft:{" "} + {convertTimeMsToTimeElapsedString( + GraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3), + )} + {/* Use formula so the displayed creation time is accurate to player bonus */} + + {Augmentations[selectedAug].prereqs.length > 0 && ( + )} - {/* Use formula so the displayed creation time is accurate to player bonus */} - - {Augmentations[selectedAug].prereqs.length > 0 && ( - - )} -
- - {(() => { - const aug = Augmentations[selectedAug]; +
+ + {(() => { + const aug = Augmentations[selectedAug]; - const info = typeof aug.info === "string" ? {aug.info} : aug.info; - const tooltip = ( - <> - {info} -
-
- {aug.stats} - - ); - return tooltip; - })()} -
+ const info = typeof aug.info === "string" ? {aug.info} : aug.info; + const tooltip = ( + <> + {info} +
+
+ {aug.stats} + + ); + return tooltip; + })()} +
+ ) : (