Skip to content

Commit

Permalink
Added upgrade of RPGNumbers
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 7, 2023
1 parent 0f206e7 commit 53d6aed
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 37 deletions.
6 changes: 3 additions & 3 deletions scripts/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
Hooks.on("init", async () => {
console.log("PF2e RPG Numbers is initiated"); if (!game.user.isGM) return;
game.RPGNumbers = new RPGNumbers();
});
})

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) {
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);
});
})
67 changes: 33 additions & 34 deletions scripts/module.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
class RPGNumbers {
constructor() {
}
static fontSize = 20;
static fontMod = 1;
static colors = {
acid: "0x56fc03",
bludgeoning: "0xc7c7c7",
cold: "0x0394fc",
fire: "0xfc5603",
force: "0xff006a",
lightning: "0x0313fc",
"": "0xffffff",
piercing: "0xc7c7c7",
poison: "0x0b6625",
mental: "0x710996",
radiant: "0xffff54",
slashing: "0xc7c7c7",
electricity: "0x54ffb2",
healing: "0x09ff00",
negative: "0x4e4e68",
positive: "0xffffbf",
chaotic: "0xa600a6",
evil: "0x611f90",
good: "0x9d730a",
lawful: "0x683e00",
sonic: "darkcyan",
bleed: "0x99001a",
this.fontSize = 20;
this.fontMod = 1;
this.colors = {
acid: "0x56fc03",
bludgeoning: "0xc7c7c7",
cold: "0x0394fc",
fire: "0xfc5603",
force: "0xff006a",
lightning: "0x0313fc",
"": "0xffffff",
piercing: "0xc7c7c7",
poison: "0x0b6625",
mental: "0x710996",
radiant: "0xffff54",
slashing: "0xc7c7c7",
electricity: "0x54ffb2",
healing: "0x09ff00",
negative: "0x4e4e68",
positive: "0xffffbf",
chaotic: "0xa600a6",
evil: "0x611f90",
good: "0x9d730a",
lawful: "0x683e00",
sonic: "darkcyan",
bleed: "0x99001a",
};
this.style = {
"fill": "white",
"fontSize": fontSize * fontMod,
align: "center",
dropShadow: true,
strokeThickness: 5,
}
};

static style = {
"fill": "white",
"fontSize": fontSize * fontMod,
align: "center",
dropShadow: true,
strokeThickness: 5,
}

static extractTerm(term, flavor = '') {
if (term.class === "NumericTerm") {
result.push({ dmg: term.number, type: term.options.flavor ?? flavor });
Expand Down

0 comments on commit 53d6aed

Please sign in to comment.