mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-04-25 07:57:01 -05:00
Properly support oldAbility arg for -ability
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
Some checks failed
Node.js CI / build (22.x) (push) Has been cancelled
This commit is contained in:
parent
6773017270
commit
90d92db507
|
|
@ -676,7 +676,7 @@ export class BattleTextParser {
|
|||
return line1 + template;
|
||||
}
|
||||
if (kwArgs.from) {
|
||||
line1 = this.maybeAbility(kwArgs.from, pokemon) + line1;
|
||||
if (!oldAbility) line1 = this.maybeAbility(kwArgs.from, pokemon) + line1;
|
||||
const template = this.template('changeAbility', kwArgs.from);
|
||||
return line1 + template.replace('[POKEMON]', this.pokemon(pokemon)).replace('[ABILITY]', this.effect(ability))
|
||||
.replace('[SOURCE]', this.pokemon(kwArgs.of));
|
||||
|
|
|
|||
|
|
@ -2390,31 +2390,20 @@ export class Battle {
|
|||
case '-ability': {
|
||||
let poke = this.getPokemon(args[1])!;
|
||||
let ability = Dex.abilities.get(args[2]);
|
||||
let oldAbility = Dex.abilities.get(args[3]);
|
||||
let effect = Dex.getEffect(kwArgs.from);
|
||||
let ofpoke = this.getPokemon(kwArgs.of);
|
||||
poke.rememberAbility(ability.name, effect.id && !kwArgs.fail);
|
||||
|
||||
if (kwArgs.silent) {
|
||||
// do nothing
|
||||
} else if (oldAbility.id) {
|
||||
this.activateAbility(poke, oldAbility.name);
|
||||
this.scene.wait(500);
|
||||
this.activateAbility(poke, ability.name, true);
|
||||
ofpoke!.rememberAbility(ability.name);
|
||||
} else if (effect.id) {
|
||||
switch (effect.id) {
|
||||
case 'trace':
|
||||
this.activateAbility(poke, "Trace");
|
||||
this.scene.wait(500);
|
||||
this.activateAbility(poke, ability.name, true);
|
||||
ofpoke!.rememberAbility(ability.name);
|
||||
break;
|
||||
case 'powerofalchemy':
|
||||
case 'receiver':
|
||||
this.activateAbility(poke, effect.name);
|
||||
this.scene.wait(500);
|
||||
this.activateAbility(poke, ability.name, true);
|
||||
ofpoke!.rememberAbility(ability.name);
|
||||
break;
|
||||
case 'roleplay':
|
||||
this.activateAbility(poke, ability.name, true);
|
||||
ofpoke!.rememberAbility(ability.name);
|
||||
break;
|
||||
case 'desolateland':
|
||||
case 'primordialsea':
|
||||
case 'deltastream':
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user