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

5E Resting in Style! API - (variation?)

1609276784

Edited 1609276952
is there a way to choose how many hit points are replenish after a long rest? we use homebrew and we like the 3.5 system better (where you recover 3 + mod. hp instead of full hp) It would be nice if this section of the hit points could be customized
1609281206

Edited 1609281361
Oosh
Sheet Author
API Scripter
If you grab the script from the repo and install it manually, you can edit it to do what you want. I don't want to speak for the author, but with "5e" in the title, I'd say it's unlikely that a setting for non-5e rules would be added. But you can modify it to do what you want (this is untested!) by making a few simple changes to the longrest() function at line 578: const longRest = function (charId) { var charName = getAttrByName(charId, 'character_name'); var hd = getAttr(charId, "hit_dice"); var hp = getAttr(charId, "hp"); var conMod = getAttr(charId, "constitution_mod"); if (!verifiedCurAndMax(charName, hd, 'Hit dice')) { return; } if (!verifiedCurAndMax(charName, hp, 'Hit points')) { return; } var max_hp = Number(hp.get("max")); var cur_hp = Number(hp.get("current")); var max_hd = Number(hd.get("max")); var cur_hd = Number(hd.get("current")); var cur_mod = Number(conMod.get('current')); if (cur_hp < 1) { sendChat("Long rest for " + charName, "A character must have at least 1 hit point at the start of the rest to gain its benefits.<ul><li>Remember that a stable creature regains 1 hit point after 1d4 hours.</li></ul>"); return; } var actions = []; var suggestions = []; // Regain hit points var msg = cur_hp == max_hp ? "You are already at full hit points." : `You regain ${Math.min((3 + cur_mod), (max_hp - cur_hp))} hit points.`; if (cur_hp < max_hp) { hp.setWithWorker ({ current: Math.min((cur_hp + 3 + cur_mod), max_hp) }); }
I'll check it... Thx :)
works like silk, incredible :O..... blessings, you have a place in the Faerûn's pantheon :P
One question, this API doesn't recover the hit die, does it? I noticed that when I took a long rest