diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js b/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js index 697d1a6c..32d9f35a 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js @@ -7,8 +7,10 @@ import CreatureProperties from '/imports/api/creature/creatureProperties/Creatur import computedSchemas from '/imports/api/properties/computedPropertySchemasIndex.js'; import applyFnToKey from '/imports/api/engine/computation/utility/applyFnToKey.js'; import { get } from 'lodash'; -import resolve, { map } from '/imports/parser/resolve.js'; +import resolve, { map, toString } from '/imports/parser/resolve.js'; +import symbol from '/imports/parser/parseTree/symbol.js'; import logErrors from './shared/logErrors.js'; +import cyrb53 from '/imports/api/engine/computation/utility/cyrb53.js'; export default function applyBuff(node, {creature, targets, scope, log}){ const prop = node.node; @@ -63,7 +65,7 @@ function crystalizeVariables({propList, scope, log}){ applyFnToKey(prop, calcKey, (prop, key) => { const calcObj = get(prop, key); if (!calcObj?.parseNode) return; - map(calcObj.parseNode, node => { + calcObj.parseNode = map(calcObj.parseNode, node => { // Skip nodes that aren't symbols or accessors if ( node.parseType !== 'accessor' && node.parseType !== 'symbol' @@ -73,6 +75,9 @@ function crystalizeVariables({propList, scope, log}){ // strip $target if (node.parseType === 'accessor'){ node.name = node.path.shift(); + if (!node.path.length){ + return symbol.create({name: node.name}) + } } else { // Can't strip symbols log.content.push({ @@ -88,6 +93,8 @@ function crystalizeVariables({propList, scope, log}){ return result; } }); + calcObj.calculation = toString(calcObj.parseNode); + calcObj.hash = cyrb53(calcObj.calculation); }); }); }); diff --git a/app/imports/ui/properties/treeNodeViews/TreeNodeView.vue b/app/imports/ui/properties/treeNodeViews/TreeNodeView.vue index c6d64135..6aa7a5d6 100644 --- a/app/imports/ui/properties/treeNodeViews/TreeNodeView.vue +++ b/app/imports/ui/properties/treeNodeViews/TreeNodeView.vue @@ -3,6 +3,12 @@ :is="treeNodeView" :model="model" :selected="selected" + :class="{ + 'inactive': model.inactive, + 'by-ancestor': model.deactivatedByAncestor, + 'by-self': model.deactivatedBySelf, + 'by-toggle': model.deactivatedByToggle, + }" /> @@ -29,3 +35,9 @@ export default { } } + +