rm aug woned

This commit is contained in:
Olivier Gagnon
2022-04-13 12:24:01 -04:00
parent 0d11a18ca9
commit c76602a5df
8 changed files with 12 additions and 21 deletions
@@ -7,7 +7,7 @@ import { Augmentation } from "../../Augmentation/Augmentation";
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
export function hasAugmentation(this: IPlayer, aug: string | Augmentation, installed = false): boolean {
export function hasAugmentation(this: IPlayer, aug: string | Augmentation, includeQueued = false): boolean {
const augName: string = aug instanceof Augmentation ? aug.name : aug;
for (const owned of this.augmentations) {
@@ -16,7 +16,7 @@ export function hasAugmentation(this: IPlayer, aug: string | Augmentation, insta
}
}
if (!installed) {
if (!includeQueued) {
for (const owned of this.queuedAugmentations) {
if (owned.name === augName) {
return true;
@@ -2084,12 +2084,7 @@ export function reapplyAllAugmentations(this: IPlayer, resetMultipliers = true):
const playerAug = this.augmentations[i];
const augName = playerAug.name;
const aug = Augmentations[augName];
if (aug == null) {
console.warn(`Invalid augmentation name in Player.reapplyAllAugmentations(). Aug ${augName} will be skipped`);
continue;
}
aug.owned = true;
if (augName == AugmentationNames.NeuroFluxGovernor) {
for (let j = 0; j < playerAug.level; ++j) {
applyAugmentation(this.augmentations[i], true);