Make `pokemon`, `move` and `targets` fields `protected set`/`public get`

This commit is contained in:
NightKev 2024-09-07 01:34:02 -07:00
parent 5bd259335b
commit 7d340f2190
1 changed files with 27 additions and 3 deletions

View File

@ -24,14 +24,38 @@ import * as Utils from "#app/utils";
import i18next from "i18next";
export class MovePhase extends BattlePhase {
public pokemon: Pokemon;
public move: PokemonMove;
public targets: BattlerIndex[];
protected _pokemon: Pokemon;
protected _move: PokemonMove;
protected _targets: BattlerIndex[];
protected followUp: boolean;
protected ignorePp: boolean;
protected failed: boolean = false;
protected cancelled: boolean = false;
public get pokemon(): Pokemon {
return this._pokemon;
}
protected set pokemon(pokemon: Pokemon) {
this._pokemon = pokemon;
}
public get move(): PokemonMove {
return this._move;
}
protected set move(move: PokemonMove) {
this._move = move;
}
public get targets(): BattlerIndex[] {
return this._targets;
}
protected set targets(targets: BattlerIndex[]) {
this._targets = targets;
}
/**
* @param followUp Indicates that the move being uses is a "follow-up" - for example, a move being used by Metronome or Dancer.
* Follow-ups bypass a few failure conditions, including flinches, sleep/paralysis/freeze and volatile status checks, etc.