mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
* Initial migration * Updated compendium YML * Added Quantity as a possible cost * Added quantity consumption to all Compendium Consumables * . * Added DestroyOnEmpty property
30 lines
915 B
JavaScript
30 lines
915 B
JavaScript
import BaseDataItem from './base.mjs';
|
|
|
|
export default class DHConsumable extends BaseDataItem {
|
|
/** @inheritDoc */
|
|
static get metadata() {
|
|
return foundry.utils.mergeObject(super.metadata, {
|
|
label: 'TYPES.Item.consumable',
|
|
type: 'consumable',
|
|
hasDescription: true,
|
|
isQuantifiable: true,
|
|
isInventoryItem: true,
|
|
hasActions: true
|
|
});
|
|
}
|
|
|
|
/** @inheritDoc */
|
|
static defineSchema() {
|
|
const fields = foundry.data.fields;
|
|
return {
|
|
...super.defineSchema(),
|
|
consumeOnUse: new fields.BooleanField({ initial: true }),
|
|
destroyOnEmpty: new fields.BooleanField({ initial: true })
|
|
};
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
/**@override */
|
|
static DEFAULT_ICON = 'systems/daggerheart/assets/icons/documents/items/round-potion.svg';
|
|
}
|