mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
Countdown max as formula to enable random countdowns
This commit is contained in:
parent
cd7c61af42
commit
8b02a4c830
2 changed files with 10 additions and 6 deletions
|
|
@ -39,13 +39,15 @@ export default class CountdownField extends fields.ArrayField {
|
|||
return;
|
||||
}
|
||||
|
||||
const data = config.countdowns.reduce(
|
||||
(acc, curr) => {
|
||||
const data = await config.countdowns.reduce(
|
||||
async (acc, curr) => {
|
||||
const { total: max } = await new Roll(curr.progress.max).evaluate();
|
||||
acc.countdowns[foundry.utils.randomID()] = {
|
||||
...curr,
|
||||
progress: {
|
||||
...curr.progress,
|
||||
current: curr.progress.max
|
||||
current: max,
|
||||
max: max
|
||||
}
|
||||
};
|
||||
return acc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue