diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js
index de395906..3f6367c3 100644
--- a/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js
+++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js
@@ -3,6 +3,9 @@ import evaluateCalculation from '../../utility/evaluateCalculation.js';
export default function computeCalculation(computation, node) {
const calcObj = node.data;
evaluateCalculation(calcObj, computation.scope);
+ if (calcObj.effects || calcObj.proficiencies) {
+ calcObj.baseValue = calcObj.value;
+ }
aggregateCalculationEffects(node, computation);
aggregateCalculationProficiencies(node, computation);
}
@@ -36,7 +39,6 @@ function aggregateCalculationEffects(node, computation) {
true // enumerate only outbound links
);
if (calcObj.effects && typeof calcObj.value === 'number') {
- calcObj.baseValue = calcObj.value;
calcObj.effects.forEach(effect => {
if (
effect.operation === 'add' &&
@@ -71,23 +73,28 @@ function aggregateCalculationProficiencies(node, computation) {
},
true // enumerate only outbound links
);
- if (calcObj.proficiencies) {
+ if (calcObj.proficiencies && typeof calcObj.value === 'number') {
calcObj.proficiency = 0;
+ let currentProf;
calcObj.proficiencies.forEach(prof => {
if (prof.value > calcObj.proficiency) {
+ if (currentProf) currentProf.overridden = true;
calcObj.proficiency = prof.value;
+ } else {
+ prof.overridden = true;
}
});
// Get the character's proficiency bonus to apply
let profBonus = computation.scope['proficiencyBonus']?.value || 0;
-
+ calcObj.proficiencyBonus = profBonus;
+ let totalBonus;
// Multiply the proficiency bonus by the actual proficiency
if (calcObj.proficiency === 0.49) {
// Round down proficiency bonus in the special case
- calcObj.proficiencyBonus = Math.floor(profBonus * 0.5);
+ totalBonus = Math.floor(profBonus * 0.5);
} else {
- calcObj.proficiencyBonus = Math.ceil(profBonus * calcObj.proficiency);
+ totalBonus = Math.ceil(profBonus * calcObj.proficiency);
}
- calcObj.value += calcObj.proficiencyBonus;
+ calcObj.value += totalBonus;
}
}
diff --git a/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue b/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue
index fa813936..a485608c 100644
--- a/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue
+++ b/app/imports/client/ui/creature/creatureProperties/CreaturePropertyDialog.vue
@@ -211,7 +211,6 @@ export default {
},
change(arg) {
const { path, value, ack } = arg;
- console.log('creaturePropDialogChangeHandler', arg);
if (path && path[0] === 'equipped'){
equipItem.call({_id: this.currentId, equipped: value}, ack);
return;
diff --git a/app/imports/client/ui/properties/components/proficiencies/InlineProficiency.vue b/app/imports/client/ui/properties/components/proficiencies/InlineProficiency.vue
new file mode 100644
index 00000000..72ee4c01
--- /dev/null
+++ b/app/imports/client/ui/properties/components/proficiencies/InlineProficiency.vue
@@ -0,0 +1,85 @@
+
+