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

Powercards Math

Hello everyone, I'm trying to do a simple math operation that will retain the value of a previous roll, then add damage for special circumstances.  In this case, I'm trying to display damage for Divine Smite, which does more damage to undead or fiends.  I can't get it to work though, maybe someone here can help? Essentially I'm trying to take ^Dmg and create another variable, $Dmg2 with another d8 added in. !power {{  --name|Divine Smite vs. @{target|token_name}  --leftsub|Melee Attack  --rightsub|5 ft. Reach  --Damage:|[[ [$Dmg] ?{Slots|1,2d8|2,3d8|3,4d8|4,5d8}]] Radiant  --vs. Undead or Fiends:| + [[ [$Dmg2] 1d8 + [^Dmg] ]] }}
1595955718
Kurt J.
Pro
API Scripter
Dustin W. said: Hello everyone, I'm trying to do a simple math operation that will retain the value of a previous roll, then add damage for special circumstances.  In this case, I'm trying to display damage for Divine Smite, which does more damage to undead or fiends.  I can't get it to work though, maybe someone here can help? Essentially I'm trying to take ^Dmg and create another variable, $Dmg2 with another d8 added in. !power {{  --name|Divine Smite vs. @{target|token_name}  --leftsub|Melee Attack  --rightsub|5 ft. Reach  --Damage:|[[ [$Dmg] ?{Slots|1,2d8|2,3d8|3,4d8|4,5d8}]] Radiant  --vs. Undead or Fiends:| + [[ [$Dmg2] 1d8 + [^Dmg] ]] }} All rolls happen at the same time in a PowerCard, so it isn't possible to use the results of one roll in another. There is almost always a way around this though, such as (in this case)   --Damage:|[[ [$Dmg] ?{Slots|1,2d8|2,3d8|3,4d8|4,5d8} + (?{Undead of Fiends:No,0|Yes,1}*(1d8)) ]] Radiant (I didn't test that line, but something like that should work.)