Skip to content

Commit

Permalink
Gen6+ Transform should also remove Focus Energy if necessary (smogon#…
Browse files Browse the repository at this point in the history
  • Loading branch information
urkerab authored May 1, 2020
1 parent c4dd88a commit 544417e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions sim/pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,16 @@ export class Pokemon {
for (boostName in pokemon.boosts) {
this.boosts[boostName] = pokemon.boosts[boostName]!;
}
if (this.battle.gen >= 6 && pokemon.volatiles['focusenergy']) this.addVolatile('focusenergy');
if (pokemon.volatiles['laserfocus']) this.addVolatile('laserfocus');
if (this.battle.gen >= 6) {
const volatilesToCopy = ['focusenergy', 'laserfocus'];
for (const volatile of volatilesToCopy) {
if (pokemon.volatiles[volatile]) {
this.addVolatile(volatile);
} else {
this.removeVolatile(volatile);
}
}
}
if (effect) {
this.battle.add('-transform', this, pokemon, '[from] ' + effect.fullname);
} else {
Expand Down

0 comments on commit 544417e

Please sign in to comment.