mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Adapt healing
This commit is contained in:
parent
92feddce1b
commit
3186378872
12 changed files with 95 additions and 87 deletions
|
|
@ -10,10 +10,11 @@ export default class DamageRoll extends DHRoll {
|
|||
|
||||
static DefaultDialog = DamageDialog;
|
||||
|
||||
static async buildEvaluate(rolls, config = {}, message = {}) {
|
||||
static async buildEvaluate(roll, config = {}, message = {}) {
|
||||
if ( config.evaluate !== false ) {
|
||||
for ( const roll of config.roll ) await roll.roll.evaluate();
|
||||
}
|
||||
roll._evaluated = true;
|
||||
const parts = config.roll.map(r => this.postEvaluate(r));
|
||||
config.roll = this.unifyDamageRoll(parts);
|
||||
}
|
||||
|
|
@ -22,7 +23,7 @@ export default class DamageRoll extends DHRoll {
|
|||
return {
|
||||
...roll,
|
||||
...super.postEvaluate(roll.roll, config),
|
||||
damageTypes: [...roll.damageTypes],
|
||||
damageTypes: [...(roll.damageTypes ?? [])],
|
||||
roll: roll.roll,
|
||||
type: config.type,
|
||||
modifierTotal: this.calculateTotalModifiers(roll.roll)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue