mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-20 20:15:50 +02:00
- remove any `.js` extension imports - remove unncessary dynamic imports of `modifier.ts` file. The file was being imported statically & dynamically. Made it pure static - increase vite chunk-size warning limit Co-authored-by: Mumble <171087428+frutescens@users.noreply.github.com>
31 lines
777 B
TypeScript
31 lines
777 B
TypeScript
import BattleScene from "#app/battle-scene";
|
|
import { applyMoveAttrs, MoveHeaderAttr } from "#app/data/move";
|
|
import Pokemon, { PokemonMove } from "#app/field/pokemon";
|
|
import { BattlePhase } from "./battle-phase";
|
|
|
|
export class MoveHeaderPhase extends BattlePhase {
|
|
public pokemon: Pokemon;
|
|
public move: PokemonMove;
|
|
|
|
constructor(scene: BattleScene, pokemon: Pokemon, move: PokemonMove) {
|
|
super(scene);
|
|
|
|
this.pokemon = pokemon;
|
|
this.move = move;
|
|
}
|
|
|
|
canMove(): boolean {
|
|
return this.pokemon.isActive(true) && this.move.isUsable(this.pokemon);
|
|
}
|
|
|
|
start() {
|
|
super.start();
|
|
|
|
if (this.canMove()) {
|
|
applyMoveAttrs(MoveHeaderAttr, this.pokemon, null, this.move.getMove()).then(() => this.end());
|
|
} else {
|
|
this.end();
|
|
}
|
|
}
|
|
}
|