[lua] Adjust accVaries to reduce accuracy not hitrate #5639
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
I know there are comments that accVaries is possibly not implemented properly, but the current intention of the param is to reduce accuracy by a percent based on TP:
The current code reduces
hitRate
by the percent ofaccuracy
(ranged or physical depending on the ws), but it ignores the evasion. I think someone was trying to be clever by utilizing the same divisor as the getHitRate functions(acc - eva)/200
, but the result is thathitRate
reduction is only a function of accuracy, meaning the explicithitRate
penalty is increased as player accuracy increases.This PR rearranges the
accVaries
consideration to beforehitRate
is calculated and adjusts thecalcParams.bonusAcc
value.Note that previous code had a param to not cap
hitRate
at 95% soaccVaries
could be considered later, then clampedhitRate
. So this new code is functionally the same there.Steps to test these changes
Ensure dancer steps, desperate flourish, and violent flourish work, as they utilize
xi.weaponskills.getHitRate
add a print in the
getRangedHitRate
andxi.weaponskills.getHitRate
functions to view the hitrate and bonusacc to verify things are working as expected.^^ first is the physical first hit's hitrate due to +100 acc. Second is regular hitrate