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

Update to Sneak atttack itemMacro to use system setting for critical rolls. #20

Open
bsleys opened this issue Jun 25, 2022 · 0 comments

Comments

@bsleys
Copy link

bsleys commented Jun 25, 2022

The current macro ignores the 5e system setting for critical rolls, ie maxing critical hit damage dice.
In the itemMacro replace:
const diceMult = args[0].isCritical ? 2: 1;
with:

    const baseDice = Math.ceil(rogueLevels/2);
    let diceMult = 1;
    let maxCritDmg = "";
    if (args[0].isCritical) {
        if ( game.settings.get("dnd5e","criticalDamageMaxDice")) {
            maxCritDmg = ` + ${baseDice * 6}`;
        } else {
            diceMult = 2;
        }
    }

and the return statement with :
return {damageRoll: '${baseDice * diceMult}d6${maxCritDmg}', flavor: "Sneak Attack"};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant