Fix expected hit count for pop-bomb like moves

Accuracy is now properly divided by 100
This commit is contained in:
Sirz Benjie 2025-02-21 14:27:28 -06:00 committed by GitHub
parent 2a8c9e4af5
commit fb2e1267a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2397,10 +2397,12 @@ export class MultiHitAttr extends MoveAttr {
if (ignoreAcc || move.accuracy === -1) {
return expectedHits;
}
const acc = move.accuracy / 100;
if (move.hasFlag(MoveFlags.CHECK_ALL_HITS) && !maxMultiHit) {
return Math.pow(move.accuracy, expectedHits);
// N.B. No moves should be the _2_TO_5 variant have the CHECK_ALL_HITS flag.
return acc * (1 - Math.pow(acc, expectedHits)) / (1 - acc);
}
return expectedHits *= move.accuracy / 100;
return expectedHits *= acc;
}
}