Implement entropy accumulation system

This commit is contained in:
nickofolas
2022-03-19 13:15:31 -05:00
parent c33c23700e
commit c92b159580
9 changed files with 113 additions and 29 deletions

View File

@@ -5,6 +5,8 @@ import { IPlayer } from "../IPlayer";
import { Augmentation } from "../../Augmentation/Augmentation";
import { applyEntropy as calculateEntropy } from "../Grafting/EntropyAccumulation";
export function hasAugmentation(this: IPlayer, aug: string | Augmentation, installed = false): boolean {
const augName: string = aug instanceof Augmentation ? aug.name : aug;
@@ -24,3 +26,10 @@ export function hasAugmentation(this: IPlayer, aug: string | Augmentation, insta
return false;
}
export function applyEntropy(this: IPlayer, stacks = 1): void {
const newMultipliers = calculateEntropy(this, stacks);
for (const [mult, val] of Object.entries(newMultipliers)) {
this.setMult(mult, val);
}
}