[AI] Prevent ai from using moves guaranteed to fail due to the weather (#6613)

Prevent ai from using moves guaranteed to fail due to the weather
This commit is contained in:
Sirz Benjie 2025-10-02 20:37:00 -05:00 committed by GitHub
parent 0da202c26e
commit 2a9e4e5ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6543,8 +6543,9 @@ export class EnemyPokemon extends Pokemon {
move.category !== MoveCategory.STATUS
&& moveTargets.some(p => {
const doesNotFail =
move.applyConditions(this, p, -1)
|| [MoveId.SUCKER_PUNCH, MoveId.UPPER_HAND, MoveId.THUNDERCLAP].includes(move.id);
!globalScene.arena.isMoveWeatherCancelled(this, move)
&& (move.applyConditions(this, p, -1)
|| [MoveId.SUCKER_PUNCH, MoveId.UPPER_HAND, MoveId.THUNDERCLAP].includes(move.id));
return (
doesNotFail
&& p.getAttackDamage({