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

Damage against AC

Is there a way to set up an if-then type of statement so that Roll20 can automatically determine if you hit an enemy, and only roll damage if it does? I'm thinking something along the lines of... %{Attack}@{Beast|AC} if {Attack}>{AC} %{Damage}@{Beast|HP} Except I'm not very good at coding macros so to anyone who actually understands things that might make no sense whatsoever. But the point is, I do two-weapon fighting. So for every round I go attack/attack and damage/damage, so I might get the first damage, I might get the second damage, I might get neither, I might get both. Also, I've noticed that it shows the AC of the enemy when using the @{Beast|AC} format-ideally, there would be a way to not have players know the AC of the enemies they're fighting. So, ideally, this is what I'd like to magically have happen: Attack 1 Attack 2 vs Enemy AC 0, 1, or 2 successes Roll damage for successes Subtract damage from HP of enemy Bar of Enemy's Health decreases by amount of damage Through all that, players would not see the AC of the enemy, or the total HP of the enemy, or the remaining HP of the enemy, but they would be able to see the bar decrease from green to yellow or whatever. That's a lot to ask of a script, but at least have it be as automated as possible, since we're really looking for a way to automate fights as much as possible in order to speed them up so that the DM isn't having to check each attack, say if it hits or not, then subtract the damage from the HP while the rest of us just sit and wait quietly to be able to do that for each of our own rolls.
1391313966
Pat S.
Forum Champion
Sheet Author
What you are asking would probably require the use of the API which is part of the mentor level subscription. This is mostly because you are trying to do two functions on one roll. The first function is to decide if the roll matches or beats the ac and the second is to roll or not. I think that is considered an if then statement and that type of statement can't be done through the roller itself or so I understand it.
To address a few points you touched on; - Hiding AC value in your roll: Can't be done with macros (comes up now and then in forums) - Conditional logic: Needs API. Only logic included with the macro system is > (greater than or equal to) and it's opposite <. - Modifying Stats: Macros are strictly read-only. You need the API in order to modify data. - (Optional): Two-weapon fighting - in most systems it's usually advantageous to roll each attack separately, so you can apply your secondary attacks to a second target if the first one dies. All in a all, you need a Mentor level subscription and API scripts to do any of it, really.