Move if check in acupressure up

This commit is contained in:
Temps Ray 2024-05-01 00:48:24 -04:00
parent fcce5998ed
commit b17539c475

View File

@ -1482,8 +1482,8 @@ export class AcupressureStatChangeAttr extends MoveEffectAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean | Promise<boolean> { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean | Promise<boolean> {
let randStats = [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD, BattleStat.ACC, BattleStat.EVA ]; let randStats = [ BattleStat.ATK, BattleStat.DEF, BattleStat.SPATK, BattleStat.SPDEF, BattleStat.SPD, BattleStat.ACC, BattleStat.EVA ];
randStats = randStats.filter(s => target.summonData.battleStats[s] < 6); randStats = randStats.filter(s => target.summonData.battleStats[s] < 6);
let boostStat = [randStats[Utils.randInt(randStats.length)]]; if (randStats.length > 0) {
if (boostStat.length > 0) { let boostStat = [randStats[Utils.randInt(randStats.length)]];
user.scene.unshiftPhase(new StatChangePhase(user.scene, target.getBattlerIndex(), this.selfTarget, boostStat, 2)); user.scene.unshiftPhase(new StatChangePhase(user.scene, target.getBattlerIndex(), this.selfTarget, boostStat, 2));
return true; return true;
} }