generated from League-of-Foundry-Developers/FoundryVTT-Module-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9535d4
commit 6283150
Showing
3 changed files
with
28 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,8 @@ | |
] | ||
}, | ||
"esmodules": [ | ||
"scripts/module.js" | ||
"scripts/module.js", | ||
"scripts/hook.js" | ||
], | ||
"languages": [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* A single Damage Number in damage number list. | ||
* @typedef {Object} DamageNumber | ||
* @property {string} type - Type of damage | ||
* @property {number} value - How much damage it was | ||
*/ | ||
Hooks.on("init", function () { | ||
console.log("PF2e RPG Numbers is initiated"); if (!game.user.isGM) return; | ||
game.RPGNumbers = new RPGNumbers(); | ||
}); | ||
|
||
Hooks.on("ready", function () { | ||
console.log("PF2e RPG Numbers is ready"); | ||
game.ui.notify("PF2e RPG Numbers is ready") | ||
}); | ||
|
||
Hooks.on("createChatMessage", async function (msg, status, id) { | ||
console.log({ msg }) | ||
if (msg?.flags?.pf2e?.context?.type !== 'damage-roll') return; | ||
const dmg_list = game.RPGNumbers.extractDamageInfoCombined(msg.rolls); | ||
const targets = game.RPGNumbers.getTargetList(msg); | ||
game.RPGNumbers.generateDamageScroll(dmg_list, targets); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters