Apply suggestions from code review

This commit is contained in:
Michael Li 2024-11-29 22:33:59 -05:00
parent 6dcf53cbd1
commit 46a9ad1732

View File

@ -5976,7 +5976,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
} }
// Find indices of off-field Pokemon that are eligible to be switched into // Find indices of off-field Pokemon that are eligible to be switched into
const eligibleNewIndices = [] as number[]; const eligibleNewIndices: number[] = [];
switchOutTarget.scene.getPlayerParty().forEach((pokemon, index) => { switchOutTarget.scene.getPlayerParty().forEach((pokemon, index) => {
if (pokemon.isAllowedInBattle() && !pokemon.isOnField()) { if (pokemon.isAllowedInBattle() && !pokemon.isOnField()) {
eligibleNewIndices.push(index); eligibleNewIndices.push(index);
@ -6020,7 +6020,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return false; return false;
} else if (user.scene.currentBattle.battleType !== BattleType.WILD) { // Switch out logic for enemy trainers } else if (user.scene.currentBattle.battleType !== BattleType.WILD) { // Switch out logic for enemy trainers
// Find indices of off-field Pokemon that are eligible to be switched into // Find indices of off-field Pokemon that are eligible to be switched into
const eligibleNewIndices = [] as number[]; const eligibleNewIndices: number[] = [];
switchOutTarget.scene.getEnemyParty().forEach((pokemon, index) => { switchOutTarget.scene.getEnemyParty().forEach((pokemon, index) => {
if (pokemon.isAllowedInBattle() && !pokemon.isOnField()) { if (pokemon.isAllowedInBattle() && !pokemon.isOnField()) {
eligibleNewIndices.push(index); eligibleNewIndices.push(index);