mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
FEAT: formatting code
FIX: fix fields used FEAT: add jsdoc
This commit is contained in:
parent
6c147a5c00
commit
f3942280b6
13 changed files with 96 additions and 114 deletions
|
|
@ -12,6 +12,26 @@ export default class DhpItem extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @param {object} options - Options which modify the getRollData method.
|
||||
* @returns
|
||||
*/
|
||||
getRollData(options = {}) {
|
||||
let data;
|
||||
if (this.system.getRollData) data = this.system.getRollData(options);
|
||||
else {
|
||||
const actorRollData = this.actor?.getRollData(options) ?? {};
|
||||
data = { ...actorRollData, item: { ...this.system } };
|
||||
}
|
||||
|
||||
if (data?.item) {
|
||||
data.item.flags = { ...this.flags };
|
||||
data.item.name = this.name;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
isInventoryItem() {
|
||||
return ['weapon', 'armor', 'miscellaneous', 'consumable'].includes(this.type);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue