From 396b82447071b820e927a9b27f5e9a3cc902ca00 Mon Sep 17 00:00:00 2001 From: cadowtin Date: Fri, 4 Aug 2023 01:49:03 -0500 Subject: [PATCH] paring down manifest --- module.json | 26 ++---------------- scripts/module.js | 69 ++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 58 deletions(-) diff --git a/module.json b/module.json index 8c1da1c..8af2604 100644 --- a/module.json +++ b/module.json @@ -5,38 +5,16 @@ "version": "#{VERSION}#", "compatibility": { "minimum": "10", - "verified": "11", - "maximum": "11" + "verified": "11" }, "authors": [ { "name": "cadowtin" } ], - "relationships": { - "systems": [ - { - "id": "pf2e", - "type": "system", - "compatibility": [ - { - "minimum": "5.2.1", - "verified": "5.3.0" - } - ] - } - ] - }, - "esmodules": [ + "scripts": [ "./scripts/module.js" ], - "languages": [ - { - "lang": "en", - "name": "English", - "path": "languages/en.json" - } - ], "url": "#{URL}#", "manifest": "#{MANIFEST}#", "download": "#{DOWNLOAD}#", diff --git a/scripts/module.js b/scripts/module.js index c3cfffe..a5a1a65 100644 --- a/scripts/module.js +++ b/scripts/module.js @@ -1,3 +1,38 @@ +const fontSize = 20; +const fontMod = 1; +const 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", +}; + +const style = { + "fill": "white", + "fontSize": fontSize * fontMod, + align: "center", + dropShadow: true, + strokeThickness: 5, +} + function extractTerm(term, flavor = '') { if (term.class === "NumericTerm") { result.push({ dmg: term.number, type: term.options.flavor ?? flavor }); @@ -60,40 +95,6 @@ function extractDamageInfoCombined(rolls) { * @param {string[]} targets list of token ids */ function generateDamageScroll(dmg_list, targets) { - const fontSize = 20; - const fontMod = 1; - const 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", - }; - - const style = { - "fill": "white", - "fontSize": fontSize * fontMod, - align: "center", - dropShadow: true, - strokeThickness: 5, - } for (const target_id of targets) { const tok = game.canvas.tokens.get(target_id); const size = tok.document.texture.scaleY * tok.document.width;