mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-04 06:37:49 +02:00
remove level, base cost and rep requirment from base augmentation obj
* added in place calculations for cost and level of augmentations given player context * removed redundant logic for dynamically calculating cost,rep and level against the augmentation object * replaced references to startingCost to baseCost as it is now always whatever it started at
This commit is contained in:
@@ -18,7 +18,7 @@ export class GraftableAugmentation {
|
||||
}
|
||||
|
||||
get cost(): number {
|
||||
return this.augmentation.startingCost * CONSTANTS.AugmentationGraftingCostMult;
|
||||
return this.augmentation.baseCost * CONSTANTS.AugmentationGraftingCostMult;
|
||||
}
|
||||
|
||||
get time(): number {
|
||||
|
||||
@@ -678,7 +678,7 @@ export class Sleeve extends Person {
|
||||
}
|
||||
|
||||
tryBuyAugmentation(p: IPlayer, aug: Augmentation): boolean {
|
||||
if (!p.canAfford(aug.startingCost)) {
|
||||
if (!p.canAfford(aug.baseCost)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -687,7 +687,7 @@ export class Sleeve extends Person {
|
||||
return false;
|
||||
}
|
||||
|
||||
p.loseMoney(aug.startingCost, "sleeves");
|
||||
p.loseMoney(aug.baseCost, "sleeves");
|
||||
this.installAugmentation(aug);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentat
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fac.playerReputation > aug.baseRepRequirement) {
|
||||
if (fac.playerReputation > aug.getCost(p).repCost) {
|
||||
availableAugs.push(aug);
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ export function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentat
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fac.playerReputation > aug.baseRepRequirement) {
|
||||
if (fac.playerReputation > aug.getCost(p).repCost) {
|
||||
availableAugs.push(aug);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export function SleeveAugmentationsModal(props: IProps): React.ReactElement {
|
||||
return (
|
||||
<TableRow key={aug.name}>
|
||||
<TableCell>
|
||||
<Button onClick={() => purchaseAugmentation(aug)} disabled={player.money < aug.startingCost}>
|
||||
<Button onClick={() => purchaseAugmentation(aug)} disabled={player.money < aug.baseCost}>
|
||||
Buy
|
||||
</Button>
|
||||
</TableCell>
|
||||
@@ -78,7 +78,7 @@ export function SleeveAugmentationsModal(props: IProps): React.ReactElement {
|
||||
</Box>
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Money money={aug.startingCost} player={player} />
|
||||
<Money money={aug.baseCost} player={player} />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user