From c0c1e45c6d481adf648d0dac522c0b7b07afb61f Mon Sep 17 00:00:00 2001 From: Jagusti <521096+Jagusti@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:27:21 +0100 Subject: [PATCH] Bypass advantage cap if using Group Advantage #194 --- CHANGELOG.md | 1 + modules/advantage.mjs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c45958..9a3e595 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ See [Issue Backlog](../../issues) and [Roadmap](../../milestones). * *Fixed* error when applying damage or making ranged attacks outside of combat when using group advantage. Thanks [@silentmark](https://github.com/silentmark)! [`a186651`](https://github.com/Jagusti/fvtt-wfrp4e-gmtoolkit/pull/188/commits/a186651) * *Added* version and download stat shields to README, to make it easy to see key install data for users and repo owners. [#190](https://github.com/Jagusti/fvtt-wfrp4e-gmtoolkit/pull/190) * *Fixed* module setting for Spectator notifications to *not* be suppressed by default. Unassigned characters are still being overlooked when experiencing issues with some macros that require an assigned actor. [#192](https://github.com/Jagusti/fvtt-wfrp4e-gmtoolkit/pull/192) +* *Fixed* issue where the Add Advantage macro be capped when using Group Advantage. [#194](https://github.com/Jagusti/fvtt-wfrp4e-gmtoolkit/issues/194) ## [Version 6.0.0](https://github.com/Jagusti/fvtt-wfrp4e-gmtoolkit/releases/tag/6.0.0) (2022-09-06) - *Changed* Group Test setup form to clear or restore custom skill field if a skill is chosen from the skill list dropdown. [#160](https://github.com/Jagusti/fvtt-wfrp4e-gmtoolkit/issues/160) diff --git a/modules/advantage.mjs b/modules/advantage.mjs index d507b12..3800e8a 100644 --- a/modules/advantage.mjs +++ b/modules/advantage.mjs @@ -70,7 +70,9 @@ export default class Advantage { switch (adjustment) { case "increase": - if (advantage.max === undefined || advantage.current < advantage.max) { + if (game.settings.get("wfrp4e", "useGroupAdvantage") + || advantage.max === undefined + || advantage.current < advantage.max) { advantage.new = Number(advantage.current + 1) const updated = await updateCharacterAdvantage() updated ? outcome = "increased" : outcome = "nochange"