Hi, I was trying to make a cool macro for the DnD 5e Wild Talent Feat ( UA are always free and publicly accessible ). This is the part i'm focusing on: Changing the Die’s Size. If you roll the highest
number on your Psionic Talent die, it decreases
by one die size after the roll. This represents you
burning through your psionic energy. For
example, if the die is a d6 and you roll a 6, it
becomes a d4. If it’s a d4 and you roll a 4, it
becomes unusable until you finish a long rest.
Conversely, if you roll a 1 on your Psionic
Talent die, it increases by one die size after the
roll, up to its starting size. This represents you
conserving psionic energy for later use. For example, if you roll a 1 on a d4, the die then
becomes a d6.
Whenever you finish a long rest, your Psionic
Talent die resets to its starting size. When you
reach certain levels in this class, the starting size
of your Psionic Talent die increases: at 5th level
(d8), 11th level (d10), and 17th level (d12). In a nutshell, I'd like a macro that firstly uses query to ask the player which is their dice size, then rolls the dice and sends the result. Then i'd like the macro to write a simple note that if the <result of the roll> is the maximum number rolled, the feat rules that the dice decrease in size, meanwhile the <result> is 1, the dice increase to the next size in order. With the help of the roll20 wiki, i've made up this spaghetti code (sorry for bad english too) &{template:default} {{name=Psionic Talent}} {{Dice Size= ?{Psionic Talent dice size?|d4|d6|d8|d10|d12} }} {{Psionic Talent Dice= [[ ?{Psionic Talent dice size?|d4|d6|d8|d10|d12} ]] }} {{Decreasing Dice size= If $[[0]] = the maximum number of the dice, it decreases of one size, after decreasing from d4 it becomes disabled}} {{Increasing Dice size= If $[[0]] = 1, the dice size increases to the next one available}} Is there a way to make the code more smart? Something like confronting the result with the maximum/minimum dice number and write the right size changing without writing everything, and don't add anything as a note if the result is a number in middle. Last small thing: how can I set the critical failure and critical success color to be reversed with query rolls? For example, since 6 is the worst result on a d6 (it decrease the dice size of the next roll) its border should be red, not green I know the normal roll whould be 1d6cf6cs1, but idk how to implement in a query.