From 0a3d5652767f7ee5e1077c15c9b6ef31f46ee16b Mon Sep 17 00:00:00 2001 From: Gambit Date: Wed, 22 May 2024 11:09:33 -0400 Subject: [PATCH] 0.1.47 --- .github/workflows/main.yml | 4 +--- module.json | 2 +- scripts/helpers.js | 6 ++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ae55223..f112060d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,9 +19,7 @@ jobs: id: set-release-notes-github run: | echo "- General:" >> release_notes.txt - echo " - Helper: Added a helper for a free item use per long rest to allow a simple single item solution. Input, await game.gps.freeSpellUse({macroPass: args[0].macroPass, workflowUuid: workflow.itemUuid}); on the top line of the items DIME macro, and set the On Use Macro option on the Midi Qol tab to - Called before the item is rolled." >> release_notes.txt - echo "- Updates:" >> release_notes.txt - echo " - Counterspell: Added a 3rd party settings option for Bloodied and Bruised features Spell Penetration and Greater Spell Penetration" >> release_notes.txt + echo " - Helper: Updated Free Item Use helper, requires MidiQol 11.4.32. To use, add: await game.gps.freeSpellUse({workflowUuid: workflow.itemUuid}); to the top line of the items DIME macro, and set the On Use Macro option on the Midi Qol tab to - Called before the item is rolled." >> release_notes.txt echo "release-notes-github<> $GITHUB_ENV cat release_notes.txt >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV diff --git a/module.json b/module.json index d459852f..02a7ff92 100644 --- a/module.json +++ b/module.json @@ -7,7 +7,7 @@ "name": "Gambit" } ], - "version": "0.1.46", + "version": "0.1.47", "compatibility": { "minimum": "11", "verified": "11", diff --git a/scripts/helpers.js b/scripts/helpers.js index d95b9697..cadd7ba7 100644 --- a/scripts/helpers.js +++ b/scripts/helpers.js @@ -10,10 +10,11 @@ export async function gmIdentifyItem({ itemUuid }) { if(itemData) await itemData.update({"system.identified": true}); } -export async function freeSpellUse({ macroPass, workflowUuid }) { - if(!macroPass || macroPass !== "preItemRoll" || !workflowUuid) return; +export async function freeSpellUse({ workflowUuid }) { + if(!workflowUuid) return; const workflow = await MidiQOL.Workflow.getWorkflow(`${workflowUuid}`); + if(workflow.macroPass !== "preItemRoll") return; const effectName = `${workflow.item.name}: Long Rest Charge Used`; @@ -30,6 +31,7 @@ export async function freeSpellUse({ macroPass, workflowUuid }) { origin: workflow.actor.uuid, flags: {dae:{specialDuration:['longRest']}} } + ui.notifications.info(`You used your once per long rest use of ${workflow.item.name} and did not use a spell slot`) return await workflow.actor.createEmbeddedDocuments("ActiveEffect", [effectData]); } }