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

Attack rolls below target AC are highlighted red even if the roll is a critical success #3952

Closed
roth-michael opened this issue Aug 8, 2024 · 4 comments · Fixed by #3953
Closed
Assignees
Labels
bug Functionality which is not working as intended
Milestone

Comments

@roth-michael
Copy link
Contributor

See below:
image

Should just be a matter of changing

if ( d20Roll.total >= d.options.target ) total.classList.add("success");

to

if ( d20Roll.total >= d.options.target || (canCrit && d20Roll.isCritical) ) total.classList.add("success");
@roth-michael
Copy link
Contributor Author

Technically both the fumble and success classes are added in the opposite scenario (a natural 1 but a bonus that lifts it above AC) but that doesn't matter, since it seems fumble takes priority over success

@Fyorl Fyorl added the bug Functionality which is not working as intended label Aug 8, 2024
@Fyorl Fyorl added this to the D&D5E 4.0.0 milestone Aug 8, 2024
@Fyorl
Copy link
Contributor

Fyorl commented Aug 8, 2024

That's how it's intended to be handled in the case of this bug as well: critical styles should take priority over the failure styles.

@roth-michael
Copy link
Contributor Author

Ah gotcha so the ideal solution would be a css one, not a code change as outlined above? (I ask because I'll make a PR if desired)

@Fyorl
Copy link
Contributor

Fyorl commented Aug 8, 2024

Yeah that would be ideal, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality which is not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants