{
  num: -212302,
  accuracy: 100,
  basePower: 100,
  category: "Physical",
  name: "Divine Parry",
  pp: 5,
  priority: -3,
  flags: {protect: 1, mirror: 1, failmefirst: 1, nosleeptalk: 1, noassist: 1, failcopycat: 1, failinstruct: 1},
  beforeTurnCallback(pokemon) {
    pokemon.addVolatile("divineparry");
  },
  basePowerCallback(pokemon, target, move) {
    const wasHitThisTurn = pokemon.attackedBy.some(
      (p) => p.damage > 0 && p.thisTurn
    );
    if (wasHitThisTurn) return move.basePower;
    return 75;
  },
  onPrepareHit(target, source, move) {
    const wasHitThisTurn = source.attackedBy.some(
      (p) => p.damage > 0 && p.thisTurn
    );
    if (wasHitThisTurn) {
      this.add("-activate", source, "move: Divine Parry", "[msg]Divine Parry was empowered by the attack!");
      move.basePower = 100;
    } else {
      this.add("-activate", source, "move: Divine Parry", "[msg]Divine Parry was not triggered and struck at reduced power!");
      move.basePower = 75;
    }
  },
  condition: {
    duration: 1,
    onStart(pokemon) {
      this.add("-singleturn", pokemon, "move: Divine Parry");
      this.add("-activate", pokemon, "move: Divine Parry", "[msg]The user is focusing and will take reduced damage this turn!");
    },
    onSourceModifyDamage(damage, source, target, move) {
      if (!move) return;
      if (this.getCategory(move) === "Status") return;
      this.add("-activate", target, "move: Divine Parry", "[msg]Divine Parry reduced the damage taken!");
      return this.chainModify(0.5);
    }
  },
  onAfterMove(pokemon) {
    pokemon.removeVolatile("divineparry");
  },
  secondary: null,
  target: "normal",
  type: "Flying",
  contestType: "Cool"
}