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 Math

So I have this Macro: !token-mod --set bar1_value|-[[20-@{target|Resist}]]  --ids @{target|token_id} It applies 20 damage to a token from bar 1 - minus the token's Resist stat.  Easy enough. If I have 0 Resist points, I take 20 damage.  If I have 20 Resist points, I take no damage.  The challenge is: If I have 30 Resist points, I heal 10 damage and that's not what I want. Ideally, if you have more Resist points that Damage points, you take 0 damage.  Thoughts on how to manage this? Thank you
(I tried looking this up myself in the conditional math wiki, but was overwhelmed by all the formulas)
1665805472
Gauss
Forum Champion
use keep/drop logic for this. [[{[[20-@{target|Resist}]], 0}kh1]] If the number goes negative then it keeps the 0.  Example: 20-30resist = {-10, 0}kh1 = 0
Thank you!