mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
Fixed adversary dice
This commit is contained in:
parent
dfb2c6bd3c
commit
ceb74296a1
6 changed files with 39 additions and 11 deletions
|
|
@ -195,7 +195,12 @@ export default class DhpActor extends Actor {
|
|||
}
|
||||
formula += ` ${modifiers.map(x => `+ ${x.value}`).join(' ')}`;
|
||||
const roll = await Roll.create(formula).evaluate();
|
||||
roll.rolledDice = roll.dice; // Perpetuating getter field
|
||||
const dice = roll.dice.flatMap(dice => ({
|
||||
denomination: dice.denomination,
|
||||
number: dice.number,
|
||||
total: dice.total,
|
||||
results: dice.results.map(result => ({ result: result.result, discarded: !result.active }))
|
||||
}));
|
||||
|
||||
if (this.type === 'character') {
|
||||
setDiceSoNiceForDualityRoll(roll, advantage);
|
||||
|
|
@ -246,6 +251,7 @@ export default class DhpActor extends Actor {
|
|||
const configRoll = {
|
||||
title: config.title,
|
||||
origin: this.id,
|
||||
dice,
|
||||
roll,
|
||||
modifiers: modifiers.filter(x => x.label),
|
||||
advantageState: advantage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue