#retroactive-advantage

1 messages ยท Page 1 of 1 (latest)

bright fiber
#

It's still janky, but much less janky than I expected. For those interested I'll try to write out the theory

#

Any chat message with a dice result has a roll instance embedded in its json, accessible with a getter at chatMessage.roll

This module clones that roll instance and manually changes the advantageMode and results according to what I understand they should look like with the new advantageMode.

If necessary, it rolls extra d20s (with DSN support for shinys) and adds those into the roll array.

After that it'll call the following Roll methods _evaluateModifiers, getFormula, _evaluateTotal to "half-way-re-evaluate" the Roll without re-rolling any dice.

From there, it bundles up the new Roll instance and updates the chatMessage with the new roll. (Had to use a GM Proxy for this because of permissions unfortunately)

#

Overall, it's a medium-risk approach that relies on the Roll class's private methods and fields, but since it's self-contained, if it ever stops working, you can just disable the module on its own and move on without it breaking anything else you're using ๐Ÿ™‚

merry trail
#

Compatibility with Compact Roll Cards? ๐Ÿ™‚

bright fiber
#

it does actually work perfectly to my surprise ๐Ÿ˜›

compact sierra
#

hey this is pretty slick ๐Ÿ‘€

bright fiber
#

I should probably get around to releasing that too lol

merry trail
#

(Yes please)

compact sierra
#

seems like it works pretty well, if im understanding what you wrote up correctly this only works for users with GM permissions?

bright fiber
merry trail
#

Just needs a GM online.

compact sierra
#

AH that'll do it.

bright fiber
#

right, good call

compact sierra
#

i was about to say, no way i have your first bug report already LOL

bright fiber
compact sierra
#

good stuff!

bright fiber
#

with that said, this is still pretty early and hasn't been battle tested very thoroughly, so by all means hit me with your bug reports and incompatibilities

compact sierra
#

ill definitely be giving it a run, but a cursory "click the buttons a lot and see what happens" yields good results

scenic elbow
#

so... what if I wanted to do this to any chat roll that has a d20?

#

I'm gonna dig through the code and see if I can just scrape what I need to create a hook that adds buttons and then modify the roll

#

heck, you take this: out of the retroactive-advantage-5e.js and this bit out of the hook and it works fine except the formula doesn't change

#

those rolls being made with inline rolls

#

but you are relying heavily on the d20roll class to do a lot of stuff. I'm going to have to fiddle with the roll object

bright fiber
#

I'm a little confused about the use case, ngl

#

macros?

scenic elbow
#

in a sense yes, my group plays with macros I made that make everything inline rolls

bright fiber
#

else I'll see if I can throw some time at converting this to stop using D20Roll so much, and use a normal Roll instance maybe

scenic elbow
#

You don't need to do that, d20Roll has a lot of 5e specific stuff you probably actually want. I will probably just fork it for my silly specific use case

bright fiber
#

I'm not sure how much I'm actually using of the 5e roll tbh. It was dizzying to try to grasp how all these roll classes interact... I wouldn't be surprised if this is low level enough to get away with ditching it.

... Which... Hmmm. I wonder if this could end up system agnostic ish

scenic elbow
#

the only place it is really being used is to clone the roll while retaining the references, which is very important,

bright fiber
#

mmm there's system specific handling for stuff like min10 being interpreted as 'reliable talent' during _evaluateModifiers I think

scenic elbow
#

never mind me then. I made all the inline roll macros to keep my foundry games feeling like dice games. I don't use automation, so it is just as easy to have them roll twice if they forget and take the relevant roll

bright fiber
#

appreciate your feedback! still interested in what you come up with for your fork if you wanna go through the trouble of pushing so I can take a look ๐Ÿ˜›

scenic elbow
#

honestly, got stuck where you copy the roll. Like I said earlier, it actually works if you just remove the checks as to whether it is a d20Roll object. It just does not update the formula.