Skip to content

Commit 563f2d0

Browse files
committed
renamed module (PF2E -> PF2e) Added more debug
1 parent 1f03c8e commit 563f2d0

File tree

2 files changed

+41
-37
lines changed

2 files changed

+41
-37
lines changed

module.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "pf2e-rpg-numbers",
3-
"title": "PF2E RPG Numbers",
3+
"title": "PF2e RPG Numbers",
44
"description": "A module that gives damage pop up text when you roll damage in pf2e.",
55
"version": "#{VERSION}#",
66
"compatibility": {
@@ -25,7 +25,7 @@
2525
}
2626
]
2727
},
28-
"esmodules": [
28+
"scripts": [
2929
"./scripts/module.js"
3030
],
3131
"languages": [

scripts/module.js

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,7 @@
1-
const fontSize = 20;
2-
const fontMod = 1;
3-
const colors = {
4-
acid: "0x56fc03",
5-
bludgeoning: "0xc7c7c7",
6-
cold: "0x0394fc",
7-
fire: "0xfc5603",
8-
force: "0xff006a",
9-
lightning: "0x0313fc",
10-
"": "0xffffff",
11-
piercing: "0xc7c7c7",
12-
poison: "0x0b6625",
13-
mental: "0x710996",
14-
radiant: "0xffff54",
15-
slashing: "0xc7c7c7",
16-
electricity: "0x54ffb2",
17-
healing: "0x09ff00",
18-
negative: "0x4e4e68",
19-
positive: "0xffffbf",
20-
chaotic: "0xa600a6",
21-
evil: "0x611f90",
22-
good: "0x9d730a",
23-
lawful: "0x683e00",
24-
sonic: "darkcyan",
25-
bleed: "0x99001a",
26-
};
1+
Hooks.on("ready", function () {
2+
console.log("PF2e RPG Numbers is ready");
3+
});
274

28-
const style = {
29-
"fill": "white",
30-
"fontSize": fontSize * fontMod,
31-
align: "center",
32-
dropShadow: true,
33-
strokeThickness: 5,
34-
}
35-
console.log({colors})
365

376
function extractTerm(term, flavor = '') {
387
if (term.class === "NumericTerm") {
@@ -96,6 +65,41 @@ function extractDamageInfoCombined(rolls) {
9665
* @param {string[]} targets list of token ids
9766
*/
9867
function generateDamageScroll(dmg_list, targets) {
68+
const fontSize = 20;
69+
const fontMod = 1;
70+
const colors = {
71+
acid: "0x56fc03",
72+
bludgeoning: "0xc7c7c7",
73+
cold: "0x0394fc",
74+
fire: "0xfc5603",
75+
force: "0xff006a",
76+
lightning: "0x0313fc",
77+
"": "0xffffff",
78+
piercing: "0xc7c7c7",
79+
poison: "0x0b6625",
80+
mental: "0x710996",
81+
radiant: "0xffff54",
82+
slashing: "0xc7c7c7",
83+
electricity: "0x54ffb2",
84+
healing: "0x09ff00",
85+
negative: "0x4e4e68",
86+
positive: "0xffffbf",
87+
chaotic: "0xa600a6",
88+
evil: "0x611f90",
89+
good: "0x9d730a",
90+
lawful: "0x683e00",
91+
sonic: "darkcyan",
92+
bleed: "0x99001a",
93+
};
94+
95+
const style = {
96+
"fill": "white",
97+
"fontSize": fontSize * fontMod,
98+
align: "center",
99+
dropShadow: true,
100+
strokeThickness: 5,
101+
}
102+
99103
for (const target_id of targets) {
100104
const tok = game.canvas.tokens.get(target_id);
101105
const size = tok.document.texture.scaleY * tok.document.width;
@@ -129,7 +133,7 @@ function getTargetList(msg) {
129133
}
130134

131135
Hooks.on("createChatMessage", async function (msg, status, id) {
132-
console.log({msg})
136+
console.log({ msg })
133137
if (msg?.flags?.pf2e?.context?.type !== 'damage-roll') return;
134138
const dmg_list = extractDamageInfoCombined(msg.rolls);
135139
const targets = getTargetList(msg);

0 commit comments

Comments
 (0)