Added DomainTouched support

This commit is contained in:
WBHarry 2026-01-11 11:54:59 +01:00
parent 7429369212
commit 8ab795b6ba
15 changed files with 62 additions and 12 deletions

View file

@ -20,7 +20,10 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
}
if (this.parent?.type === 'domainCard') {
return this.parent.system.inVault && !this.parent.system.vaultActive;
const vaultSupressed = this.parent.system.vaultSupressed;
const domainTouchedSupressed = this.parent.system.domainTouchedSuppressed;
return vaultSupressed || domainTouchedSupressed;
}
return super.isSuppressed;

View file

@ -31,7 +31,7 @@ export default class DHItem extends foundry.documents.Item {
static async createDocuments(sources, operation) {
// Ensure that items being created are valid to the actor its being added to
const actor = operation.parent;
sources = actor?.system?.isItemValid ? sources.filter((s) => actor.system.isItemValid(s)) : sources;
sources = actor?.system?.isItemValid ? sources.filter(s => actor.system.isItemValid(s)) : sources;
return super.createDocuments(sources, operation);
}
@ -146,6 +146,8 @@ export default class DHItem extends foundry.documents.Item {
/* -------------------------------------------- */
async use(event) {
if (this.system.cannotUse) return;
const actions = new Set(this.system.actionsList);
if (actions?.size) {
let action = actions.first();