Action system improvements

- Actions/spells now display their summary, not their description
- All save branches and attack branches run when there are no targets
- Improved action logging
- Index branch lets you customise a choice of children to run
This commit is contained in:
Stefan Zermatten
2022-03-09 01:31:09 +02:00
parent c68667be9c
commit 788cbb182d
15 changed files with 201 additions and 53 deletions

View File

@@ -29,8 +29,9 @@ export default function computeVariableAsSkill(computation, node, prop){
}
// Combine everything to get the final result
const statBase = node.data.baseValue;
const statBase = node.data.baseValue || 0;
const aggregator = node.data.effectAggregator;
const aggregatorBase = aggregator.base || 0;
// If there is no aggregator, determine if the prop can hide, then exit
if (!aggregator){
@@ -41,7 +42,7 @@ export default function computeVariableAsSkill(computation, node, prop){
return;
}
// Combine aggregator
const base = (statBase > aggregator.base ? statBase : aggregator.base) || 0;
const base = statBase > aggregatorBase ? statBase : aggregatorBase;
let result = (base + prop.abilityMod + profBonus + aggregator.add) * aggregator.mul;
if (result < aggregator.min) result = aggregator.min;
if (result > aggregator.max) result = aggregator.max;