mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
Updated compendiums with countdowns
This commit is contained in:
parent
8b02a4c830
commit
615b7eb4a5
25 changed files with 1161 additions and 523 deletions
|
|
@ -39,21 +39,18 @@ export default class CountdownField extends fields.ArrayField {
|
|||
return;
|
||||
}
|
||||
|
||||
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: max,
|
||||
max: max
|
||||
}
|
||||
};
|
||||
return acc;
|
||||
},
|
||||
{ countdowns: {} }
|
||||
);
|
||||
const data = { countdowns: {} };
|
||||
for (let countdown of config.countdowns) {
|
||||
const { total: max } = await new Roll(countdown.progress.max).evaluate();
|
||||
data.countdowns[foundry.utils.randomID()] = {
|
||||
...countdown,
|
||||
progress: {
|
||||
...countdown.progress,
|
||||
current: max,
|
||||
max: max
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
await emitAsGM(
|
||||
GMUpdateEvent.UpdateCountdowns,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue