Added LinkedItems for class. Added autoremoval of features and linkeditems when the related item is removed.

This commit is contained in:
WBHarry 2025-07-22 04:48:21 +02:00
parent 6336f2a60f
commit df8b96e9bc
16 changed files with 202 additions and 118 deletions

View file

@ -7,7 +7,8 @@ export default class DHSubclass extends BaseDataItem {
return foundry.utils.mergeObject(super.metadata, {
label: 'TYPES.Item.subclass',
type: 'subclass',
hasDescription: true
hasDescription: true,
isItemLinkable: true
});
}
@ -30,19 +31,19 @@ export default class DHSubclass extends BaseDataItem {
get foundationFeatures() {
return this.features.filter(
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.featureSubTypes.foundation
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.itemLinkFeatureTypes.foundation
);
}
get specializationFeatures() {
return this.features.filter(
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.featureSubTypes.specialization
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.itemLinkFeatureTypes.specialization
);
}
get masteryFeatures() {
return this.features.filter(
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.featureSubTypes.mastery
x => x.system.itemLinks[this.parent.uuid] === CONFIG.DH.ITEM.itemLinkFeatureTypes.mastery
);
}