Code: Select all
[h: WpnMod = arg(0)]
[h: STRMod = getAbilMod("Strength")]
[h: SizeMod = getSizeMod()]
[h: AttRoll = 1d20]
[getName()] attacks:<br>
<!-- Check for Crit Success/Failure-->
[switch(AttRoll),code:
case 1: {<b>Critical Failure</b><br>};
case 20: {
<b>Threat</b><br>
Critical Success Roll is: [1d20+STRMod+BAB+SizeMod+WpnMod]<br>
Normal Damage is [if(getSize()=="Medium") : 1d8+STRmod+WpnMod]
[if(getSize()=="Large") : 2d6 +STRmod+WpnMod]
};
default: {
AC: [AttRoll+STRMod+BAB+SizeMod+WpnMod]<br>
Dam: [if(getSize()=="Medium") : 1d8+STRmod+WpnMod]
[if(getSize()=="Large") : 2d6 +STRmod+WpnMod]
}]
Code: Select all
[Attack(1)]
getName() = getName()Dannix« attacks:
AC: 23
Dam: 6 »
There are tooltips for the 23 and 6 (as expected and desired).
I figured if I changed:
Code: Select all
[getName()] attacks:<br>
Code: Select all
[r:getName()] attacks:<br>
Dannix attacks:
AC: AttRoll+STRMod+BAB+SizeMod+WpnMod = 11 + 1 + 9 + 0 + 1*22«
Dam: 9 »
There is a little ASCII box where the * is above. The same thing happens when I run it from a different token, and the same expansion happens when the Threat switch is executed. Changing the AC line to [r:...] fixes it, but suppresses the tool tips, which I don't like. Any ideas?
And on an unrelated note: Is there anyway to store global variables (that exist after a macro is done executing) other than using Token Properties? I'm looking for a way to keep track of which spells are active, among other things.