mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Added reroll icon
This commit is contained in:
parent
b44d4695ad
commit
87d4ec0c7e
2 changed files with 7 additions and 2 deletions
|
|
@ -195,11 +195,15 @@ export default class DamageRoll extends DHRoll {
|
|||
results.splice(Number(result) + 1, 0, newResult[0]);
|
||||
|
||||
const rerolledDice = parsedRoll.dice.map((x, index) => {
|
||||
if (index !== Number(dice)) return { ...x, dice: x.denomination };
|
||||
const isRerollDice = index === Number(dice);
|
||||
if (!isRerollDice) return { ...x, dice: x.denomination };
|
||||
return {
|
||||
dice: parsedRoll.dice[dice].denomination,
|
||||
total: parsedRoll.dice[dice].total,
|
||||
results: results
|
||||
results: results.map(result => ({
|
||||
...result,
|
||||
hasRerolls: result.hasRerolls || isRerollDice
|
||||
}))
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue