mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-22 04:55:53 +02:00
* beginnings of implementation of mirror armor * logging some new changes * fixing edge cases * adding changes for sticky web and other features of mirror armor * adding changes for sticky web and other features of mirror armor * adding more unit tests and cleaning up notes * Update src/data/ability.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Update src/data/ability.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Update src/data/ability.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Update src/data/ability.ts Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * using arena tags source id variable * updating submodule pointer for locales * small change * Update src/data/move.ts commit Kev fix (minor flip for consistency) Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * fix import * Use global scene * Update tests --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: Madmadness65 <59298170+Madmadness65@users.noreply.github.com> Co-authored-by: Madmadness65 <blaze.the.fireman@gmail.com>
38 lines
950 B
TypeScript
38 lines
950 B
TypeScript
import { globalScene } from "#app/global-scene";
|
|
import type { BattlerIndex } from "#app/battle";
|
|
import { PokemonPhase } from "./pokemon-phase";
|
|
|
|
export class ShowAbilityPhase extends PokemonPhase {
|
|
private passive: boolean;
|
|
|
|
constructor(battlerIndex: BattlerIndex, passive: boolean = false) {
|
|
super(battlerIndex);
|
|
|
|
this.passive = passive;
|
|
}
|
|
|
|
start() {
|
|
super.start();
|
|
|
|
const pokemon = this.getPokemon();
|
|
|
|
if (pokemon) {
|
|
|
|
if (!pokemon.isPlayer()) {
|
|
/** If its an enemy pokemon, list it as last enemy to use ability or move */
|
|
globalScene.currentBattle.lastEnemyInvolved = pokemon.getBattlerIndex() % 2;
|
|
} else {
|
|
globalScene.currentBattle.lastPlayerInvolved = pokemon.getBattlerIndex() % 2;
|
|
}
|
|
|
|
globalScene.abilityBar.showAbility(pokemon, this.passive);
|
|
|
|
if (pokemon?.battleData) {
|
|
pokemon.battleData.abilityRevealed = true;
|
|
}
|
|
}
|
|
|
|
this.end();
|
|
}
|
|
}
|