Fixed checks not applying rolled effects

This commit is contained in:
ThaumRystra
2023-11-12 21:11:04 +02:00
parent 2e3e6e22b6
commit 800ef3328c
9 changed files with 52 additions and 10 deletions

View File

@@ -32,10 +32,10 @@ export default function computeCalculation(computation, node) {
delete calcObj._localScope;
}
export function resolveCalculationNode(calculation, parseNode, scope) {
export function resolveCalculationNode(calculation, parseNode, scope, givenContext) {
const fn = calculation._parseLevel;
const calculationScope = { ...calculation._localScope, ...scope };
const { result: resultNode, context } = resolve(fn, parseNode, calculationScope);
const { result: resultNode, context } = resolve(fn, parseNode, calculationScope, givenContext);
calculation.errors = context.errors;
calculation.valueNode = resultNode;
}

View File

@@ -32,11 +32,12 @@ export default function aggregateDefinition({ node, linkedNode, link }) {
if (propBaseValue === undefined) return;
// Store a summary of the definition as a base value effect
node.data.effectIds = node.data.effectIds || [];
node.data.definitions = node.data.definitions || [];
if (prop.type === 'pointBuyRow') {
node.data.effectIds.push(prop.tableId);
node.data.definitions.push({ _id: prop.tableId, type: 'pointBuy', row: prop.index });
} else {
node.data.effectIds.push(prop._id);
node.data.definitions.push({ _id: prop._id, type: node.data.type });
}
if (node.data.baseValue === undefined || propBaseValue > node.data.baseValue) {
node.data.baseValue = propBaseValue;

View File

@@ -50,5 +50,6 @@ export default function computeVariableAsAttribute(computation, node, prop) {
// Store effects and proficiencies
prop.effectIds = node.data.effectIds;
prop.definitions = node.data.definitions;
prop.proficiencyIds = node.data.proficiencyIds;
}

View File

@@ -35,6 +35,7 @@ export default function computeVariableAsSkill(computation, node, prop) {
// Store effects and proficiencies
prop.effectIds = node.data.effectIds;
prop.definitions = node.data.definitions;
prop.proficiencyIds = node.data.proficiencyIds;
// If there is no aggregator, determine if the prop can hide, then exit