{
  onStart(pokemon) {
    this.effectState.statboostsreversed = false;
  },
  onResidualOrder: 29,
  onResidual(pokemon) {
    if ((pokemon.boosts.spa || pokemon.boosts.atk) && this.effectState.statboostsreversed === false) {
      this.add("-activate", pokemon, "ability: Phantom Dancing", "[msg]statsreversed");
      this.effectState.statboostsreversed = true;
    } else if ((pokemon.boosts.spa || pokemon.boosts.atk) && this.effectState.statboostsreversed === true) {
      this.add("-activate", pokemon, "ability: Phantom Dancing", "[msg]statsnormalized");
      this.effectState.statboostsreversed = false;
    }
    pokemon.addVolatile("magictrick");
    const atk = pokemon.boosts.atk;
    pokemon.boosts.atk = pokemon.boosts.spa;
    pokemon.boosts.spa = atk;
  },
  flags: {},
  name: "Phantom Dancing",
  rating: 2.5,
  num: -32111
}