Skip to content

Commit

Permalink
fix to errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 7, 2023
1 parent a45c58f commit 0f206e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions scripts/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
* @property {string} type - Type of damage
* @property {number} value - How much damage it was
*/
Hooks.on("init", function () {
Hooks.on("init", async () => {
console.log("PF2e RPG Numbers is initiated"); if (!game.user.isGM) return;
game.RPGNumbers = new RPGNumbers();
});

Hooks.on("ready", function () {
Hooks.on("ready", async () => {
console.log("PF2e RPG Numbers is ready");
game.ui.notify("PF2e RPG Numbers is ready")
if (!game.user.isGM) return;
game.RPGNumbers = new RPGNumbers();
});

Hooks.on("createChatMessage", async function (msg, status, id) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class RPGNumbers {
result.push({ dmg: dieResult.result, type: term.options.flavor ?? flavor });
}
} else if (term.class === "Grouping") {
extractTerm(term.term, term?.options?.flavor ?? flavor);
this.extractTerm(term.term, term?.options?.flavor ?? flavor);
} else if (term.class === "ArithmeticExpression") {
for (const operand of term?.operands) {
extractTerm(operand, flavor);
}
} else if (!term?.class) {
for (const t of term.rolls) {
for (const tt of term.terms) {
extractTerm(tt, tt?.options?.flavor ?? flavor);
this.extractTerm(tt, tt?.options?.flavor ?? flavor);
}
}
}
Expand All @@ -78,7 +78,7 @@ class RPGNumbers {
//console.log(dmg);
}
//console.log({inp, term})
//extractTerm(term, inp?.options?.flavor ?? '');
//this.extractTerm(term, inp?.options?.flavor ?? '');
}
}

Expand Down

0 comments on commit 0f206e7

Please sign in to comment.