Countdown max as formula to enable random countdowns

This commit is contained in:
WBHarry 2025-11-18 18:37:26 +01:00
parent cd7c61af42
commit 8b02a4c830
2 changed files with 10 additions and 6 deletions

View file

@ -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;