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 seems to be ignoring some of the math

I'm using the powercards script and have built the following macro: !power {{  --tokenid|@{selected|token_id} --target_list|@{target|token_id} --emote|**@{Selected|token_name}** slashes at @{Target|token_name} with a longsword! --format|atwill --titlefontshadow|none --name|Longsword  --leftsub|Main Hand  --rightsub|Melee Slashing --Attack|[[ [$atk] 1d20+@{Selected|ATK}+?{Modifier|0}]] vs Slashing AC --?? $atk.total > @{target|AC} ?? Enemy Dodge:|[[ 1d100cf>[[@{target|Dodge}-2*($atk.total-@{target|AC}+1)]]cs<[[@{target|Dodge}-2*($atk.total-@{target|AC})]] ]] }} The combat flow goes something like this: Token A rolls 1d20 + modifiers to hit Token B, if the result is higher than Token B's Slashing AC, then Token B rolls a dodge attempt. Token B has an attribute called "dodge" and rolls 1d100 to attempt to roll under this value. However, the value is modified by how well Token A succeeded initially on the to-hit roll. Token B subtracts their AC from the Token A's total, multiplies the resultant value by 2, then penalizes their dodge roll by that amount. So, assume Token A rolls a 22 after all modifiers, and Token B's AC is 12. That means when Token B rolls to dodge, they penalize their dodge score by 20. (10*2) This is the only part of the above macro that isn't working. It's simply rolling the base dodge chance of Token B. The cs/cf stuff is just to make the box red or green on a failure/success. Any idea what I'm missing/doing wrong?
1587419645
GiGs
Pro
Sheet Author
API Scripter
There's a Power Cards API thread in the API or Pro section of the forum. You'll likely get help from people familiar with the syntax there.
Thanks for the heads up!