fixes enigma berry proccing twice from a single hit

This commit is contained in:
alchemis 2024-05-20 16:40:46 -03:00
parent f4bd1218ef
commit 1dec465261

View File

@ -40,7 +40,7 @@ export function getBerryPredicate(berryType: BerryType): BerryPredicate {
case BerryType.LUM:
return (pokemon: Pokemon) => !!pokemon.status || !!pokemon.getTag(BattlerTagType.CONFUSED);
case BerryType.ENIGMA:
return (pokemon: Pokemon) => !!pokemon.turnData.attacksReceived.filter(a => a.result === HitResult.SUPER_EFFECTIVE).length;
return (pokemon: Pokemon) => !!pokemon.turnData.attacksReceived.filter(a => a.result === HitResult.SUPER_EFFECTIVE).length && !(pokemon.scene.getCurrentPhase() instanceof TurnEndPhase);
case BerryType.LIECHI:
case BerryType.GANLON:
case BerryType.PETAYA: