{
  num: -212304,
  accuracy: 90,
  basePower: 80,
  category: "Special",
  name: "Beam Roulette",
  pp: 10,
  priority: 0,
  flags: {protect: 1, mirror: 1, metronome: 1},
  zMove: {basePower: 180},
  onModifyMove(move, pokemon) {
    const roll = this.random(5);
    pokemon.volatiles["beamrouletteeffect"] = {slot: roll};
    if (roll === 0) move.basePower = 160;
    if (roll === 1) move.basePower = 40;
    if (roll === 4) move.selfSwitch = true;
  },
  onHit(target, source, move) {
    const roll = source.volatiles["beamrouletteeffect"]?.slot;
    delete source.volatiles["beamrouletteeffect"];
    if (roll === 2) {
      const stats = ["atk", "spa", "spe", "spd", "def"];
      const stat = stats[this.random(stats.length)];
      this.boost({[stat]: -1}, target, source);
    } else if (roll === 3) {
      const stats = ["atk", "spa", "spe", "spd", "def"];
      const stat = stats[this.random(stats.length)];
      this.boost({[stat]: 1}, source);
    }
    if (move.isZ && this.randomChance(2, 5)) {
      const stats = ["atk", "spa", "spe", "spd", "def"];
      const stat = stats[this.random(stats.length)];
      this.boost({[stat]: 2}, source);
    }
  },
  secondary: null,
  target: "normal",
  type: "Ghost",
  contestType: "Beautiful"
}