{
    onSetStatus(status, target, source, effect) {
        if (["sunnyday", "desolateland"].includes(target.effectiveWeather())) {
            if (effect?.status) {
                this.add("-immune", target, "[from] ability: Leaf Guard");
            }
            return false;
        }
    },
    onTryAddVolatile(status, target) {
        if (status.id === "yawn" && ["sunnyday", "desolateland"].includes(target.effectiveWeather())) {
            this.add("-immune", target, "[from] ability: Leaf Guard");
            return null;
        }
    },
    onDamage(damage, target, source, effect) {
        if (effect.effectType !== "Move" && this.field.isWeather(["sunnyday", "desolateland"])) {
            if (effect.effectType === "Ability" && this.field.isWeather(["sunnyday", "desolateland"]))
                this.add("-activate", source, "ability: " + effect.name);
            return false;
        }
    },
    flags: { breakable: 1 },
    name: "Leaf Guard",
    rating: 0.5,
    num: 102
}
