bol/module/item/item.js

37 lines
927 B
JavaScript
Raw Normal View History

2021-07-08 10:12:12 +02:00
/**
* Extend the basic Item with some very simple modifications.
* @extends {Item}
*/
export class BoLItem extends Item {
/**
* Augment the basic Item data model with additional dynamic data.
*/
prepareData() {
2022-07-01 15:48:54 +02:00
super.prepareData()
const actorData = this.actor ? this.actor.system : {}
2021-07-08 10:12:12 +02:00
}
2021-11-08 14:40:29 +01:00
2022-07-01 15:48:54 +02:00
/* -------------------------------------------- */
2021-11-08 14:40:29 +01:00
get properties() {
2022-07-01 15:48:54 +02:00
return this.system.properties
2021-11-08 14:40:29 +01:00
}
/* -------------------------------------------- */
/**
* Get the Array of item properties which are used in the small sidebar of the description tab
* @return {Array}
* @private
*/
get itemProperties() {
const props = [];
2022-07-01 15:48:54 +02:00
if ( this.type === "item" ) {
const entries = Object.entries(this.system.properties)
props.push(...entries.filter(e => e[1] === true).map(e => { return game.bol.config.itemProperties2[e[0]] }))
2021-11-08 14:40:29 +01:00
}
2022-07-01 15:48:54 +02:00
return props.filter(p => !!p)
2021-11-08 14:40:29 +01:00
}
2021-07-08 10:12:12 +02:00
}