mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Add multiple conditions handler + update Bare Bones domain card
This commit is contained in:
parent
af3a415e56
commit
4a63836c0d
8 changed files with 213 additions and 38 deletions
|
|
@ -112,8 +112,12 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
|||
}
|
||||
|
||||
verifyCondition(actor) {
|
||||
if(!this.system.conditional?.field) return true;
|
||||
return foundry.applications.ux.SearchFilter.evaluateFilter(actor, this.system.conditional);
|
||||
if(!this.system.conditional?.condition.length) return true;
|
||||
return this.system.conditional.condition.filter(c => c.field).map(c => {
|
||||
if(!isNaN(c.value))
|
||||
c.value = Number(c.value);
|
||||
return c;
|
||||
})[this.system.conditional.andOr ? 'every' : 'some'](c => foundry.applications.ux.SearchFilter.evaluateFilter(actor, c));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue