Skip to content

Commit

Permalink
v0.3.6
Browse files Browse the repository at this point in the history
- Fixed a bug that prevented versatile weapon attacks from working properly when exported to macros.
- Made an async function accessible for macros to create a new Mob Attack Dialog. All you need is `await MobAttacks.createDialog();`
  • Loading branch information
Stendarpaval committed Sep 5, 2021
1 parent d8129c1 commit ab2abea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
],
"url": "https://github.com/Stendarpaval/mob-attack-tool",
"version": "0.3.5",
"version": "0.3.6",
"minimumCoreVersion": "0.8.8",
"compatibleCoreVersion": "0.8.8",
"system": ["dnd5e"],
Expand All @@ -27,5 +27,5 @@
"styles/mob-attack-tool.css"
],
"manifest": "https://raw.githubusercontent.com/Stendarpaval/mob-attack-tool/main/module.json",
"download": "https://github.com/Stendarpaval/mob-attack-tool/releases/download/0.3.5/module.zip"
"download": "https://github.com/Stendarpaval/mob-attack-tool/releases/download/0.3.6/module.zip"
}
11 changes: 8 additions & 3 deletions scripts/mobAttackTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,9 @@ export function MobAttacks() {
attacker = game.actors.get(locator["actorID"]);
weapon = attacker.items.getName(locator["weaponName"])
weapons[weapon.id] = weapon;
attacks[weapon.id] = [];
attacks[locator.weaponID] = [];
for (let target of targets) {
attacks[weapon.id].push({targetId: target.targetId, targetNumAttacks: target.weapons.filter(w => w.weaponId === locator.weaponID).length});
attacks[locator.weaponID].push({targetId: target.targetId, targetNumAttacks: target.weapons.filter(w => w.weaponId === weapon.id).length});
}
})

Expand All @@ -857,7 +857,12 @@ export function MobAttacks() {
})();
}

async function createDialog() {
await mobAttackTool();
}

return {
quickRoll:quickRoll
quickRoll:quickRoll,
createDialog:createDialog
};
}

0 comments on commit ab2abea

Please sign in to comment.