mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-29 02:06:07 +00:00
Fix Minimize AI and add NaN AI score safeguard (#2460)
This commit is contained in:
parent
7ae6baf9a5
commit
a14128aece
@ -3964,6 +3964,8 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
|
||||
return -3;
|
||||
case BattlerTagType.ENCORE:
|
||||
return -2;
|
||||
case BattlerTagType.MINIMIZED:
|
||||
return 0;
|
||||
case BattlerTagType.INGRAIN:
|
||||
case BattlerTagType.IGNORE_ACCURACY:
|
||||
case BattlerTagType.AQUA_RING:
|
||||
|
@ -3505,6 +3505,10 @@ export class EnemyPokemon extends Pokemon {
|
||||
|
||||
const target = this.scene.getField()[mt];
|
||||
let targetScore = move.getUserBenefitScore(this, target, move) + move.getTargetBenefitScore(this, target, move) * (mt < BattlerIndex.ENEMY === this.isPlayer() ? 1 : -1);
|
||||
if (Number.isNaN(targetScore)) {
|
||||
console.error(`Move ${move.name} returned score of NaN`);
|
||||
targetScore = 0;
|
||||
}
|
||||
if ((move.name.endsWith(" (N)") || !move.applyConditions(this, target, move)) && ![Moves.SUCKER_PUNCH, Moves.UPPER_HAND, Moves.THUNDERCLAP].includes(move.id)) {
|
||||
targetScore = -20;
|
||||
} else if (move instanceof AttackMove) {
|
||||
|
Loading…
Reference in New Issue
Block a user