{
  name: "Diamond Grove",
  rating: 3.5,
  num: -210,
  flags: {breakable: 1},

  onStart(pokemon) {
    if (this.field.isTerrain("grassyterrain")) {
      this.add("-ability", pokemon, "Diamond Grove");
      this.add("-activate", pokemon, "ability: Diamond Grove");
    }
  },

  onTerrainChange(pokemon) {
    if (this.field.isTerrain("grassyterrain")) {
      this.add("-activate", pokemon, "ability: Diamond Grove");
    }
  },

  onModifyDamage(damage, source, target, move) {
    if (target !== this.effectState.target) return;
    if (!this.field.isTerrain("grassyterrain")) return;
    if (!move || move.category === "Status") return;

    const hitData = target.getMoveHitData(move);
    if (!hitData || !hitData.typeMod) return;
    if (hitData.typeMod <= 0) return;

    const mult = this.dex.getEffectiveness(move, target);
    let typeMult = 1;
    if (mult === 1) typeMult = 2;
    else if (mult === 2) typeMult = 4;
    else if (mult === 3) typeMult = 8;
    else if (mult === 4) typeMult = 16;

    if (typeMult > 1) return this.chainModify(1 / typeMult);
  },

  onDamage(damage, target, source, effect) {
    if (!this.field.isTerrain("grassyterrain")) return;
    if (effect && effect.effectType === "Hazard") {
      return false;
    }
  },

  onEffectiveness(typeMod, target, type, move) {
    if (target !== this.effectState.target) return;
    if (!this.field.isTerrain("grassyterrain")) return;
    if (!move) return;
    if (typeMod > 0) return 0;
  },
}