Hello from me again.
First of all I would like to thank @
HoneyBadger,@
The Aaron & @
Vince for all the work they put in this script.
Disclaimer: I use version 2.3.5 -- Production Server
This is for a D&D 5e campaign, in which you can cast a spell as a higher level for a greater effect (more damage, more targets, etc.). I use a roll query like ?{SpellLevel|1} in the macro, and from that it's easy to create a macro for variable damage (ex. [[(?{SpellLevel|1}+3)d6]] for 4d6 + 1d6/lvl abofe 1st).
Where this breaks down is when the spell cast at higher level affects more targets. If you can affect 1 target per level (starting at lvl 1) I can easily use the --targetlist tag along with --Target#?{SpellLevel|1}|%%token_name%% since the level of the spell equals the number of the targets affected. But some spells do not follow that simple formula. Let's take an example where a 2nd level spell affects 1 target and 1 more for each level above 2. I tried some things and here are the results (SPOILER ALERT: Nothing worked.)
--Target#(?{SpellLevel|2}-1)|%%token_name%% passes to the script as Target#(2-1)
--Target#[[?{SpellLevel|2}-1]]|%%token_name%% passes to the script as Target#$[[0]]
The problem is that I cannot do maths with the roll query before I pass it to the script and if I use inline maths the result is a roll object.
Can you guys think of a way to solve that? This is one of the last major problems I have with powercards. I know that one solution is to rewrite the whole parser that creates the powercard array. Anything that does not demand so much work?
Thank you again,
Chris