From 314e37430d007b3d99b80413040c558d3e5b52a0 Mon Sep 17 00:00:00 2001 From: nickofolas Date: Thu, 7 Apr 2022 00:48:39 -0500 Subject: [PATCH 1/3] Add Augmentation unique to Grafting --- src/Augmentation/AugmentationCreator.tsx | 13 +++++++++++++ src/Augmentation/AugmentationHelpers.tsx | 5 +++++ src/Augmentation/data/AugmentationNames.ts | 1 + src/PersonObjects/Grafting/GraftableAugmentation.ts | 6 ++++++ .../Player/PlayerObjectGeneralMethods.tsx | 5 ++++- 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/Augmentation/AugmentationCreator.tsx b/src/Augmentation/AugmentationCreator.tsx index f9693c1bf..767ded38e 100644 --- a/src/Augmentation/AugmentationCreator.tsx +++ b/src/Augmentation/AugmentationCreator.tsx @@ -1484,6 +1484,19 @@ export const initGeneralAugmentations = (): Augmentation[] => [ ), factions: [FactionNames.TianDiHui], }), + + // Grafting-exclusive Augmentation + new Augmentation({ + name: AugmentationNames.CongruityImplant, + repCost: 0, + moneyCost: 150e12, + info: + "Developed by a pioneer in Grafting research, this implant " + + "generates pulses of stability which seem to have a nullifying " + + "effect versus the Entropy virus.", + stats: <>This Augmentation removes the Entropy virus, and prevents it from affecting you again., + factions: [], + }), ]; export const initBladeburnerAugmentations = (): Augmentation[] => [ diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index 2250d65f3..ba98992ec 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -141,6 +141,11 @@ function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void } } + // Special logic for Congruity Implant + if (aug.name === AugmentationNames.CongruityImplant) { + Player.entropy = 0; + } + // Push onto Player's Augmentation list if (!reapply) { const ownedAug = new PlayerOwnedAugmentation(aug.name); diff --git a/src/Augmentation/data/AugmentationNames.ts b/src/Augmentation/data/AugmentationNames.ts index f0fe6a46f..fc77c6d78 100644 --- a/src/Augmentation/data/AugmentationNames.ts +++ b/src/Augmentation/data/AugmentationNames.ts @@ -91,6 +91,7 @@ export enum AugmentationNames { BionicArms = "Bionic Arms", SNA = "Social Negotiation Assistant (S.N.A)", HydroflameLeftArm = "Hydroflame Left Arm", + CongruityImplant = "nickofolas Congruity Implant", EsperEyewear = "EsperTech Bladeburner Eyewear", EMS4Recombination = "EMS-4 Recombination", OrionShoulder = "ORION-MKIV Shoulder", diff --git a/src/PersonObjects/Grafting/GraftableAugmentation.ts b/src/PersonObjects/Grafting/GraftableAugmentation.ts index dbace889d..1f22f2c25 100644 --- a/src/PersonObjects/Grafting/GraftableAugmentation.ts +++ b/src/PersonObjects/Grafting/GraftableAugmentation.ts @@ -1,6 +1,7 @@ import { sum } from "lodash"; import { Augmentation } from "../../Augmentation/Augmentation"; +import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { CONSTANTS } from "../../Constants"; export interface IConstructorParams { @@ -18,6 +19,11 @@ export class GraftableAugmentation { } get cost(): number { + // Sell the Grafting-exclusive Aug at its starting price only + if (this.augmentation.name === AugmentationNames.CongruityImplant) { + return this.augmentation.startingCost; + } + return this.augmentation.startingCost * CONSTANTS.AugmentationGraftingCostMult; } diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index 00f0acbd7..da209729d 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -1371,7 +1371,10 @@ export function finishGraftAugmentationWork(this: IPlayer, cancelled: boolean): ); applyAugmentation(Augmentations[augName]); - this.entropy += 1; + + if (!this.hasAugmentation(AugmentationNames.CongruityImplant)) { + this.entropy += 1; + } this.applyEntropy(this.entropy); } else { dialogBoxCreate(`You cancelled the crafting of ${augName}.
Your money was not returned to you.`); From 78463ed1c06fc61e5dfbfb32ad49518f0ec84aaf Mon Sep 17 00:00:00 2001 From: nickofolas Date: Thu, 7 Apr 2022 11:25:12 -0500 Subject: [PATCH 2/3] Tweaks and improvements --- src/Augmentation/AugmentationCreator.tsx | 2 +- src/Augmentation/AugmentationHelpers.tsx | 3 ++- src/PersonObjects/Grafting/GraftableAugmentation.ts | 6 ------ src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Augmentation/AugmentationCreator.tsx b/src/Augmentation/AugmentationCreator.tsx index 767ded38e..00951f369 100644 --- a/src/Augmentation/AugmentationCreator.tsx +++ b/src/Augmentation/AugmentationCreator.tsx @@ -1489,7 +1489,7 @@ export const initGeneralAugmentations = (): Augmentation[] => [ new Augmentation({ name: AugmentationNames.CongruityImplant, repCost: 0, - moneyCost: 150e12, + moneyCost: 50e12, info: "Developed by a pioneer in Grafting research, this implant " + "generates pulses of stability which seem to have a nullifying " + diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index ba98992ec..263fe90a3 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -142,8 +142,9 @@ function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void } // Special logic for Congruity Implant - if (aug.name === AugmentationNames.CongruityImplant) { + if (aug.name === AugmentationNames.CongruityImplant && !reapply) { Player.entropy = 0; + Player.applyEntropy(Player.entropy) } // Push onto Player's Augmentation list diff --git a/src/PersonObjects/Grafting/GraftableAugmentation.ts b/src/PersonObjects/Grafting/GraftableAugmentation.ts index 1f22f2c25..dbace889d 100644 --- a/src/PersonObjects/Grafting/GraftableAugmentation.ts +++ b/src/PersonObjects/Grafting/GraftableAugmentation.ts @@ -1,7 +1,6 @@ import { sum } from "lodash"; import { Augmentation } from "../../Augmentation/Augmentation"; -import { AugmentationNames } from "../../Augmentation/data/AugmentationNames"; import { CONSTANTS } from "../../Constants"; export interface IConstructorParams { @@ -19,11 +18,6 @@ export class GraftableAugmentation { } get cost(): number { - // Sell the Grafting-exclusive Aug at its starting price only - if (this.augmentation.name === AugmentationNames.CongruityImplant) { - return this.augmentation.startingCost; - } - return this.augmentation.startingCost * CONSTANTS.AugmentationGraftingCostMult; } diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index da209729d..b316096ea 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -1374,8 +1374,8 @@ export function finishGraftAugmentationWork(this: IPlayer, cancelled: boolean): if (!this.hasAugmentation(AugmentationNames.CongruityImplant)) { this.entropy += 1; + this.applyEntropy(this.entropy); } - this.applyEntropy(this.entropy); } else { dialogBoxCreate(`You cancelled the crafting of ${augName}.
Your money was not returned to you.`); } From 57f04d3911b5a384c379dcfb2d0bcb18b25c37ea Mon Sep 17 00:00:00 2001 From: nickofolas Date: Thu, 7 Apr 2022 11:45:21 -0500 Subject: [PATCH 3/3] Fix prettier --- src/Augmentation/AugmentationHelpers.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Augmentation/AugmentationHelpers.tsx b/src/Augmentation/AugmentationHelpers.tsx index 263fe90a3..6078ae182 100644 --- a/src/Augmentation/AugmentationHelpers.tsx +++ b/src/Augmentation/AugmentationHelpers.tsx @@ -144,7 +144,7 @@ function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void // Special logic for Congruity Implant if (aug.name === AugmentationNames.CongruityImplant && !reapply) { Player.entropy = 0; - Player.applyEntropy(Player.entropy) + Player.applyEntropy(Player.entropy); } // Push onto Player's Augmentation list