Skip to content

Commit

Permalink
Merge pull request #228 from roth-michael/1.10.2
Browse files Browse the repository at this point in the history
update hd recovery fraction
  • Loading branch information
roth-michael authored May 29, 2024
2 parents f2f1703 + 1d47859 commit ec8b6c7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Rest Recovery Changelog

## Version 1.10.2
- Updated fractional hp recovery from HD rolls to use the same dropdown as Periapt of Wound Closure's dropdown for how to multiply hit die rolls

## Version 1.10.1
- Removed libwrapper dependency
- Translation updates (thanks Kharmans!)
Expand Down
6 changes: 3 additions & 3 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,8 @@
"RequiresModule": "Requires {module_name}",
"General": {
"PeriaptRollMechanics": {
"Title": "Periapt of Wound Closure Mechanics",
"Hint": "This configures how the item \"Periapt of Wound Closure\" handles the multiplication of the hit die roll.",
"Title": "Hit Die Multiplication Mechanics",
"Hint": "This configures how hit die multiplying effects such as the item \"Periapt of Wound Closure\" and the \"Hit Die roll multiplier\" setting handle the multiplication of the hit die roll.",
"Options": {
"MultiplyRoll": "Multiply dice roll",
"MultiplyTotal": "Multiply total result"
Expand Down Expand Up @@ -462,7 +462,7 @@
"Hint": "This prevents characters from rolling hit dice during short rests."
},
"HDRecoveryFraction": {
"Title": "Hit Die recovery fraction",
"Title": "Hit Die roll multiplier",
"Hint": "The fraction of a hit die roll to actually recover as hit points each time a hit die is rolled."
},
"ResourcesRecoveryFraction": {
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "rest-recovery",
"title": "Rest Recovery for 5E",
"description": "Adds 5e long and short rest mechanics and variant rules, such as feats, class features, and hit-dice healing.",
"version": "1.10.1",
"version": "1.10.2",
"authors": [
{
"name": "Wasp",
Expand Down
6 changes: 5 additions & 1 deletion scripts/rest-workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class RestWorkflow {
formula = "(" + formula + "*2)";
}

if (hdMult !== 1) {
if (hdMult !== 1 && !multiplyTotal) {
formula = `floor(${formula}*${hdMult})`;
}

Expand All @@ -146,6 +146,10 @@ export default class RestWorkflow {
config.formula = `(${formula})*2`;
}

if (hdMult !== 1 && multiplyTotal) {
config.formula = `floor((${formula})*${hdMult})`;
}

});

Hooks.on("dnd5e.rollHitDie", (actor, roll, updates) => {
Expand Down

0 comments on commit ec8b6c7

Please sign in to comment.