daggerheart/module/data/item/feature.mjs
WBHarry e9ad9c539a
264 - Action Feature Swap (#265)
* Removed action fields on Adversary/Environment in favor of using Feature Items

* Added drag/drop for features onto adversary/environment settings

* Added Drag of features from Adversary/Environment settings to anywhere in Foundry

* Updated all item types except Class/Subclass

* Added for Class/Subclass

* Items now copy over their features to Character

* Corrected back to actions for right items

* Fixed adversary/environment features display

* PR Fixes
2025-07-05 22:35:05 +02:00

25 lines
855 B
JavaScript

import BaseDataItem from './base.mjs';
import ActionField from '../fields/actionField.mjs';
export default class DHFeature extends BaseDataItem {
/** @inheritDoc */
static get metadata() {
return foundry.utils.mergeObject(super.metadata, {
label: 'TYPES.Item.feature',
type: 'feature',
hasDescription: true
});
}
/** @inheritDoc */
static defineSchema() {
const fields = foundry.data.fields;
return {
...super.defineSchema(),
type: new fields.StringField({ choices: CONFIG.DH.ITEM.featureTypes, nullable: true, initial: null }),
originId: new fields.StringField({ nullable: true, initial: null }),
identifier: new fields.StringField(),
actions: new fields.ArrayField(new ActionField())
};
}
}