diff --git a/app/imports/api/engine/actions/applyProperty.js b/app/imports/api/engine/actions/applyProperty.js index 805d420e..4dc1cb79 100644 --- a/app/imports/api/engine/actions/applyProperty.js +++ b/app/imports/api/engine/actions/applyProperty.js @@ -4,6 +4,7 @@ import branch from './applyPropertyByType/applyBranch.js'; import buff from './applyPropertyByType/applyBuff.js'; import buffRemover from './applyPropertyByType/applyBuffRemover.js'; import damage from './applyPropertyByType/applyDamage.js'; +import folder from './applyPropertyByType/applyFolder.js'; import note from './applyPropertyByType/applyNote.js'; import roll from './applyPropertyByType/applyRoll.js'; import savingThrow from './applyPropertyByType/applySavingThrow.js'; @@ -16,6 +17,7 @@ const applyPropertyByType = { buff, buffRemover, damage, + folder, note, roll, savingThrow, diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js b/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js new file mode 100644 index 00000000..0965f56d --- /dev/null +++ b/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js @@ -0,0 +1,11 @@ +import recalculateInlineCalculations from './shared/recalculateInlineCalculations.js'; +import applyProperty from '../applyProperty.js'; +import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers.js'; + +export default function applyFolder(node, actionContext) { + // Apply triggers + applyNodeTriggers(node, 'before', actionContext); + applyNodeTriggers(node, 'after', actionContext); + // Apply children + node.children.forEach(child => applyProperty(child, actionContext)); +}