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

[Help] DnD 5e Fighting Spirit Temp HP Forumla?

Hello! I am trying to automate some portions of my DnD campaign, and one of my players is a Samurai Fighter. I would like to have a formula that I could use with ChatSetAttr in order to have an Ability on his sheet automatically set his Temp HP appropriately based on the Fighting Spirit subclass feature.  I am having trouble thinking of a formula that would calculate the values correctly, where 3rd - 9th level would output a value of 5, 10th - 14th a value of 10, and 15th - 20th a value of 15. If anyone who is more mathematically minded than I can help me figure out a working formula, it would be greatly appreciated. I have tried combing the forums and the internet at large for such a thing, but cannot seem to find anything.  Thank you in advance for your help, even if the result is figuring out that it isn't feasible within the bounds of Roll20's capabilities.
The level attribute might need to be corrected for your character sheet but this should work [[ 5*{3,10,15}<@{character_level} ]]
RainbowEncoder said: The level attribute might need to be corrected for your character sheet but this should work [[ 5*{3,10,15}<@{character_level} ]] Thank you, that formula worked perfectly when I substituted in the correct level attribute! I can't say that I've ever seen that format on a formula here on Roll20 though, would you mind explaining how that outputs the correct result so I can successfully apply it to other scenarios in the future?
It uses Group Rolls with target number . The character level gets compared to each number and the number of success is then multiplied by 5. So at level 1 or 2 it isn't equal or greater than any of them so 0 successes times 5 for 0 At levels 3 to 9 it's equal or greater than just the '3' for 1 success times 5 for 5 Levels 10 to 14 it's equal or greater than the '3' and '10' for 2 successes times 5 for 10 Levels 15 onwards it's equal or greater than the '3', '10' and '15' for 3 successes times 5 for 15.
Ah, brilliant! That is a handy function that I haven't come across yet. Thank you very much for your help!