Skip to content

Commit

Permalink
0.1.61
Browse files Browse the repository at this point in the history
  • Loading branch information
gambit07 committed Jun 7, 2024
1 parent b2629bc commit f224321
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<<EOF" >> $GITHUB_ENV
cat release_notes.txt >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Gambit"
}
],
"version": "0.1.60",
"version": "0.1.61",
"compatibility": {
"minimum": "11",
"verified": "11",
Expand Down
12 changes: 8 additions & 4 deletions scripts/macros/cloudRune.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down Expand Up @@ -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 = `
<div style='display: flex; flex-direction: column; align-items: start; justify-content: center; padding: 10px;'>
Expand All @@ -112,11 +116,11 @@ export async function showCloudRuneDialog({targetUuids, actorUuid, tokenUuid, in
</div>
<div style='display: flex; width: 100%; gap: 20px;'>
<div style='flex-grow: 1; display: flex; flex-direction: column;'>
<p style='margin: 0 0 10px 0;'>Choose who is advantaged:</p>
<p style='margin: 0 0 10px 0;'>Choose who the attack is deflected to:</p>
${validTokens.length >= 1 ?
`<select id="targetSelection" style="padding: 4px; width: 100%; box-sizing: border-box; border-radius: 4px; border: 1px solid #ccc;">
${validTokens.map(valid => `<option value="${valid.actor.uuid}">${valid.actor.name}</option>`).join('')}
</select>` : '<p>No valid friendlies in range.</p>'
</select>` : '<p>No valid targets in range.</p>'
}
</div>
<div style='padding-left: 20px; text-align: center; border-left: 1px solid #ccc;'>
Expand Down

0 comments on commit f224321

Please sign in to comment.