{
    onSourceModifyAtkPriority: 6,
    onSourceModifyAtk(atk, attacker, defender, move) {
      if (this.field.isWeather(["sandstorm"])) {
        if (move.type === "Water") {
          this.debug("Sand Guard weaken");
          return this.chainModify(0.5);
        }
      }
    },
    onSourceModifySpAPriority: 5,
    onSourceModifySpA(atk, attacker, defender, move) {
      if (this.field.isWeather(["sandstorm"])) {
        if (move.type === "Water") {
          this.debug("Sand Guard weaken");
          return this.chainModify(0.5);
        }
      }
    },
    onModifyDefPriority: 6,
    onModifyDef(def, pokemon) {
      if (["sandstorm"].includes(pokemon.effectiveWeather())) {
        return this.chainModify(1.25);
      }
    },
    onSetStatus(status, target, source, effect) {
      if (["sandstorm"].includes(target.effectiveWeather())) {
        if (effect?.status) {
          this.add("-immune", target, "[from] ability: Sand Guard");
        }
        return false;
      }
    },
    onTryAddVolatile(status, target) {
      if (status.id === "yawn" && ["snow", "hail"].includes(target.effectiveWeather())) {
        this.add("-immune", target, "[from] ability: Sand Guard");
        return null;
      }
    },
    onImmunity(type, pokemon) {
      if (type === "sandstorm")
        return false;
    },
    flags: { breakable: 1 },
    name: "Sand Guard",
    rating: 3.5,
    num: -32080
}