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

fix: natural 1s/20s now auto fail/succeed #342

Merged
merged 2 commits into from
Feb 22, 2023
Merged

Conversation

anthonyronda
Copy link
Member

Fixes #340 and #341

These were accessing the wrong properties of the roll object and not using strong comparison, which is at least part of why it took so long to find a problem here. Thanks to @bakbakbakbakbak's tests for discovering this

@bakbakbakbakbak bakbakbakbakbak self-requested a review February 10, 2023 10:50
@anthonyronda anthonyronda linked an issue Feb 10, 2023 that may be closed by this pull request
1 task
Copy link
Collaborator

@bakbakbakbakbak bakbakbakbakbak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After testing this, we should add result.isFailure = true; after row 206 to indiciate a failure. Other than that, as you indicated, ascending AC is not utilizing the attackIsSuccess.

@anthonyronda
Copy link
Member Author

anthonyronda commented Feb 14, 2023

@bakbakbakbakbak in your review summary you wrote "add result.isFailure = true; after row 206 to indiciate a failure" but could you write this where this should go in a review comment annotation instead?

I ask because there is no result after line 206. The digestAttackResult function ends on line 193

@bakbakbakbakbak bakbakbakbakbak self-requested a review February 14, 2023 21:53
@bakbakbakbakbak
Copy link
Collaborator

@bakbakbakbakbak in your review summary you wrote "add result.isFailure = true; after row 206 to indiciate a failure" but could you write this where this should go in a review comment annotation instead?

I ask because there is no result after line 206. The digestAttackResult function ends on line 193

I couldn't so I added a commit to the branch when I tried editing the file in github. I don't know if the change makes sense, but since we already have a isFailure value.

@bakbakbakbakbak bakbakbakbakbak dismissed their stale review February 15, 2023 19:21

I have reconsidered, we don't need to implement the changes I suggested right now. I think it is a better idea to get the fix out instead of being nit-picky with an unused variable here!

) {
result.details = game.i18n.format(
"OSE.messages.AttackAscendingFailure",
{
bonus: result.target,
}
);
result.isFailure = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we could consider remove the isFailure value and just check isSuccess which is false by default?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been reconsidering, I think we can disregard this for now!

@@ -178,6 +181,7 @@ export class OseDice {
result.details = game.i18n.format("OSE.messages.AttackFailure", {
bonus: result.target,
});
result.isFailure = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for row 172 but for Ascending AC.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been reconsidering, I think we can disregard this for now!

@anthonyronda anthonyronda merged commit f20c765 into main Feb 22, 2023
@anthonyronda anthonyronda deleted the fix/natural-1s-and-20s branch February 22, 2023 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants