mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Added the ability for effects to automatically activate/deactivate depending on range between tokens
This commit is contained in:
parent
4defe69c21
commit
b80f598625
13 changed files with 218 additions and 30 deletions
|
|
@ -321,3 +321,18 @@ export const arraysEqual = (a, b) =>
|
|||
[...new Set([...a, ...b])].every(v => a.filter(e => e === v).length === b.filter(e => e === v).length);
|
||||
|
||||
export const setsEqual = (a, b) => a.size === b.size && [...a].every(value => b.has(value));
|
||||
|
||||
export function compareValues(a, b, compare) {
|
||||
switch (compare) {
|
||||
case CONFIG.DH.GENERAL.compareOperator.lessThan.id:
|
||||
return a < b;
|
||||
case CONFIG.DH.GENERAL.compareOperator.lessThanEqual.id:
|
||||
return a <= b;
|
||||
case CONFIG.DH.GENERAL.compareOperator.equal.id:
|
||||
return a === b;
|
||||
case CONFIG.DH.GENERAL.compareOperator.moreThanEqual.id:
|
||||
return a >= b;
|
||||
case CONFIG.DH.GENERAL.compareOperator.moreThan.id:
|
||||
return a > b;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue