Added UI backend that can do computations with context

This commit is contained in:
Thaum Rystra
2020-04-23 14:26:05 +02:00
parent 7416101a34
commit 95bfcd79c9
16 changed files with 294 additions and 40 deletions

View File

@@ -19,8 +19,9 @@ function combineAttribute(stat, aggregator){
if (!stat.decimal) result = Math.floor(result);
stat.value = result;
if (stat.attributeType === 'ability') {
stat.mod = Math.floor((result - 10) / 2);
stat.modifier = Math.floor((result - 10) / 2);
}
stat.currentValue = stat.value - (stat.damage || 0);
}
function combineSkill(stat, aggregator, memo){
@@ -30,7 +31,7 @@ function combineSkill(stat, aggregator, memo){
if (!ability.computationDetails.computed){
computeStat(ability, memo);
}
stat.abilityMod = ability.mod;
stat.abilityMod = ability.modifier;
}
// Combine all the child proficiencies
for (let i in stat.proficiencies){