pokerogue/src/phases/party-member-pokemon-phase.ts
Sirz Benjie 408b66f913
[Misc][Refactor][GitHub] Ditch eslint for biome, and add a formatter (#5495)
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-03-09 14:13:25 -07:00

26 lines
767 B
TypeScript

import { globalScene } from "#app/global-scene";
import type Pokemon from "#app/field/pokemon";
import { FieldPhase } from "./field-phase";
export abstract class PartyMemberPokemonPhase extends FieldPhase {
protected partyMemberIndex: number;
protected fieldIndex: number;
protected player: boolean;
constructor(partyMemberIndex: number, player: boolean) {
super();
this.partyMemberIndex = partyMemberIndex;
this.fieldIndex = partyMemberIndex < globalScene.currentBattle.getBattlerCount() ? partyMemberIndex : -1;
this.player = player;
}
getParty(): Pokemon[] {
return this.player ? globalScene.getPlayerParty() : globalScene.getEnemyParty();
}
getPokemon(): Pokemon {
return this.getParty()[this.partyMemberIndex];
}
}