Skip to content

Commit

Permalink
v10 support (#44)
Browse files Browse the repository at this point in the history
* chore: update dependencies
* feat: add Foundry v10 support (note that this drops v9 support)
* 0.2.0
  • Loading branch information
TheGiddyLimit authored Oct 22, 2022
1 parent b5e00a8 commit f69a1a3
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 109 deletions.
6 changes: 3 additions & 3 deletions macro-item/spell/XGE_toll-the-dead.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ async function macro (args) {
if (args[0].macroPass !== "preDamageRoll") return;

const target = await fromUuid(args[0].targetUuids[0]);
const needsD12 = target.actor.data.data.attributes.hp.value < target.actor.data.data.attributes.hp.max;
const needsD12 = target.actor.system.attributes.hp.value < target.actor.system.attributes.hp.max;
const theItem = await fromUuid(args[0].uuid);
let formula = theItem.data.data.damage.parts[0][0];
let formula = theItem.system.damage.parts[0][0];
if (needsD12) formula = formula.replace("d8", "d12");
else formula = formula.replace("d12", "d8");
theItem.data.data.damage.parts[0][0] = formula;
theItem.system.damage.parts[0][0] = formula;
}
2 changes: 1 addition & 1 deletion module/data/spell/GiddySpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"name": "Collapse Astronomical Body",
"source": "GiddySpell",
"img": "icons/magic/earth/orb-ringed-lava-black-orange.webp",
"data": {
"system": {
"actionType": "other",
"damage.parts": [
[
Expand Down
4 changes: 2 additions & 2 deletions module/data/spell/__core.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@
"Expire effect when character casts a spell on an enemy",
"Automate effect--WIS save should be forced"
],
"data": {
"system": {
"actionType": "other"
},
"effects": [
Expand Down Expand Up @@ -567,7 +567,7 @@
{
"name": "Toll the Dead",
"source": "XGE",
"data": {
"system": {
"damage.parts": [
[
"1d8",
Expand Down
28 changes: 13 additions & 15 deletions module/js/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,22 @@ class DataManager {
static _getPostProcessed ({out}) {
if (!out.itemMacro) return out;

out = MiscUtil.copy(out);
out = foundry.utils.deepClone(out);

out.flags = out.flags || {};
out.flags.itemacro = {
"macro": {
"data": {
"_id": null,
"name": "-",
"type": "script",
"author": game.userId,
"img": "icons/svg/dice-target.svg",
"scope": "global",
"command": out.itemMacro,
"folder": null,
"sort": 0,
"permission": {"default": 0},
"flags": {},
},
"_id": null,
"name": "-",
"type": "script",
"author": game.userId,
"img": "icons/svg/dice-target.svg",
"scope": "global",
"command": out.itemMacro,
"folder": null,
"sort": 0,
"ownership": {"default": 0},
"flags": {},
},
};

Expand All @@ -74,7 +72,7 @@ class DataManager {
}

class Api {
static init () { game.modules.get(SharedConsts.MODULE_NAME).api = this; }
static init () { game.modules.get(SharedConsts.MODULE_ID).api = this; }

static pGetExpandedAddonData (opts) { return DataManager.api_pGetExpandedAddonData(opts); }
}
Expand Down
6 changes: 3 additions & 3 deletions module/shared/SharedConsts.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class SharedConsts {
static MODULE_NAME = `plutonium-addon-automation`;
static MODULE_ID = `plutonium-addon-automation`;
static MODULE_TITLE = "Plutonium Addon: Automation";

static MODULE_DIR = `./dist/${SharedConsts.MODULE_NAME}`;
static MODULE_DIR = `./dist/${SharedConsts.MODULE_ID}`;

static MODULE_PATH = `modules/${SharedConsts.MODULE_NAME}`;
static MODULE_PATH = `modules/${SharedConsts.MODULE_ID}`;

static MODULE_NAME_PARENT = `plutonium`;
}
Expand Down
74 changes: 51 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plutonium-addon-automation",
"version": "0.1.7",
"version": "0.2.0",
"author": "Giddy",
"type": "module",
"license": "MIT",
Expand All @@ -20,14 +20,14 @@
"mt": "npm run macro-template --"
},
"devDependencies": {
"@league-of-foundry-developers/foundry-vtt-types": "^9.269.0",
"5etools-utils": "^0.1.21",
"@league-of-foundry-developers/foundry-vtt-types": "^9.280.0",
"5etools-utils": "^0.1.23",
"adm-zip-giddy": "^0.4.12",
"ajv": "^8.10.0",
"commander": "^9.1.0",
"eslint": "^8.11.0",
"express": "^4.17.3",
"json-source-map": "^0.6.1",
"plutonium-utils": "^0.1.13"
"plutonium-utils": "^0.1.15"
}
}
Loading

0 comments on commit f69a1a3

Please sign in to comment.