From 21b83f3ea8997d2fe7bd88de13d6383a68cd2eda Mon Sep 17 00:00:00 2001 From: Budzyn <43236231+budzyn0@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:48:25 +0200 Subject: [PATCH] ref. #274, Fix marking failure rolls timing when dicesonice is enabled (#276) * ref. #274, Fix marking failure rolls timing when dicesonice is enabled * Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ module/roll/roll.js | 27 +++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c7aec2..0b0416b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Release/Patch Notes +## Version 1.6.2 - 2025-xx-xx + +### **Bug Fixes:** + +- [#274] () - Automated fail marking now works after dice so nice resolve roll. + ## Version 1.6.1 - 2025-09-09 > Thanks to the following new contributor: [Tobifroe](https://github.com/tobifroe). diff --git a/module/roll/roll.js b/module/roll/roll.js index 02ab37f..768a8a0 100644 --- a/module/roll/roll.js +++ b/module/roll/roll.js @@ -256,6 +256,10 @@ export class DGPercentileRoll extends DGRoll { this.options.rollMode = "blindroll"; } + const diceSoNice = + game.modules.has("dice-so-nice") && + game.modules.get("dice-so-nice").active; + const label = this.createLabel(); let resultString = ""; @@ -299,12 +303,7 @@ export class DGPercentileRoll extends DGRoll { if (failureMark) { const keyForUpdate = `${this.skillPath}.failure`; - // TODO: auto-update actor or post icon with manual apply - await this.actor.update({ - [keyForUpdate]: true, - }); - - return this.toMessage({ + const message = await this.toMessage({ flags: { deltagreen: { rollbacks: { @@ -315,7 +314,19 @@ export class DGPercentileRoll extends DGRoll { content: html, flavor: label, }); + + if (diceSoNice) { + await game.dice3d.waitFor3DAnimationByMessageID(message.id); + } + + // TODO: auto-update actor or post icon with manual apply + await this.actor.update({ + [keyForUpdate]: true, + }); + + return message; } + return this.toMessage({ content: html, flavor: label }); } @@ -434,9 +445,9 @@ export class DGPercentileRoll extends DGRoll { * @returns {Boolean} */ get isInhuman() { - /* + /* Changing this to only consider the base x5 stat target for whether something is 'inhuman' - because I do not think the intent was an Agent with a high strength getting a +40% bonus to be considered 'inhuman' + because I do not think the intent was an Agent with a high strength getting a +40% bonus to be considered 'inhuman' and therefore benefit from the increased crit threshold, although could be wrong about this. */ if (this.target > 99 && this.type === "stat") {