diff --git a/app/imports/api/creature/computation/combineStat.js b/app/imports/api/creature/computation/combineStat.js index a475a4ec..5588d46e 100644 --- a/app/imports/api/creature/computation/combineStat.js +++ b/app/imports/api/creature/computation/combineStat.js @@ -44,11 +44,22 @@ function combineAttribute(stat, aggregator, memo){ stat.dependencies.push(...dependencies); } stat.currentValue = stat.value - (stat.damage || 0); + // Ability scores get modifiers if (stat.attributeType === 'ability') { stat.modifier = Math.floor((stat.currentValue - 10) / 2); } else { stat.modifier = undefined; } + // Hit dice get constitution modifiers + stat.constitutionMod = undefined; + if (stat.attributeType === 'hitDice') { + let conStat = memo.statsByVariableName['constitution']; + if (conStat && 'modifier' in conStat){ + stat.constitutionMod = conStat.modifier; + stat.dependencies.push(conStat._id, ...conStat.dependencies); + } + } + // Stats that have no effects can be hidden based on a sheet setting stat.hide = aggregator.hasNoEffects && stat.baseValue === undefined || undefined diff --git a/app/imports/api/creature/computation/computeEndStepProperty.js b/app/imports/api/creature/computation/computeEndStepProperty.js index 6317549c..cb143dbf 100644 --- a/app/imports/api/creature/computation/computeEndStepProperty.js +++ b/app/imports/api/creature/computation/computeEndStepProperty.js @@ -6,6 +6,10 @@ export default function computeEndStepProperty(prop, memo){ case 'spell': computeAction(prop, memo); break; + case 'adjustment': + case 'damage': + computePropertyField(prop, memo, 'amount', 'compile'); + break; case 'attack': computeAction(prop, memo); computeAttack(prop, memo); diff --git a/app/imports/api/properties/Attributes.js b/app/imports/api/properties/Attributes.js index c1b50619..aa60982f 100644 --- a/app/imports/api/properties/Attributes.js +++ b/app/imports/api/properties/Attributes.js @@ -122,6 +122,11 @@ let ComputedOnlyAttributeSchema = new SimpleSchema({ type: SimpleSchema.Integer, optional: true, }, + // The computed creature constitution modifier + constitutionMod: { + type: Number, + optional: true, + }, // Should this attribute hide hide: { type: Boolean, diff --git a/app/imports/ui/components/computation/Computed.vue b/app/imports/ui/components/computation/Computed.vue deleted file mode 100644 index 81c94303..00000000 --- a/app/imports/ui/components/computation/Computed.vue +++ /dev/null @@ -1,94 +0,0 @@ - - - - - diff --git a/app/imports/ui/components/computation/ComputedForCreature.vue b/app/imports/ui/components/computation/ComputedForCreature.vue deleted file mode 100644 index a676a4fe..00000000 --- a/app/imports/ui/components/computation/ComputedForCreature.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - diff --git a/app/imports/ui/creature/slots/SlotFillDialog.vue b/app/imports/ui/creature/slots/SlotFillDialog.vue index 89329cbe..277395b3 100644 --- a/app/imports/ui/creature/slots/SlotFillDialog.vue +++ b/app/imports/ui/creature/slots/SlotFillDialog.vue @@ -56,8 +56,8 @@ /> diff --git a/app/imports/ui/properties/components/actions/ActionCard.vue b/app/imports/ui/properties/components/actions/ActionCard.vue index d0a66727..aa0760b5 100644 --- a/app/imports/ui/properties/components/actions/ActionCard.vue +++ b/app/imports/ui/properties/components/actions/ActionCard.vue @@ -71,7 +71,10 @@ /> diff --git a/app/imports/ui/properties/treeNodeViews/DamageTreeNode.vue b/app/imports/ui/properties/treeNodeViews/DamageTreeNode.vue index 6baf3fae..4f146aa9 100644 --- a/app/imports/ui/properties/treeNodeViews/DamageTreeNode.vue +++ b/app/imports/ui/properties/treeNodeViews/DamageTreeNode.vue @@ -11,30 +11,19 @@
- - - {{ model.damageType }} - - - damage - + {{ model.amountResult }} + {{ model.damageType }} damage
diff --git a/app/imports/ui/properties/viewers/AttributeViewer.vue b/app/imports/ui/properties/viewers/AttributeViewer.vue index 04f9be45..0b163d66 100644 --- a/app/imports/ui/properties/viewers/AttributeViewer.vue +++ b/app/imports/ui/properties/viewers/AttributeViewer.vue @@ -39,8 +39,8 @@ :value="reset" /> diff --git a/app/imports/ui/properties/viewers/ContainerViewer.vue b/app/imports/ui/properties/viewers/ContainerViewer.vue index 088346ee..cb18ccd8 100644 --- a/app/imports/ui/properties/viewers/ContainerViewer.vue +++ b/app/imports/ui/properties/viewers/ContainerViewer.vue @@ -44,8 +44,8 @@ diff --git a/app/imports/ui/properties/viewers/DamageMultiplierViewer.vue b/app/imports/ui/properties/viewers/DamageMultiplierViewer.vue index 7eafa526..5aa69763 100644 --- a/app/imports/ui/properties/viewers/DamageMultiplierViewer.vue +++ b/app/imports/ui/properties/viewers/DamageMultiplierViewer.vue @@ -17,6 +17,7 @@ export default { case 0: return 'Immunity'; case 0.5: return 'Resistance'; case 2: return 'Vulnerability'; + default: return ''; } }, }, diff --git a/app/imports/ui/properties/viewers/DamageViewer.vue b/app/imports/ui/properties/viewers/DamageViewer.vue index 3b9a0fb0..530ae4ba 100644 --- a/app/imports/ui/properties/viewers/DamageViewer.vue +++ b/app/imports/ui/properties/viewers/DamageViewer.vue @@ -1,25 +1,16 @@ diff --git a/app/imports/ui/properties/viewers/FeatureViewer.vue b/app/imports/ui/properties/viewers/FeatureViewer.vue index 59fda96d..64534f58 100644 --- a/app/imports/ui/properties/viewers/FeatureViewer.vue +++ b/app/imports/ui/properties/viewers/FeatureViewer.vue @@ -1,9 +1,15 @@ diff --git a/app/imports/ui/properties/viewers/FolderViewer.vue b/app/imports/ui/properties/viewers/FolderViewer.vue index 0a784889..48ae8589 100644 --- a/app/imports/ui/properties/viewers/FolderViewer.vue +++ b/app/imports/ui/properties/viewers/FolderViewer.vue @@ -1,7 +1,7 @@ - - diff --git a/app/imports/ui/properties/viewers/SkillViewer.vue b/app/imports/ui/properties/viewers/SkillViewer.vue index 1e3c2160..9194f08f 100644 --- a/app/imports/ui/properties/viewers/SkillViewer.vue +++ b/app/imports/ui/properties/viewers/SkillViewer.vue @@ -35,8 +35,8 @@ :value="model.baseProficiency" /> @@ -19,6 +19,3 @@ export default { mixins: [propertyViewerMixin], } - - diff --git a/app/imports/ui/properties/viewers/SpellViewer.vue b/app/imports/ui/properties/viewers/SpellViewer.vue index bd082048..55d445ec 100644 --- a/app/imports/ui/properties/viewers/SpellViewer.vue +++ b/app/imports/ui/properties/viewers/SpellViewer.vue @@ -18,8 +18,8 @@ :value="`${model.level} ${model.school}`" /> diff --git a/app/imports/ui/properties/viewers/shared/PropertyDescription.vue b/app/imports/ui/properties/viewers/shared/PropertyDescription.vue index afd4c0e9..d68eb51c 100644 --- a/app/imports/ui/properties/viewers/shared/PropertyDescription.vue +++ b/app/imports/ui/properties/viewers/shared/PropertyDescription.vue @@ -1,21 +1,30 @@