mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-25 08:16:04 +00:00
[Bug] add ability revelead for trace, refactor (#2258)
This commit is contained in:
parent
0b019d9823
commit
dbecb72890
@ -1899,6 +1899,7 @@ export class TraceAbAttr extends PostSummonAbAttr {
|
||||
pokemon.summonData.ability = target.getAbility().id;
|
||||
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` traced ${target.name}'s\n${allAbilities[target.getAbility().id].name}!`));
|
||||
setAbilityRevealed(target);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -2457,9 +2458,7 @@ export class FriskAbAttr extends PostSummonAbAttr {
|
||||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
||||
for (const opponent of pokemon.getOpponents()) {
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " frisked " + opponent.name + "'s " + opponent.getAbility().name + "!"));
|
||||
if (opponent.battleData) {
|
||||
opponent.battleData.abilityRevealed = true;
|
||||
}
|
||||
setAbilityRevealed(opponent);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -3820,6 +3819,17 @@ function queueShowAbility(pokemon: Pokemon, passive: boolean): void {
|
||||
pokemon.scene.clearPhaseQueueSplice();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ability of a Pokémon as revealed.
|
||||
*
|
||||
* @param pokemon - The Pokémon whose ability is being revealed.
|
||||
*/
|
||||
function setAbilityRevealed(pokemon: Pokemon): void {
|
||||
if (pokemon.battleData) {
|
||||
pokemon.battleData.abilityRevealed = true;
|
||||
}
|
||||
}
|
||||
|
||||
export const allAbilities = [ new Ability(Abilities.NONE, 3) ];
|
||||
|
||||
export function initAbilities() {
|
||||
|
Loading…
Reference in New Issue
Block a user