ironmonk88 / monks-active-tiles

GNU General Public License v3.0
50 stars 31 forks source link

Feature request: Critical Success and Critical Failure #182

Open galaara98 opened 2 years ago

galaara98 commented 2 years ago

can you add support for redirecting to a label when Critical Success and Critical Failure (different from Success and Failure) Redirect Request Results when requested a roll from Monks Token Bar: Critical Success in DND5e, this is generally a Natural 20. In PathFinder 2e this is 10 or move above the DC, also in PF2e if a Natural 20 add an extra 10 to the dice total and then check results I dont know other systems, but a Nat 20 if using 20sided dice for DC, otherwise not sure. Critical Failure in DND5e this is generally a Natural 1 in Pathfinder 2e this is 10 or more below the DC, also in PF2e if a Natural 1 then subtract 10 from the dice total and then check result.

in addition to the already Success, Failure, Continue It might be possible for the system itself to tell you if it is a critical [again in my case the check is coming from monks token bar, request roll], in not sure if that is available in the API

*PF2e, technically the rules are if Natural 20, determine the result and then improve it by 1 step (so crit failure becomes failure, failure becomes success, and success becomes crit success) and the inverse for Natural 1. But the math should work above.

ironmonk88 commented 2 years ago

This has been asked for before, but I'm leaving it out because it's very system specific and there's just too much variation to be able to cover effectively in a single action. And Redirecting is only supposed to be a quick and easy short hand.

There is a macro included called "Multiple Anchors based on DC" that should give you the basis for checking for critical success or failure, since the macros get the full dice results it's possible to check everything and make a redirect that suits your exact purposes.

galaara98 commented 2 years ago

is there a way for the macro to know what the DC was set in the GUI so I could use math from there.

like

goto.push({ tokens: await Promise.all(results.filter(r => r.roll.total < (r.roll.dc - 10)).map(async (t) => { return await fromUuid(t.uuid); })), tag: 'anchor-below-10' });

Crowguard commented 2 years ago

Snugug wrote a macro for this a few weeks ago. Minus that last bit about improving the result. Only works for the MATT Request Roll action though. Just noticed this request was specifically for Token Bar.

https://github.com/Snugug/foundry-helpers/blob/101ae14f9f16217165b0815f1278b7633b912305/macros/customizable-anchors-based-on-dc.js

galaara98 commented 2 years ago

Thanks!

galaara98 commented 2 years ago

So, it works for from rolls with Token Bar... EXCEPT fumble (lowest on die) and critical success (highest on die) are not coming through at all [they are just doing the math so 20+somebonus or 1+somebonus

any chance you want to peek inside MATT request roll action and see what it is doing special for those cases? [meanwhile, i'll look at MATT, to see if it would get in the way of anything else... I like Action bar (i would be lying if I didn't say I'm partial to several of your mods)

Edit.. Ok, im a bit confused.. I use Monks Active Tile Trigger to call the Roll, but it only has the ability to request because I have Monks Active Bar also (i thought matt was something else, but i see it is just abbreviate for your monks active tile trigger)

========================

So the macro is working except it is not going to the labels fumble or critical when it hits a natural 1/20, do you think it has something to do with pf2e because it has a special handling around critical, and the macro is expecting something that perhaps DND5e would send [ill post this question into Snugug's git issues]

Crowguard commented 2 years ago

Might want to message Snugug about the crits & fumbles; I haven't personally tried those two as I use 5e. Last time I talked to him, he said they worked.