pokerogue/src/messages.ts

19 lines
615 B
TypeScript
Raw Normal View History

import { BattleSpec } from "./enums/battle-spec";
2024-02-29 17:08:50 -08:00
import Pokemon from "./field/pokemon";
2023-04-14 22:32:16 -07:00
export function getPokemonMessage(pokemon: Pokemon, content: string): string {
2024-04-09 09:42:18 -07:00
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;
}
2024-04-09 09:42:18 -07:00
return prefix;
2023-04-14 22:32:16 -07:00
}