{
  name: "Bizarre Elixir",
  num: -1024,
  accuracy: true,
  basePower: 0,
  pp: 10,
  priority: 0,
  category: "Status",
  type: "Psychic",
  flags: { snatch: 1, metronome: 1 },
  onTryHit(pokemon) {
    if (!pokemon.item) return false;
  },
  onHit(pokemon) {
    const item = pokemon.takeItem();
    if (!item) return false;

    this.boost({ spe: 1, spa: 1 }, pokemon);

    const applyAbility = (pokemon, newAbilityId) => {
      const newAbility = this.dex.abilities.get(newAbilityId);
      if (!newAbility) return;

      pokemon.setAbility(newAbilityId);
      pokemon.abilityState = { id: newAbilityId, target: pokemon };
      this.add('-ability', pokemon, newAbility.name, '[from] move: Bizarre Elixir');

      if (newAbility.onStart) {
        newAbility.onStart.call(this, pokemon);
      }
    };

    switch (item.id) {
      case "leftovers":
        this.heal(pokemon.maxhp / 2, pokemon);
        break;
      case "choicescarf":
        this.boost({ spe: 1 }, pokemon);
        break;
      case "choiceband":
        this.boost({ atk: 1 }, pokemon);
        break;
      case "choicespecs":
        this.boost({ spa: 1 }, pokemon);
        break;
      case "lifeorb":
        this.boost({ atk: 2, spa: 2 }, pokemon);
        this.damage(pokemon.maxhp / 2, pokemon);
        break;
      case "airballoon":
        applyAbility(pokemon, "levitate");
        break;
      case "focussash":
        applyAbility(pokemon, "sturdy");
        break;
      case "heavydutyboots":
        applyAbility(pokemon, "magicguard");
        break;
      case "rockyhelmet":
        applyAbility(pokemon, "roughskin");
        break;
      case "toxicorb":
        applyAbility(pokemon, "poisonheal");
        break;
      case "blacksludge":
        this.damage(pokemon.maxhp / 4, pokemon);
        break;
      case "kingsrock":
        applyAbility(pokemon, "monarch");
        break;
      case "flameorb":
        applyAbility(pokemon, "guts");
        break;
      case "weaknesspolicy":
        applyAbility(pokemon, "filter");
        break;
      case "eviolite": {
        const stat = pokemon.storedStats.def >= pokemon.storedStats.spd ? "def" : "spd";
        const boost = {};
        boost[stat] = 1;
        this.boost(boost, pokemon);
        break;
      }
      case "boosterenergy":
        if (this.randomChance(1, 2)) {
          this.field.setTerrain("electricterrain");
        } else {
          this.field.setWeather("sunnyday");
        }
        break;
      default:
        if (this.randomChance(1, 2)) {
          pokemon.addVolatile("confusion", pokemon);
        } else {
          this.boost({ atk: 1, spa: 1 }, pokemon);
        }
    }
  },
  secondary: null,
  target: "self",
  contestType: "Clever"
}
