A better way?

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
SzassT
Cave Troll
Posts: 30
Joined: Sun Apr 30, 2017 4:32 pm
Location: Fort Smith, AR

A better way?

Post by SzassT »

I have implemented a macro for one of my players at his request. This has resulted in other players liking it after seeing it and wanting their own. While it wasn't difficult to make, I was wondering if there is a better way to make variations of this macro:

Code: Select all

[h:attack = 1d20+24]
[r,if(attack >= 40),CODE:
{
Rolls a <b><font color="red">[attack-24]</color></b> for a Possible Crit with <b>[1d20+24]</b> to Confirm on First Attack
};
{
Gets <b>[attack]</b> to Hit on First Attack
}]
[h:attack = 1d20+19]
[r,if(attack >= 35),CODE:
{
, Rolls a <b><font color="red">[attack-19]</color></b> for a Possible Crit with <b>[1d20+19]</b> to Confirm on Second Attack
};
{
, Gets <b>[attack]</b> to Hit on Second Attack
}]
[h:attack = 1d20+14]
[r,if(attack >= 30),CODE:
{
, Rolls a <b><font color="red">[attack-14]</color></b> for a Possible Crit with <b>[1d20+14]</b> to Confirm on Third Attack
};
{
, Gets <b>[attack]</b> to Hit on Third Attack
}]
[h:attack = 1d20+24]
[r,if(attack >= 40),CODE:
{
, Rolls a <b><font color="red">[attack-24]</color></b> for a Possible Crit with <b>[1d20+24]</b> to Confirm on Bonus Attack
};
{
, Gets <b>[attack]</b> to Hit on Bonus Attack
}]
[h:attack = 1d20+19]
[r,if(attack >= 35),CODE:
{
, Rolls a <b><font color="red">[attack-19]</color></b> for a Possible Crit with <b>[1d20+19]</b> to Confirm on First Off-Hand Attack
};
{
, Gets <b>[attack]</b> to Hit on First Off-Hand Attack
}]
[h:attack = 1d20+14]
[r,if(attack >= 30),CODE:
{
, Rolls a <b><font color="red">[attack-14]</color></b> for a Possible Crit with <b>[1d20+14]</b> to Confirm on Second Off-Hand Attack
};
{
, Gets <b>[attack]</b> to Hit on Second Off-Hand Attack
}]
[h:attack = 1d20+9]
[r,if(attack >= 25),CODE:
{
, and Rolls a <b><font color="red">[attack-9]</color></b> for a Possible Crit with <b>[1d20+9]</b> to Confirm on Third Off-Hand Attack.
};
{
, and Gets <b>[attack]</b> to Hit on Third Off-Hand Attack.
}]
My player's are actually all in the same room, so we use character sheets for their stats, not their tokens. Their tokens have notes for me (the DM), so drawing from their token isn't really viable.

Always looking to improve so any suggestions are welcome! Thanks in advance!

[EDIT] I thought I maybe should put some insight into the source for numbers, so:

Code: Select all

1d20+X
- then X=Attack Bonus

Code: Select all

if(attack >= Y)
- Then Y=20+Attack Bonus-Crit Range (So in this case, the critical hit range is 16 to 20, or 5 (16 is 1, 17 is 2, 18 is 3, 19 is 4, 20 is 5)

Code: Select all

and Rolls a <b><font color="red">[attack-9]</color></b> for a Possible Crit
- Displays the number rolled to gain a Possible Crit and then rolls a new attack roll for the Confirmation roll.
The last part just shows the roll if it was not a possible crit.

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: A better way?

Post by aliasmask »

I've done a couple of generic attack macros over the years, here's one for comparison: http://forums.rptools.net/viewtopic.php ... 81#p233681

Post Reply

Return to “MapTool”