{
  name: "Renegade",
  num: -9001,
  rating: 4,
  flags: {},
  onDamagingHit(damage, target, source, move) {
    if (move && move.type === "Dark") {
      if (!target.side.renegadeBoosts) target.side.renegadeBoosts = {};
      if (!target.side.renegadeBoosts[target.position]) target.side.renegadeBoosts[target.position] = 0;
      if (target.side.renegadeBoosts[target.position] < 5) {
        target.side.renegadeBoosts[target.position]++;
        this.add('-ability', target, 'Renegade');
        this.add('-message', `${target.name}'s Attack and Special Attack rose! (${target.side.renegadeBoosts[target.position]}/5)`);
      }
      target.abilityState.renegadeBoosts = target.side.renegadeBoosts[target.position];
    }
  },
  onStart(pokemon) {
    if (!pokemon.side.renegadeBoosts) pokemon.side.renegadeBoosts = {};
    const boosts = pokemon.side.renegadeBoosts[pokemon.position] || 0;
    pokemon.abilityState.renegadeBoosts = boosts;
  },
  onSwitchIn(pokemon) {
    if (!pokemon.side.renegadeBoosts) pokemon.side.renegadeBoosts = {};
    const boosts = pokemon.side.renegadeBoosts[pokemon.position] || 0;
    pokemon.abilityState.renegadeBoosts = boosts;
  },
  onModifyAtk(atk, pokemon) {
    const boosts = pokemon.abilityState.renegadeBoosts || 0;
    if (boosts > 0) {
      return this.chainModify(1 + boosts * 0.2);
    }
  },
  onModifySpA(spa, pokemon) {
    const boosts = pokemon.abilityState.renegadeBoosts || 0;
    if (boosts > 0) {
      return this.chainModify(1 + boosts * 0.2);
    }
  }
}
