Augs prereqs now include all augs in succession

This commit is contained in:
nickofolas 2022-04-22 19:18:35 -05:00
parent cb34afbe5b
commit b193953b98
4 changed files with 49 additions and 59 deletions

@ -242,7 +242,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
moneyCost: 1.15e8, moneyCost: 1.15e8,
repCost: 2.75e4, repCost: 2.75e4,
info: "The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.", 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, dexterity_mult: 1.3,
factions: [ factions: [
FactionNames.TheDarkArmy, FactionNames.TheDarkArmy,
@ -339,7 +339,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
info: info:
"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that " + "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.", "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, strength_mult: 1.18,
defense_mult: 1.18, defense_mult: 1.18,
factions: [ factions: [
@ -673,7 +673,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
"This upgraded firmware allows the Embedded Netburner Module to control information on " + "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 " + "a network by re-routing traffic, spoofing IP addresses, and altering the data inside network " +
"packets.", "packets.",
prereqs: [AugmentationNames.ENMCore], prereqs: [AugmentationNames.ENMCore, AugmentationNames.ENM],
hacking_speed_mult: 1.05, hacking_speed_mult: 1.05,
hacking_money_mult: 1.3, hacking_money_mult: 1.3,
hacking_chance_mult: 1.05, 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. " + "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 " + "This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into " +
"any device on a network.", "any device on a network.",
prereqs: [AugmentationNames.ENMCoreV2], prereqs: [AugmentationNames.ENMCoreV2, AugmentationNames.ENMCore, AugmentationNames.ENM],
hacking_speed_mult: 1.05, hacking_speed_mult: 1.05,
hacking_money_mult: 1.4, hacking_money_mult: 1.4,
hacking_chance_mult: 1.1, hacking_chance_mult: 1.1,
@ -826,7 +826,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [
"are a set of specialized microprocessors that are attached to " + "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 " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " +
"so that the brain doesn't have to.", "so that the brain doesn't have to.",
prereqs: [AugmentationNames.CranialSignalProcessorsG2], prereqs: [AugmentationNames.CranialSignalProcessorsG2, AugmentationNames.CranialSignalProcessorsG1],
hacking_speed_mult: 1.02, hacking_speed_mult: 1.02,
hacking_money_mult: 1.15, hacking_money_mult: 1.15,
hacking_mult: 1.09, hacking_mult: 1.09,
@ -841,7 +841,11 @@ export const initGeneralAugmentations = (): Augmentation[] => [
"are a set of specialized microprocessors that are attached to " + "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 " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " +
"so that the brain doesn't have to.", "so that the brain doesn't have to.",
prereqs: [AugmentationNames.CranialSignalProcessorsG3], prereqs: [
AugmentationNames.CranialSignalProcessorsG3,
AugmentationNames.CranialSignalProcessorsG2,
AugmentationNames.CranialSignalProcessorsG1,
],
hacking_speed_mult: 1.02, hacking_speed_mult: 1.02,
hacking_money_mult: 1.2, hacking_money_mult: 1.2,
hacking_grow_mult: 1.25, hacking_grow_mult: 1.25,
@ -856,7 +860,12 @@ export const initGeneralAugmentations = (): Augmentation[] => [
"are a set of specialized microprocessors that are attached to " + "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 " + "neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations " +
"so that the brain doesn't have to.", "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_mult: 1.3,
hacking_money_mult: 1.25, hacking_money_mult: 1.25,
hacking_grow_mult: 1.75, 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 " + "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 " + "fully and wholly free of it's accursed toll. Serenity brings tranquility the form " +
"of no longer suffering a stat penalty. ", "of no longer suffering a stat penalty. ",
prereqs: [AugmentationNames.StaneksGift2], prereqs: [AugmentationNames.StaneksGift2, AugmentationNames.StaneksGift1],
isSpecial: true, isSpecial: true,
hacking_chance_mult: 1 / 0.95, hacking_chance_mult: 1 / 0.95,
hacking_speed_mult: 1 / 0.95, hacking_speed_mult: 1 / 0.95,

@ -236,7 +236,7 @@ export function PurchaseableAugmentation(props: IPurchaseableAugProps): React.Re
{props.parent.rep !== undefined && ( {props.parent.rep !== undefined && (
<Requirement <Requirement
fulfilled={props.parent.rep >= aug.baseRepRequirement} fulfilled={props.parent.rep >= aug.baseRepRequirement}
value={`${numeralWrapper.formatReputation(aug.baseRepRequirement)} reputation`} value={`${numeralWrapper.formatReputation(aug.baseRepRequirement)} rep`}
color={Settings.theme.rep} color={Settings.theme.rep}
/> />
)} )}

@ -54,36 +54,15 @@ export function joinFaction(faction: Faction): void {
//Returns a boolean indicating whether the player has the prerequisites for the //Returns a boolean indicating whether the player has the prerequisites for the
//specified Augmentation //specified Augmentation
export function hasAugmentationPrereqs(aug: Augmentation): boolean { export function hasAugmentationPrereqs(aug: Augmentation): boolean {
let hasPrereqs = true; return aug.prereqs.every((aug) => Player.hasAugmentation(aug));
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;
} }
export function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string { export function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string {
const hasPrereqs = hasAugmentationPrereqs(aug); const hasPrereqs = hasAugmentationPrereqs(aug);
if (!hasPrereqs) { 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) { if (sing) {
return txt; return txt;
} else { } else {

@ -129,34 +129,36 @@ export const GraftingRoot = (): React.ReactElement => {
</> </>
} }
/> />
<Typography color={Settings.theme.info}> <Box sx={{ maxHeight: 330, overflowY: "scroll" }}>
<b>Time to Graft:</b>{" "} <Typography color={Settings.theme.info}>
{convertTimeMsToTimeElapsedString( <b>Time to Graft:</b>{" "}
GraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3), {convertTimeMsToTimeElapsedString(
GraftableAugmentations[selectedAug].time / (1 + (player.getIntelligenceBonus(3) - 1) / 3),
)}
{/* Use formula so the displayed creation time is accurate to player bonus */}
</Typography>
{Augmentations[selectedAug].prereqs.length > 0 && (
<AugPreReqsChecklist player={player} aug={Augmentations[selectedAug]} />
)} )}
{/* Use formula so the displayed creation time is accurate to player bonus */}
</Typography>
{Augmentations[selectedAug].prereqs.length > 0 && (
<AugPreReqsChecklist player={player} aug={Augmentations[selectedAug]} />
)}
<br /> <br />
<Typography sx={{ maxHeight: 305, overflowY: "scroll" }}> <Typography>
{(() => { {(() => {
const aug = Augmentations[selectedAug]; const aug = Augmentations[selectedAug];
const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info; const info = typeof aug.info === "string" ? <span>{aug.info}</span> : aug.info;
const tooltip = ( const tooltip = (
<> <>
{info} {info}
<br /> <br />
<br /> <br />
{aug.stats} {aug.stats}
</> </>
); );
return tooltip; return tooltip;
})()} })()}
</Typography> </Typography>
</Box>
</Box> </Box>
</Paper> </Paper>
) : ( ) : (