mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 22:46:12 +01:00
Added the ability for effects to have stacks
This commit is contained in:
parent
4aab5d315a
commit
79057b0718
11 changed files with 187 additions and 18 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { itemAbleRollParse } from '../helpers/utils.mjs';
|
||||
import { RefreshType, socketEvent } from '../systemRegistration/socket.mjs';
|
||||
import { RefreshType } from '../systemRegistration/socket.mjs';
|
||||
|
||||
export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||
/* -------------------------------------------- */
|
||||
|
|
@ -182,10 +182,17 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
|||
} catch (_) {}
|
||||
}
|
||||
|
||||
const evalValue = this.effectSafeEval(itemAbleRollParse(key, parseModel, effect.parent));
|
||||
const evalValue = this.effectSafeEval(this.effectRollParse(key, parseModel, effect.parent, effect));
|
||||
return evalValue ?? key;
|
||||
}
|
||||
|
||||
static effectRollParse(value, actor, item, effect) {
|
||||
const stackingParsedValue = effect.system.stacking?.enabled
|
||||
? Roll.replaceFormulaData(value, { stacks: effect.system.stacking.value })
|
||||
: value;
|
||||
return itemAbleRollParse(stackingParsedValue, actor, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Altered Foundry safeEval to allow non-numeric return
|
||||
* @param {string} expression
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue