Simplify ActiveEffect handling by a lot

This commit is contained in:
Johannes Loher 2021-02-16 03:26:26 +01:00
parent 1b715031a8
commit 66334d338f
2 changed files with 33 additions and 149 deletions

View file

@ -18,4 +18,18 @@ export class DS4Item extends Item<DS4ItemData> {
data.rank.total = data.rank.base + data.rank.mod;
}
}
isNonEquippedEuipable(): boolean {
return "equipped" in this.data.data && !this.data.data.equipped;
}
/**
* The number of times that active effect changes originating from this item should be applied.
*/
get activeEffectFactor(): number {
if (this.data.type === "talent") {
return this.data.data.rank.total ?? this.data.data.rank.base + this.data.data.rank.mod;
}
return 1;
}
}