Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close #16 #33

Merged
merged 2 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
[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:

- 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.
- 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

[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.
19 changes: 19 additions & 0 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ import {
import { debug, log } from "./util.js";

let checkArmorStealth;
let skipReminders;

Hooks.once("init", () => {
log("initializing Advantage Reminder");

// 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
Expand Down Expand Up @@ -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);
});
Expand All @@ -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);
});
Expand All @@ -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);
});
Expand All @@ -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);
});
Expand All @@ -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);
});
Expand All @@ -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);
});
Expand All @@ -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);
});
Expand Down