Skip to content

Commit

Permalink
0.0.39
Browse files Browse the repository at this point in the history
  • Loading branch information
gambit07 committed Feb 7, 2024
1 parent dbfec31 commit ecbc910
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ jobs:
draft: false
prerelease: false
body: |
Update: Tweak to Counterspell Initializer assignment
Added: Boldin's Beard Oil, Dipolar Gages
Update: Additional tweak to counterspell initializer. Grouping assignment is now primarily based on token disposition. Deployment dialog button options changed from 'Npcs' and 'Pcs' to 'Friendlies' and 'Hostiles' to match token dispositions
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.zip, ./module.json'
tag: ${{ steps.get-version.outputs.version }}
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.0.38",
"version": "0.0.39",
"compatibility": {
"minimum": "11",
"verified": "11",
Expand Down
8 changes: 4 additions & 4 deletions scripts/macroFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ async function enableCounterspell(combat) {
let npcs = [], pcs = [];
for (let combatant of combat.combatants.values()) {
let existingItem = combatant.actor.items.find(i => i.name === itemName);
if (combatant.actor.type === 'npc' || (combatant.actor.type === 'character' && combatant.document.disposition === -1)) {
if ((combatant.actor.type === 'npc' || combatant.actor.type === 'character') && combatant.document.disposition === -1) {
if(existingItem) await combatant.actor.deleteEmbeddedDocuments("Item", [existingItem.id]);
npcs.push(combatant);
} else if (combatant.actor.type === 'character') {
} else if ((combatant.actor.type === 'npc' || combatant.actor.type === 'character') && combatant.document.disposition === 1) {
if(existingItem) await combatant.actor.deleteEmbeddedDocuments("Item", [existingItem.id]);
pcs.push(combatant);
}
Expand All @@ -184,14 +184,14 @@ async function enableCounterspell(combat) {

if (hasPcWithCounterspell) {
buttons.pc = {
label: "PCs",
label: "Friendlies",
callback: () => processCombatants(npcs)
};
}

if (hasNpcWithCounterspell) {
buttons.npc = {
label: "NPCs",
label: "Hostiles",
callback: () => processCombatants(pcs)
};
}
Expand Down

0 comments on commit ecbc910

Please sign in to comment.