2021-02-05 03:42:42 +01:00
|
|
|
import { DS4ItemData } from "./item-data";
|
2020-12-23 18:23:26 +01:00
|
|
|
|
2020-12-23 16:52:20 +01:00
|
|
|
/**
|
|
|
|
* Extend the basic Item with some very simple modifications.
|
|
|
|
* @extends {Item}
|
|
|
|
*/
|
2021-01-26 03:55:18 +01:00
|
|
|
export class DS4Item extends Item<DS4ItemData> {
|
2020-12-23 16:52:20 +01:00
|
|
|
/**
|
|
|
|
* Augment the basic Item data model with additional dynamic data.
|
|
|
|
*/
|
2020-12-23 18:23:26 +01:00
|
|
|
prepareData(): void {
|
2020-12-23 16:52:20 +01:00
|
|
|
super.prepareData();
|
2021-01-06 01:24:37 +01:00
|
|
|
this.prepareDerivedData();
|
2020-12-23 16:52:20 +01:00
|
|
|
|
|
|
|
// Get the Item's data
|
2020-12-23 18:23:26 +01:00
|
|
|
// const itemData = this.data;
|
|
|
|
// const actorData = this.actor ? this.actor.data : {};
|
|
|
|
// const data = itemData.data;
|
2020-12-23 16:52:20 +01:00
|
|
|
}
|
2021-01-06 01:24:37 +01:00
|
|
|
|
|
|
|
prepareDerivedData(): void {
|
2021-02-05 03:42:42 +01:00
|
|
|
if (this.data.type === "talent") {
|
|
|
|
const data = this.data.data;
|
2021-01-06 11:52:11 +01:00
|
|
|
data.rank.total = data.rank.base + data.rank.mod;
|
2021-01-06 01:24:37 +01:00
|
|
|
}
|
|
|
|
}
|
2020-12-23 16:52:20 +01:00
|
|
|
}
|