Skip to content

Commit

Permalink
Merge pull request #26 from eupolemo/issue-24
Browse files Browse the repository at this point in the history
Issue 24
  • Loading branch information
eupolemo authored Feb 19, 2022
2 parents b9d3e64 + 15468f0 commit 3ab47fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dice-roller.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ Hooks.on("renderChatMessage", async (app, html, msg) => {
const die = roll.dice[0];
let bonus = 0;

if (roll.terms.includes("+")) {
bonus = roll.terms[roll.terms.indexOf("+") + 1];
const operator = roll.terms.filter(e => e.operator === "+")
const operatorIndex = roll.terms.findIndex(e => e.operator === "+")
if (operator.length > 0) {
bonus = roll.terms[operatorIndex + 1].number;
}

if (pattern.test(formula)) {
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Dice roller using syntax of L5R 4th Edition.",
"author": "Eupolemo Castro",
"version": "1.3.0",
"minimumCoreVersion": "0.7.0",
"compatibleCoreVersion": "0.7.9",
"minimumCoreVersion": "0.8.8",
"compatibleCoreVersion": "9.249",
"scripts": ["./dice-roller.js"],
"url": "https://github.com/eupolemo/fvtt-l5r4ed-dice-roller",
"manifest": "https://github.com/eupolemo/fvtt-l5r4ed-dice-roller/raw/main/module.json",
Expand Down

0 comments on commit 3ab47fd

Please sign in to comment.