From 0906a410ccb2182a7f28bc292e21ec4d5557be92 Mon Sep 17 00:00:00 2001 From: Chris Seieroe Date: Sun, 18 Sep 2022 16:12:27 -0700 Subject: [PATCH 1/2] update readme with new modules and remove old ones BR and MRE are no longer supported in v10 so remove them. Include notes about their replacements --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7654c83..afe1dbe 100644 --- a/README.md +++ b/README.md @@ -44,17 +44,13 @@ Notes about other modules. ### Compatibility Notes -[Better Rolls for 5e](https://foundryvtt.com/packages/betterrolls5e) This module works with Better Rolls, making rolls with advantage and disadvantage with the following known issues. - -- Active effects for critical hits do not work. -- The "d20 Mode" Better Rolls setting of "Single Roll Upgradeable" does not give the hint in the pop-up asking what kind of roll to perform. It will still apply the active effects though possibly leading to some confusion, especially since advantage and disadvantage will not cancel each other out like they should. -- Does not show messages, even if "d20 Mode" is set to "Query for (Dis)Advantage" - [Midi QOL](https://foundryvtt.com/packages/midi-qol) This module works with Midi QOL, however there is a lot of crossover. Both modules will handle the advantage/disadvantage/critical flags, so you don't need this module for that. If you want the CSS change and messages feature, then it works with these known issues: - Midi QOL will ignore any advantage/disadvantage/critical settings that Advantage Reminder finds and passes along. It will perform the check for those flags itself. It is wasted work but shouldn't cause a noticable performance hit. - Does not show messages if Midi QOL is configured to fast forward rolls -[Minimal Rolling Enhancements for D&D5e](https://foundryvtt.com/packages/mre-dnd5e) This module works with MRE, making rolls with advantage/disadvantage and showing messages if you hold the "Roll Dialog Modifier Key" (an MRE setting). +[Faster Rolling by Default DnD5e](https://foundryvtt.com/packages/faster-rolling-by-default-5e) This moodule works with Faster Rolling by Default. If the dialog is shown, it will show any messages and have the default button set correctly. + +[Roll Groups](https://foundryvtt.com/packages/rollgroups) This module works with Roll Groups. -[Dynamic effects using Active Effects](https://foundryvtt.com/packages/dae) If you're using the message feature to add inline roll formulas, you need to use DAE version 0.10.01 or newer. Earlier versions would evaluate the deferred die roll in the active effect's value, making the button not work. +[Ready Set Roll for D&D5e](https://foundryvtt.com/packages/ready-set-roll-5e) This module works with Ready Set Roll but does nothing when quick rolls are enabled. Since quick rolls fast forward, skipping the dialog, this module does nothing. However, if you have quick rolls disabled for certain rolls then it will work, processing advantage/disadvantage/critical defaults and showing messages. From 5c926bc3be72132f29e563178940e78a8fb07d83 Mon Sep 17 00:00:00 2001 From: Chris Seieroe Date: Mon, 19 Sep 2022 15:25:56 -0700 Subject: [PATCH 2/2] close #16 --- CHANGELOG.md | 1 + README.md | 4 ++-- src/module.js | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e4106..2632325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - feature: now requires v10, removes warnings about using deprecated functions - feature: removed dependency on lib-wrapper, switched to new hooks that the dnd5e system introduced +- feature: [#16](https://github.com/kaelad02/adv-reminder/issues/16) do not process the advantage/disadvantage/critical flags if Midi is active # 2.0.1 diff --git a/README.md b/README.md index afe1dbe..1a431dd 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,9 @@ Notes about other modules. ### Compatibility Notes -[Midi QOL](https://foundryvtt.com/packages/midi-qol) This module works with Midi QOL, however there is a lot of crossover. Both modules will handle the advantage/disadvantage/critical flags, so you don't need this module for that. If you want the CSS change and messages feature, then it works with these known issues: +[Midi QOL](https://foundryvtt.com/packages/midi-qol) This module works with Midi QOL, however there is a lot of crossover. Both modules can handle the advantage/disadvantage/critical flags, so you don't need this module for that. If you want the CSS change and messages feature, then it works with the following notes: -- Midi QOL will ignore any advantage/disadvantage/critical settings that Advantage Reminder finds and passes along. It will perform the check for those flags itself. It is wasted work but shouldn't cause a noticable performance hit. +- This module will not process the advantage/disadvantage/critical flags if Midi QOL is active, since it will process them already - Does not show messages if Midi QOL is configured to fast forward rolls [Faster Rolling by Default DnD5e](https://foundryvtt.com/packages/faster-rolling-by-default-5e) This moodule works with Faster Rolling by Default. If the dialog is shown, it will show any messages and have the default button set correctly. diff --git a/src/module.js b/src/module.js index 5891992..e2ecd5a 100644 --- a/src/module.js +++ b/src/module.js @@ -18,6 +18,7 @@ import { import { debug, log } from "./util.js"; let checkArmorStealth; +let skipReminders; Hooks.once("init", () => { log("initializing Advantage Reminder"); @@ -25,6 +26,10 @@ Hooks.once("init", () => { // DAE version 0.8.81 added support for "impose stealth disadvantage" checkArmorStealth = !game.modules.get("dae")?.active; debug("checkArmorStealth", checkArmorStealth); + + // skip all reminder checks if Midi is active since it will do it anyways + skipReminders = game.modules.get("midi-qol")?.active; + debug("skipReminders", skipReminders); }); // Add message flags to DAE so it shows them in the AE editor @@ -69,6 +74,8 @@ Hooks.on("dnd5e.preRollAttack", (item, config) => { debug("checking for message effects on this attack roll"); new AttackMessage(item.actor, item).addMessage(config); + + if (skipReminders) return; debug("checking for adv/dis effects on this attack roll"); new AttackReminder(item.actor, getTarget(), item).updateOptions(config); }); @@ -85,6 +92,8 @@ Hooks.on("dnd5e.preRollAbilitySave", (actor, config, abilityId) => { debug("checking for message effects on this saving throw"); new AbilitySaveMessage(actor, abilityId).addMessage(config); + + if (skipReminders) return; debug("checking for adv/dis effects on this saving throw"); new AbilitySaveReminder(actor, abilityId).updateOptions(config); }); @@ -97,6 +106,8 @@ Hooks.on("dnd5e.preRollAbilityTest", (actor, config, abilityId) => { debug("checking for message effects on this ability check"); new AbilityCheckMessage(actor, abilityId).addMessage(config); + + if (skipReminders) return; debug("checking for adv/dis effects on this ability check"); new AbilityCheckReminder(actor, abilityId).updateOptions(config); }); @@ -109,6 +120,8 @@ Hooks.on("dnd5e.preRollSkill", (actor, config, skillId) => { debug("checking for message effects on this skill check"); new SkillMessage(actor, skillId).addMessage(config); + + if (skipReminders) return; debug("checking for adv/dis effects on this skill check"); new SkillReminder(actor, skillId, checkArmorStealth).updateOptions(config); }); @@ -121,6 +134,8 @@ Hooks.on("dnd5e.preRollToolCheck", (item, config) => { debug("checking for message effects on this tool check"); new AbilityCheckMessage(item.actor, item.system.ability).addMessage(config); + + if (skipReminders) return; debug("checking for adv/dis effects on this tool check"); new AbilityCheckReminder(item.actor, item.system.ability).updateOptions(config); }); @@ -133,6 +148,8 @@ Hooks.on("dnd5e.preRollDeathSave", (actor, config) => { debug("checking for message effects on this death save"); new DeathSaveMessage(actor).addMessage(config); + + if (skipReminders) return; debug("checking for adv/dis effects on this death save"); new DeathSaveReminder(actor).updateOptions(config); }); @@ -146,6 +163,8 @@ Hooks.on("dnd5e.preRollDamage", (item, config) => { debug("checking for message effects on this damage roll"); new DamageMessage(item.actor, item).addMessage(config); + + if (skipReminders) return; debug("checking for critical/normal effects on this damage roll"); new CriticalReminder(item.actor, getTarget(), item).updateOptions(config); });