mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
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(),
|
|
//Testing new armor schema
|
|
armor: new fields.SchemaField({
|
|
value: new fields.NumberField({integer: true, min: 0, initial: 0}),
|
|
max: new fields.NumberField({ required: true, integer: true, min: 0, initial: 0}),
|
|
priority: new fields.StringField({
|
|
required: true,
|
|
choices: CONFIG.DH.ITEM.allArmorKeys,
|
|
initial: CONFIG.DH.ITEM.armorPriorityKeys[0]
|
|
})
|
|
}),
|
|
//End
|
|
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';
|
|
}
|