Cap combined accuracy modifier at 6 and -6

This commit is contained in:
Deukhoofd 2025-02-15 20:17:37 +01:00
parent 58e9f4c3d1
commit 9b0ac36597
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 2 additions and 2 deletions

View File

@ -63,8 +63,8 @@ public class Gen7BattleStatCalculator : IBattleStatCalculator
var difference = targetEvasion - userAccuracy;
var statModifier = difference switch
{
> 0 => 3.0f / (3.0f + difference),
< 0 => 3.0f + Math.Abs(difference) / 3.0f,
> 0 => 3.0f / (3.0f + Math.Min(difference, 6)),
< 0 => 3.0f + -Math.Max(difference, -6) / 3.0f,
_ => 1.0f
};
modifiedAccuracy = (int)(modifiedAccuracy * statModifier);