Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Macro for Double Damage on Crit (No Specific Template)

Hiho, I'm looking for a way to create a macro which rolls an attack, checks if a crit appeared and doubles the dmg if so. But not double damage like rolling 2 same sided dice instead of one but doubles a damage roll what has already been made.  I.e. Rolling attack 1d20 and 2d6 damage. attack: 20 -> crit, damage 10. So the macro should make a 20 out of the 10 somehow. I'm tried it with a check on crit to put out a 0 or 1 and do like 0 or 1 * damage roll (reuse) and adding those up at the end. But it does not work the way I tried it. &{template:default} {{name=Attack Macro}} [[ [[1d8+?{Damage|0}]] + [[ [[floor([[1d20cs>20+?{Attack|0}]]/[[20 + ?{Attack|0}]])]]d8+?{Damage|0}[CRIT] ]]]] {{Attack =$[[1]]}} {{Damage=$[[0]]+$[[4]] = $[[5]]}} Found this macro from GiGs  and tried to work from there. Below is what I tried. &{template:default} {{name=Attack Macro}} [[ [[2d6]] + [[ [[floor([[1d20cs>20]]/[[20]])]]*$[[0]] ]]]] {{Attack =$[[1]]}} {{Damage=$[[0]]+$[[4]] = $[[5]]}} Hope that someone can help me with this :) PS: Is it possible to do a text output on Crit?
1656051245

Edited 1656051258
GiGs
Pro
Sheet Author
API Scripter
To your last question, no it's not possible to do text output on a crit. :( Regarding your roll I see this: /[[20]])]]*$[[0]] First, I don't know why the 20 is an inline roll. You could just do /20)]]*$[[0]] But the bigger issue is this part: *$[[0]] You cant treat the reused roll as a number. It's an object of some sort, and can't be used in arithmetic here. Rather than looking for a 0 or 1, I'd be looking at getting a 1 or 2, and multiplying the original 2d6 roll by that. Try this: &{template:default} {{name=Attack Macro}}[[ [[2d6]] * [[ 1 + [[floor([[1d20cs>20]]/20)]] ]] ]] {{Attack =$[[1]]}} {{Damage=$[[0]] * $[[3]] = $[[4]]}}
Thanks! That worked just fine!