diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7519809f..3d46251b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,14 +18,8 @@ jobs: - name: Set Release Notes for Github id: set-release-notes-github run: | - echo "- General:" >> release_notes.txt - echo " - 3rd Party Reactions: Added a 3rd party reaction dialog helper. This allows processing simpler 3rd party reactions that require a yes/no decision dialog that goes to the user which can then be followed with your automation code based on decision. Added (adding?) a post in helpful-helpers that should give some pointers" >> release_notes.txt - echo " - Settings: Cleaned up descriptions a little bit. Probably doesnt matter much but it was annoying me" >> release_notes.txt - echo "- Additions:" >> release_notes.txt - echo " - Cloud Rune: Automates the Echo Knights Cloud Rune feature." >> release_notes.txt - echo " - Rebuke the Damned: Automates the homebrew Channel Divinity Rebuke the Damned feature." >> release_notes.txt - echo "- Updates:" >> release_notes.txt - echo " - Opportunity Attack: Fixed the mirror 3rd party dialog implementation to show the correct GM title when enabled." >> release_notes.txt + echo "- Bugfixes:" >> release_notes.txt + echo " - Cloud Rune: Forgot to exclude the attacker." >> 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 46639cd8..e8a76b7b 100644 --- a/module.json +++ b/module.json @@ -7,7 +7,7 @@ "name": "Gambit" } ], - "version": "0.1.60", + "version": "0.1.61", "compatibility": { "minimum": "11", "verified": "11", diff --git a/scripts/macros/cloudRune.js b/scripts/macros/cloudRune.js index 9f733295..039e3f5c 100644 --- a/scripts/macros/cloudRune.js +++ b/scripts/macros/cloudRune.js @@ -19,6 +19,9 @@ export async function cloudRune({workflowData,workflowType,workflowCombat}) { let browserUser; for (const validTokenPrimary of findValidTokens) { + const nearbyTokens = MidiQOL.findNearby(null, validTokenPrimary, 30, { includeToken: false }); + let validTokens = nearbyTokens.filter(token => token.document.disposition !== validTokenPrimary.document.disposition && MidiQOL.canSee(validTokenPrimary.document.uuid,token.document.uuid) && token.document.uuid !== workflow.token.document.uuid); + if(validTokens.length === 0) return; if(validTokenPrimary.id === target.id) return; @@ -32,6 +35,7 @@ export async function cloudRune({workflowData,workflowType,workflowCombat}) { } if(workflowType === "attack") { + let result; if (MidiQOL.safeGetGameSetting('gambits-premades', 'Mirror 3rd Party Dialog for GMs') && browserUser.id !== game.users?.activeGM.id) { @@ -102,8 +106,8 @@ export async function showCloudRuneDialog({targetUuids, actorUuid, tokenUuid, in let target = fromUuidSync(targetUuids); let browserUser = MidiQOL.playerForActor(originToken.actor); - const nearbyFriendlies = MidiQOL.findNearby(null, originToken.object, 30, { includeToken: true }); - let validTokens = nearbyFriendlies.filter(token => token.document.disposition !== originToken.disposition && MidiQOL.canSee(tokenUuid,token.document.uuid)); + const nearbyTokens = MidiQOL.findNearby(null, originToken.object, 30, { includeToken: false }); + let validTokens = nearbyTokens.filter(token => token.document.disposition !== originToken.disposition && MidiQOL.canSee(tokenUuid,token.document.uuid) && token.document.uuid !== initiatingTokenUuid); dialogContent = `
@@ -112,11 +116,11 @@ export async function showCloudRuneDialog({targetUuids, actorUuid, tokenUuid, in
-

Choose who is advantaged:

+

Choose who the attack is deflected to:

${validTokens.length >= 1 ? `` : '

No valid friendlies in range.

' + ` : '

No valid targets in range.

' }