From e27f4209e51aa3606d18e1ab776af5f27fb20262 Mon Sep 17 00:00:00 2001 From: Byroks Date: Mon, 27 Nov 2023 20:05:20 +0100 Subject: [PATCH] Squashed commit of the following: commit 0bfa224dae1ecd3123d032320652f92e9e04e514 Author: Byroks Date: Mon Nov 27 19:56:05 2023 +0100 V1.3.1 (#6) * v1.3.1 * v1.3.1 * update .gitingore commit 35a6b0fae99db5eadc21e491a2438c587b7180b2 Author: Byroks Date: Mon Nov 27 19:48:56 2023 +0100 v1.3.1 commit db21ca93b0458fdbe25b0d764be14bed033c7a6c Author: Byroks Date: Sun Nov 26 13:13:13 2023 +0100 subtract ap when casting spell Changes: + subtract AP when casting a spell --- .gitignore | 2 +- package.json | 2 +- source/module/items/M5Item.ts | 6 ++++++ source/module/sheets/M5CharacterSheet.ts | 1 + source/system.json | 10 +++++----- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 53bd0a9..6f460ab 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,4 @@ package-lock.json source/packs/ source/generators/ dist -midgard5*.zip \ No newline at end of file +*.zip \ No newline at end of file diff --git a/package.json b/package.json index a660581..c4244e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foundry-system-midgard5", - "version": "1.3.0", + "version": "1.3.1", "description": "", "main": "index.js", "scripts": { diff --git a/source/module/items/M5Item.ts b/source/module/items/M5Item.ts index 34e09bb..c759191 100644 --- a/source/module/items/M5Item.ts +++ b/source/module/items/M5Item.ts @@ -215,6 +215,12 @@ export class M5Item extends Item { } }); + if (item.type === "spell" || item.type === "kampfkunst") { + if (this.actor["system"].ap.value >= item.system.ap) { + this.actor["system"].ap.value -= item.system.ap; + } + } + const roll = new M5Roll(rollData, this.actor, item.name); return roll.toMessage(); } else { diff --git a/source/module/sheets/M5CharacterSheet.ts b/source/module/sheets/M5CharacterSheet.ts index 9aeb08f..655ef3e 100644 --- a/source/module/sheets/M5CharacterSheet.ts +++ b/source/module/sheets/M5CharacterSheet.ts @@ -160,6 +160,7 @@ export default class M5CharacterSheet extends ActorSheet { const context = this.actor as any; const item = context.items.get(itemId) as M5Item; await item.roll(); + this.render(); }); html.find(".roll-brawl-button").on("click", async (event) => { diff --git a/source/system.json b/source/system.json index 96c56b3..d65c1f2 100644 --- a/source/system.json +++ b/source/system.json @@ -3,13 +3,13 @@ "name": "midgard5", "title": "Midgard 5. Edition", "description": "The German RPG Midgard 5. Edition", - "version": "1.3.0", + "version": "1.3.1", "compatibility": { "minimum": "10", "verified": "11", "maximum": "11" }, - "authors": [{ "name": "Byroks" }], + "authors": [{"name": "Byroks"}], "scripts": ["bundle.js"], "styles": ["bundle.css"], "packs": [ @@ -89,8 +89,8 @@ "primaryTokenAttribute": "lp", "secondaryTokenAttribute": "ap", "url": "https://github.com/Byroks/foundry-vtt-system-midgard5", - "manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.0/system.json", - "download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.0/midgard5-v1.3.0.zip", + "manifest": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.1/system.json", + "download": "https://github.com/Byroks/foundry-vtt-system-midgard5/releases/download/v1.3.1/midgard5-v1.3.1.zip", "initiative": "@c.calc.attributes.gw.value", "license": "LICENSE.txt" -} +} \ No newline at end of file