mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Added DomainTouched support
This commit is contained in:
parent
7429369212
commit
8ab795b6ba
15 changed files with 62 additions and 12 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue