Fixed skill and attribute effect lists
Now using effectId lists
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
export default function aggregateProficiency({node, linkedNode, link}){
|
||||
export default function aggregateProficiency({ node, linkedNode, link }) {
|
||||
if (
|
||||
link.data !== 'proficiency' &&
|
||||
!(link.data === 'definition' && linkedNode.data.type === 'skill')
|
||||
) return;
|
||||
let proficiency;
|
||||
if (link.data === 'proficiency'){
|
||||
if (link.data === 'proficiency') {
|
||||
proficiency = linkedNode.data.value || 0;
|
||||
} else if (link.data === 'definition' && linkedNode.data.type === 'skill'){
|
||||
} else if (link.data === 'definition' && linkedNode.data.type === 'skill') {
|
||||
proficiency = linkedNode.data.baseProficiency || 0;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
if (proficiency) {
|
||||
// Store a link to the proficiency
|
||||
node.data.proficiencyIds = node.data.proficiencyIds || [];
|
||||
node.data.proficiencyIds.push(linkedNode.data._id);
|
||||
}
|
||||
|
||||
// Store the highest proficiency
|
||||
if (
|
||||
node.data.proficiency === undefined ||
|
||||
proficiency > node.data.proficiency
|
||||
){
|
||||
) {
|
||||
node.data.proficiency = proficiency;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ export default function computeVariableAsAttribute(computation, node, prop) {
|
||||
prop.baseValue === undefined ||
|
||||
undefined
|
||||
|
||||
// Store effects
|
||||
// Store effects and proficiencies
|
||||
prop.effectIds = node.data.effectIds;
|
||||
prop.proficiencyIds = node.data.proficiencyIds;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,9 @@ export default function computeVariableAsSkill(computation, node, prop) {
|
||||
const aggregator = node.data.effectAggregator;
|
||||
const aggregatorBase = aggregator?.base || 0;
|
||||
|
||||
// Store effects
|
||||
// Store effects and proficiencies
|
||||
prop.effectIds = node.data.effectIds;
|
||||
prop.proficiencyIds = node.data.proficiencyIds;
|
||||
|
||||
// If there is no aggregator, determine if the prop can hide, then exit
|
||||
if (!aggregator) {
|
||||
|
||||
Reference in New Issue
Block a user