Rebase fix, move hasAugmentation to Person

This commit is contained in:
Snarling
2022-09-27 13:20:42 -04:00
parent 8a9515f154
commit b364cdf734
4 changed files with 6 additions and 27 deletions
+1 -4
View File
@@ -53,9 +53,7 @@ export class PlayerObject extends Person {
moneySourceB = new MoneySourceTracker();
playtimeSinceLastAug = 0;
playtimeSinceLastBitnode = 0;
purchasedServers: string[] = [];
queuedAugmentations: IPlayerOwnedAugmentation[] = [];
scriptProdSinceLastAug = 0;
purchasedServers: string[] = []; scriptProdSinceLastAug = 0;
sleeves: Sleeve[] = [];
sleevesFromCovenant = 0;
sourceFiles: PlayerOwnedSourceFile[] = [];
@@ -105,7 +103,6 @@ export class PlayerObject extends Person {
getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;
getUpgradeHomeCoresCost = serverMethods.getUpgradeHomeCoresCost;
gotoLocation = generalMethods.gotoLocation;
hasAugmentation = augmentationMethods.hasAugmentation;
hasCorporation = corporationMethods.hasCorporation;
hasGangWith = gangMethods.hasGangWith;
hasTorRouter = serverMethods.hasTorRouter;
@@ -2,31 +2,8 @@
* Augmentation-related methods for the Player class (PlayerObject)
*/
import { PlayerObject } from "./PlayerObject";
import { Augmentation } from "../../Augmentation/Augmentation";
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
export function hasAugmentation(this: PlayerObject, aug: string | Augmentation, ignoreQueued = false): boolean {
const augName: string = aug instanceof Augmentation ? aug.name : aug;
for (const owned of this.augmentations) {
if (owned.name === augName) {
return true;
}
}
if (!ignoreQueued) {
for (const owned of this.queuedAugmentations) {
if (owned.name === augName) {
return true;
}
}
}
return false;
}
export function applyEntropy(this: PlayerObject, stacks = 1): void {
// Re-apply all multipliers
this.reapplyAllAugmentations();