Implements accuracy/evasion

This commit is contained in:
2024-12-22 12:19:42 +01:00
parent 06ce7fd38d
commit 5b518df24a
7 changed files with 57 additions and 6 deletions

View File

@@ -140,10 +140,10 @@ internal static class MoveTurnExecutor
// modifying it.
if (accuracy != 255)
{
executingMove.RunScriptHook(x => x.ChangeAccuracy(executingMove, target, hitIndex, ref accuracy));
accuracy = battle.Library.StatCalculator.CalculateModifiedAccuracy(executingMove, target,
hitIndex, accuracy);
}
// TODO: Deal with accuracy/evasion stats.
if (accuracy < 100 && battle.Random.GetInt(100) >= accuracy)
{
executingMove.RunScriptHook(x => x.OnMoveMiss(executingMove, target));