FEAT: BaseDataItem class

add TODO comments for future improvements
FIX: Remove effect field on template
FIX: remove unused DhpEffects file
This commit is contained in:
Joaquin Pereyra 2025-05-30 20:31:34 -03:00
parent 5a2c69d48f
commit ec7f32cdc7
14 changed files with 298 additions and 201 deletions

View file

@ -1,10 +1,21 @@
export default class DHConsumable extends foundry.abstract.TypeDataModel {
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,
});
}
/** @inheritDoc */
static defineSchema() {
const fields = foundry.data.fields;
return {
description: new fields.HTMLField({}),
quantity: new fields.NumberField({ initial: 1, integer: true }),
...super.defineSchema(),
consumeOnUse: new fields.BooleanField({ initial: false })
};
}