mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
Apply suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
ca8a3019c9
commit
acc33e88d0
@ -11,7 +11,7 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Phase for the "charging turn" of two-turn moves (e.g. Dig).
|
* Phase for the "charging turn" of two-turn moves (e.g. Dig).
|
||||||
* @extends PokemonPhase
|
* @extends {@linkcode PokemonPhase}
|
||||||
*/
|
*/
|
||||||
export class MoveChargePhase extends PokemonPhase {
|
export class MoveChargePhase extends PokemonPhase {
|
||||||
/** The move instance that this phase applies */
|
/** The move instance that this phase applies */
|
||||||
@ -25,7 +25,7 @@ export class MoveChargePhase extends PokemonPhase {
|
|||||||
this.targetIndex = targetIndex;
|
this.targetIndex = targetIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
public override start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
const user = this.getUserPokemon();
|
const user = this.getUserPokemon();
|
||||||
@ -50,7 +50,7 @@ export class MoveChargePhase extends PokemonPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Checks the move's instant charge conditions, then ends this phase. */
|
/** Checks the move's instant charge conditions, then ends this phase. */
|
||||||
end() {
|
public override end() {
|
||||||
const user = this.getUserPokemon();
|
const user = this.getUserPokemon();
|
||||||
const move = this.move.getMove();
|
const move = this.move.getMove();
|
||||||
|
|
||||||
@ -74,11 +74,11 @@ export class MoveChargePhase extends PokemonPhase {
|
|||||||
super.end();
|
super.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getUserPokemon(): Pokemon {
|
public getUserPokemon(): Pokemon {
|
||||||
return (this.player ? this.scene.getPlayerField() : this.scene.getEnemyField())[this.fieldIndex];
|
return (this.player ? this.scene.getPlayerField() : this.scene.getEnemyField())[this.fieldIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getTargetPokemon(): Pokemon | undefined {
|
public getTargetPokemon(): Pokemon | undefined {
|
||||||
return this.scene.getField(true).find((p) => this.targetIndex === p.getBattlerIndex());
|
return this.scene.getField(true).find((p) => this.targetIndex === p.getBattlerIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ describe("Arena - Gravity", () => {
|
|||||||
.enemyAbility(Abilities.BALL_FETCH)
|
.enemyAbility(Abilities.BALL_FETCH)
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyMoveset(Moves.SPLASH)
|
.enemyMoveset(Moves.SPLASH)
|
||||||
.startingLevel(5)
|
|
||||||
.enemyLevel(5);
|
.enemyLevel(5);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user