mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +02:00
26 lines
767 B
TypeScript
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];
|
|
}
|
|
}
|