pokerogue/src/messages.ts

19 lines
615 B
TypeScript

import { BattleSpec } from "./enums/battle-spec";
import Pokemon from "./field/pokemon";
export function getPokemonMessage(pokemon: Pokemon, content: string): string {
return `${getPokemonPrefix(pokemon)}${pokemon.name}${content}`;
}
export function getPokemonPrefix(pokemon: Pokemon): string {
let prefix: string;
switch (pokemon.scene.currentBattle.battleSpec) {
case BattleSpec.DEFAULT:
prefix = !pokemon.isPlayer() ? pokemon.hasTrainer() ? 'Foe ' : 'Wild ' : '';
break;
case BattleSpec.FINAL_BOSS:
prefix = !pokemon.isPlayer() ? 'Foe ' : '';
break;
}
return prefix;
}