{
  name: "Dawnbreak",
  rating: 4,
  num: -22001,
  flags: {},
  onStart(pokemon) {
    if (!pokemon.abilityState) pokemon.abilityState = {};
    if (pokemon.side?.active?.length > 1) {
      const ally = pokemon.side.active.find(p => p && p !== pokemon && !p.fainted);
      if (ally?.hasAbility?.("moonwake") && !pokemon.abilityState.dawnbreakUsed) {
        pokemon.abilityState.dawnbreakUsed = true;
        this.add("-ability", pokemon, "Dawnbreak");
        this.boost({spa: 1}, pokemon);
      } else {
        this.add("-ability", pokemon, "Dawnbreak");
      }
    } else {
      this.add("-ability", pokemon, "Dawnbreak");
    }

    for (const target of pokemon.side.foe.active) {
      if (!target || target.fainted) continue;
      target.addVolatile("embargo");
    }
  },
  onResidual(pokemon) {
    for (const target of pokemon.side.foe.active) {
      if (!target || target.fainted) continue;
      target.addVolatile("embargo");
    }
  },
  onEnd(pokemon) {
    for (const target of pokemon.side.foe.active) {
      if (!target) continue;
      target.removeVolatile("embargo");
    }
  }
}