{
  name: "Giant Avatar",
  rating: 5,
  flags: {},
  onPrepareHit(source, target, move) {
    if (!source || !source.hasAbility("giantavatar") || !move) return;
    if (move.category === "Status" || move.multihit || move.flags?.noparentalbond || move.flags?.charge || move.flags?.futuremove || move.spreadHit || move.isZ || move.isMax) return;
    move.multihit = 2;
    move.multihitType = "parentalbond";
  },
  onBasePowerPriority: 20,
  onBasePower(basePower, attacker, defender, move) {
    if (!attacker || !attacker.hasAbility("giantavatar")) return;
    if (!move) return;
    let modifier = 1;
    if (move.category === "Physical") modifier *= 1.5;
    if (move.flags?.contact) modifier *= 1.3;
    if (modifier !== 1) return this.chainModify(modifier);
  },
  onDamagingHit(damage, target, source, move) {
    if (!target || !target.hasAbility("giantavatar")) return;
    if (!move || !move.category || move.category === "Status" || typeof damage !== "number" || damage <= 0) return;
    const typeMod = target.runEffectiveness && move.type ? target.runEffectiveness(move) : (typeof move.typeMod === "number" ? move.typeMod : 0);
    const shared = typeMod > 0 ? 0.5 : 0.25;
    const extra = Math.max(1, Math.floor(damage * shared));
    this.add("-activate", target, "ability: Giant Avatar");
    this.damage(extra, target, target, this.dex.abilities.get("giantavatar"));
  }
}
