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

Macro roll default to 1 if zero or below?

Good evening all. I'm trying to update a macro for a custom system I've been running, and I can't quite seem to get the result I want. Here's the current iteration: &{template:default}{{name=HP DMG Resistance}}{{HP DMG after Resistance is [[(?{Damage|0}-(?{Resistance Reduced?|No,No|1d4,1d4|1d6,1d6|1d8,1d8|1d10,1d10|1d12,1d12|1d20,1d20}-@{Resistance})))]]}}{{NOTE: Resistance can only reduce HP DMG to 1.}} How would I go about adjusting it so that the roll result automatically shows a 1 whenever the math works out to be zero or a negative number?
What is in the @{Resistance} attribute? Just a number, or a text value, or a die roll? The basic idea would be something like this: [[{[[?{Damage|0}-?{Resistance Reduced?|No,0|1d4,1d4|1d6,1d6|1d8,1d8|1d10,1d10|1d12,1d12|1d20,1d20}-@{Resistance}]],1}k1]] But I'm not sure if that's going to give you the actual result you want.  If you give a little more information on how the mechanic works, then someone can likely give you a working inline roll macro.
Thank you!!! That works like a charm! Short summary: I'm using a heavily updated version of the Heroes of Remnant system (fan-made RWBY TTRPG system). After a character's protective energy ("Aura") is stripped away by damage, they're subject to attacks hitting their HP. Resistance is a type of damage mitigation stat based on the character's Toughness stat plus optional boosts from certain Skills -- it can reduce damage to 1, but not prevent it entirely. I've tested the code you set up and it seems to represent that perfectly! Thanks again!!