{
    onStart(pokemon) {
        for (const ally of pokemon.alliesAndSelf()) {
            if (["brn"].includes(ally.status)) {
                this.add("-activate", pokemon, "ability: Water Veil");
                ally.cureStatus();
            }
        }
    },
    onUpdate(pokemon) {
        if (["brn"].includes(pokemon.status)) {
            this.add("-activate", pokemon, "ability: Water Veil");
            pokemon.cureStatus();
        }
    },
    onAllySwitchIn(pokemon) {
        if (["brn"].includes(pokemon.status)) {
            this.add("-activate", this.effectState.target, "ability: Water Veil");
            pokemon.cureStatus();
        }
    },
    onSetStatus(status, target, source, effect) {
        if (!["brn"].includes(status.id))
            return;
        if (effect?.status) {
            this.add("-immune", target, "[from] ability: Water Veil");
        }
        return false;
    },
    onAllySetStatus(status, target, source, effect) {
        if (!["brn"].includes(status.id))
            return;
        if (effect?.status) {
            const effectHolder = this.effectState.target;
            this.add("-block", target, "ability: Water Veil", "[of] " + effectHolder);
        }
        return false;
    },
    onSourceModifyDamage(damage, source, target, move) {
        if (move.type === 'Fire' && (target === this.effectState.target || target.side === this.effectState.target.side)) {
            this.debug('Water Veil - reducing damage');
            return this.chainModify(0.8);
        }
    },
    flags: {breakable: 1},
    name: "Water Veil",
    rating: 2,
    num: 41,
}
