{
  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 side of this.sides) {
      for (const target of side.active) {
        if (!target || target.fainted) continue;
        if (target === pokemon) continue;
        target.addVolatile("embargo");
      }
    }
  },
  onResidual(pokemon) {
    for (const side of this.sides) {
      for (const target of side.active) {
        if (!target || target.fainted) continue;
        if (target === pokemon) continue;
        target.addVolatile("embargo");
      }
    }
  },
  onEnd(pokemon) {
    for (const side of this.sides) {
      for (const target of side.active) {
        if (!target) continue;
        target.removeVolatile("embargo");
      }
    }
  }
}