mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Fixed DiceSoNice using the upgraded DiceSizes for 2d4c1
This commit is contained in:
parent
e25cf0c4cd
commit
9fba339230
1 changed files with 19 additions and 1 deletions
|
|
@ -11,7 +11,25 @@ export default class BaseDie extends foundry.dice.terms.Die {
|
|||
if (this.number !== 2) return false;
|
||||
|
||||
const maxIncreasesDiceSize = modifier.endsWith('1');
|
||||
return this.continueCombo(maxIncreasesDiceSize);
|
||||
const result = await this.continueCombo(maxIncreasesDiceSize);
|
||||
|
||||
/* The flow of DiceSoNice has no way of knowign that some of the results of a Die should be a different denomination
|
||||
We solve this by marking the results as hidden so they're not picked up by the auto roll of DiceSoNice.
|
||||
The actual rolls are done here in place so every dice gets the correct denomination.
|
||||
*/
|
||||
if (game.modules.get('dice-so-nice')?.active) {
|
||||
await Promise.allSettled(this.results.map(async result => {
|
||||
const roll = await (new Roll(`1${result.denomination ?? this.denomination}`)).evaluate();
|
||||
roll.terms[0].results = [result];
|
||||
roll._evaluateTotal();
|
||||
return game.dice3d.showForRoll(roll, game.user, false);
|
||||
}));
|
||||
}
|
||||
|
||||
for (const result of this.results)
|
||||
result.hidden = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async continueCombo(maxIncreasesDiceSize) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue